/* ==========================================================
   base.css — 全局设计变量、重置、通用组件
   风格约定：扁平、细边框、单一主色、克制的动效（<=150ms）
   二次开发：改这里的变量即可整体换肤
   ========================================================== */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f8fa;
  --bg-tint: #eef4fa;
  --ink: #17222e;
  --ink-2: #39485a;
  --muted: #63748a;
  --line: #dfe6ee;
  --line-strong: #c7d3e0;
  --accent: #1a6fc4;
  --accent-dark: #125694;
  --accent-soft: #e8f2fc;
  --teal: #0b8b86;
  --warn: #b45309;
  --warn-soft: #fff7e8;
  --radius: 6px;
  --maxw: 1180px;
  --header-h: 64px;
  --ease: 120ms ease;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; line-height: 1.35; letter-spacing: -.01em; }
p { margin: 0 0 12px; }
ul, ol { margin: 0 0 12px; padding-left: 20px; }
li { margin-bottom: 5px; }
table { border-collapse: collapse; width: 100%; }
hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 56px 0; border-top: 1px solid var(--line); }
.section:first-child { border-top: 0; }
.section--soft { background: var(--bg-soft); }
.section-head { margin-bottom: 26px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.section-head h2 { font-size: 27px; }
.section-head p { color: var(--muted); margin: 8px 0 0; max-width: 760px; }
.section-head--row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 8px 16px; border: 1px solid var(--accent);
  background: var(--accent); color: #fff; border-radius: var(--radius);
  font-size: 14px; font-weight: 600; transition: background var(--ease), border-color var(--ease), color var(--ease);
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn--ghost { background: transparent; color: var(--accent); }
.btn--ghost:hover { background: var(--accent-soft); color: var(--accent-dark); }
.btn--line { background: #fff; color: var(--ink-2); border-color: var(--line-strong); }
.btn--line:hover { border-color: var(--accent); color: var(--accent); background: #fff; }
.btn--sm { min-height: 31px; padding: 5px 11px; font-size: 13px; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 卡片 */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card--hover { transition: border-color var(--ease); }
.card--hover:hover { border-color: var(--accent); }
.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* 标签 */
.tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px;
  font-size: 11.5px; font-weight: 600; border-radius: 3px;
  background: var(--bg-tint); color: var(--accent); border: 1px solid #d6e6f7;
  white-space: nowrap;
}
.tag--teal { background: #e7f6f4; color: var(--teal); border-color: #c9e9e5; }
.tag--gray { background: var(--bg-soft); color: var(--muted); border-color: var(--line); }
.tag--warn { background: var(--warn-soft); color: var(--warn); border-color: #f3ddb0; }

/* 表单 */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input, .select, .textarea {
  width: 100%; min-height: 38px; padding: 8px 11px; background: #fff;
  border: 1px solid var(--line-strong); border-radius: var(--radius); outline: none;
  transition: border-color var(--ease); font-size: 14px;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); }
.input::placeholder, .textarea::placeholder { color: #9aa9b9; }

/* 表格 */
.table { font-size: 14px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { background: var(--bg-soft); font-weight: 650; color: var(--ink-2); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table--striped tbody tr:nth-child(even) { background: #fbfcfe; }
.table-scroll { overflow-x: auto; }

/* 提示块 */
.note { background: var(--warn-soft); border-left: 3px solid #e0a33a; padding: 11px 14px; border-radius: 0 var(--radius) var(--radius) 0; font-size: 14px; color: #6b4b15; margin: 14px 0; }
.formula { display: block; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 14px; font: 14px/1.6 Consolas, Monaco, monospace; color: var(--ink-2); margin: 12px 0; overflow-x: auto; white-space: pre-wrap; }
.empty { padding: 44px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius); }

/* 面包屑 */
.crumb { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; font-size: 13px; color: var(--muted); padding: 18px 0 0; }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--accent); }
.crumb span::before { content: "/"; margin-right: 7px; color: var(--line-strong); }
.crumb span:first-child::before { content: ""; margin: 0; }

/* 工具类 */
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.flex { display: flex; } .between { justify-content: space-between; } .center { align-items: center; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.hidden { display: none !important; }
.icon { width: 18px; height: 18px; flex: 0 0 auto; vertical-align: -3px; }

/* 骨架与错误 */
.loading { padding: 60px 20px; text-align: center; color: var(--muted); }
.error-box { margin: 24px auto; max-width: 720px; padding: 18px; border: 1px solid #f0c9c9; background: #fff6f6; border-radius: var(--radius); color: #8b2b2b; }

@media (max-width: 960px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .wrap { padding: 0 16px; }
  .section { padding: 38px 0; }
  .section-head h2 { font-size: 22px; }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
