﻿:root {
  --content-max: 960px;
  --rt-accent: #d97706;
  --rt-accent-soft: rgba(217, 119, 6, 0.14);
  --rt-border: rgba(15, 23, 42, 0.12);
  --rt-surface: rgba(255, 248, 235, 0.8);
  --rt-code: rgba(148, 163, 184, 0.12);
}

html {
  scroll-padding-top: 1.5rem;
}

body,
.content main {
  font-family: "Segoe UI Variable Text", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.content main {
  max-width: var(--content-max);
  margin: 0 auto;
  line-height: 1.78;
  font-size: 17px;
}

.content main h1,
.content main h2,
.content main h3 {
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.content main h1 {
  margin-top: 0.4rem;
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 2px solid var(--rt-accent-soft);
}

.content main h2 {
  margin-top: 2.4rem;
  padding-top: 0.2rem;
}

.content main p,
.content main ul,
.content main ol,
.content main table,
.content main blockquote,
.content main details {
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.content main li + li {
  margin-top: 0.35rem;
}

.content main a {
  text-underline-offset: 0.18em;
}

.content main code {
  border-radius: 0.35rem;
  padding: 0.12em 0.35em;
  background: var(--rt-code);
}

.content main pre code {
  padding: 0;
  background: transparent;
}

.content main blockquote,
.content main details {
  border: 1px solid var(--rt-border);
  border-left: 4px solid var(--rt-accent);
  background: var(--rt-surface);
  border-radius: 0.75rem;
  padding: 0.9rem 1rem;
}

.content main details > summary {
  cursor: pointer;
  font-weight: 600;
}

.content main table {
  display: table;
  width: 100%;
  overflow: hidden;
  border-collapse: collapse;
  border-radius: 0.75rem;
}

.content main table th,
.content main table td {
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--rt-border);
  vertical-align: top;
}

.content main table th {
  background: var(--rt-accent-soft);
}

.chapter li.part-title {
  margin-top: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

@media (max-width: 900px) {
  .content main {
    font-size: 16px;
  }
}

.language-toggle {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  margin: 0;
}

.language-toggle__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.5rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--rt-border);
  background: #fff;
  color: inherit;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  transition: background-color 0.18s, color 0.18s, border-color 0.18s;
}

.language-toggle__button:hover {
  border-color: var(--rt-accent);
  color: var(--rt-accent);
}

.language-toggle__button.is-active {
  background: var(--rt-accent);
  border-color: var(--rt-accent);
  color: #fff;
}

.language-toggle__button[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}

.right-buttons .language-toggle {
  margin-left: 0.5rem;
}


/* Optimized Chinese Typography */
:root {
  --content-max: 900px;
  --line-height-main: 1.85;
}

body, .content main {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.content main {
  line-height: var(--line-height-main);
  text-align: justify;
  text-justify: inter-character;
  word-break: break-word;
}

.content main h1, .content main h2, .content main h3, .content main h4 {
  font-weight: 600;
  color: #1a202c;
  margin-top: 2.5rem;
}

/* Enhancing code readability */
code {
  font-family: "Fira Code", "Source Code Pro", Consolas, Monaco, monospace;
  font-size: 0.92em;
}

/* Callouts / Blockquotes */
.content main blockquote {
  background: #f8fafc;
  border-left: 5px solid #3b82f6;
  color: #475569;
  font-style: normal; /* Normal for Chinese quotes */
}

/* Emphasis Dot for Chinese */
em {
  font-style: normal;
  text-emphasis: dot;
  -webkit-text-emphasis: dot;
  text-emphasis-position: under;
}


/* Optimized Chinese Typography */
:root {
  --content-max: 920px;
}

body, .content main {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.content main {
  line-height: 1.8;
  text-align: justify;
  text-justify: inter-character;
  word-break: break-word;
  font-size: 18px;
}

.content main h1, .content main h2, .content main h3, .content main h4 {
  font-weight: 600;
  color: #1a202c;
}

/* Callouts / Blockquotes */
.content main blockquote {
  background: #f8fafc;
  border-left: 5px solid #d97706; /* Link back to accent color if possible */
  color: #444;
  font-style: normal;
  border-radius: 4px;
}

/* Emphasis for Chinese: Emphasis dots is standard but text-emphasis isn't well supported everywhere. 
   Using slightly bold font for emphasis is safer. */
em {
  font-style: normal;
  font-weight: 600;
  color: #0366d6; /* Subtle blue for technical accent */
}

/* PAN Spacing Simulation */
.content p {
  letter-spacing: 0.01em;
}
