/* 多多言 · 个人学习站点 */

:root {
  color-scheme: light dark;

  --bg: #fbfaf8;
  --bg-elev: #ffffff;
  --bg-soft: #f2efea;
  --text: #1d2025;
  --text-soft: #4c525b;
  --text-muted: #8a8f98;
  --line: #e5e1da;
  --line-soft: #efece6;
  --accent: #2f6f6a;
  --accent-soft: #dce9e6;
  --shadow: 0 1px 2px rgba(29, 32, 37, 0.04), 0 10px 30px rgba(29, 32, 37, 0.05);

  --radius: 16px;
  --measure: 700px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121417;
    --bg-elev: #191c20;
    --bg-soft: #1f2328;
    --text: #e8eaed;
    --text-soft: #b6bcc5;
    --text-muted: #7e858f;
    --line: #282d33;
    --line-soft: #22262b;
    --accent: #7fc0b7;
    --accent-soft: #1e3431;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(1100px 520px at 50% -260px, var(--accent-soft) 0%, transparent 70%),
    var(--bg);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 10;
  background: linear-gradient(90deg, var(--accent), var(--accent) 22%, var(--line-soft) 100%);
  opacity: 0.9;
}

::selection {
  background: var(--accent-soft);
  color: var(--text);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
  text-underline-offset: 3px;
}

a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 20;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--bg-elev);
  font-size: 14px;
}

.skip:focus { top: 12px; text-decoration: none; }

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 64px 24px 88px;
}

/* ---- header ---- */

.site-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 44px;
}

.site-head h1 {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: 0.04em;
}

.site-head h1 a { color: var(--text); }
.site-head h1 a:hover { text-decoration: none; color: var(--accent); }

.tagline {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  font-size: 13.5px;
}

.site-nav a {
  color: var(--text-soft);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}

.site-nav a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
  text-decoration: none;
}

/* ---- hero ---- */

.hero {
  margin: 0 0 52px;
  padding: 28px 30px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero p {
  margin: 0;
  font-size: 15.5px;
  color: var(--text-soft);
}

.hero p + p { margin-top: 12px; }

.hero strong {
  color: var(--text);
  font-weight: 600;
}

/* ---- sections ---- */

section { margin-bottom: 56px; }

h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  padding-left: 2px;
  font-size: 13px;
  font-weight: 650;
  color: var(--text-muted);
  letter-spacing: 0.14em;
}

h2::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---- entries ---- */

.entry {
  position: relative;
  padding: 18px 18px 20px;
  margin: 0 -18px;
  border-radius: 14px;
  transition: background 0.18s ease, box-shadow 0.18s ease;
}

.entry:hover {
  background: var(--bg-elev);
  box-shadow: var(--shadow);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 1.6;
}

.entry h3 {
  margin: 0 0 7px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
}

.entry h3 a { color: var(--text); }

.entry h3 a::after {
  content: "→";
  display: inline-block;
  margin-left: 6px;
  color: var(--text-muted);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, color 0.15s ease;
}

.entry:hover h3 a { color: var(--accent); text-decoration: none; }
.entry:hover h3 a::after {
  opacity: 1;
  transform: translateX(0);
  color: var(--accent);
}

.entry p {
  margin: 0;
  font-size: 14.5px;
  color: var(--text-soft);
}

section > p {
  margin: 0;
  font-size: 15px;
  color: var(--text-soft);
}

/* ---- footer ---- */

footer {
  margin-top: 72px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.footer-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  margin: 0;
}

.footer-line span { white-space: nowrap; }

footer a {
  color: var(--text-soft);
  border-bottom: 1px solid var(--line);
}

footer a:hover { border-bottom-color: var(--accent); }
footer a:hover { color: var(--accent); }

/* ---- article pages ---- */

.article-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
  font-size: 13.5px;
}

.article-nav a { color: var(--text-muted); }

.article-nav a:hover {
  color: var(--accent);
  text-decoration: none;
}

.article-head {
  margin-bottom: 36px;
}

.article-head .meta { margin-bottom: 10px; }

.article-head h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: 0.01em;
  color: var(--text);
}

.article-body {
  font-size: 15.5px;
  line-height: 1.9;
  color: var(--text-soft);
}

.article-body p { margin: 0 0 18px; }

.article-body h2 {
  display: block;
  margin: 40px 0 14px;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--text);
}

.article-body h2::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 15px;
  margin-right: 10px;
  vertical-align: -1px;
  border-radius: 2px;
  background: var(--accent);
}

.article-body ul,
.article-body ol {
  margin: 0 0 18px;
  padding-left: 22px;
}

.article-body li { margin-bottom: 8px; }

.article-body code {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--bg-soft);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
}

.article-body pre {
  margin: 0 0 18px;
  padding: 16px 18px;
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--bg-soft);
  line-height: 1.7;
}

.article-body pre code {
  padding: 0;
  background: none;
  font-size: 13px;
}

.article-body blockquote {
  margin: 0 0 18px;
  padding: 4px 0 4px 16px;
  border-left: 3px solid var(--accent-soft);
  color: var(--text-muted);
}

.article-body a {
  border-bottom: 1px solid var(--accent-soft);
}

/* ---- responsive ---- */

@media (max-width: 560px) {
  .wrap { padding: 44px 20px 72px; }

  .site-head { align-items: flex-start; }
  .site-head h1 { font-size: 24px; }

  .hero { padding: 22px 20px; margin-bottom: 40px; }
  .hero p { font-size: 15px; }

  section { margin-bottom: 40px; }

  .entry { padding: 16px 14px 18px; margin: 0 -14px; }
  .entry h3 { font-size: 16.5px; }

  .article-head h1 { font-size: 23px; }
  .article-body { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ---- print ---- */

@media print {
  body { background: #fff; }
  body::before, .site-nav, .article-nav, .skip { display: none; }
  .wrap { max-width: none; padding: 0; }
  a { color: inherit; }
}
