/* ═══════════════════════════════════════
   知树 · 儿童学习图谱 · 主样式表
   配色：柔和绿色系 + 暖白底色
═══════════════════════════════════════ */

:root {
  --zt-primary:     #2A7A4F;
  --zt-primary-lt:  #4CAF79;
  --zt-primary-bg:  #F0F8F3;
  --zt-bg:          #F4F9F6;
  --zt-card:        #FFFFFF;
  --zt-text:        #1A3328;
  --zt-text-muted:  #5A7A6A;
  --zt-border:      #D0E8DA;
  --zt-accent:      #F5A623;
  --zt-radius:      12px;
  --zt-radius-sm:   8px;
  --zt-shadow:      0 2px 12px rgba(42,122,79,.10);
  --zt-shadow-hover:0 6px 20px rgba(42,122,79,.18);
}

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

body {
  background: var(--zt-bg);
  color: var(--zt-text);
  font-family: "PingFang SC","Microsoft YaHei",system-ui,-apple-system,sans-serif;
  line-height: 1.6;
}

/* ── 导航栏 ──────────────────────────── */
.zt-navbar {
  background: var(--zt-card);
  border-bottom: 1px solid var(--zt-border);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.zt-brand { text-decoration: none !important; display: flex; align-items: center; gap: 8px; }
.zt-logo-icon { font-size: 1.6rem; }
.zt-logo-text {
  font-size: 1.4rem; font-weight: 700;
  color: var(--zt-primary);
  letter-spacing: .5px;
}
.zt-search-form { flex: 1; max-width: 420px; margin: 0 24px; }
.zt-search-input {
  border: 1.5px solid var(--zt-border);
  border-right: none;
  border-radius: var(--zt-radius-sm) 0 0 var(--zt-radius-sm) !important;
  background: var(--zt-bg);
}
.zt-search-input:focus { border-color: var(--zt-primary); box-shadow: none; }
.zt-search-btn {
  background: var(--zt-primary);
  color: #fff;
  border: none;
  border-radius: 0 var(--zt-radius-sm) var(--zt-radius-sm) 0 !important;
}
.zt-search-btn:hover { background: var(--zt-primary-lt); color: #fff; }
.zt-lang-btn {
  border-color: var(--zt-border);
  color: var(--zt-text-muted);
  font-size: .8rem;
  padding: 3px 10px;
  border-radius: 20px;
}
.zt-lang-btn:hover { background: var(--zt-primary-bg); border-color: var(--zt-primary); color: var(--zt-primary); }

/* ── Hero ───────────────────────────── */
.zt-hero {
  background: linear-gradient(135deg, #EAF5EE 0%, #F4FAF7 50%, #FFF8EE 100%);
  border-bottom: 1px solid var(--zt-border);
}
.zt-hero-title {
  font-size: 2.4rem; font-weight: 800;
  color: var(--zt-text); line-height: 1.25;
}
.zt-highlight { color: var(--zt-primary); }
.zt-hero-sub { color: var(--zt-text-muted); font-size: 1.05rem; margin-top: 12px; line-height: 1.7; }
.zt-hero-input {
  border: 1.5px solid var(--zt-border);
  border-radius: var(--zt-radius) !important;
  background: #fff;
  font-size: 1rem;
}
.zt-hero-input:focus { border-color: var(--zt-primary); box-shadow: 0 0 0 3px rgba(42,122,79,.12); }
.zt-hero-btn {
  background: var(--zt-primary); color: #fff;
  border-radius: var(--zt-radius) !important;
  padding: 10px 24px;
  border: none; white-space: nowrap;
}
.zt-hero-btn:hover { background: var(--zt-primary-lt); color: #fff; }

/* 统计数字 */
.zt-hero-stats {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px; padding: 32px;
}
.zt-stat-item {
  background: var(--zt-card);
  border-radius: var(--zt-radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--zt-shadow);
}
.zt-stat-num {
  display: block; font-size: 2rem; font-weight: 800;
  color: var(--zt-primary); line-height: 1;
}
.zt-stat-label {
  display: block; font-size: .8rem;
  color: var(--zt-text-muted); margin-top: 4px;
}

/* ── Section ────────────────────────── */
.zt-section { padding: 48px 0; }
.zt-section-title {
  font-size: 1.4rem; font-weight: 700;
  color: var(--zt-text); margin-bottom: 24px;
}

/* ── 学科卡片 ───────────────────────── */
.zt-subject-card {
  display: flex; flex-direction: column; align-items: center;
  background: var(--zt-card);
  border: 1.5px solid var(--zt-border);
  border-radius: var(--zt-radius);
  padding: 24px 16px;
  text-decoration: none;
  transition: all .2s ease;
  box-shadow: var(--zt-shadow);
  border-top: 3px solid var(--subject-color, #2A7A4F);
}
.zt-subject-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--zt-shadow-hover);
  border-color: var(--subject-color, #2A7A4F);
  text-decoration: none;
}
.zt-subject-icon { font-size: 2.2rem; margin-bottom: 8px; }
.zt-subject-name {
  font-weight: 600; font-size: 1rem;
  color: var(--zt-text); text-align: center;
}
.zt-subject-count {
  font-size: .82rem; color: var(--zt-text-muted); margin-top: 4px;
}

/* ── 年龄快捷入口 ───────────────────── */
.zt-age-section { background: var(--zt-primary-bg); }
.zt-age-row {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.zt-age-chip {
  display: inline-flex; flex-direction: column; align-items: center;
  background: var(--zt-card);
  border: 1.5px solid var(--zt-border);
  border-radius: 50px;
  padding: 8px 18px;
  text-decoration: none;
  transition: all .2s;
  min-width: 64px;
}
.zt-age-chip:hover {
  background: var(--zt-primary);
  border-color: var(--zt-primary);
  text-decoration: none;
}
.zt-age-chip:hover .zt-age-num,
.zt-age-chip:hover .zt-age-unit { color: #fff; }
.zt-age-num { font-size: 1.1rem; font-weight: 700; color: var(--zt-primary); line-height: 1; }
.zt-age-unit { font-size: .72rem; color: var(--zt-text-muted); }

/* ── 主题卡片（列表视图）──────────────── */
.zt-topic-card {
  display: block; background: var(--zt-card);
  border: 1.5px solid var(--zt-border);
  border-radius: var(--zt-radius);
  padding: 16px;
  text-decoration: none;
  transition: all .2s;
  box-shadow: var(--zt-shadow);
  height: 100%;
}
.zt-topic-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--zt-shadow-hover);
  border-color: var(--zt-primary);
  text-decoration: none;
}
.zt-topic-header {
  display: flex; justify-content: space-between; align-items: center;
  border-left: 3px solid;
  padding-left: 8px; margin-bottom: 8px;
}
.zt-topic-subject { font-size: .8rem; font-weight: 600; }
.zt-topic-age { font-size: .75rem; color: var(--zt-text-muted); background: var(--zt-bg); padding: 2px 8px; border-radius: 20px; }
.zt-topic-name { font-size: .95rem; font-weight: 600; color: var(--zt-text); margin-bottom: 4px; line-height: 1.4; }
.zt-topic-domain { font-size: .8rem; margin-bottom: 8px; }
.zt-type-badge { font-size: .72rem; padding: 2px 8px; border-radius: 20px; font-weight: 500; }

/* ── 筛选面板 ───────────────────────── */
.zt-filter-panel {
  background: var(--zt-card);
  border: 1.5px solid var(--zt-border);
  border-radius: var(--zt-radius);
  padding: 20px;
  box-shadow: var(--zt-shadow);
  position: sticky; top: 72px;
}
.zt-filter-title { font-size: 1rem; font-weight: 700; color: var(--zt-text); margin-bottom: 16px; }
.zt-filter-group { margin-bottom: 14px; }
.zt-filter-label { font-size: .82rem; font-weight: 600; color: var(--zt-text-muted); display: block; margin-bottom: 4px; }
.zt-select { border-color: var(--zt-border); font-size: .88rem; }
.zt-select:focus { border-color: var(--zt-primary); box-shadow: 0 0 0 2px rgba(42,122,79,.15); }
.zt-clear-btn { border: 1px dashed var(--zt-border); color: var(--zt-text-muted); font-size: .82rem; }
.zt-clear-btn:hover { border-color: #E74C3C; color: #E74C3C; }

/* 面包屑 */
.zt-breadcrumb { font-size: .85rem; color: var(--zt-text-muted); }
.zt-breadcrumb a { color: var(--zt-primary); text-decoration: none; }
.zt-breadcrumb a:hover { text-decoration: underline; }
.zt-breadcrumb-sep { margin: 0 6px; color: var(--zt-border); }
.zt-breadcrumb-item {
  display: inline-block; padding: 2px 10px;
  border-radius: 20px; font-size: .82rem; font-weight: 500;
}

/* ── 主题详情页 ─────────────────────── */
.zt-topic-detail-card {
  background: var(--zt-card);
  border: 1.5px solid var(--zt-border);
  border-radius: var(--zt-radius);
  box-shadow: var(--zt-shadow);
  overflow: hidden;
}
.zt-detail-header { padding: 24px; border-bottom: 1px solid var(--zt-border); }
.zt-detail-title { font-size: 1.6rem; font-weight: 800; color: var(--zt-text); margin: 8px 0 0; }
.zt-detail-title-en { font-size: .9rem; margin-top: 4px; }
.zt-detail-section { padding: 20px 24px; border-bottom: 1px solid var(--zt-border); }
.zt-detail-section:last-child { border-bottom: none; }
.zt-detail-section-title { font-size: .95rem; font-weight: 700; color: var(--zt-text); margin-bottom: 12px; }
.zt-detail-desc { color: var(--zt-text); line-height: 1.75; margin: 0; }

.zt-badge-subject, .zt-badge-domain, .zt-badge-type, .zt-badge-age {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: .78rem; font-weight: 500;
}
.zt-badge-domain { background: var(--zt-primary-bg); color: var(--zt-primary); }
.zt-badge-age { background: #FFF3E0; color: #E65100; }

.zt-evidence-list { list-style: none; padding: 0; margin: 0; }
.zt-evidence-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 8px 0; border-bottom: 1px solid var(--zt-bg);
  font-size: .92rem;
}
.zt-evidence-item:last-child { border-bottom: none; }
.zt-ev-icon {
  width: 22px; height: 22px; min-width: 22px;
  background: #E8F5EE; color: var(--zt-primary);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700;
}

.zt-assessment-box { background: #FFFBF0; }
.zt-assessment-text { color: var(--zt-text); line-height: 1.75; margin: 0; font-size: .93rem; }

/* 侧边卡片（先修/解锁） */
.zt-side-card {
  background: var(--zt-card);
  border: 1.5px solid var(--zt-border);
  border-radius: var(--zt-radius);
  padding: 16px;
  box-shadow: var(--zt-shadow);
}
.zt-side-title {
  font-size: .9rem; font-weight: 700; color: var(--zt-text);
  margin-bottom: 12px; display: flex; align-items: center;
}
.zt-count-badge {
  margin-left: auto; background: var(--zt-bg); color: var(--zt-text-muted);
  font-size: .72rem; padding: 1px 8px; border-radius: 20px; font-weight: 500;
}
.zt-prereq-item {
  display: block; padding: 8px 10px; border-radius: 8px;
  text-decoration: none; margin-bottom: 4px;
  border: 1px solid transparent; transition: all .15s;
}
.zt-prereq-item:hover {
  background: var(--zt-primary-bg);
  border-color: var(--zt-primary);
  text-decoration: none;
}
.zt-prereq-name { font-size: .88rem; font-weight: 600; color: var(--zt-text); line-height: 1.3; }
.zt-prereq-meta { font-size: .75rem; color: var(--zt-text-muted); margin-top: 2px; }
.zt-prereq-reason { font-size: .75rem; color: var(--zt-text-muted); margin-top: 4px; font-style: italic; }
.zt-empty-msg { font-size: .85rem; color: var(--zt-text-muted); margin: 0; padding: 8px 0; }
.zt-more-hint { font-size: .78rem; color: var(--zt-text-muted); margin: 4px 0 0; text-align: center; }

.zt-graph-btn {
  background: linear-gradient(135deg, var(--zt-primary), var(--zt-primary-lt));
  color: #fff; border: none;
  border-radius: var(--zt-radius);
  padding: 12px;
  font-weight: 600;
  transition: all .2s;
}
.zt-graph-btn:hover { opacity: .9; transform: translateY(-2px); color: #fff; }

/* 图谱弹窗 */
.zt-modal-header { background: var(--zt-primary-bg); border-bottom: 1px solid var(--zt-border); }
.zt-modal-footer { background: var(--zt-bg); }

/* ── 搜索页 ─────────────────────────── */
.zt-search-input-lg {
  border: 1.5px solid var(--zt-border);
  border-radius: var(--zt-radius) 0 0 var(--zt-radius) !important;
  background: var(--zt-card);
}
.zt-search-input-lg:focus { border-color: var(--zt-primary); box-shadow: none; }
.zt-search-btn-lg {
  background: var(--zt-primary); color: #fff;
  border-radius: 0 var(--zt-radius) var(--zt-radius) 0 !important;
  border: none; padding: 0 24px;
}
.zt-search-btn-lg:hover { background: var(--zt-primary-lt); color: #fff; }
.zt-result-count { font-size: .9rem; color: var(--zt-text-muted); }
.zt-result-count strong { color: var(--zt-primary); }

.zt-quick-searches { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.zt-quick-kw {
  padding: 4px 14px; border-radius: 20px;
  background: var(--zt-card); border: 1.5px solid var(--zt-border);
  color: var(--zt-primary); text-decoration: none; font-size: .88rem;
  transition: all .15s;
}
.zt-quick-kw:hover { background: var(--zt-primary); color: #fff; border-color: var(--zt-primary); }

/* ── 空状态 ─────────────────────────── */
.zt-empty-state { text-align: center; padding: 48px 24px; }
.zt-empty-icon { font-size: 3rem; }
.zt-empty-state p { color: var(--zt-text-muted); margin-top: 12px; }

/* ── 页脚 ───────────────────────────── */
.zt-footer { background: var(--zt-card); border-top: 1px solid var(--zt-border); }
.zt-footer-brand { font-weight: 700; color: var(--zt-primary); font-size: 1.1rem; }
.zt-link { color: var(--zt-primary); }

/* ── 通用按钮 ───────────────────────── */
.zt-btn-primary {
  background: var(--zt-primary); color: #fff; border: none;
  border-radius: var(--zt-radius-sm);
}
.zt-btn-primary:hover { background: var(--zt-primary-lt); color: #fff; }

/* ── 导航栏登录/用户按钮 ─────────────────────────────── */
.zt-login-btn {
  background: var(--zt-primary); color: #fff !important;
  border: none; border-radius: 20px; padding: 4px 14px;
  font-size: .82rem; font-weight: 600; transition: background .2s;
}
.zt-login-btn:hover { background: var(--zt-primary-lt); }
.zt-user-btn {
  background: var(--zt-primary-bg); color: var(--zt-primary);
  border: 1.5px solid var(--zt-border); border-radius: 20px;
  padding: 4px 14px; font-size: .82rem; font-weight: 600;
}
.zt-user-btn:hover { background: var(--zt-primary); color: #fff; border-color: var(--zt-primary); }

/* ── 已锁定图谱按钮 ──────────────────────────────────── */
.zt-graph-btn-locked {
  background: #EEF2F2; color: #8A9A9A;
  border: 1.5px dashed #C0CECC; border-radius: var(--zt-radius);
  padding: 12px; font-weight: 600; width: 100%; transition: all .2s;
}
.zt-graph-btn-locked:hover {
  background: var(--zt-primary-bg); color: var(--zt-primary);
  border-color: var(--zt-primary);
}

/* ── 认证页面卡片 ─────────────────────────────────────── */
.zt-auth-card {
  background: var(--zt-card); border: 1.5px solid var(--zt-border);
  border-radius: var(--zt-radius); padding: 36px 32px; box-shadow: var(--zt-shadow);
}
.zt-auth-header { text-align: center; margin-bottom: 24px; }
.zt-auth-title  { font-size: 1.3rem; font-weight: 700; color: var(--zt-text); margin: 8px 0 4px; }
.zt-auth-sub    { font-size: .88rem; }
.zt-form-label  { font-size: .82rem; font-weight: 600; color: var(--zt-text-muted);
                  display: block; margin-bottom: 4px; }
.zt-form-input  { border: 1.5px solid var(--zt-border) !important; background: var(--zt-bg) !important; }
.zt-form-input:focus { border-color: var(--zt-primary) !important;
                       box-shadow: 0 0 0 3px rgba(42,122,79,.1) !important; }

/* ── 注册弹窗 ────────────────────────────────────────── */
.zt-reg-modal   { border-radius: var(--zt-radius); overflow: hidden; }
.zt-reg-header  { background: var(--zt-primary-bg); border-bottom: 1px solid var(--zt-border); }
.zt-reg-qr-col  { background: linear-gradient(160deg, #EAF5EE, #F4FAF7); }
.zt-reg-qr-box  { padding: 32px 20px; text-align: center; height: 100%;
                  display: flex; flex-direction: column; align-items: center; justify-content: center; }
.zt-reg-qr-title { font-weight: 700; color: var(--zt-primary); margin-bottom: 14px; }
.zt-reg-qr-img  { width: 155px; height: 155px; object-fit: contain;
                  border-radius: 10px; border: 3px solid #fff;
                  box-shadow: 0 4px 16px rgba(42,122,79,.15); }
.zt-reg-qr-tip  { margin-top: 12px; font-size: .82rem; color: #5A7A6A; line-height: 1.75; }
.zt-reg-form-col { border-left: 1px solid var(--zt-border); }
.zt-reg-form-box { padding: 24px 22px; }
.zt-reg-form-title { font-weight: 700; color: var(--zt-primary); margin-bottom: 14px; }

/* ── 响应式 ─────────────────────────── */
@media (max-width: 768px) {
  .zt-hero-title { font-size: 1.7rem; }
  .zt-search-form { display: none !important; }
  .zt-hero-stats { grid-template-columns: 1fr 1fr; }
  .zt-filter-panel { position: static; }
  .zt-detail-title { font-size: 1.3rem; }
}
