:root {
  --bg: #f7f8fa;
  --card: #ffffff;
  --text: #1a1c1f;
  --text-secondary: #55595f;
  --text-tertiary: #8b9096;
  --accent: #0a59f7;
  --accent-soft: rgba(10, 90, 247, 0.08);
  --border: #e6e8eb;
  --notice-bg: #fff8e6;
  --notice-border: #f0dfa8;
  --notice-text: #7a5b12;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121416;
    --card: #1b1e22;
    --text: #f0f2f4;
    --text-secondary: #b6bcc4;
    --text-tertiary: #858b93;
    --accent: #6ea8fe;
    --accent-soft: rgba(110, 168, 254, 0.14);
    --border: #2b2f35;
    --notice-bg: #2a2413;
    --notice-border: #4a3f1d;
    --notice-text: #e2c877;
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  line-height: 1.75;
  font-size: 16px;
}

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
}

.header-inner {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.header .app-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.header .doc-name {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-left: auto;
}

.header a {
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}

main {
  max-width: 820px;
  margin: 0 auto;
  padding: 20px 16px 64px;
}

.doc {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 20px 32px;
}

.doc h1 {
  font-size: 22px;
  line-height: 1.4;
  margin: 0 0 6px;
  letter-spacing: 0.5px;
}

.meta {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 20px;
}

.notice {
  border: 1px solid var(--notice-border);
  background: var(--notice-bg);
  color: var(--notice-text);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 24px;
}

h2 {
  font-size: 17px;
  margin: 32px 0 12px;
  padding-left: 10px;
  border-left: 3px solid var(--accent);
  line-height: 1.5;
}

h3 {
  font-size: 15px;
  margin: 22px 0 8px;
  color: var(--text);
}

p {
  margin: 0 0 12px;
  color: var(--text-secondary);
}

p.clause {
  text-indent: 0;
}

p strong,
li strong {
  color: var(--text);
  font-weight: 600;
}

ol,
ul {
  margin: 0 0 12px;
  padding-left: 22px;
  color: var(--text-secondary);
}

li {
  margin-bottom: 8px;
}

code {
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12.5px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 5px;
  word-break: break-all;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 4px 0 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 480px;
  font-size: 14px;
}

th,
td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: top;
}

th {
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}

tbody tr:last-child td,
tr:last-child td {
  border-bottom: none;
}

.toc {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 16px;
}

.toc-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}

.toc ol {
  margin: 0;
  padding-left: 20px;
}

.toc a {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
}

.toc a:hover {
  text-decoration: underline;
}

.cards {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

@media (min-width: 680px) {
  .cards {
    grid-template-columns: 1fr 1fr;
  }
}

.card-link {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.card-link:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.card-link .tag {
  display: inline-block;
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 20px;
  padding: 2px 10px;
  margin-bottom: 10px;
}

.card-link h2 {
  border: none;
  padding: 0;
  margin: 0 0 8px;
  font-size: 17px;
}

.card-link p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-tertiary);
}

.footer {
  max-width: 820px;
  margin: 24px auto 0;
  padding: 0 16px;
  font-size: 12.5px;
  color: var(--text-tertiary);
  text-align: center;
  line-height: 1.9;
}

.pending {
  color: var(--notice-text);
  background: var(--notice-bg);
  border-bottom: 1px dashed var(--notice-border);
  padding: 0 3px;
}

.back-top {
  position: fixed;
  right: 18px;
  bottom: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 18px;
  line-height: 38px;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
