/* ============================================================
 * 数学工具箱 · 科学计算器
 * 主页 + 工作台（科学计算 / 解方程）共用一套变量与样式。
 * ============================================================ */

:root {
    --ink: #0f172a;
    --ink-2: #48526d;
    --ink-3: #8d95a8;
    --line: #e4e7f0;
    --line-soft: #eef0f6;
    --bg: #f7f8fc;
    --card: #ffffff;
    --accent: #4f46e5;
    --accent-deep: #4338ca;
    --accent-soft: #eef0ff;
    --danger: #d92d4b;
    --ok: #0f9d6e;
    --radius: 16px;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
            "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    /* 数字字体：不用带斜杠零的等宽字体，避免 0 显示成 Ø */
    --num: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
           "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--ink);
    font-size: 14px;
    line-height: 1.6;
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
.grow { flex: 1; }
code { font-family: var(--num); font-size: 0.94em; }

.wrap {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 36px 42px;
}

.ico {
    width: 15px; height: 15px;
    fill: none; stroke: currentColor;
    stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
    flex: none;
}

/* ---------------- 顶栏 ---------------- */
.nav {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 66px;
    border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 9px; }
.brand-mark {
    width: 27px; height: 27px;
    display: grid; place-items: center;
    background: var(--ink); color: #fff;
    border-radius: 8px; font-size: 14px; font-weight: 600;
}
.brand-name { font-weight: 650; font-size: 14.5px; letter-spacing: 0.2px; }
.nav-sep { color: #ccd2e0; }
.nav-here, .nav-now { color: var(--ink-3); font-size: 13px; }
a.nav-here:hover { color: var(--accent); }
.nav-now { color: var(--ink-2); }
.nav-link {
    font-size: 13px; color: var(--ink-2);
    padding: 6px 10px; border-radius: 8px;
    transition: background 0.15s, color 0.15s;
}
.nav-link:hover { background: #fff; color: var(--accent); }

/* ---------------- 通用按钮 ---------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 1px solid transparent; border-radius: 10px;
    font-family: inherit; font-size: 13.5px; font-weight: 600;
    padding: 9px 16px; cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.08s, box-shadow 0.15s;
}
.btn.lg { padding: 12px 20px; font-size: 14px; border-radius: 11px; }
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 10px 22px -14px rgba(79,70,229,0.9); }
.btn.primary:hover { background: var(--accent-deep); }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--ink-2); }
.btn.ghost:hover { border-color: #cdd3e6; color: var(--accent); }
.btn:active { transform: translateY(1px); }

kbd {
    font-family: var(--num); font-size: 10.5px;
    background: #fff; border: 1px solid var(--line); border-bottom-width: 2px;
    border-radius: 4px; padding: 0 4px; color: #6b748c;
}

/* ============================================================
   主页
   ============================================================ */
.home-hero {
    display: grid;
    grid-template-columns: 1.08fr 0.92fr;
    gap: 54px;
    align-items: center;
    padding: 58px 0 52px;
}
.eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 12px; color: var(--ink-3); letter-spacing: 0.3px;
}
.eyebrow .dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}
.home-hero h1 {
    font-size: clamp(34px, 4.1vw, 50px);
    line-height: 1.28;
    letter-spacing: -1.6px;
    font-weight: 700;
    margin: 16px 0 18px;
}
.home-hero h1 em {
    font-style: normal;
    background: linear-gradient(100deg, #4f46e5 0%, #7c5ce0 45%, #e11d48 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
}
.lede {
    font-size: 14.5px; color: var(--ink-2);
    max-width: 490px; line-height: 1.85;
    text-wrap: pretty;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.hero-facts {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px; margin-top: 34px; padding-top: 22px;
    border-top: 1px solid var(--line);
}
.fact { display: flex; flex-direction: column; gap: 3px; }
.fact-k { font-size: 11.5px; color: var(--ink-3); }
.fact-v { font-size: 16px; font-weight: 650; letter-spacing: -0.2px; }

.hero-side {
    background: var(--card); border: 1px solid var(--line);
    border-radius: 20px; padding: 22px 22px 18px;
    box-shadow: 0 20px 44px -34px rgba(16,23,40,0.45);
}
.side-title { font-size: 12px; color: var(--ink-3); letter-spacing: 0.4px; margin-bottom: 8px; }
.side-list { list-style: none; }
.side-list li {
    display: flex; gap: 14px; align-items: flex-start;
    padding: 12px 0; border-bottom: 1px solid var(--line-soft);
}
.side-list li:last-child { border-bottom: 0; }
.side-no { font-family: var(--num); font-size: 12px; color: #b6bdd0; padding-top: 2px; flex: none; }
.side-body { display: flex; flex-direction: column; gap: 2px; }
.side-name { font-size: 13.5px; font-weight: 650; }
.side-desc { font-size: 11.8px; color: var(--ink-3); line-height: 1.65; }
.side-note { font-size: 11px; color: #a4abbe; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }

.home-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.home-card {
    background: var(--card); border: 1px solid var(--line);
    border-radius: 20px; overflow: hidden;
    box-shadow: 0 18px 40px -34px rgba(16,23,40,0.5);
    display: flex; flex-direction: column;
}
.card-visual {
    height: 190px; padding: 22px;
    background: linear-gradient(150deg, #f3f4ff 0%, #fafbff 60%, #fff 100%);
    border-bottom: 1px solid var(--line-soft);
    display: flex; align-items: center; justify-content: center; gap: 18px;
}
.mini-screen {
    width: 150px; flex: none;
    background: #fff; border: 1px solid var(--line);
    border-radius: 11px; padding: 10px 12px;
    box-shadow: 0 10px 24px -18px rgba(16,23,40,0.5);
    display: flex; flex-direction: column; align-items: flex-end;
}
.mini-screen span { font-family: var(--num); font-size: 10px; color: #a4abbe; white-space: nowrap; }
.mini-screen strong { font-family: var(--num); font-size: 26px; font-weight: 650; letter-spacing: -0.8px; }
.mini-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; width: 186px; }
.mini-key {
    height: 30px; display: grid; place-items: center;
    background: #fff; border: 1px solid var(--line); border-radius: 7px;
    font-family: var(--num); font-size: 11px; color: var(--ink-2);
}
.mini-key.is-op { background: var(--accent-soft); border-color: #e0e4ff; color: var(--accent); }
.mini-key.is-eq { background: var(--accent); border-color: var(--accent); color: #fff; }

.card-visual--eq { flex-direction: column; gap: 14px; }
.mini-eq {
    width: 100%; max-width: 300px;
    background: #fff; border: 1px solid var(--line); border-radius: 12px;
    padding: 14px 18px; display: flex; flex-direction: column; align-items: center; gap: 2px;
    box-shadow: 0 10px 24px -18px rgba(16,23,40,0.5);
}
.mini-eq-line { font-family: var(--num); font-size: 14px; color: var(--ink-2); }
.mini-eq-arrow { color: #c2c8da; font-size: 14px; line-height: 1.2; }
.mini-eq-res { font-family: var(--num); font-size: 15px; font-weight: 650; color: var(--accent); }
.mini-tags { display: flex; gap: 7px; flex-wrap: wrap; justify-content: center; }
.mini-tags span {
    font-size: 10.5px; color: var(--ink-3);
    border: 1px solid var(--line); background: #fff;
    border-radius: 20px; padding: 3px 10px;
}

.card-body { padding: 22px 24px 24px; display: flex; flex-direction: column; flex: 1; }
.card-kicker { font-size: 11px; color: var(--accent); letter-spacing: 1px; font-weight: 650; }
.card-body h2 { font-size: 19px; letter-spacing: -0.4px; margin: 6px 0 10px; }
.card-body p { font-size: 12.8px; color: var(--ink-2); line-height: 1.8; }
.card-body ul { list-style: none; margin: 16px 0 20px; }
.card-body li {
    font-size: 12px; color: var(--ink-2);
    padding: 6px 0 6px 16px; position: relative;
}
.card-body li::before {
    content: ''; position: absolute; left: 2px; top: 14px;
    width: 5px; height: 5px; border-radius: 50%; background: #c7cce0;
}
.card-cta {
    margin-top: auto; display: inline-flex; align-items: center; gap: 7px;
    font-size: 13px; font-weight: 650; color: var(--accent);
}
.card-cta:hover { color: var(--accent-deep); }
.card-cta .ico { transition: transform 0.15s; }
.card-cta:hover .ico { transform: translateX(3px); }

.home-demos { margin-top: 44px; }
.section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 16px; }
.section-head h2 { font-size: 17px; letter-spacing: -0.3px; }
.section-head p { font-size: 12px; color: var(--ink-3); }
.demo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.demo {
    background: var(--card); border: 1px solid var(--line); border-radius: 13px;
    padding: 14px 16px; display: flex; flex-direction: column; gap: 5px;
    transition: border-color 0.15s, transform 0.12s, box-shadow 0.15s;
}
.demo:hover {
    border-color: #c9cdf7; transform: translateY(-2px);
    box-shadow: 0 14px 26px -20px rgba(79,70,229,0.8);
}
.demo-name { font-size: 12.5px; font-weight: 650; }
.demo-eq { font-size: 11.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-hint { font-size: 10.5px; color: #a4abbe; }

.home-notes {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px; margin-top: 42px; padding-top: 24px;
    border-top: 1px solid var(--line);
}
.home-note h3 { font-size: 13px; font-weight: 650; margin-bottom: 6px; }
.home-note p { font-size: 12px; color: var(--ink-3); line-height: 1.8; }

.foot {
    display: flex; align-items: center; gap: 8px;
    margin-top: 36px; padding-top: 18px;
    border-top: 1px solid var(--line);
    font-size: 12px; color: var(--ink-3);
}
.foot a { color: var(--ink-2); }
.foot a:hover { color: var(--accent); }
.foot a + a { margin-left: 16px; }
.foot-dot { color: #ccd2e0; }

/* ============================================================
   工作台
   ============================================================ */
.workbench { padding-top: 28px; }

.tabs {
    display: flex; align-items: center; gap: 8px;
    border-bottom: 1px solid var(--line); margin-bottom: 24px;
}
.tab {
    display: inline-flex; align-items: center; gap: 8px;
    border: 0; background: none; font-family: inherit;
    font-size: 13.5px; font-weight: 600; color: var(--ink-3);
    padding: 10px 16px 13px; cursor: pointer;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
}
.tab:hover { color: var(--ink-2); }
.tab.is-on { color: var(--accent); border-bottom-color: var(--accent); }
.tabs-note { margin-left: auto; font-size: 11.5px; color: #a4abbe; }

.work-grid {
    display: grid;
    grid-template-columns: minmax(0, 570px) minmax(0, 1fr);
    gap: 22px; align-items: start;
}

.calc-card {
    background: var(--card); border: 1px solid var(--line);
    border-radius: 20px; padding: 16px;
    box-shadow: 0 18px 40px -32px rgba(16,23,40,0.5);
}

.screen {
    background: #f8f9fd; border: 1px solid var(--line-soft);
    border-radius: 13px; padding: 12px 16px 14px;
}
.screen-top { display: flex; align-items: center; gap: 7px; min-height: 20px; }
.mode-badge {
    font-family: var(--num); font-size: 10px; font-weight: 700; letter-spacing: 0.6px;
    background: var(--accent-soft); color: var(--accent);
    border-radius: 5px; padding: 1px 6px; flex: none;
}
.mem-badge {
    font-family: var(--num); font-size: 10px; font-weight: 700;
    background: #fff0f3; color: var(--danger);
    border-radius: 5px; padding: 1px 6px; flex: none;
}
.screen-note {
    flex: 1; min-width: 0; text-align: right;
    font-size: 11px; color: #a4abbe;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.screen-note.is-err { color: var(--danger); }

.screen-expr {
    display: block; width: 100%;
    border: 0; outline: 0; background: transparent;
    font-family: var(--num); font-size: 15px; color: var(--ink-2);
    text-align: right; padding: 6px 0 2px;
    letter-spacing: 0.2px;
}
.screen-expr::placeholder { color: #b9c0d0; font-size: 13px; }
.screen-expr:focus { color: var(--ink); }

.screen-value {
    font-family: var(--num); font-size: 38px; line-height: 1.25;
    font-weight: 600; letter-spacing: -1.2px; color: var(--ink);
    min-height: 48px; margin-top: 2px; text-align: right;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.screen-value.is-pending { color: #aeb5c7; }
.screen-value.is-error { color: var(--danger); }
.screen-value.is-committed { color: var(--accent-deep); }

.mode-bar {
    display: flex; flex-wrap: wrap; gap: 8px 16px;
    align-items: center; padding: 13px 2px 11px;
    border-bottom: 1px dashed var(--line); margin-bottom: 12px;
}
.seg-group { display: flex; align-items: center; gap: 6px; }
.seg-label { font-size: 10.5px; color: var(--ink-3); flex: none; }
.seg { display: inline-flex; background: #f2f4fa; border-radius: 7px; padding: 2px; gap: 2px; }
.seg button {
    border: 0; background: none; font-family: var(--num);
    font-size: 10.5px; font-weight: 600; color: #8a93a9;
    padding: 3px 8px; border-radius: 5px; cursor: pointer;
    transition: background 0.12s, color 0.12s;
}
.seg button:hover { color: var(--accent); }
.seg button.is-on { background: #fff; color: var(--accent); box-shadow: 0 1px 3px rgba(16,23,40,0.09); }

.keys { display: grid; gap: 7px; }
.keys--fn { grid-template-columns: repeat(6, minmax(0, 1fr)); margin-bottom: 9px; }
.keys--main { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.key {
    display: flex; align-items: center; justify-content: center;
    height: 42px; border: 1px solid transparent; border-radius: 9px;
    background: #f7f8fc; color: var(--ink);
    font-family: var(--num); font-size: 14px; font-weight: 500;
    cursor: pointer; white-space: nowrap;
    transition: background 0.12s, transform 0.08s, box-shadow 0.12s;
    -webkit-tap-highlight-color: transparent; user-select: none;
}
.key svg {
    width: 18px; height: 18px;
    fill: none; stroke: currentColor; stroke-width: 1.6;
    stroke-linecap: round; stroke-linejoin: round;
}
.key:hover { background: #eff1f8; }
.key:active { transform: translateY(1px) scale(0.985); }
.key:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.keys--main .key { height: 50px; font-size: 18px; }
.key--sci { background: #f4f6fc; color: #4a5570; font-size: 13px; }
.key--sci:hover { background: #eaeefb; }
.key--const { background: #f4f6fc; color: var(--accent); font-size: 15px; font-weight: 650; }
.key--fn { background: #f1f3fa; color: #5a6480; font-size: 14px; }
.key--fn:hover { background: #e9ecf6; }
.key--op { background: var(--accent-soft); color: var(--accent); border-color: #e2e5ff; font-size: 18px; }
.key--op:hover { background: #e5e8ff; }
.key--eq {
    background: var(--accent); color: #fff; font-size: 20px;
    box-shadow: 0 8px 18px -10px rgba(79,70,229,0.9);
}
.key--eq:hover { background: var(--accent-deep); }
.key--span2 { grid-column: span 2; }

@keyframes nudge {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}
.calc-card.is-shake { animation: nudge 0.24s ease; }

.hint {
    margin-top: 13px; font-size: 11.2px; line-height: 1.9; color: #a2a9bb;
}
.hint code { color: #7b83a0; }

/* ---------------- 侧栏 ---------------- */
.side { display: flex; flex-direction: column; gap: 16px; }
.history, .cheat {
    background: var(--card); border: 1px solid var(--line);
    border-radius: 18px; padding: 16px 18px 14px;
}
.history { min-height: 250px; }
.history-head {
    display: flex; align-items: center; justify-content: space-between;
    padding-bottom: 10px; border-bottom: 1px solid var(--line-soft);
}
.history-head h2 { font-size: 13px; font-weight: 650; }
.link-btn {
    border: 0; background: none; font-family: inherit;
    font-size: 12px; color: var(--ink-3); cursor: pointer;
    padding: 2px 4px; border-radius: 5px;
}
.link-btn:hover { color: var(--danger); background: #fdf2f4; }
.history-list { list-style: none; }
.history-item + .history-item { border-top: 1px solid var(--line-soft); }
.history-item button {
    width: 100%; display: flex; align-items: baseline; gap: 12px;
    padding: 9px 6px; margin: 0 -6px;
    border: 0; background: none; font-family: inherit;
    text-align: left; border-radius: 8px; cursor: pointer;
    transition: background 0.12s;
}
.history-item button:hover { background: #fafbff; }
.h-expr {
    flex: 1; min-width: 0; font-family: var(--num); font-size: 12px;
    color: #8d95a8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.h-res { font-family: var(--num); font-size: 13.5px; font-weight: 600; flex: none; }
.history-empty { padding: 26px 6px 14px; text-align: center; font-size: 11.5px; color: #a4abbe; line-height: 1.9; }
.history-tip { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 11.5px; color: #a4abbe; }

.cheat h3 { font-size: 13px; font-weight: 650; margin-bottom: 10px; }
.cheat dl { display: grid; grid-template-columns: 68px 1fr; gap: 8px 10px; }
.cheat dt { font-size: 11.5px; color: var(--ink-3); }
.cheat dd { font-size: 11.5px; color: var(--ink-2); }
.cheat code { background: #f5f6fb; border-radius: 4px; padding: 1px 5px; color: #5a6480; }

/* ============================================================
   解方程面板
   ============================================================ */
.solve-grid {
    display: grid;
    grid-template-columns: minmax(0, 470px) minmax(0, 1fr);
    gap: 22px; align-items: start;
}
.solve-editor, .solve-result {
    background: var(--card); border: 1px solid var(--line);
    border-radius: 20px; padding: 22px;
    box-shadow: 0 18px 40px -34px rgba(16,23,40,0.5);
}
.solve-head { display: flex; align-items: center; gap: 10px; }
.solve-head h2 { font-size: 17px; letter-spacing: -0.3px; }
.solve-badge {
    font-family: var(--num); font-size: 10.5px; font-weight: 650;
    color: var(--accent); background: var(--accent-soft);
    border-radius: 20px; padding: 2px 9px;
}
.solve-lede { font-size: 12.5px; color: var(--ink-2); line-height: 1.8; margin: 8px 0 16px; }

#eqInput {
    width: 100%; min-height: 168px; resize: vertical;
    border: 1px solid var(--line); border-radius: 12px;
    background: #f8f9fd; padding: 14px 16px;
    font-family: var(--num); font-size: 14.5px; line-height: 2;
    color: var(--ink); outline: 0;
    transition: border-color 0.15s, box-shadow 0.15s;
}
#eqInput:focus { border-color: #b9bff0; box-shadow: 0 0 0 3px rgba(79,70,229,0.08); background: #fff; }
#eqInput::placeholder { color: #b3bacd; }

.eq-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.eq-tools-label { font-size: 11px; color: var(--ink-3); margin-right: 2px; }
.eq-tools-sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.eq-tool {
    min-width: 34px; padding: 5px 9px;
    border: 1px solid var(--line); border-radius: 8px; background: #fff;
    font-family: var(--num); font-size: 13px; color: var(--ink-2); cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.eq-tool:hover { border-color: #c9cdf7; color: var(--accent); background: #fafaff; }
.eq-tool:active { background: #f0f1ff; }
.eq-tool--eq {
    font-weight: 700; color: var(--accent);
    background: var(--accent-soft); border-color: #dcdcfb;
}
.eq-tool--act { font-family: inherit; font-size: 11.5px; }

.solve-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.solve-shortcut { font-size: 11px; color: #a4abbe; }

.chips-label { font-size: 11.5px; color: var(--ink-3); margin: 22px 0 9px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
    border: 1px solid var(--line); background: #fff;
    font-family: inherit; font-size: 11.5px; color: var(--ink-2);
    border-radius: 20px; padding: 5px 12px; cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.chip:hover { border-color: #c9cdf7; color: var(--accent); background: #fafaff; }

.rules {
    margin-top: 22px; padding-top: 16px;
    border-top: 1px solid var(--line-soft);
}
.rules h3 { font-size: 12.5px; font-weight: 650; margin-bottom: 8px; }
.rules ul { list-style: none; }
.rules li { font-size: 11.8px; color: var(--ink-2); line-height: 1.85; padding: 3px 0 3px 14px; position: relative; }
.rules li::before {
    content: ''; position: absolute; left: 2px; top: 13px;
    width: 5px; height: 5px; border-radius: 50%; background: #c7cce0;
}
.rules b { color: var(--ink); font-weight: 650; }
.rules code { background: #f5f6fb; border-radius: 4px; padding: 1px 5px; }

.solve-result { min-height: 420px; }
.eq-empty { font-size: 13px; color: #a4abbe; text-align: center; padding: 84px 12px; line-height: 2.1; }
.eq-empty code { background: #f5f6fb; border-radius: 4px; padding: 2px 6px; }
.eq-error {
    background: #fff5f7; border: 1px solid #f8d9e0; border-radius: 12px;
    padding: 16px 18px; display: flex; flex-direction: column; gap: 6px;
}
.eq-error b { color: var(--danger); font-size: 13px; }
.eq-error span { color: #9b4257; font-size: 12.5px; line-height: 1.7; }

.eq-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--line-soft); }
.eq-head h3 { font-size: 17px; letter-spacing: -0.3px; }
.eq-method { font-size: 11px; color: var(--ink-3); }

.eq-solutions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.eq-sol {
    display: flex; align-items: center; gap: 14px;
    background: #f8f9fd; border: 1px solid var(--line-soft);
    border-radius: 12px; padding: 13px 16px;
}
.eq-sol-no {
    font-family: var(--num); font-size: 11px; font-weight: 700;
    color: var(--accent); background: var(--accent-soft);
    border-radius: 6px; padding: 3px 8px; flex: none; min-width: 34px; text-align: center;
}
.eq-sol-vals { display: flex; flex-wrap: wrap; gap: 8px 20px; flex: 1; }
.eq-sol-item { display: inline-flex; align-items: baseline; gap: 6px; font-family: var(--num); }
.eq-sol-item b { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.eq-sol-item span { font-size: 17px; font-weight: 650; letter-spacing: -0.3px; }
.eq-sol-res { font-size: 10.5px; color: var(--ok); flex: none; }
.eq-note { margin-top: 16px; font-size: 11.8px; color: var(--ink-3); line-height: 1.8; }

.eq-src { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }
.eq-src summary { font-size: 11.5px; color: var(--ink-3); cursor: pointer; }
.eq-src-line {
    font-family: var(--num); font-size: 12px; color: #7b83a0;
    padding: 6px 0 0 12px; white-space: pre-wrap; word-break: break-all;
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1020px) {
    .home-hero { grid-template-columns: 1fr; gap: 30px; padding: 42px 0 40px; }
    .hero-side { max-width: 560px; }
    .work-grid, .solve-grid { grid-template-columns: 1fr; }
    .side { flex-direction: row; flex-wrap: wrap; }
    .side > * { flex: 1 1 260px; }
    .solve-result { min-height: 0; }
}

@media (max-width: 760px) {
    .wrap { padding: 0 20px 32px; }
    .nav-link { display: none; }
    .home-cards { grid-template-columns: 1fr; }
    .demo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .home-notes { grid-template-columns: 1fr; gap: 14px; }
    .hero-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
    .tabs-note { display: none; }
    .eq-tools-sep { display: none; }
    .foot { flex-wrap: wrap; }
}

@media (max-width: 520px) {
    .home-hero h1 { font-size: 31px; }
    .calc-card, .solve-editor, .solve-result { padding: 13px; border-radius: 16px; }
    .keys { gap: 5px; }
    .keys--fn .key { height: 38px; font-size: 11.5px; }
    .keys--main .key { height: 46px; font-size: 16px; }
    .screen-value { font-size: 30px; }
    .mode-bar { gap: 8px 10px; }
    .seg button { padding: 3px 6px; font-size: 9.5px; }
    .demo-grid { grid-template-columns: 1fr; }
    .eq-sol { flex-wrap: wrap; gap: 8px; }
    .card-visual { height: 170px; }
}

/* ---------- 顶栏里的登录状态 ---------- */
.sso-who {
    display: inline-flex; align-items: baseline; gap: 7px;
    font-size: 12px; color: #8d95a8; white-space: nowrap;
}
.sso-who b { font-weight: 600; color: #5b6480; }
.sso-who a { color: #a4abbe; text-decoration: none; }
.sso-who a:hover { color: #4f46e5; }

.sso-login {
    display: inline-flex; align-items: center; height: 28px; padding: 0 13px;
    border: 1px solid #d8dcf5; border-radius: 8px; background: #fff;
    font-size: 12px; color: #4f46e5; text-decoration: none; white-space: nowrap;
    transition: border-color .15s, background .15s;
}
.sso-login:hover { border-color: #b6b9f0; background: #f4f4ff; }

@media (max-width: 760px) {
    .sso-who b { display: none; }
}
