/* ============================================================
   KDD 个人工具站 —— 样式
   视觉基准：地枢中台「金 + 暖米色」品牌体系（与 localhost:8080 控制台一致）
     · 主色金 #D4AF37（金棕渐变），文字深金 #8A6D1A
     · 页面底色暖米 #F5F2EA，卡片纯白，表头/分区米金 #FAF6EA
     · 成功=橄榄绿 #7A9E3A，警告=暗金 #B8860B，失败=陶土红 #C65F4A
   ============================================================ */

:root {
  --bg: #F5F2EA;
  --surface: #ffffff;
  --line: #E8E4D8;
  --line-soft: #F0EDE3;
  --ink: #333333;
  --ink-2: #6f6650;
  --ink-3: #8b8b8b;
  --brand: #D4AF37;
  --brand-ink: #8A6D1A;
  --brand-hover: #C4A032;
  --brand-soft: #F5E7C6;
  --brand-grad: linear-gradient(135deg, #D4AF37, #B8860B);
  --ok: #7A9E3A;
  --ok-soft: #EEF3E1;
  --ok-ink: #5f7d28;
  --warn: #B8860B;
  --warn-soft: #F7EED8;
  --err: #C65F4A;
  --err-soft: #FBEAE6;
  --r: 10px;
  --h-bar: 54px;
  --maxw: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

a { color: inherit; text-decoration: none; }

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

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* 顶部提示条 */
.banner {
  padding: 8px 16px;
  background: var(--warn-soft);
  color: #6b4e10;
  border-bottom: 1px solid #ecd9a8;
  font-size: 13px;
}
.banner[hidden] { display: none; }

/* ---------------- 顶栏 / 导航 ---------------- */
.bar {
  height: var(--h-bar);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.bar__brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.bar__logo {
  background: var(--brand-grad);
  color: #fff; font-weight: 700; font-size: 13px;
  letter-spacing: .5px; padding: 4px 9px; border-radius: 6px;
  box-shadow: 0 2px 8px rgba(212,175,55,.35);
}
.bar__name { font-weight: 700; font-size: 15px; white-space: nowrap; color: var(--ink); }

.nav { display: flex; align-items: center; gap: 4px; }
.nav__link {
  padding: 6px 12px; border-radius: 7px;
  font-size: 13.5px; font-weight: 600; color: var(--ink-2);
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.nav__link:hover { background: var(--brand-soft); color: var(--brand-ink); }
.nav__link.is-active { background: var(--brand-soft); color: var(--brand-ink); }

/* 汉堡按钮（移动端显示） */
.nav-toggle {
  display: none;
  flex-direction: column; justify-content: center; gap: 4px;
  width: 38px; height: 34px; padding: 7px;
  border: 1px solid var(--line); border-radius: 7px;
  background: #fff; cursor: pointer;
}
.nav-toggle span { display: block; height: 2px; background: var(--ink-2); border-radius: 2px; }

/* ---------------- 主体容器 ---------------- */
.wrap {
  max-width: var(--maxw); margin: 0 auto;
  padding: 22px 16px 56px;
  display: flex; flex-direction: column; gap: 22px;
}

/* ---------------- Hero ---------------- */
.hero {
  display: flex; gap: 22px; align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 28px 26px;
  box-shadow: 0 1px 2px rgba(60,50,20,.04);
}
.hero__avatar {
  flex: none;
  width: 84px; height: 84px; border-radius: 18px;
  display: grid; place-items: center;
  background: var(--brand-grad);
  color: #fff; font-size: 38px; font-weight: 800;
  box-shadow: 0 6px 18px rgba(212,175,55,.35);
}
.hero__body { min-width: 0; }
.hero__title { margin: 0 0 6px; font-size: 24px; color: var(--ink); }
.hero__sub { margin: 0 0 12px; color: var(--ink-2); max-width: 640px; }
.hero__tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; padding: 0; list-style: none; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 10px; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 11px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-ink);
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
}

/* ---------------- 卡片 / 分区 ---------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(60,50,20,.04);
}
.card__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; flex-wrap: wrap;
  padding: 10px 16px;
  background: #FAF6EA;
  border-bottom: 1px solid var(--line-soft);
}
.card__head h2 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 8px; color: var(--brand-ink); }
.card__body { padding: 16px; }

.section { scroll-margin-top: 66px; }

.badge {
  display: inline-block; min-width: 20px; padding: 0 7px;
  border-radius: 999px; background: var(--ink); color: #fff;
  font-size: 12px; text-align: center; line-height: 19px;
}

.hint {
  margin: 0 0 14px; padding: 9px 12px;
  font-size: 12.5px; color: var(--ink-2);
  background: #FAF6EA; border-left: 3px solid var(--brand); border-radius: 0 6px 6px 0;
}
.hint code { font-family: var(--mono); font-size: 11.5px; background: #fff; padding: 1px 5px; border-radius: 4px; }

/* 标签 */
.tag {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.tag--brand { background: var(--brand-soft); color: var(--brand-ink); }
.tag--warn  { background: var(--warn-soft); color: var(--warn); }
.tag--ok    { background: var(--ok-soft); color: var(--ok-ink); }
.tag--err   { background: var(--err-soft); color: var(--err); }
.tag--soft  { background: #efe9da; color: var(--ink-2); }

/* ---------------- 按钮（沿用控制台体系） ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  padding: 7px 15px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff; color: var(--ink);
  font: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: background .15s, filter .15s, transform .1s;
}
.btn:hover { background: #FBF4E6; }
.btn--sm { padding: 4px 11px; font-size: 12.5px; }
.btn--primary { background: var(--brand-grad); border-color: transparent; color: #fff; box-shadow: 0 2px 8px rgba(212,175,55,.35); }
.btn--primary:hover { filter: brightness(.96); background: var(--brand-grad); }
.btn--ghost { background: transparent; }
.btn--ghost:hover { background: var(--brand-soft); }
.head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------------- 工具卡片网格 ---------------- */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.tool-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  transition: border-color .15s, box-shadow .15s, transform .12s;
}
.tool-card:hover {
  border-color: var(--brand);
  box-shadow: 0 6px 18px rgba(138,109,26,.12);
  transform: translateY(-2px);
}
.tool-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.tool-card__name { margin: 0; font-size: 16px; color: var(--ink); }
.tool-card__desc { margin: 0; color: var(--ink-2); font-size: 13px; flex: 1; }
.tool-card__foot { display: flex; justify-content: flex-end; }
.tool-card__go { color: var(--brand-ink); font-weight: 700; font-size: 13px; }
.tool-card:hover .tool-card__go { text-decoration: underline; }

/* ---------------- 下载列表 ---------------- */
.dl-list { display: flex; flex-direction: column; gap: 10px; }
.dl-item {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 13px 15px;
  border: 1px solid var(--line); border-radius: 9px;
  background: #FCFAF4;
}
.dl-item__info { min-width: 0; }
.dl-item__name { font-size: 15px; font-weight: 700; color: var(--ink); }
.dl-item__meta { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.dl-item__desc { font-size: 13px; color: var(--ink-2); margin-top: 3px; }
.dl-empty { color: var(--ink-3); text-align: center; padding: 18px; }

/* ---------------- 页脚 ---------------- */
.foot {
  background: var(--surface);
  border-top: 1px solid var(--line);
  margin-top: 8px;
}
.foot__inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: 22px 16px;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-start;
}
.foot__brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); }
.foot__note { margin: 0; color: var(--ink-2); font-size: 13px; max-width: 680px; }
.foot__copy { margin: 0; color: var(--ink-3); font-size: 12px; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .nav {
    position: absolute; top: var(--h-bar); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 8px 12px 12px;
    box-shadow: 0 10px 24px rgba(40,30,10,.12);
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav__link { padding: 11px 12px; }
  .hero { flex-direction: column; text-align: center; padding: 24px 18px; }
  .hero__tags { justify-content: center; }
  .hero__actions { justify-content: center; }
  .hero__sub { margin-left: auto; margin-right: auto; }
  .dl-item { flex-direction: column; align-items: stretch; }
  .dl-item .btn { width: 100%; }
  .wrap { padding: 16px 12px 48px; gap: 18px; }
}
