/* 知芽官网 / 会员中心公共样式 */
:root {
  --green: #10b981;
  --green-dark: #059669;
  --green-deep: #047857;
  --green-soft: #d1fae5;
  --green-bg: #f0fdf6;
  --ink: #1f2937;
  --ink-2: #4b5563;
  --ink-3: #9ca3af;
  --line: #e5e7eb;
  --card: #ffffff;
  --warn: #f59e0b;
  --red: #ef4444;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(16, 185, 129, .08);
  --maxw: 1080px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: #fff;
  line-height: 1.6;
}
a { color: var(--green-dark); text-decoration: none; }
img { max-width: 100%; display: block; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ===== 顶部导航 ===== */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-in { display: flex; align-items: center; gap: 24px; height: 60px; }
.nav-brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; color: var(--ink); }
.nav-brand img { width: 30px; height: 30px; }
.nav-brand b { color: var(--green-deep); }
.nav-links { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav-links a, .nav-links button {
  border: 0; background: none; cursor: pointer;
  font-size: 14.5px; color: var(--ink-2); padding: 8px 12px; border-radius: 9px;
  font-family: inherit;
}
.nav-links a:hover, .nav-links button:hover { color: var(--green-deep); background: var(--green-bg); }
.nav-links .btn-primary { color: #fff; background: var(--green); }
.nav-links .btn-primary:hover { background: var(--green-dark); color: #fff; }
.nav-user { display: none; align-items: center; gap: 4px; }

/* ===== 通用按钮 / 表单 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; cursor: pointer; border-radius: 12px;
  font-family: inherit; font-size: 15px; font-weight: 600;
  padding: 12px 22px; transition: all .15s; line-height: 1.4;
}
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); transform: translateY(-1px); }
.btn-outline { background: #fff; color: var(--green-deep); border: 1.5px solid var(--green); }
.btn-outline:hover { background: var(--green-bg); }
.btn-block { width: 100%; }
.btn-danger-o { background: #fff; color: var(--red); border: 1.5px solid #fca5a5; }
.btn[disabled] { opacity: .6; cursor: not-allowed; transform: none; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13.5px; color: var(--ink-2); margin-bottom: 6px; font-weight: 600; }
.field input, .field select {
  width: 100%; padding: 12px 14px; font-size: 15px; font-family: inherit;
  border: 1.5px solid var(--line); border-radius: 11px; outline: none; background: #fff; color: var(--ink);
  -webkit-appearance: none; appearance: none;
}
.field input:focus, .field select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(16,185,129,.12); }
.hint { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }

/* ===== 卡片 ===== */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px;
}
.tag {
  display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
}
.tag-green { background: var(--green-soft); color: var(--green-deep); }
.tag-amber { background: #fef3c7; color: #b45309; }
.tag-gray { background: #f3f4f6; color: var(--ink-3); }
.tag-red { background: #fee2e2; color: #b91c1c; }

/* ===== 首页 hero ===== */
.hero { background: linear-gradient(160deg, var(--green-bg) 0%, #e7f9f0 60%, #fff 100%); padding: 64px 0 72px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; }
.hero h1 { font-size: 40px; line-height: 1.25; font-weight: 800; letter-spacing: .5px; }
.hero h1 em { font-style: normal; color: var(--green-deep); }
.hero .sub { margin: 18px 0 28px; font-size: 17px; color: var(--ink-2); }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-shot { border-radius: 20px; box-shadow: 0 20px 50px rgba(4,120,87,.18); border: 6px solid #fff; }

/* 区块 */
.section { padding: 64px 0; }
.sec-title { text-align: center; font-size: 30px; font-weight: 800; margin-bottom: 10px; }
.sec-sub { text-align: center; color: var(--ink-2); margin-bottom: 40px; font-size: 15.5px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.feature {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; transition: all .18s;
}
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--green); }
.feature .ico { font-size: 30px; }
.feature h3 { font-size: 17px; margin: 12px 0 6px; }
.feature p { font-size: 13.8px; color: var(--ink-2); }

/* ===== 价格 ===== */
.pricing { background: var(--green-bg); }
.price-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; max-width: 900px; margin: 0 auto; }
@media (max-width: 720px) { .price-grid { grid-template-columns: 1fr; } }
.price-card {
  background: #fff; border-radius: 22px; padding: 34px 30px; text-align: center;
  border: 2px solid transparent;
  box-shadow: var(--shadow); position: relative;
}
.price-card.hot { border-color: var(--green); }
.price-card .flag {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: var(--green); color: #fff; font-size: 12px; font-weight: 700;
  padding: 4px 14px; border-radius: 999px; white-space: nowrap;
}
.price-num { font-size: 52px; font-weight: 800; color: var(--green-deep); }
.price-num small { font-size: 16px; font-weight: 600; color: var(--ink-3); margin-right: 4px; }
.price-unit { font-size: 14px; color: var(--ink-3); margin-top: -4px; }
.price-list { text-align: left; margin: 22px 0 24px; display: inline-block; }
.price-list li { list-style: none; padding: 7px 0 7px 30px; position: relative; color: var(--ink-2); font-size: 14.5px; }
.price-list li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 800; }
.trial-banner { text-align: center; margin-top: 26px; color: var(--green-deep); font-weight: 700; }

/* FAQ */
.faq-item { border-bottom: 1px solid var(--line); padding: 6px 0; }
.faq-q { width: 100%; background: none; border: 0; cursor: pointer; text-align: left; font-size: 16px; font-weight: 600; padding: 16px 2px; font-family: inherit; color: var(--ink); display: flex; justify-content: space-between; align-items: center; }
.faq-q::after { content: "+"; font-size: 20px; color: var(--green); transition: transform .2s; }
.faq-item.open .faq-q::after { transform: rotate(45deg); }
.faq-a { display: none; color: var(--ink-2); font-size: 14.5px; padding: 0 2px 18px; }
.faq-item.open .faq-a { display: block; }

/* ===== 会员中心 ===== */
.dash-bg { background: var(--green-bg); min-height: calc(100vh - 61px); padding: 30px 0 60px; }
.me-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.avatar-lg {
  width: 64px; height: 64px; border-radius: 50%; font-size: 34px;
  display: flex; align-items: center; justify-content: center;
  background: var(--green-soft); border: 2px solid #fff;
  box-shadow: var(--shadow);
}
.me-head h1 { font-size: 22px; }
.me-head .meta { font-size: 13.5px; color: var(--ink-2); }
.me-body { display: grid; grid-template-columns: 340px 1fr; gap: 20px; margin-top: 22px; align-items: start; }
.mem-status { font-size: 15px; font-weight: 800; margin: 6px 0 2px; }
.mem-status.s-member { color: var(--green-deep); }
.mem-status.s-trial { color: var(--warn); }
.mem-status.s-expired { color: var(--red); }
.big-num { font-size: 34px; font-weight: 800; color: var(--green-deep); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0 4px; text-align: center; }
.stat-grid .stat { background: var(--green-bg); border-radius: 12px; padding: 12px 6px; }
.stat-grid .n { font-size: 22px; font-weight: 800; color: var(--green-deep); }
.stat-grid .t { font-size: 12px; color: var(--ink-2); }
.sec-h { font-size: 16px; font-weight: 700; margin: 24px 0 12px; display: flex; align-items: center; gap: 8px; }
.sec-h .line { flex: 1; height: 1px; background: var(--line); }

/* 近7天柱状 */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 110px; padding: 6px 2px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar-col .bar {
  width: 100%; max-width: 34px; border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--green), var(--green-dark));
  min-height: 3px; transition: height .4s;
}
.bar-col .d { font-size: 11px; color: var(--ink-3); }
.bar-col .cnt { font-size: 11px; font-weight: 700; color: var(--green-deep); }

/* 学科进度 */
.subj-row { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.subj-row:last-child { border-bottom: 0; }
.subj-row .nm { width: 64px; font-size: 14px; font-weight: 600; flex: none; }
.pbar { flex: 1; height: 8px; background: #eef2f0; border-radius: 999px; overflow: hidden; }
.pbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--green-dark)); border-radius: 999px; }
.subj-row .vl { width: 52px; text-align: right; font-size: 12.5px; color: var(--ink-2); flex: none; }

/* 行操作 */
.row-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.row-line:last-child { border-bottom: 0; }
.row-line .l { font-size: 14.5px; color: var(--ink-2); }
.row-line .r { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--ink); }
.code-chip {
  font-family: "SF Mono", Menlo, Consolas, monospace; font-weight: 700; letter-spacing: 1.5px;
  background: var(--green-bg); color: var(--green-deep); border: 1.5px dashed var(--green);
  padding: 8px 16px; border-radius: 10px; font-size: 18px; cursor: pointer;
}
.muted-btn { background: none; border: 0; color: var(--green-dark); font-size: 13px; cursor: pointer; font-family: inherit; padding: 4px 8px; border-radius: 8px; }
.muted-btn:hover { background: var(--green-bg); }
.muted-btn.danger { color: var(--red); }
.muted-btn.danger:hover { background: #fee2e2; }

/* 孩子卡片 */
.kid-card { display: flex; gap: 16px; padding: 18px; border: 1.5px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; background: #fff; }
.kid-card .avatar-lg { width: 54px; height: 54px; font-size: 28px; flex: none; }
.kid-info { flex: 1; min-width: 0; }
.kid-info h3 { font-size: 17px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kid-info .desc { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.kid-stats { display: flex; gap: 18px; margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.kid-stats b { color: var(--green-deep); font-size: 16px; }
.kid-report { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.kid-ops { display: flex; flex-direction: column; gap: 6px; justify-content: center; flex: none; }

/* 报告内嵌（家长展开） */
.daily-inline { display: flex; gap: 4px; align-items: flex-end; height: 60px; margin: 8px 0 4px; }
.daily-inline .b { flex: 1; background: var(--green); opacity: .85; border-radius: 4px 4px 0 0; min-height: 3px; }
.loading { color: var(--ink-3); font-size: 14px; padding: 10px 0; text-align: center; }

/* toast */
#toast { position: fixed; top: 74px; left: 50%; transform: translateX(-50%) translateY(-20px); background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 10px; font-size: 14px; z-index: 99; opacity: 0; pointer-events: none; transition: all .25s; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.ok { background: var(--green-deep); }
#toast.err { background: #dc2626; }

/* modal */
.modal-mask { position: fixed; inset: 0; background: rgba(17,24,39,.5); display: none; align-items: center; justify-content: center; z-index: 90; padding: 20px; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 18px; width: 100%; max-width: 400px; padding: 26px; }
.modal h3 { margin-bottom: 16px; font-size: 18px; }
.modal .row-line { border: 0; padding: 10px 0; }

/* footer */
.footer { background: #0b3d2e; color: #cfe8dc; padding: 34px 0; }
.footer-in { display: flex; flex-direction: column; gap: 14px; align-items: center; text-align: center; font-size: 13px; }
.footer-in .brand { font-size: 17px; font-weight: 800; color: #fff; display: flex; align-items: center; gap: 8px; }
.footer-in img { width: 24px; height: 24px; }
.footer a { color: #8ed6b8; }

/* 认证页 */
.auth-wrap { min-height: calc(100vh - 61px); display: flex; align-items: flex-start; justify-content: center; padding: 46px 16px; background: linear-gradient(160deg, var(--green-bg), #fff); }
.auth-box { width: 100%; max-width: 420px; }
.auth-card { background: #fff; border-radius: 20px; box-shadow: var(--shadow); border: 1px solid var(--line); padding: 30px 28px; }
.auth-card h1 { font-size: 22px; margin-bottom: 4px; }
.auth-card .sub { color: var(--ink-2); font-size: 13.5px; margin-bottom: 20px; }
.role-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; background: #f1f5f3; padding: 5px; border-radius: 12px; margin-bottom: 18px; }
.role-switch button { border: 0; background: none; padding: 9px; border-radius: 9px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink-2); font-family: inherit; }
.role-switch button.on { background: #fff; color: var(--green-deep); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.auth-alt { text-align: center; margin-top: 16px; font-size: 13.5px; color: var(--ink-2); }
.auth-note { background: var(--green-bg); border-radius: 12px; padding: 12px 14px; font-size: 12.5px; color: var(--green-deep); margin-top: 18px; }

/* 空态 */
.empty { text-align: center; color: var(--ink-3); padding: 26px 0; font-size: 14px; }
.empty .big { font-size: 40px; margin-bottom: 8px; }

@media (max-width: 860px) {
  .hero { padding: 40px 0 48px; }
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .hero h1 { font-size: 30px; }
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .section { padding: 46px 0; }
  .sec-title { font-size: 25px; }
  .me-body { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .kid-card { flex-wrap: wrap; }
  .kid-ops { flex-direction: row; width: 100%; justify-content: flex-end; }
}
@media (max-width: 520px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .nav-links a.hide-s, .nav-links button.hide-s { display: none; }
}
