/* ============================================================================
 * 乐理学堂 · 独立应用样式
 * ============================================================================ */
:root{
  --ink:#1e2433; --ink2:#4c5568; --ink3:#626a7a;
  --bg:#f6f2ea; --card:#fffdf8; --line:#e5ded1;
  --violet:#4f46e5; --violet-deep:#3730a3; --gold:#b45309;
  --ok:#0f766e; --bad:#b91c1c;
  --r-lg:18px; --r-md:12px;
  --sh-1:0 2px 10px rgba(60,40,140,.06);
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:-apple-system,"PingFang SC","Microsoft YaHei",sans-serif;
  background:var(--bg);color:var(--ink);line-height:1.7;font-size:15px;
  min-height:100vh;
}
@font-face{font-family:'Bravura';src:url('/assets/fonts/Bravura.woff2') format('woff2');font-display:swap}

/* ---------------- 外壳：顶栏 + 主区 ---------------- */
.shell{min-height:100vh;display:flex;flex-direction:column;max-width:860px;margin:0 auto;padding:0 14px}
.top{display:flex;align-items:center;gap:12px;padding:18px 2px 14px}
.brand-mark{width:40px;height:40px;border-radius:12px;background:linear-gradient(135deg,#1e2433,#4338ca);display:grid;place-items:center;flex:none}
.brand-mark svg{width:22px;height:22px}
.brand-txt{font-size:19px;font-weight:800;line-height:1.25}
.brand-txt small{display:block;font-size:12px;font-weight:600;color:var(--ink3)}
.top-right{margin-left:auto;display:flex;gap:8px;align-items:center}
.main{flex:1;padding-bottom:70px}

/* ---------------- 卡片与文字 ---------------- */
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--r-lg);padding:22px 20px;margin:14px 0;box-shadow:var(--sh-1)}
.card--flat{box-shadow:none;background:rgba(255,255,255,.7)}
.sec{display:flex;align-items:baseline;gap:10px;margin-bottom:8px}
.sec-title{font-size:16px;font-weight:800}
.sec-more{margin-left:auto;font-size:12px;color:var(--ink3);font-weight:700}
.big{font-size:15px;color:var(--ink2)}
.mt8{margin-top:8px}.mt12{margin-top:12px}
.hl{background:#eef0ff;border-radius:6px;padding:1px 6px;color:var(--violet);font-weight:700}
.lead{font-size:15px;color:var(--ink2);margin:8px 0 14px}
.hook{border:1.5px dashed #fed7aa;background:#fff7ed;border-radius:14px;padding:10px 16px;margin:4px 0 14px;font-size:14px;color:#92400e}
.hook b{color:#92400e}
.callout{border-left:4px solid var(--violet);background:#eef0ff;border-radius:0 12px 12px 0;padding:10px 16px;margin:14px 0;font-size:14px;color:var(--ink2)}
.callout b{color:var(--ink)}
.talk{border-left:4px solid var(--ok);background:#ecfdf5;border-radius:0 12px 12px 0;padding:10px 16px;margin:14px 0;font-size:14px;color:#134e4a}
.talk b{color:var(--ok)}

/* ---------------- 行 / 按钮 / 徽章 ---------------- */
.row{display:flex;align-items:center;gap:12px;padding:12px 4px;border-bottom:1px solid var(--line)}
.row:last-child{border-bottom:0}
.row-ico{width:42px;height:42px;border-radius:12px;background:#eef0ff;display:grid;place-items:center;font-size:20px;flex:none}
.row-main{flex:1;min-width:0}
.row-title{font-weight:700;font-size:15px}
.row-sub{font-size:12.5px;color:var(--ink3)}
.row-acts{display:flex;gap:6px;align-items:center;flex:none}
.btn{border:0;border-radius:12px;padding:9px 16px;font-size:14px;font-weight:700;cursor:pointer;margin:4px 6px 4px 0;background:#eef0ff;color:var(--violet);transition:.15s;font-family:inherit;white-space:nowrap}
/* 按钮组行：与 .row 的区别是会换行，按钮不被压扁（.row 无 flex-wrap，放多个按钮会被挤成竖排） */
.btnrow{display:flex;flex-wrap:wrap;align-items:center;gap:0;padding:8px 4px;border:0}
.btn:hover{background:#e0e7ff}
.btn--pri{background:var(--violet);color:#fff}
.btn--pri:hover{background:var(--violet-deep)}
.btn--ghost{background:transparent;border:1.5px solid var(--line);color:var(--ink2)}
.btn:disabled{opacity:.45;cursor:default}
.chip{display:inline-flex;align-items:center;gap:4px;border-radius:999px;padding:3px 10px;font-size:12px;font-weight:700;background:#eef0ff;color:var(--violet)}
.chip--gold{background:#fef3c7;color:#92400e}
.chip--muted{background:#efeadd;color:var(--ink3)}

/* ---------------- 进度 ---------------- */
.prog{height:8px;border-radius:99px;background:#e5ded1;overflow:hidden;margin:10px 0}
.prog i{display:block;height:100%;border-radius:99px;background:linear-gradient(90deg,#6366f1,var(--violet));transition:width .4s}

/* ---------------- 提示条 / Toast / 撒花 ---------------- */
.notice{display:flex;gap:10px;align-items:flex-start;background:#eef0ff;border-radius:12px;padding:10px 14px;margin:10px 0;font-size:13.5px;color:var(--ink2)}
.notice span:first-child{flex:none}
.notice--ok{background:#ecfdf5}
.notice--warn{background:#fff7ed}
.toast{position:fixed;left:50%;bottom:28px;transform:translateX(-50%) translateY(20px);background:#1e2433;color:#fff;padding:10px 20px;border-radius:99px;font-size:14px;font-weight:600;opacity:0;pointer-events:none;transition:.25s;z-index:99;max-width:86vw;text-align:center}
.toast.is-on{opacity:1;transform:translateX(-50%)}
.confetti{position:fixed;inset:0;pointer-events:none;overflow:hidden;z-index:98}
.confetti i{position:absolute;top:-30px;animation:fall 2.4s ease-in forwards}
@keyframes fall{to{transform:translateY(110vh) rotate(540deg);opacity:.6}}

/* ---------------- 乐理演示组件 ---------------- */
.staffbox{background:#fffdf8;border:2px solid #eef0ff;border-radius:14px;padding:10px 6px;margin:12px 0;overflow-x:auto}
.staffbox svg{display:block}
.foot-hint{font-size:12px;color:var(--ink3);padding:6px 10px}
.tsteps{display:flex;gap:6px;flex-wrap:wrap;margin:10px 0;padding:0 8px}
.tstep{min-width:54px;text-align:center;border:1.5px solid #e5ded1;border-radius:10px;padding:6px 8px;font-size:12px;color:#626a7a;background:#fff}
.tstep b{display:block;font-size:14px;color:var(--ink2)}
.tstep--cur{border-color:var(--violet);background:#eef0ff}
.tstep--cur b{color:var(--violet)}
.tstep--err{border-color:var(--bad);background:#fef2f2}
.tstep--err b{color:var(--bad)}
.tstep--fix{border-color:var(--ok);background:#ecfdf5}
.tstep--fix b{color:var(--ok)}
.readout{font-size:22px;font-weight:800;color:var(--violet)}
.readout small{font-size:12px;color:var(--ink3);font-weight:600}

/* ---------------- 测验 ---------------- */
.quiz-opt{display:block;width:100%;text-align:left;border:1.5px solid var(--line);background:#fff;border-radius:12px;padding:10px 14px;font-size:14px;font-weight:600;cursor:pointer;margin:6px 0;font-family:inherit;color:var(--ink);transition:.15s}
.quiz-opt:hover{border-color:var(--violet)}
.quiz-opt:disabled{cursor:default}
.quiz-opt--right{border-color:var(--ok);background:#ecfdf5;color:var(--ok)}
.quiz-opt--bad{border-color:var(--bad);background:#fef2f2;color:var(--bad)}
.quiz-q{font-size:14px;font-weight:700;margin:14px 0 4px}

/* ---------------- 表格 ---------------- */
table{border-collapse:collapse;width:100%;font-size:13px;margin:12px 0}
th,td{border:1px solid var(--line);padding:7px 10px;text-align:center}
th{background:#eef0ff;color:var(--ink2);font-weight:700}
/* 紧凑 12 列表格：第 2 课的「12 半音音名/唱名对照」专用，避免 13px 字号在手机宽度挤压 */
.solf-table{font-size:11.5px;margin:8px 0}
.solf-table th,.solf-table td{padding:5px 3px}
.solf-table th{background:#eef0ff}

/* ---------------- 音色按钮：人声（绿）vs 钢琴（紫） ----------------
 * 一眼分得出"这个按钮会唱、那个会弹"：唱名一律绿系，键盘/节拍一律紫系 */
.btn--v{background:#ecfdf5;color:#0f766e}
.btn--v:hover{background:#d1fae5}
.btn--sm{padding:6px 11px;font-size:13px;border-radius:10px;margin:3px 4px 3px 0}

/* 音色切换组（点谱等图形交互用：一处切换，整组生效） */
.srcpick{display:inline-flex;border:1.5px solid var(--line);border-radius:10px;overflow:hidden;background:#fff;vertical-align:middle}
.srcpick button{border:0;background:#fff;color:var(--ink3);font-size:12.5px;font-weight:700;padding:5px 12px;cursor:pointer;font-family:inherit;transition:.15s}
.srcpick button+button{border-left:1.5px solid var(--line)}
.srcpick button.is-on{background:#ecfdf5;color:#0f766e}
.srcpick button.is-on[data-src="piano"]{background:#eef0ff;color:var(--violet)}

/* 唱名按钮组（七音演唱：点哪个唱哪个） */
.solfrow{display:flex;flex-wrap:wrap;gap:6px;padding:6px 8px}
.solfbtn{flex:0 0 auto;min-width:64px;border:1.5px solid #d1fae5;background:#ecfdf5;color:#0f766e;border-radius:12px;padding:7px 10px;font-size:12px;font-weight:600;cursor:pointer;font-family:inherit;text-align:center;transition:.15s}
.solfbtn:hover{background:#d1fae5;border-color:#a7f3d0}
.solfbtn b{display:block;font-size:15px;font-weight:800}
.solfbtn.is-on{background:var(--ok);border-color:var(--ok);color:#fff}
.solfbtn.is-on small{color:#d1fae5}

/* ---- Hatsing theory hub / lesson additions ---- */
.theory-page{max-width:900px;margin-inline:auto}
.theory-intro p{font-size:15px;color:#4c5568}
.theory-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:22px 0}
.theory-card{display:flex;align-items:center;gap:12px;background:#fff;border:1px solid var(--line);border-radius:16px;padding:14px;text-decoration:none;color:var(--ink);box-shadow:var(--sh-1);transition:.15s}
.theory-card:hover{border-color:#c7d2fe;transform:translateY(-1px)}
.theory-card.is-soon{opacity:.62;cursor:default;box-shadow:none}
.theory-ico{width:42px;height:42px;border-radius:12px;background:#eef0ff;display:grid;place-items:center;font-size:20px;flex:none}
.theory-card-body{display:flex;flex-direction:column;min-width:0;flex:1}
.theory-card-body strong{font-size:15px;line-height:1.35}
.theory-card-body span{font-size:12.5px;color:var(--ink3);margin-top:2px}
.theory-enter{font-size:12px;font-weight:800;color:var(--violet);white-space:nowrap}
.theory-note{font-size:12.5px;color:var(--ink3);margin:18px 0 0}
.theory-links{display:flex;gap:18px;flex-wrap:wrap;margin-top:18px;font-size:13px}
.theory-links a{color:var(--violet);font-weight:700}
.theory-lesson{padding:20px 20px 14px}
.theory-demo{margin:14px 0}
.theory-demo .staffbox{margin:0}
.theory-back{margin:18px 0 0;font-size:13px}
.theory-back a{color:var(--violet)}
.theory-related{margin-top:22px}
.theory-related h2{margin:0 0 8px}
.theory-related ul{padding-left:20px;color:#4c5568;font-size:14px}
.theory-related li{margin:5px 0}
.theory-page .hook,.theory-page .lead,.theory-page .callout,.theory-page .talk{font-family:-apple-system,"PingFang SC","Microsoft YaHei",sans-serif}
@media (max-width:700px){.theory-grid{grid-template-columns:1fr}.theory-page{width:100%}}
.theory-toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%) translateY(16px);background:#1e2433;color:#fff;padding:9px 18px;border-radius:999px;font-size:13px;opacity:0;pointer-events:none;transition:.2s;z-index:100;max-width:86vw;text-align:center}
.theory-toast.is-on{opacity:1;transform:translateX(-50%) translateY(0)}
.theory-num{font:800 11px/1 var(--mono,ui-monospace,monospace);color:var(--muted,#626a7a);min-width:18px;text-align:right;flex:none}

/* ---- Hatsing site palette, final override ---- */
:root{
  --ink:#1e2433; --ink2:#4c5568; --ink3:#626a7a;
  --bg:#f6f2ea; --card:#fffdf8; --line:#e5ded1;
  --violet:#4f46e5; --violet-deep:#3730a3;
  --gold:#b45309; --ok:#0f766e; --bad:#b91c1c;
  --sh-1:0 18px 40px rgba(30,36,51,.08);
}
.ui-icon{width:20px;height:20px;stroke:currentColor;stroke-width:1.75;fill:none;display:inline-block;vertical-align:middle;flex:none}
.theory-ico .ui-icon{width:21px;height:21px}
.theory-inline-icon{display:inline-flex;align-items:center;margin-right:4px;color:var(--accent);vertical-align:-3px}
.theory-inline-icon .ui-icon{width:17px;height:17px}

/* ---- Hatsing lesson content standard ---- */
.theory-lesson{max-width:900px}
.theory-lesson .lead{font-size:16px;line-height:1.75;color:#3d4558;margin:0 0 18px;max-width:800px}
.theory-lesson .hook{font-size:15px;line-height:1.7;padding:12px 16px;margin:0 0 18px;border:1px dashed #fed7aa;background:#fff7ed;border-radius:12px;color:#92400e}
.theory-lesson .hook b{color:#7c2d12}
.theory-lesson .callout{font-size:15px;line-height:1.7;padding:12px 16px;margin:18px 0;border:0;border-left:3px solid var(--accent);background:var(--accent-soft);border-radius:0 10px 10px 0;color:#3d4558}
.theory-lesson .callout b{color:var(--ink)}
.theory-lesson .talk{font-size:15px;line-height:1.75;padding:12px 16px;margin:18px 0;border:0;border-left:3px solid var(--warm);background:#fffdf8;border-radius:0 10px 10px 0;color:#3d4558}
.theory-lesson .talk b{color:#92400e}
.theory-lesson .staffbox{margin:18px 0;padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--paper)}
.theory-lesson .btn{background:#fffdf8;border:1px solid var(--line);color:var(--ink);border-radius:9px;padding:8px 13px;font-size:13px;font-weight:700;min-height:36px}
.theory-lesson .btn:hover{background:var(--accent-soft);border-color:#c7d2fe}
.theory-lesson .btn--pri{background:var(--accent);border-color:var(--accent);color:#fff}
.theory-lesson .btn--pri:hover{background:var(--violet-deep);border-color:var(--violet-deep)}
.theory-lesson .btn--v{background:var(--accent-soft);border-color:#c7d2fe;color:var(--accent)}
.theory-lesson .btn--v:hover{background:#e0e7ff}
.theory-lesson .btn--sm{padding:6px 10px;font-size:12px;min-height:32px}
.theory-lesson .btn--ghost{background:transparent;border-color:var(--line);color:var(--ink2)}
.theory-lesson .readout{font-size:18px;line-height:1.4;font-weight:700;color:var(--accent)}
.theory-lesson .foot-hint{font-size:12px;line-height:1.6;color:var(--ink3);padding:6px 8px 2px}
.theory-lesson .btnrow{gap:6px;padding:8px 0}
.theory-lesson .hl{background:var(--accent-soft);color:var(--accent);border-radius:5px;padding:1px 5px;font-weight:700}
.theory-lesson .callout .theory-inline-icon,.theory-lesson .talk .theory-inline-icon{vertical-align:-3px}
@media (max-width:620px){
  .theory-lesson .lead,.theory-lesson .callout,.theory-lesson .talk{font-size:15px}
  .theory-lesson .staffbox{padding:8px}
}
.theory-lesson .btn--v.btn--pri{background:var(--accent);border-color:var(--accent);color:#fff}
.theory-lesson .btn--v.btn--pri:hover{background:var(--violet-deep);border-color:var(--violet-deep)}
.theory-do{font:800 14px/1 Georgia,"Times New Roman",serif;color:var(--ink);letter-spacing:-.03em;display:inline-block;transform:translateY(1px)}
.theory-hub-note{font-size:14px;line-height:1.7;color:var(--ink3);margin:8px 0 0;max-width:760px}
.theory-card-body h3{font-size:15px;line-height:1.35;margin:0;font-weight:650;color:var(--ink)}
.theory-try{font-size:14px;line-height:1.3;margin:16px 0 6px;color:var(--ink2);font-weight:700}
