:root {
  --bg:        #f8fafc;
  --bg-2:      #f1f5f9;
  --bg-3:      #e2e8f0;
  --white:     #ffffff;
  --text:      #0f172a;
  --text-2:    #334155;
  --text-3:    #64748b;
  --text-4:    #94a3b8;
  --primary:   #6366f1;
  --primary-2: #4f46e5;
  --primary-3: #4338ca;
  --accent:    #8b5cf6;
  --success:   #10b981;
  --warning:   #f59e0b;
  --danger:    #ef4444;
  --border:    #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(15 23 42 / 0.04);
  --shadow:    0 4px 6px -1px rgb(15 23 42 / 0.05), 0 2px 4px -2px rgb(15 23 42 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(15 23 42 / 0.08), 0 4px 6px -4px rgb(15 23 42 / 0.08);
  --radius:    12px;
  --radius-sm: 8px;
  --f:         'Inter', 'Noto Sans SC', 'PingFang SC', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--f);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 260px;
  background: var(--white);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.sidebar-brand { padding: 24px; border-bottom: 1px solid var(--border); }
.sidebar-brand .logo { font-size: 20px; font-weight: 800; color: var(--text); letter-spacing: -0.5px; cursor: pointer; }
.sidebar-brand .logo span { color: var(--primary); }
.sidebar-brand .tagline { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.sidebar-nav { flex: 1; padding: 16px 12px; }
.nav-section {
  font-size: 11px; font-weight: 700; color: var(--text-4);
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 8px 12px; margin-top: 8px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; margin: 2px 0;
  border-radius: var(--radius-sm);
  cursor: pointer; color: var(--text-2);
  font-size: 13px; font-weight: 500;
  transition: all 0.15s ease;
}
.nav-item:hover { background: var(--bg); color: var(--primary); }
.nav-item.active { background: rgb(99 102 241 / 0.08); color: var(--primary-2); }
.nav-item .icon {
  width: 22px; height: 22px; border-radius: 6px;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.nav-item .count {
  margin-left: auto; font-size: 11px; color: var(--text-4);
  background: var(--bg-2); padding: 2px 7px; border-radius: 999px;
}
.nav-item.active .count { background: rgb(99 102 241 / 0.12); color: var(--primary-2); }

.sidebar-footer { padding: 16px; border-top: 1px solid var(--border); }
.unlock-status { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); margin-bottom: 12px; }
.unlock-status.locked { color: var(--danger); }
.unlock-status.unlocked { color: var(--success); }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.locked { background: var(--danger); }
.dot.unlocked { background: var(--success); }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  border: none; cursor: pointer;
  transition: all 0.15s ease;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-2); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-2); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: rgb(99 102 241 / 0.04); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; }

.main { flex: 1; margin-left: 260px; min-height: 100vh; }
.header {
  position: sticky; top: 0;
  background: rgba(248,250,252,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 40;
  padding: 14px 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.search-box { position: relative; flex: 1; max-width: 520px; }
.search-box i, .search-box svg {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  font-size: 14px; color: var(--text-4); pointer-events: none; z-index: 1;
}
.search-box input {
  width: 100%; padding: 10px 16px 10px 40px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--white); font-size: 13.5px; color: var(--text);
  outline: none; transition: all 0.15s ease;
}
.search-box input::placeholder { color: var(--text-4); }
.search-box input:hover { border-color: var(--bg-3); }
.search-box input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgb(99 102 241 / 0.1); }
.header-actions { display: flex; align-items: center; gap: 12px; }
.mobile-menu-btn { display: none; }

.content { padding: 28px 24px; max-width: 1600px; margin: 0 auto; }

.hero {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  border-radius: var(--radius);
  padding: 48px; color: #fff; margin-bottom: 32px;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute;
  top: -50%; right: -10%; width: 500px; height: 500px;
  background: rgba(255,255,255,0.08); border-radius: 50%;
}
.hero h1 { font-size: 30px; font-weight: 800; margin-bottom: 12px; position: relative; line-height: 1.45; }
.hero h1 .hero-line2 { display: block; font-size: 18px; font-weight: 500; opacity: 0.9; margin-top: 10px; }
.hero p { font-size: 15px; opacity: 0.92; max-width: 640px; position: relative; line-height: 1.9; }
.hero-stats { display: flex; gap: 32px; margin-top: 28px; position: relative; flex-wrap: wrap; }
.hero-stats .stat strong { display: block; font-size: 28px; font-weight: 800; }
.hero-stats .stat span { font-size: 13px; opacity: 0.85; }

.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.section-title { font-size: 18px; font-weight: 700; color: var(--text); }
.section-sub { font-size: 13px; color: var(--text-3); margin-top: 2px; }
.filter-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.pill {
  padding: 6px 12px; border-radius: 999px;
  background: var(--white); border: 1px solid var(--border);
  font-size: 12px; color: var(--text-2); cursor: pointer;
}
.pill:hover { border-color: var(--primary); color: var(--primary); }
.pill.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px; cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: rgb(99 102 241 / 0.2); }
.card-top { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 14px; }
.card-logo {
  width: 48px; height: 48px; border-radius: 12px;
  display: grid; place-items: center;
  font-size: 20px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.card-meta { flex: 1; min-width: 0; }
.card-name { font-size: 15px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-tagline {
  font-size: 12px; color: var(--text-3); margin-top: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.5;
}
.card-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.badge { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--bg-2); color: var(--text-2); }
.badge.revenue { background: rgb(16 185 129 / 0.1); color: var(--success); }
.badge.cat { background: rgb(99 102 241 / 0.08); color: var(--primary-2); }
.badge.new { background: rgb(245 158 11 / 0.14); color: #b45309; }
.card-footer {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px;
  font-size: 12px; color: var(--text-4);
  padding-top: 14px; border-top: 1px solid var(--border);
}
.card-footer span { display: flex; align-items: center; gap: 4px; min-width: 0; }
.card-footer span:first-child { flex: 0 0 auto; white-space: nowrap; }
.card-footer span:last-child { flex: 1; align-items: flex-start; line-height: 1.6; }
.card-footer span:last-child i { margin-top: 3px; flex: 0 0 auto; }

.more-wrap { text-align: center; margin-top: 28px; }

.detail-back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 13px; cursor: pointer; margin-bottom: 20px; }
.detail-back:hover { color: var(--primary); }
.detail-layout { display: grid; grid-template-columns: 200px 1fr; gap: 24px; }
.detail-sidebar { position: sticky; top: 90px; height: fit-content; max-height: calc(100vh - 120px); overflow-y: auto; }
.detail-sidebar .toc-title {
  font-size: 11px; font-weight: 700; color: var(--text-4);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 12px;
}
.toc-item { padding: 8px 12px; border-radius: var(--radius-sm); font-size: 12.5px; color: var(--text-2); cursor: pointer; margin: 1px 0; }
.toc-item:hover { background: var(--bg-2); color: var(--primary); }
.toc-item.active { background: rgb(99 102 241 / 0.08); color: var(--primary-2); font-weight: 600; }

.detail-main { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.detail-hero { padding: 36px; border-bottom: 1px solid var(--border); display: flex; gap: 24px; }
.detail-hero .logo {
  width: 80px; height: 80px; border-radius: 20px;
  display: grid; place-items: center;
  font-size: 36px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.detail-hero-info { flex: 1; }
.detail-hero-info h1 { font-size: 28px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.detail-hero-info .tagline { font-size: 15px; color: var(--text-3); margin-bottom: 16px; }
.detail-hero-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-hero-badges .badge { font-size: 12px; padding: 5px 12px; }

.detail-body { padding: 36px; }
.detail-section { margin-bottom: 36px; scroll-margin-top: 100px; }
.detail-section:last-child { margin-bottom: 0; }
.detail-section h2 {
  font-size: 18px; font-weight: 700; color: var(--text);
  margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.detail-section p { font-size: 14px; color: var(--text-2); margin-bottom: 12px; line-height: 1.8; }
.detail-section ul { list-style: none; display: grid; gap: 10px; }
.detail-section ul li {
  background: var(--bg); padding: 12px 14px; border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text-2); position: relative; padding-left: 34px;
}
.detail-section ul li::before {
  content: '•'; position: absolute; left: 14px; top: 11px;
  color: var(--primary); font-size: 18px; font-weight: 700;
}

.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.kv-item { background: var(--bg); padding: 14px; border-radius: var(--radius-sm); }
.kv-item .label { font-size: 11px; color: var(--text-4); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.kv-item .value { font-size: 15px; font-weight: 700; color: var(--text); }

.cta-box {
  background: linear-gradient(135deg, #f1f5f9 0%, #e0e7ff 100%);
  border: 1px solid rgb(99 102 241 / 0.15);
  border-radius: var(--radius); padding: 28px; margin-top: 32px;
}
.cta-box h3 { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.cta-box p { color: var(--text-2); margin-bottom: 16px; }

.lock-overlay { position: relative; }
.lock-message {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px;
  background: linear-gradient(180deg, transparent 0%, rgba(255,255,255,0.96) 35%, rgba(255,255,255,1) 100%);
}
.lock-message h3 { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.lock-message p { color: var(--text-3); margin-bottom: 16px; max-width: 460px; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,0.5);
  z-index: 100; display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal { background: var(--white); border-radius: var(--radius); width: 100%; max-width: 420px; box-shadow: var(--shadow-lg); overflow: hidden; }
.modal-header { padding: 24px 24px 16px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 18px; font-weight: 700; }
.modal-header p { font-size: 13px; color: var(--text-3); margin-top: 4px; }
.modal-body { padding: 24px; }
.modal-body label { display: block; font-size: 12px; font-weight: 600; color: var(--text-3); margin-bottom: 6px; }
.modal-body input {
  width: 100%; padding: 11px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 12px;
}
.modal-body input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgb(99 102 241 / 0.1); }
.modal-body .hint { font-size: 12px; color: var(--text-4); margin-bottom: 16px; }
.modal-body .error { font-size: 12px; color: var(--danger); margin-bottom: 12px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

.sub-head {
  font-size: 13px; font-weight: 700; color: var(--text);
  margin: 26px 0 10px; padding-left: 10px; border-left: 3px solid var(--primary);
}
.copy-wrap {
  position: relative; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 14px 12px; margin-bottom: 10px;
}
.copy-label { font-size: 11.5px; font-weight: 700; color: var(--text-4); margin-bottom: 8px; }
.copy-src { font-size: 13px; color: var(--text-2); line-height: 1.75; white-space: pre-wrap; padding-right: 74px; }
.copy-btn {
  position: absolute; top: 10px; right: 10px;
  font-size: 11.5px; font-weight: 600;
  padding: 4px 10px; border-radius: 6px; cursor: pointer;
  background: #fff; color: var(--primary);
  border: 1px solid rgb(99 102 241 / 0.35);
  transition: all .15s;
}
.copy-btn:hover { background: var(--primary); color: #fff; }
.copy-btn.sm { padding: 3px 9px; font-size: 11px; }

.tbl-wrap { overflow-x: auto; margin-bottom: 18px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 560px; }
.tbl th {
  text-align: left; font-weight: 700; font-size: 12px; color: var(--text-3);
  background: var(--bg); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--border); color: var(--text-2); vertical-align: top; line-height: 1.6; }
.tbl tr:last-child td { border-bottom: none; }
.tbl-price { color: var(--success); font-weight: 700; white-space: nowrap; }
.tbl-must { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 4px; background: rgb(16 185 129 / 0.12); color: var(--success); font-weight: 600; }
.tbl-opt { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 4px; background: var(--bg); color: var(--text-4); border: 1px solid var(--border); }

.rm-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 18px; margin-bottom: 12px; background: #fff; }
.rm-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.rm-week { font-size: 12px; font-weight: 800; color: #fff; background: var(--primary); padding: 3px 10px; border-radius: 20px; }
.rm-goal { font-size: 14px; font-weight: 700; color: var(--text); }
.rm-card ul { margin: 0 0 10px; padding-left: 20px; }
.rm-card li { font-size: 13px; color: var(--text-2); margin-bottom: 6px; line-height: 1.6; }
.rm-milestone { font-size: 12.5px; color: var(--success); background: rgb(16 185 129 / 0.06); border-radius: 6px; padding: 8px 12px; font-weight: 600; }

.rule-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.rule-item { display: flex; gap: 12px; font-size: 12.5px; line-height: 1.6; padding: 10px 12px; background: var(--bg); border-radius: 6px; }
.rule-item span { color: var(--text-4); font-weight: 600; min-width: 96px; flex-shrink: 0; }
.rule-item b { color: var(--text-2); font-weight: 500; }

.obj-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 10px; background: #fff; }
.obj-q { font-size: 13.5px; font-weight: 700; color: var(--text); margin-bottom: 8px; display: flex; gap: 8px; align-items: flex-start; }
.obj-idx {
  display: inline-grid; place-items: center; flex-shrink: 0;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgb(239 68 68 / 0.1); color: #dc2626;
  font-size: 11px; font-weight: 700; margin-top: 1px;
}
.obj-a { font-size: 13px; color: var(--text-2); line-height: 1.75; padding-right: 60px; }
.obj-a .copy-src { padding-right: 0; display: inline; white-space: normal; font-size: 13px; }

.jr-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 18px; margin-bottom: 12px; background: #fff; }
.jr-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.jr-stage { font-size: 13.5px; font-weight: 800; color: var(--primary-2); }
.jr-when { font-size: 11.5px; color: var(--text-4); }
.jr-goal { font-size: 12.5px; color: var(--success); margin-top: 8px; }
.jr-tip { font-size: 12.5px; color: var(--text-3); margin-top: 4px; }

.tier-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 18px; margin-bottom: 12px; background: #fff; }
.tier-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.tier-name { font-size: 14px; font-weight: 800; color: var(--text); }
.tier-row { font-size: 12.5px; color: var(--text-2); line-height: 1.7; margin-bottom: 4px; }
.tier-row i { font-style: normal; color: var(--text-4); display: inline-block; min-width: 62px; }

.faq-list { columns: 2; column-gap: 18px; }
.faq-item {
  break-inside: avoid; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0; margin-bottom: 8px; background: #fff; display: inline-block; width: 100%;
}
.faq-item summary {
  cursor: pointer; list-style: none; padding: 11px 14px;
  font-size: 13px; font-weight: 600; color: var(--text);
  display: flex; justify-content: space-between; gap: 8px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; color: var(--text-4); font-weight: 400; }
.faq-item[open] summary::after { content: '−'; color: var(--primary); }
.faq-item[open] summary { color: var(--primary); }
.faq-a { padding: 0 14px 13px; font-size: 12.5px; color: var(--text-2); line-height: 1.75; }

.sch-row { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px dashed var(--border); }
.sch-row:last-child { border-bottom: none; }
.sch-time { font-size: 12px; font-weight: 700; color: var(--primary); min-width: 92px; flex-shrink: 0; padding-top: 2px; font-variant-numeric: tabular-nums; }
.sch-task { font-size: 13.5px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.sch-note { font-size: 12px; color: var(--text-4); line-height: 1.6; }

.chk { display: grid; gap: 10px; }
.chk-item { display: flex; gap: 12px; background: var(--bg); border-radius: var(--radius-sm); padding: 12px 14px; }
.chk-no {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
  background: rgb(99 102 241 / 0.12); color: var(--primary-2);
}
.chk-t { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.chk-d { font-size: 12.5px; color: var(--text-2); line-height: 1.65; }

.phase-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 18px; margin-bottom: 12px; background: #fff; }
.phase-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.phase-tag { font-size: 12px; font-weight: 800; color: #fff; background: var(--accent); padding: 3px 10px; border-radius: 20px; }
.phase-goal { font-size: 13.5px; font-weight: 700; color: var(--text); }
.phase-card ol { padding-left: 20px; margin-bottom: 10px; }
.phase-card ol li { font-size: 13px; color: var(--text-2); margin-bottom: 6px; line-height: 1.65; }

@media (max-width: 760px) {
  .faq-list { columns: 1; }
  .copy-src { padding-right: 0; padding-top: 22px; }
  .obj-a { padding-right: 0; padding-top: 20px; }
}

.empty-state { text-align: center; padding: 80px 20px; color: var(--text-3); }
.empty-state h3 { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 8px; }

/* ===== 移动端适配基础：抽屉遮罩 + 触摸 + 安全区 ===== */
.sidebar-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,0.55);
  z-index: 45; opacity: 0; pointer-events: none;
  transition: opacity 0.22s ease;
}
.sidebar-overlay.open { opacity: 1; pointer-events: auto; }
@supports (backdrop-filter: blur(2px)) {
  .sidebar-overlay.open { backdrop-filter: blur(2px); }
}
button, .btn, .nav-item, .pill, .toc-item, .copy-btn, .ai-back, .chk-item, .faq-item summary {
  touch-action: manipulation;
}
* { -webkit-tap-highlight-color: transparent; }
body { padding-bottom: env(safe-area-inset-bottom); }

/* ===== 平板/手机断点 ≤900 ===== */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%); transition: transform 0.24s ease;
    box-shadow: var(--shadow-lg); width: 78%; max-width: 320px;
  }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .mobile-menu-btn { display: inline-flex; }
  .header { padding: 10px 14px; gap: 10px; }
  .header .search-box input { padding: 9px 12px 9px 36px; }
  .header-actions .btn { padding: 7px 10px; font-size: 12px; }
  .content { padding: 18px 14px calc(36px + env(safe-area-inset-bottom)); }

  /* Hero */
  .hero { padding: 30px 22px; border-radius: 10px; }
  .hero h1 { font-size: 22px; line-height: 1.5; }
  .hero h1 .hero-line2 { font-size: 15px; margin-top: 8px; }
  .hero p { font-size: 14px; line-height: 1.85; }
  .hero-stats { gap: 16px 24px; margin-top: 22px; }
  .hero-stats .stat strong { font-size: 22px; }

  /* Section */
  .section-header { flex-direction: column; align-items: flex-start; gap: 6px; }
  .section-title { font-size: 17px; }
  .section-sub { font-size: 13px; }

  /* Filter pills 横滚 */
  .filter-pills {
    flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px;
    margin: 0 -14px 16px; padding-left: 14px; padding-right: 14px;
    scrollbar-width: none;
  }
  .filter-pills::-webkit-scrollbar { display: none; }

  /* Cards */
  .cards-grid { grid-template-columns: 1fr; gap: 14px; }
  .card { padding: 18px; }
  .card-top { gap: 12px; margin-bottom: 12px; }
  .card-logo { width: 44px; height: 44px; font-size: 18px; border-radius: 11px; }
  .card-name { font-size: 15.5px; }
  .card-tagline { font-size: 12px; }
  .card-badges { gap: 5px; margin-bottom: 12px; }
  .card-footer { padding-top: 12px; font-size: 11.5px; }

  /* Detail 堆叠 */
  .detail-layout { grid-template-columns: 1fr; }
  .detail-sidebar { display: none; }
  .detail-main { border-radius: 10px; }
  .detail-hero {
    flex-direction: column; align-items: flex-start;
    padding: 22px; gap: 16px;
  }
  .detail-hero .logo { width: 56px; height: 56px; font-size: 26px; border-radius: 14px; }
  .detail-hero-info h1 { font-size: 22px; }
  .detail-hero-info .tagline { font-size: 13.5px; margin-bottom: 12px; }
  .detail-hero-badges { gap: 6px; }
  .detail-hero-badges .badge { font-size: 11px; padding: 4px 10px; }
  .detail-body { padding: 22px; }
  .detail-section { margin-bottom: 28px; }
  .detail-section h2 { font-size: 16.5px; }
  .detail-section p { font-size: 13.5px; line-height: 1.85; }
  .detail-section ul li { font-size: 12.5px; padding: 11px 12px 11px 30px; }

  .kv-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .kv-item { padding: 12px; }
  .kv-item .value { font-size: 13.5px; }
  .kv-item .label { font-size: 10.5px; }

  .tbl th, .tbl td { padding: 9px 10px; font-size: 12px; }
  .tbl { min-width: 480px; }

  .rm-card, .tier-card, .obj-card, .jr-card, .phase-card { padding: 14px; }
  .rm-goal { font-size: 13.5px; }
  .rm-week { font-size: 11.5px; padding: 3px 9px; }

  .copy-wrap { padding: 12px 14px; }
  .copy-src { padding-right: 64px; font-size: 12.5px; line-height: 1.7; }
  .copy-btn { top: 9px; right: 9px; padding: 4px 8px; font-size: 11px; }
  .obj-a { padding-right: 56px; }

  .faq-list { columns: 1; }
  .faq-item summary { font-size: 12.5px; padding: 10px 12px; }
  .faq-a { font-size: 12px; }

  .cta-box { padding: 22px; }
  .cta-box h3 { font-size: 16px; }
  .cta-box p { font-size: 13px; }

  .modal { max-width: 100%; border-radius: 12px; margin: 0 14px; }
  .modal-header, .modal-body, .modal-footer { padding-left: 20px; padding-right: 20px; }
  .modal-header h3 { font-size: 16px; }

  .rule-item { font-size: 12px; padding: 9px 11px; }
  .rule-item span { min-width: 86px; font-size: 11px; }

  /* AI banner / AI hero */
  .ai-banner { padding: 14px 16px; gap: 12px; margin-bottom: 18px; border-radius: 10px; }
  .ai-banner-icon { width: 38px; height: 38px; font-size: 13px; border-radius: 9px; }
  .ai-banner-title { font-size: 14px; }
  .ai-banner-sub { font-size: 11.5px; }
  .ai-banner-cta { font-size: 12px; }

  .ai-hero { padding: 26px 22px; border-radius: 10px; }
  .ai-hero .kicker { font-size: 11px; letter-spacing: 0.18em; }
  .ai-hero h1 { font-size: 22px; }
  .ai-hero p { font-size: 13.5px; line-height: 1.85; }
  .ai-hero .ai-stats { gap: 14px 24px; }
  .ai-hero .ai-stats b { font-size: 18px; }

  .ai-tool-card { gap: 9px; }
  .ai-tool-card .t-logo { width: 36px; height: 36px; font-size: 17px; }
  .ai-tool-card .t-name { font-size: 14px; }
  .ai-tool-card .t-vendor { font-size: 11px; }

  .ai-detail-head { gap: 14px; }
  .ai-detail-head .d-logo { width: 48px; height: 48px; font-size: 24px; border-radius: 12px; }

  .ai-block { padding: 16px 18px; margin-bottom: 12px; }
  .ai-block h4 { font-size: 14.5px; margin-bottom: 10px; }
  .ai-block ol li, .ai-block ul li, .ai-block p { font-size: 13px; }

  .ai-svc-card { gap: 9px; }
  .ai-svc-card .s-title { font-size: 14px; }
  .ai-svc-card .s-desc { font-size: 12px; line-height: 1.7; }
  .ai-svc-card .s-hl { font-size: 11.5px; padding: 9px 10px; }
}

/* ===== 极窄屏 ≤420（iPhone SE / 12 mini） ===== */
@media (max-width: 420px) {
  body { font-size: 14px; }
  .header { padding: 9px 12px; gap: 8px; }
  .header .search-box input { font-size: 12.5px; padding: 9px 10px 9px 32px; }
  /* 隐藏右上「🔑 输入访问码」按钮，留底部解锁入口 */
  .header-actions .btn-outline { display: none; }
  .content { padding: 14px 12px calc(40px + env(safe-area-inset-bottom)); }

  .hero { padding: 22px 18px; }
  .hero h1 { font-size: 19px; }
  .hero h1 .hero-line2 { font-size: 13.5px; }
  .hero p { font-size: 13px; line-height: 1.85; }
  .hero-stats { gap: 12px 18px; }
  .hero-stats .stat strong { font-size: 18px; }
  .hero-stats .stat span { font-size: 11px; }

  .section-title { font-size: 16px; }
  .section-sub { font-size: 12.5px; }

  .card { padding: 16px; }
  .card-logo { width: 40px; height: 40px; font-size: 16px; border-radius: 10px; }
  .card-name { font-size: 14.5px; }
  .card-tagline { font-size: 11.5px; }
  .badge { font-size: 10.5px; padding: 2.5px 7px; }
  .card-footer { font-size: 11px; gap: 10px; }

  .filter-pills .pill { padding: 6px 10px; font-size: 11.5px; }

  .ai-banner { flex-wrap: wrap; }
  .ai-banner-cta { margin-left: 0; }
  .ai-hero { padding: 22px 18px; }
  .ai-hero h1 { font-size: 19px; }
  .ai-hero .ai-stats { gap: 10px 18px; }
  .ai-hero .ai-stats b { font-size: 16px; }
  .ai-hero .ai-stats span { font-size: 11px; }

  .detail-hero { padding: 18px; gap: 14px; }
  .detail-body { padding: 18px; }
  .detail-hero-info h1 { font-size: 20px; }
  .detail-hero-info .tagline { font-size: 13px; }
  .detail-section h2 { font-size: 15.5px; padding-bottom: 9px; margin-bottom: 12px; }

  .tbl th, .tbl td { padding: 8px 9px; font-size: 11.5px; }

  .obj-a { padding-right: 0; padding-top: 24px; }
  .copy-src { padding-right: 0; padding-top: 24px; }
  .obj-card { padding-bottom: 32px; }
  .copy-btn { position: static; display: block; margin-top: 8px; }

  .cta-box { padding: 18px; }
  .modal { margin: 0 10px; }
  .modal-header, .modal-body, .modal-footer { padding-left: 16px; padding-right: 16px; }
}

/* 横屏 + 短屏（手机横屏浏览） */
@media (max-height: 500px) and (orientation: landscape) {
  .hero { padding: 22px 24px; }
  .hero h1 { font-size: 20px; }
  .detail-hero { padding: 18px 24px; flex-direction: row; align-items: center; }
  .detail-hero .logo { width: 52px; height: 52px; font-size: 24px; }
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-4); }

/* ===== AI 集成栈 ===== */
.ai-banner {
  display: flex; align-items: center; gap: 14px; cursor: pointer;
  background: linear-gradient(120deg, #1c1917, #3f2d1a);
  border: 1px solid #57534e; border-radius: var(--radius);
  padding: 16px 20px; margin-bottom: 22px; transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.ai-banner:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.ai-banner-icon {
  width: 42px; height: 42px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, #c9a46a, #b45309);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px; letter-spacing: 0.5px;
}
.ai-banner-title { color: #fafaf9; font-weight: 700; font-size: 15px; }
.ai-banner-sub { color: #c9b8a3; font-size: 12px; margin-top: 3px; }
.ai-banner-cta { margin-left: auto; color: #d6b98c; font-size: 13px; font-weight: 600; flex-shrink: 0; }

.ai-hero {
  background: linear-gradient(135deg, #1c1917, #3f2d1a);
  color: #fafaf9; border-radius: var(--radius);
  padding: 32px; margin-bottom: 28px;
}
.ai-hero .kicker { font-size: 12px; letter-spacing: 0.22em; color: #c9a46a; font-weight: 700; margin-bottom: 10px; }
.ai-hero h1 { font-size: 26px; font-weight: 800; color: #fff; margin-bottom: 10px; }
.ai-hero p { font-size: 14px; color: #d6d3d1; max-width: 720px; line-height: 1.85; }
.ai-hero .ai-stats { display: flex; gap: 30px; margin-top: 20px; flex-wrap: wrap; }
.ai-hero .ai-stats b { color: #d6b98c; font-size: 22px; font-weight: 800; display: block; }
.ai-hero .ai-stats span { display: block; font-size: 12px; color: #a8a29e; margin-top: 2px; }

.ai-tool-card { display: flex; flex-direction: column; gap: 10px; }
.ai-tool-card .t-logo {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  font-size: 19px; color: #fff; flex-shrink: 0;
}
.ai-tool-card .t-name { font-weight: 700; font-size: 14.5px; color: var(--text); }
.ai-tool-card .t-vendor { font-size: 11.5px; color: var(--text-4); margin-top: 1px; }
.ai-tool-card .t-tag {
  font-size: 11.5px; color: var(--text-3); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.ai-detail { max-width: 780px; }
.ai-detail-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 8px; }
.ai-detail-head .d-logo {
  width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center;
  font-size: 28px; color: #fff; flex-shrink: 0;
}
.ai-back {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font-size: 13px; color: var(--text-3); margin-bottom: 18px; font-weight: 500;
}
.ai-back:hover { color: var(--primary); }
.ai-block {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; margin-bottom: 16px;
}
.ai-block h4 { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 12px; }
.ai-block ol { padding-left: 22px; display: grid; gap: 8px; }
.ai-block ol li { font-size: 13.5px; color: var(--text-2); line-height: 1.7; }
.ai-block ul { display: grid; gap: 8px; list-style: none; }
.ai-block ul li { font-size: 13.5px; color: var(--text-2); line-height: 1.7; padding-left: 16px; position: relative; }
.ai-block ul li::before { content: '·'; position: absolute; left: 4px; color: var(--text-4); font-weight: 700; }
.ai-block p { font-size: 13.5px; color: var(--text-2); line-height: 1.8; }
.ai-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.ai-chip {
  font-size: 11.5px; color: var(--text-2); background: var(--bg-2);
  border: 1px solid var(--border); padding: 4px 10px; border-radius: 999px;
}
.ai-svc-card { display: flex; flex-direction: column; gap: 10px; }
.ai-svc-card .s-head { display: flex; align-items: center; gap: 10px; }
.ai-svc-card .s-icon { font-size: 24px; }
.ai-svc-card .s-title { font-weight: 700; font-size: 14.5px; }
.ai-svc-card .s-desc { font-size: 12.5px; color: var(--text-3); line-height: 1.7; }
.ai-svc-card .s-hl { font-size: 12px; color: var(--text-2); background: var(--bg); border-radius: 8px; padding: 10px 12px; line-height: 1.7; }