/* ======================================================================
   audio-loudness · 响度仪表台（独立视觉：米纸 + 墨绿 + 橙指针）
   ====================================================================== */

.ld-page {
    --ld-bg: #f5f2e9;
    --ld-panel: #fffdf7;
    --ld-panel2: #f1ece0;
    --ld-ink: #1b1a15;
    --ld-ink2: #565043;
    --ld-ink3: #8c8574;
    --ld-line: #e2dbc9;
    --ld-green: #1f6f4a;
    --ld-green-soft: #e8f2ec;
    --ld-amber: #c2700b;
    --ld-red: #b3261e;
    --ld-mono: ui-monospace, "SFMono-Regular", Consolas, "Cascadia Mono", monospace;

    background: var(--ld-bg);
    color: var(--ld-ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    padding-bottom: 8px;
}

:root[data-theme="dark"] .ld-page {
    --ld-bg: #10120f;
    --ld-panel: #171a16;
    --ld-panel2: #1d211c;
    --ld-ink: #eee9dc;
    --ld-ink2: #b1aa9a;
    --ld-ink3: #7c7768;
    --ld-line: #2a2f28;
    --ld-green: #5ecb9a;
    --ld-green-soft: #14251d;
    --ld-amber: #f0b34a;
    --ld-red: #f0776a;
}

.ld-wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }

/* Hero */
.ld-hero { padding: 32px 0 20px; display: grid; grid-template-columns: minmax(0, 1fr) 276px; gap: 26px; align-items: start; }

.ld-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--ld-mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase;
    color: var(--ld-green); background: var(--ld-green-soft);
    border-radius: 2px; padding: 5px 9px; margin-bottom: 14px;
}

.ld-eyebrow::before { content: "▮"; font-size: 10px; }

.ld-hero h1 { margin: 0 0 12px; font-size: clamp(26px, 3.3vw, 37px); line-height: 1.22; letter-spacing: -.012em; font-weight: 800; }

.ld-hero h1 em {
    display: block; margin-top: 8px; font-style: normal;
    font-size: clamp(14px, 1.5vw, 16px); font-weight: 600; color: var(--ld-ink2); line-height: 1.6;
}

.ld-lead { margin: 0; font-size: 14.5px; line-height: 1.85; color: var(--ld-ink2); max-width: 63ch; }
.ld-lead b { color: var(--ld-ink); box-shadow: inset 0 -.5em 0 rgba(31, 111, 74, .16); }

.ld-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 15px; }
.ld-chips span {
    font-family: var(--ld-mono); font-size: 11.5px; color: var(--ld-ink2);
    border: 1px solid var(--ld-line); border-radius: 2px; padding: 4px 8px; background: var(--ld-panel);
}

.ld-side { background: var(--ld-panel); border: 1px solid var(--ld-line); border-top: 3px solid var(--ld-green); border-radius: 3px; padding: 16px; }
.ld-side h2 { margin: 0 0 10px; font-size: 13px; }
.ld-side table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ld-side th, .ld-side td { padding: 6px 4px; border-bottom: 1px dashed var(--ld-line); text-align: left; color: var(--ld-ink2); }
.ld-side th { font-family: var(--ld-mono); color: var(--ld-ink); width: 42%; font-weight: 700; }
.ld-side tr:last-child th, .ld-side tr:last-child td { border-bottom: 0; }
.ld-side p { margin: 10px 0 0; font-size: 11.5px; color: var(--ld-ink3); line-height: 1.6; }

/* 工作台 */
.ld-desk { background: var(--ld-panel); border: 1px solid var(--ld-line); border-radius: 4px; overflow: hidden; }
.ld-desk-head { display: flex; align-items: center; gap: 10px; padding: 11px 18px; border-bottom: 1px solid var(--ld-line); background: var(--ld-panel2); }
.ld-desk-head b { font-size: 14px; }
.ld-desk-head span { margin-left: auto; font-family: var(--ld-mono); font-size: 11.5px; color: var(--ld-ink3); }

.ld-drop {
    margin: 16px 18px; padding: 18px 16px; text-align: center;
    border: 1.5px dashed #b9c9bd; border-radius: 3px; cursor: pointer; transition: .15s; background: var(--ld-panel);
}
.ld-drop:hover, .ld-drop.is-over { border-color: var(--ld-green); background: var(--ld-green-soft); }
.ld-drop b { display: block; font-size: 14.5px; margin-bottom: 5px; }
.ld-drop span { font-size: 12.5px; color: var(--ld-ink3); line-height: 1.6; }

/* 主区 */
.ld-main { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; padding: 0 18px 16px; align-items: start; }

.ld-board { border: 1px solid var(--ld-line); border-radius: 3px; overflow: hidden; }
.ld-board-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 9px 12px; background: var(--ld-panel2); border-bottom: 1px solid var(--ld-line); font-size: 12.5px; color: var(--ld-ink2); }
.ld-board-head b { font-size: 13px; color: var(--ld-ink); }
.ld-board-head span { font-family: var(--ld-mono); font-size: 11.5px; color: var(--ld-ink3); }

.ld-tablewrap { max-height: 340px; overflow: auto; }
.ld-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ld-table thead th {
    position: sticky; top: 0; z-index: 1; background: var(--ld-panel);
    font-family: var(--ld-mono); font-size: 11px; color: var(--ld-ink3); font-weight: 600;
    text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--ld-line); white-space: nowrap;
}
.ld-table td { padding: 8px 10px; border-bottom: 1px solid var(--ld-line); color: var(--ld-ink2); vertical-align: middle; }
.ld-table tr:last-child td { border-bottom: 0; }
.ld-table td.ld-num { font-family: var(--ld-mono); color: var(--ld-ink); white-space: nowrap; }
.ld-table td.ld-name { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ld-table tr.is-hot td { background: rgba(194, 112, 11, .06); }
.ld-empty { padding: 28px 14px; text-align: center; color: var(--ld-ink3); font-size: 12.5px; line-height: 1.8; }
.ld-empty b { display: block; color: var(--ld-ink2); font-size: 14px; margin-bottom: 4px; }

/* 读数仪表 */
.ld-gauge { padding: 12px 14px; border-top: 1px solid var(--ld-line); background: var(--ld-panel); }
.ld-gauge-top { display: flex; align-items: baseline; gap: 8px; }
.ld-gauge-top b { font-family: var(--ld-mono); font-size: 30px; line-height: 1; color: var(--ld-green); letter-spacing: -.02em; }
.ld-gauge-top span { font-size: 12px; color: var(--ld-ink3); }
.ld-gauge-top i { margin-left: auto; font-style: normal; font-family: var(--ld-mono); font-size: 11.5px; color: var(--ld-ink3); }
.ld-scale { position: relative; height: 12px; margin-top: 10px; border-radius: 2px; background: linear-gradient(90deg, #2f6f52 0%, #6aa87f 45%, #d9b25a 72%, #c0553f 100%); opacity: .9; }
.ld-scale i { position: absolute; top: -4px; width: 3px; height: 20px; background: var(--ld-ink); border-radius: 1px; transition: left .2s ease; }
.ld-scale-ticks { display: flex; justify-content: space-between; margin-top: 3px; font-family: var(--ld-mono); font-size: 10px; color: var(--ld-ink3); }

/* 参数 */
.ld-pad { display: grid; gap: 11px; align-content: start; }
.ld-group { border: 1px solid var(--ld-line); border-radius: 3px; padding: 11px; display: grid; gap: 9px; background: var(--ld-panel); }
.ld-group h3 { margin: 0; font-family: var(--ld-mono); font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--ld-green); }

.ld-targets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ld-targets button {
    font-family: var(--ld-mono); font-size: 11.5px; padding: 7px 4px; border-radius: 2px;
    border: 1px solid var(--ld-line); background: var(--ld-panel); color: var(--ld-ink2); cursor: pointer; transition: .14s; line-height: 1.35;
}
.ld-targets button b { display: block; font-size: 13px; color: var(--ld-ink); }
.ld-targets button:hover { border-color: var(--ld-green); }
.ld-targets button.is-on { background: var(--ld-green); border-color: var(--ld-green); color: #f3fff9; }
.ld-targets button.is-on b { color: #f3fff9; }

.ld-field { display: grid; gap: 4px; font-size: 12.5px; color: var(--ld-ink2); }
.ld-field .ld-line { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.ld-field input[type="range"] { width: 100%; accent-color: var(--ld-green); }
.ld-field output { font-family: var(--ld-mono); font-size: 11.5px; color: var(--ld-green); }
.ld-field select { width: 100%; background: var(--ld-panel); color: var(--ld-ink); border: 1px solid var(--ld-line); border-radius: 2px; font-size: 13px; padding: 7px 8px; }
.ld-field small { font-size: 11.5px; color: var(--ld-ink3); line-height: 1.5; }

.ld-switches { display: grid; gap: 7px; font-size: 12.5px; color: var(--ld-ink2); }
.ld-switches label { display: flex; align-items: center; gap: 7px; }

.ld-checks { display: grid; gap: 5px; }
.ld-check { display: grid; grid-template-columns: 15px 1fr; gap: 7px; font-size: 12px; line-height: 1.55; color: var(--ld-ink2); }
.ld-check i { font-style: normal; text-align: center; }
.ld-check.is-ok i { color: var(--ld-green); }
.ld-check.is-warn i { color: var(--ld-amber); }
.ld-check.is-bad i { color: var(--ld-red); }

/* 操作 */
.ld-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 0 18px 14px; }
.ld-actions .ld-tip { margin-left: auto; font-size: 12px; color: var(--ld-ink3); }

.ld-btn {
    appearance: none; border: 1px solid var(--ld-line); background: var(--ld-panel);
    color: var(--ld-ink); font-size: 13px; font-weight: 600; border-radius: 3px;
    padding: 9px 13px; cursor: pointer; transition: .14s;
}
.ld-btn:hover:not(:disabled) { border-color: var(--ld-green); color: var(--ld-green); }
.ld-btn:disabled { opacity: .42; cursor: not-allowed; }
.ld-btn-main { background: var(--ld-green); border-color: var(--ld-green); color: #f3fff9; font-weight: 800; }
.ld-btn-main:hover:not(:disabled) { filter: brightness(1.06); color: #f3fff9; }
.ld-btn-sm { padding: 6px 10px; font-size: 12px; }

.ld-msg { margin: 0; padding: 0 18px 15px; font-size: 12.5px; line-height: 1.65; color: var(--ld-ink3); }
.ld-msg.is-err { color: var(--ld-red); }
.ld-msg.is-ok { color: var(--ld-green); }

.ld-progress { padding: 0 18px 14px; }
.ld-bar { height: 8px; border-radius: 2px; background: var(--ld-line); overflow: hidden; }
.ld-bar i { display: block; height: 100%; width: 0; background: var(--ld-green); transition: width .2s linear; }
.ld-pmeta { display: flex; justify-content: space-between; gap: 10px; margin-top: 7px; font-family: var(--ld-mono); font-size: 11.5px; color: var(--ld-ink3); }

.ld-results { margin: 0 18px 15px; border: 1px solid var(--ld-line); border-radius: 3px; overflow: hidden; }
.ld-results[hidden] { display: none; }
.ld-results-head { padding: 8px 12px; background: var(--ld-panel2); border-bottom: 1px solid var(--ld-line); font-size: 12.5px; color: var(--ld-ink2); }
.ld-result-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--ld-line); font-size: 12.5px; }
.ld-result-row:last-child { border-bottom: 0; }
.ld-result-row b { font-size: 13px; }
.ld-result-row span { font-family: var(--ld-mono); font-size: 11.5px; color: var(--ld-ink3); }
.ld-result-row .ld-ops { margin-left: auto; display: flex; gap: 6px; }

@media (max-width: 980px) {
    .ld-hero { grid-template-columns: 1fr; gap: 16px; padding-top: 24px; }
    .ld-main { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
    .ld-wrap { padding: 0 12px; }
    .ld-actions .ld-tip { margin-left: 0; width: 100%; }
    .ld-table td.ld-name { max-width: 120px; }
    .ld-gauge-top b { font-size: 26px; }
}
