/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ===== Base ===== */
html {
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC",
               "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
               -apple-system, BlinkMacSystemFont, serif;
  line-height: 1.9;
  color: #2c2c2c;
  background: #fafaf8;
}

/* ===== Hero / Title ===== */
.hero {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  color: #fff;
  padding: 5rem 1.5rem 4rem;
  text-align: center;
}

.hero-inner {
  max-width: 900px;
  margin: 0 auto;
}

.hero-title {
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.3;
  margin-bottom: 1.5rem;
  border: none;
  color: #fff;
}

.hero-meta {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.7);
  font-family: "PingFang SC", "Hiragino Sans GB", sans-serif;
}

.hero-meta .author {
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

.hero-meta .sep {
  margin: 0 0.6rem;
  opacity: 0.4;
}

.hero-meta .email {
  color: rgba(255, 255, 255, 0.65);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-meta .email:hover {
  color: #fff;
  border-bottom-color: #fff;
}

/* ===== Article Container ===== */
.article {
  max-width: min(900px, 90vw);
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
}

/* ===== Abstract (first two paragraphs) ===== */
.article > p:first-child,
.article > p:nth-child(2) {
  font-size: 1.05rem;
  color: #555;
  line-height: 2;
  padding: 1.5rem 2rem;
  background: #f5f4f0;
  border-left: 3px solid #c9a96e;
  border-radius: 0 6px 6px 0;
  margin-bottom: 1rem;
}

.article > p:nth-child(2) {
  margin-bottom: 2.5rem;
}

/* ===== Headings ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC",
               "PingFang SC", serif;
  font-weight: 700;
  color: #1a1a1a;
}

h2 {
  font-size: 1.55rem;
  margin: 3.5rem 0 1.2rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e0ddd5;
  letter-spacing: 0.03em;
}

h3 {
  font-size: 1.25rem;
  margin: 2.5rem 0 0.8rem;
  color: #333;
}

h4, h5, h6 {
  font-size: 1.08rem;
  margin: 2rem 0 0.6rem;
  color: #444;
}

/* ===== Body Text ===== */
p {
  margin: 0 0 1.3rem;
  text-align: justify;
  text-justify: inter-ideograph;
}

/* ===== Links ===== */
a {
  color: #2563eb;
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s;
}

a:hover {
  color: #1d4ed8;
}

/* ===== Blockquotes ===== */
blockquote {
  margin: 1.8rem 0;
  padding: 1rem 1.5rem;
  border-left: 3px solid #c9a96e;
  background: #f9f8f4;
  color: #4a4a4a;
  border-radius: 0 4px 4px 0;
  font-style: italic;
}

blockquote p {
  margin: 0.5rem 0;
  text-align: left;
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* ===== Lists ===== */
ul, ol {
  margin: 0 0 1.3rem;
  padding-left: 1.6rem;
}

li {
  margin: 0.35rem 0;
}

li > ul, li > ol {
  margin: 0.2rem 0 0.2rem;
}

/* ===== Code ===== */
code {
  font-family: "JetBrains Mono", "Fira Code", "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: #f0ede6;
  padding: 0.15em 0.45em;
  border-radius: 3px;
  color: #b5503c;
}

pre {
  margin: 1.8rem 0;
  padding: 1.3rem 1.6rem;
  background: #1e1e2e;
  color: #cdd6f4;
  border-radius: 8px;
  overflow-x: auto;
  line-height: 1.65;
  font-size: 0.85rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
  border-radius: 0;
}

/* ===== Images & Figures ===== */
figure {
  margin: 2.5rem 0;
  text-align: center;
}

figure img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

figcaption {
  font-family: "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-size: 0.85rem;
  color: #888;
  margin-top: 0.8rem;
  line-height: 1.5;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 2rem auto;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* ===== Tables ===== */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.8rem 0;
  font-size: 0.92rem;
  font-family: "PingFang SC", "Hiragino Sans GB", sans-serif;
}

th, td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid #e0ddd5;
  text-align: left;
}

th {
  font-weight: 600;
  color: #1a1a1a;
  border-bottom: 2px solid #c9a96e;
}

tr:hover td {
  background: #f9f8f4;
}

/* ===== Horizontal Rule ===== */
hr {
  border: none;
  border-top: 1px solid #e0ddd5;
  margin: 3rem auto;
  max-width: 200px;
}

/* ===== Strong & Em ===== */
strong {
  font-weight: 700;
  color: #1a1a1a;
}

/* ===== Footnotes ===== */
.footnotes {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e0ddd5;
  font-size: 0.88rem;
  color: #666;
}

/* ===== Footer ===== */
.site-footer {
  background: #1a1a2e;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  padding: 2rem 1.5rem;
  font-size: 0.85rem;
  font-family: "PingFang SC", sans-serif;
}

.footer-inner p {
  margin: 0.3rem 0;
  text-align: center;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.6);
}

.site-footer a:hover {
  color: #fff;
}

/* ===== Print ===== */
@media print {
  .hero { background: none; color: #000; padding: 2rem 0; }
  .hero-title { color: #000; }
  .hero-meta { color: #666; }
  .site-footer { display: none; }
  body { font-size: 11pt; color: #000; background: #fff; }
  pre { background: #f5f5f5; color: #000; border: 1px solid #ccc; box-shadow: none; }
  img { box-shadow: none; }
  a { color: #000; }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  html { font-size: 16px; }

  .hero {
    padding: 3.5rem 1.2rem 3rem;
  }

  .hero-title {
    font-size: 1.9rem;
    letter-spacing: 0.04em;
  }

  .article {
    padding: 2rem 1.2rem 3.5rem;
  }

  .article > p:first-child,
  .article > p:nth-child(2) {
    padding: 1.2rem 1.2rem;
    font-size: 1rem;
  }

  h2 {
    font-size: 1.35rem;
    margin-top: 2.5rem;
  }

  pre {
    padding: 1rem 1.2rem;
    font-size: 0.82rem;
    border-radius: 0;
    margin-left: -1.2rem;
    margin-right: -1.2rem;
  }

  figure {
    margin: 1.8rem -1.2rem;
  }

  figure img {
    border-radius: 0;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.6rem;
  }

  .hero-meta {
    font-size: 0.85rem;
  }
}
