/*
 * Custom styles for 经济金融AI智能体设计 textbook
 * Based on lianxhcn/research_with_AI styling
 */

/* Base font size */
body {
  font-size: 1.05rem;
}

/* Title Block */
.quarto-meta-block {
  display: grid;
  grid-template-columns: 50% 50%;
}

.quarto-meta {
  margin-bottom: 1.4em;
}

.quarto-meta-padded {
  padding-top: .4em;
}

.quarto-meta p.quarto-meta-title {
  text-transform: uppercase;
  font-size: 0.8em;
}

.quarto-meta p {
  margin-top: 0;
  margin-bottom: 0;
}

.quarto-frontmatter {
  font-size: 0.9em !important;
  line-height: 0.9em !important;
}

pre.quarto-frontmatter-container {
  border: solid var(--vscode-panel-border) 1px;
  width: calc(100% - 1.1em);
  padding: 0.5em 0 0.5em 0.5em!important;
  margin-right: 0.6em;
}

.quarto-abstract {
  padding-top: 0.5em;
}

/* Decorated Divs */
pre {
  padding: 0.5em;
  border: solid var(--vscode-panel-border) 1px;
  width: calc(100% - 1.6em)
}

.quarto-div {
  border: solid 1px var(--vscode-panel-border);
  border-radius: 3px;
  background-color: #EEEEEE11;
  color: var(--vscode-foreground);
  padding: 1em;
  margin-bottom: 1em;
  box-sizing: border-box;
  width: calc(100% - 0.6em);
}

.quarto-attribute-decorator + h1,
.quarto-attribute-decorator + h2,
.quarto-attribute-decorator + h3,
.quarto-attribute-decorator + h4,
.quarto-attribute-decorator + h5,
.quarto-attribute-decorator + h6,
.quarto-attribute-decorator + pre {
  margin-top: 0 !important;
}

.quarto-attribute-decorator.quarto-heading-attribute-decorator {
  transform: translateY(2em);
}

.quarto-attribute-decorator {
  margin-top: var(--jp-content-heading-margin-top);
  padding-right: 1em;
  display: flex;
  justify-content: right;
  background-color: transparent;
  font-size: 0.7em;
  transform: translateY(1em);
}

.quarto-attribute-decorator .quarto-attribute-decorator-content {
  border: solid var(--vscode-panel-border) 1px;
  background-color: var(--theme-input-background);
  border-radius: 20px;
  margin-right: 1.5em;
  padding-bottom: 2px;
  padding-left: 7px;
  padding-right: 7px;
  white-space: nowrap;
}

/* 控制章节标题与上下元素的间距 */
h1.title,
h1.anchored {
  margin-top: 0.8em;
  margin-bottom: 0.7em;
}

/* Code Blocks */
.jp-RenderedHTMLCommon pre,
.jp-RenderedHTMLCommon > pre {
  margin-left: .1em;
  margin-right: 0;
  padding: 0.2em;
  border: solid 1px var(--vscode-panel-border);
  border-radius: 3px;
}

/* Tables */
.quarto-rendered-md.jp-RenderedHTMLCommon table {
  margin-left: inherit;
  margin-right: inherit;
}

/* Callouts - 提示框、警示框等 */
.callout {
  margin-top: 1em;
  margin-bottom: 1em;
  border-radius: 6px;
  font-size: 0.95rem;
  box-sizing: border-box;
  width: 100%;
  border-left: 6px solid #ccc;
  background-color: #f9f9f9;
  padding: 0;
  overflow: hidden;
}

.callout-header {
  display: flex;
  align-items: center;
  padding: 0.6em 1em;
  font-weight: bold;
  font-size: 1rem;
}

.callout-body {
  padding: 0.8em 1em;
  line-height: 1.6;
}

/* Callout 类型样式 */
div.callout-important {
  border-left-color: #d9534f;
}
div.callout-important .callout-header {
  background-color: #f7dddc;
  color: #a94442;
}

div.callout-note {
  border-left-color: #4582ec;
}
div.callout-note .callout-header {
  background-color: #dae6fb;
  color: #305fdd;
}

div.callout-warning {
  border-left-color: #f0ad4e;
}
div.callout-warning .callout-header {
  background-color: #fcefdc;
  color: #8a6d3b;
}

div.callout-tip {
  border-left-color: #02b875;
}
div.callout-tip .callout-header {
  background-color: #ccf1e3;
  color: #1e7e34;
}

div.callout-caution {
  border-left-color: #fd7e14;
}
div.callout-caution .callout-header {
  background-color: #ffe5d0;
  color: #995700;
}

/* 自定义提示词对话框 */
div.callout-prompt {
  border-left-color: #881a86;
}
div.callout-prompt .callout-header {
  background-color: #ece6ee;
  color: #ba17c9;
}

/* Shortcodes */
span.shortcode {
  font-family: var(--jp-code-font-family);
  line-height: var(--jp-code-line-height);
  background: var(--vscode-textPreformat-background);
  color: var(--vscode-textPreformat-foreground);
  padding-left: 1px;
  padding-right: 1px;
  white-space: pre-wrap;
}

/* Footnotes */
hr.footnotes-sep {
  width: calc(100% - 0.6em);
}

/* 控制代码块与输出结果之间的垂直间距 */
div.cell > div.cell-output,
div.cell > div.cell-output-display,
div.cell-output-stdout {
  margin-top: 0.1em !important;
  margin-bottom: 0.1em !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.cell-output-stdout pre {
  font-size: 0.95em;
  line-height: 1.3;
  margin: 0;
  padding: 0;
}
