/* ShieldyH · 全站视觉层
   白底、克制的蓝紫渐变、清晰的排版层级；只覆盖样式，不改页面结构。 */

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface2: #f8fafc;
  --surface-hover: #f8fafc;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #0f172a;
  --text-dim: #64748b;
  --text-soft: #6b7280;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: #eff6ff;
  --accent-glow: #93c5fd;
  --violet: #7c3aed;
  --cyan: #06b6d4;
  --yellow: #b45309;
  --gradient: linear-gradient(135deg, #2563eb 0%, #7c3aed 55%, #06b6d4 100%);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 14px 36px rgba(15, 23, 42, 0.08);
  --radius: 12px;
  --radius-lg: 18px;
  --header-h: 68px;
  --max: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

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

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: -0.005em;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { background: #dbeafe; color: #0f172a; }

img, video { max-width: 100%; }

h1, h2, h3, h4 {
  font-family: var(--font);
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

h1 { font-size: clamp(2rem, 4.4vw, 3.2rem); }
h2 { font-size: clamp(1.3rem, 2.2vw, 1.65rem); }
h3 { font-size: 1.08rem; }

p, li { color: #334155; line-height: 1.8; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }

code, pre, kbd, samp { font-family: var(--mono); }

button, input, textarea, select { font: inherit; }

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

/* ── 顶部导航 ───────────────────────────── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 22px;
  min-height: var(--header-h);
  padding: 10px clamp(16px, 4vw, 40px);
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.84);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.logo::before {
  content: "S";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 7px;
  background: var(--gradient);
  box-shadow: 0 5px 14px rgba(37, 99, 235, 0.28);
  color: #fff;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}
.logo span {
  margin-left: 2px;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text-dim);
}

.top-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }

.nav-item {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 0.875rem;
  text-decoration: none;
  transition: color .16s ease, background .16s ease;
}
.nav-item:hover { color: var(--text); background: #f1f5f9; }
.nav-item.active { color: var(--accent-strong); background: var(--accent-soft); }

.nav-item[href="/chat.html"] {
  margin-left: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}
.nav-item[href="/chat.html"]:hover { background: #1e293b; color: #fff; }
.nav-item[href="/chat.html"].active { background: var(--gradient); color: #fff; }

.search-bar {
  width: 280px;
  max-width: 100%;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.85rem;
  outline: none;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.search-bar:focus {
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}
.search-bar::placeholder { color: var(--text-soft); }

/* ── Hero ───────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: clamp(64px, 8vw, 104px) 20px clamp(48px, 6vw, 76px);
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(900px 420px at 50% -12%, rgba(37, 99, 235, 0.10), transparent 72%),
    radial-gradient(620px 320px at 86% 18%, rgba(124, 58, 237, 0.06), transparent 72%),
    #fff;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 68%);
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 68%);
  pointer-events: none;
}
.hero > * { position: relative; }

.hero h1 {
  max-width: 900px;
  margin: 0 auto 16px;
  font-size: clamp(2.1rem, 4.8vw, 3.5rem);
  line-height: 1.12;
  letter-spacing: -0.04em;
  font-weight: 800;
  color: var(--text);
}
.hero .subtitle,
.hero > p {
  max-width: 680px;
  margin: 0 auto;
  color: var(--text-dim);
  font-size: 1.02rem;
  line-height: 1.9;
}
.hero .promise {
  display: inline-block;
  margin: 18px auto 0;
  padding: 7px 12px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.84rem;
  line-height: 1.5;
}
.hero .badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}
.hero .badge,
.hero .badges .badge {
  display: inline-block;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text-dim);
  font-size: 0.74rem;
  line-height: 1.6;
}

/* 首页 hero 专用 */
.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  padding: 7px 12px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.05);
  color: var(--accent-strong);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.hero .eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}
.hero h1 .grad {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: #0f172a; color: #fff; }
.btn.primary:hover { background: var(--accent); color: #fff; }
.btn.ghost { background: #fff; border-color: var(--border); color: var(--text); }
.btn.ghost:hover { border-color: var(--border-strong); background: #f8fafc; }
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 24px;
  margin-top: 34px;
  color: var(--text-dim);
  font-size: 0.78rem;
}
.hero-meta strong {
  margin-right: 4px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.86rem;
  font-weight: 700;
}

/* ── 通用卡片 ───────────────────────────── */
.card, .feature-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.card::before, .feature-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: var(--gradient);
  opacity: 0;
  transition: opacity .18s ease;
}
.card:hover, .feature-card:hover {
  transform: translateY(-3px);
  border-color: rgba(37, 99, 235, 0.22);
  box-shadow: var(--shadow-md);
}
.card:hover::before, .feature-card:hover::before { opacity: 1; }
.card h2, .card h3, .feature-card h3 { color: var(--text); font-size: 1.08rem; }
.card p, .feature-card p { color: var(--text-dim); font-size: 0.9rem; line-height: 1.8; }
.card .card-link { margin-top: auto; font-size: 0.82rem; font-weight: 600; }
.card-link::after { content: " →"; }

/* 首页四入口 */
.cards-section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(48px, 6vw, 76px) clamp(16px, 4vw, 24px);
  display: block;
}
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}
.section-head h2 { margin-top: 6px; font-size: clamp(1.35rem, 2.2vw, 1.7rem); }
.section-head > p {
  max-width: 380px;
  margin: 0;
  color: var(--text-dim);
  font-size: 0.88rem;
  line-height: 1.8;
}
.section-kicker {
  color: var(--accent-strong);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.card-grid .card { padding: 26px; }
.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.card-index {
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}
.card-tag {
  padding: 3px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-bottom: 4px;
  border-radius: 11px;
  background: #f1f5f9;
  color: var(--accent);
  transition: background .18s ease, color .18s ease;
}
.card-icon svg { width: 19px; height: 19px; }
.card:hover .card-icon { background: var(--accent-soft); color: var(--accent-strong); }
.card-grid .card h2 { margin: 2px 0 4px; font-size: 1.18rem; }
.card-grid .card p { margin: 0; }
.card-grid .card .card-link { margin-top: 16px; }

/* ── 内容页 ─────────────────────────────── */
.wrap, .container { max-width: var(--max); margin-left: auto; margin-right: auto; }
main.wrap { max-width: 760px; padding-left: 24px; padding-right: 24px; }

.section-title, .sec-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.lead p, .step p { color: #475569; }
.step h2 { font-size: 1.45rem; }
.step .num {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}
.case-note div {
  border-radius: var(--radius);
  background: #fbfdff;
  box-shadow: var(--shadow-sm);
}
.case-card {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.case-card:hover { border-color: rgba(37, 99, 235, 0.22); box-shadow: var(--shadow-md); }
.case-card .role { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; }

.glossary h2, .cases h2 { color: var(--text); font-size: 1.45rem; }
.glossary h2::before, .cases h2::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 9px;
  border-radius: 2px;
  background: var(--gradient);
  vertical-align: 2px;
}

/* 学习页 */
.hero .badge {
  padding: 6px 12px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.76rem;
}
.course-section { max-width: var(--max); }
.course-head .course-en { font-size: 1.55rem; letter-spacing: -0.03em; }
.course-head .course-zh { color: var(--accent-strong); font-weight: 600; }
.lesson {
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.lesson:hover { transform: translateY(-2px); border-color: rgba(37, 99, 235, 0.2); box-shadow: var(--shadow-md); }
.lesson video { border-radius: var(--radius); }
.lesson .lesson-n {
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
}
.lesson h3 { font-size: 1.15rem; }
.lesson .intro { font-size: 0.88rem; }

/* 研究页 */
.grid { gap: 16px; }
.grid-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid .card {
  padding: 20px;
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.grid .card h3 { font-size: 1rem; }
.grid .card p { font-size: 0.82rem; line-height: 1.75; }
.grid .card-tag {
  display: inline-block;
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.grid .card-meta { margin-top: auto; color: var(--text-soft); font-size: 0.68rem; }
.sec-title { margin: 8px 0 16px; }

/* 技能市场 */
main { align-items: flex-start; }
aside {
  width: 220px;
  padding: 22px 0;
  border-right: 1px solid var(--border);
}
.cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2px 12px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 0.85rem;
  line-height: 1.5;
}
.cat-item:hover { background: #f8fafc; color: var(--text); }
.cat-item.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-right: 0;
  font-weight: 600;
}
.cat-item .count {
  float: none;
  margin-left: 8px;
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 0.72rem;
}
.content { padding: 30px clamp(20px, 3vw, 36px) 64px; }
.content h2 { color: var(--text); font-size: 1.55rem; letter-spacing: -0.03em; }
.content .subtitle { margin-bottom: 22px; color: var(--text-dim); font-size: 0.84rem; }
.skill-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.skill-card {
  gap: 8px;
  padding: 18px;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.skill-card:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.22);
  background: #fff;
  box-shadow: var(--shadow-md);
}
.skill-card .name {
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.skill-card .desc { color: var(--text-dim); font-size: 0.82rem; line-height: 1.7; }
.skill-card .meta { gap: 8px; font-size: 0.72rem; }
.skill-card .meta .tag {
  padding: 2px 7px;
  border-radius: 5px;
  background: #f1f5f9;
  color: var(--text-dim);
  font-size: 0.68rem;
}
.skill-card .download-btn {
  height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 650;
  line-height: 32px;
}
.skill-card .download-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.skill-card .download-btn .dl-size { opacity: 0.72; }
.skill-card .unavailable-note { border-radius: 8px; font-size: 0.74rem; }
.stats-bar {
  padding: 12px clamp(16px, 4vw, 40px);
  background: #fbfdff;
  color: var(--text-dim);
  font-size: 0.78rem;
}
.stats-bar strong { color: var(--text); font-family: var(--mono); }
.download-note {
  padding: 10px clamp(16px, 4vw, 40px);
  background: #fbfdff;
  font-size: 0.78rem;
}

/* 聊天输入框：避免 1px 溢出出现滚动条 */
.composer textarea, #input { min-height: 52px; }

/* 表格与提示 */
table { font-size: 0.9rem; }
th { color: var(--text); }
th, td { padding: 10px 12px; border-color: var(--border); }

.note {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fbfdff;
  color: var(--text-dim);
  font-size: 0.88rem;
}

footer {
  padding: 32px 20px;
  border-top: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 0.78rem;
  text-align: center;
}
footer a { color: var(--text-dim); }
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: var(--max);
  margin: 0 auto;
}
.footer-inner span:first-child { color: var(--text); font-weight: 650; }
.footer-inner span:last-child { color: var(--text-soft); }

/* ── 响应式 ─────────────────────────────── */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .section-head { align-items: flex-start; flex-direction: column; gap: 10px; }
  .section-head > p { max-width: 100%; }
  .search-bar { width: 220px; }
}

@media (max-width: 768px) {
  body { font-size: 15px; }
  header { min-height: 60px; padding: 10px 14px; gap: 8px 12px; }
  .logo { font-size: 1rem; }
  .logo::before { width: 22px; height: 22px; }
  .top-nav { width: 100%; gap: 0; }
  .nav-item { padding: 7px 9px; font-size: 0.8rem; }
  .nav-item[href="/chat.html"] { margin-left: 0; padding: 7px 11px; }
  .hero { padding: 44px 16px 40px; }
  .hero h1 { font-size: clamp(1.8rem, 8vw, 2.4rem); }
  .hero .subtitle, .hero > p { font-size: 0.94rem; line-height: 1.8; }
  .hero-meta { gap: 8px 16px; margin-top: 24px; }
  .card-grid { grid-template-columns: 1fr; }
  .cards-section { padding-left: 16px; padding-right: 16px; }
  main.wrap { padding-left: 16px; padding-right: 16px; }
  table { display: block; width: 100%; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .tablewrap table { display: table; width: 100%; overflow: visible; white-space: normal; }
  .grid-4 { grid-template-columns: 1fr; }

  main { display: block; }
  aside {
    display: flex;
    width: 100%;
    height: auto;
    padding: 10px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    position: static;
    gap: 6px;
    -webkit-overflow-scrolling: touch;
  }
  aside::-webkit-scrollbar { display: none; }
  .cat-item {
    flex: 0 0 auto;
    margin: 0;
    padding: 7px 11px;
    border-radius: 999px;
    background: #f8fafc;
    font-size: 0.78rem;
    white-space: nowrap;
  }
  .cat-item .count { margin-left: 6px; }
  .content { padding: 20px 16px 48px; }
  .skill-grid { grid-template-columns: 1fr; }
  .search-bar { width: 100%; }
  .footer-inner { flex-direction: column; gap: 4px; text-align: center; }
}

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