/* Claude Code 国内使用指南 —— 站点样式。无外部字体、无外部依赖。 */

:root {
  color-scheme: light;
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-2: #f0f0ec;
  --text: #1b1b18;
  --muted: #5b5b55;
  --border: #e2e1dc;
  --accent: #0e6b62;
  --accent-hover: #0b5850;
  --accent-ink: #ffffff;
  --accent-soft: #e2f3f0;
  --warn: #8a4b00;
  --warn-soft: #fdf1df;
  --danger: #a3261d;
  --code-bg: #f3f2ee;
  --code-text: #23231f;
  --shadow: 0 1px 2px rgba(20, 20, 15, 0.05), 0 4px 16px rgba(20, 20, 15, 0.04);
  --radius: 12px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #111317;
    --surface: #181b21;
    --surface-2: #20242c;
    --text: #e8e9ec;
    --muted: #a3a8b3;
    --border: #2c313b;
    --accent: #3cc9b4;
    --accent-hover: #5fd8c6;
    --accent-ink: #062520;
    --accent-soft: rgba(60, 201, 180, 0.13);
    --warn: #f0b45c;
    --warn-soft: rgba(240, 180, 92, 0.12);
    --danger: #ff8a80;
    --code-bg: #0c0e12;
    --code-text: #dfe3ea;
    --shadow: none;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans CJK SC", "Source Han Sans SC", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  overflow-wrap: break-word;
}

a {
  color: var(--accent);
  text-underline-offset: 2px;
}

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

code,
pre,
kbd {
  font-family: var(--mono);
  font-size: 0.9em;
}

:not(pre) > code {
  background: var(--code-bg);
  color: var(--code-text);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.05em 0.35em;
  word-break: break-all;
}

kbd {
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0 0.3em;
  background: var(--surface);
}

h1,
h2,
h3 {
  line-height: 1.3;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.5rem);
  margin: 0 0 0.5rem;
}

h2 {
  font-size: 1.4rem;
  margin: 0 0 0.75rem;
}

h3 {
  font-size: 1.08rem;
  margin: 1.4rem 0 0.5rem;
}

p {
  margin: 0 0 0.9rem;
}

ul,
ol {
  margin: 0 0 1rem;
  padding-left: 1.4rem;
}

li + li {
  margin-top: 0.3rem;
}

/* ---------- 布局 ---------- */

.wrap {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 16px;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 10px;
  padding-bottom: 10px;
}

.brand {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.brand span {
  color: var(--accent);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 0.95rem;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 4px 0;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--accent);
}

main {
  padding: 28px 0 40px;
}

section {
  margin: 0 0 22px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

@media (max-width: 600px) {
  .card {
    padding: 16px;
  }
  main {
    padding-top: 20px;
  }
}

.hero {
  padding: 8px 0 6px;
}

.lead {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 44em;
}

.eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 2px 10px;
  margin-bottom: 10px;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.88rem;
}

.note {
  font-size: 0.9rem;
  color: var(--muted);
  border-left: 3px solid var(--border);
  padding: 2px 0 2px 12px;
  margin: 0 0 1rem;
}

.callout {
  background: var(--accent-soft);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0 0 1rem;
  font-size: 0.95rem;
}

.callout.warn {
  background: var(--warn-soft);
}

.callout p:last-child,
.callout ul:last-child {
  margin-bottom: 0;
}

/* ---------- 按钮 ---------- */

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 4px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  line-height: 1.3;
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.btn.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--accent-ink);
}

.btn.small-btn {
  min-height: 32px;
  padding: 4px 10px;
  font-size: 0.85rem;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
label.file-btn:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- 代码块 ---------- */

.code {
  position: relative;
  margin: 0 0 1rem;
}

.code pre {
  margin: 0;
  background: var(--code-bg);
  color: var(--code-text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  padding-right: 64px;
  overflow-x: auto;
  line-height: 1.6;
  font-size: 0.86rem;
  tab-size: 2;
}

.code .copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  min-height: 28px;
  padding: 2px 10px;
  font-size: 0.8rem;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
}

.code .copy-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- 表格 ---------- */

.table-wrap {
  overflow-x: auto;
  margin: 0 0 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

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

th {
  background: var(--surface-2);
  font-weight: 600;
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: 0;
}

td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

td code {
  white-space: nowrap;
  word-break: normal;
}

tr.total td {
  font-weight: 700;
  background: var(--surface-2);
}

/* ---------- 统计块 ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 0 0 1rem;
}

.stat {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 12px 14px;
  min-width: 0;
}

.stat .label {
  font-size: 0.85rem;
  color: var(--muted);
}

.stat .value {
  font-size: 1.45rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
  margin: 2px 0;
}

.stat .sub {
  font-size: 0.82rem;
  color: var(--muted);
}

.stat.accent {
  background: var(--accent-soft);
}

.stat.accent .value {
  color: var(--accent);
}

.stat.warn {
  background: var(--warn-soft);
}

.stat.warn .value {
  color: var(--warn);
}

@media (max-width: 600px) {
  .stats {
    gap: 8px;
  }
  .stat {
    padding: 10px 12px;
  }
  .stat .value {
    font-size: 1.15rem;
  }
}

/* ---------- 工具卡片 ---------- */

.tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.tool {
  display: block;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.tool:hover {
  border-color: var(--accent);
  color: var(--text);
}

.tool h3 {
  margin: 0 0 6px;
  color: var(--accent);
}

.tool p {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
}

/* ---------- 步骤 ---------- */

.steps {
  list-style: none;
  padding: 0;
  counter-reset: step;
}

.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 40px;
  margin: 0 0 1rem;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.steps > li > strong:first-child {
  display: block;
}

/* ---------- 表单 ---------- */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  margin: 0 0 1rem;
}

.form-grid .full {
  grid-column: 1 / -1;
}

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.field label,
.field .label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.field .hint {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.5;
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="url"],
select {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 16px; /* 防止 iOS 聚焦时放大 */
}

input.mono {
  font-family: var(--mono);
  font-size: 15px;
}

.input-row {
  display: flex;
  gap: 8px;
}

.input-row input {
  flex: 1;
  min-width: 0;
}

.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border: 0;
  padding: 0;
  margin: 0;
}

.seg legend {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
  padding: 0;
}

.seg label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  cursor: pointer;
  font-size: 0.93rem;
  font-weight: 500;
}

.seg label:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.93rem;
  cursor: pointer;
}

.check input {
  margin-top: 6px;
  width: 16px;
  height: 16px;
  flex: none;
}

.file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 12px;
}

label.file-btn {
  position: relative;
  overflow: hidden;
}

label.file-btn input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.dropzone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0 0 12px;
}

.dropzone.over {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.status {
  font-size: 0.92rem;
  color: var(--muted);
  min-height: 1.5em;
  margin: 0 0 10px;
}

.status.error {
  color: var(--danger);
}

.warnings {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.warnings li {
  background: var(--warn-soft);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.9rem;
}

.warnings li.err {
  color: var(--danger);
}

/* ---------- CTA ---------- */

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 18px 0 6px;
  background: var(--accent-soft);
}

.cta .cta-text {
  font-weight: 600;
  font-size: 1.02rem;
}

.cta .cta-text strong {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.disclosure {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 6px 0 0;
}

/* ---------- 页脚 ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 22px 0 34px;
  font-size: 0.86rem;
  color: var(--muted);
}

.site-footer p {
  margin: 0 0 0.4rem;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- 报错速查 ---------- */

.code.wrap pre {
  white-space: pre-wrap;
  word-break: break-word;
}

.error-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.error-list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.error-list li:first-child {
  padding-top: 0;
}

.error-list a {
  font-weight: 600;
}

.error-list code {
  white-space: normal;
  word-break: break-word;
}

.error-list p {
  margin: 6px 0 0;
  color: var(--muted);
}
