/* LingoReport UI — 浅色主题，与成绩单 PDF 配色一致（#1e4078 / #dc503c） */

:root {
    --primary: #1e4078;
    --primary-soft: #eef3fb;
    --accent: #dc503c;
    --ink: #1b2330;
    --ink-2: #5b6779;
    --ink-3: #8a93a6;
    --bg: #f4f6fa;
    --card: #ffffff;
    --line: #dde4ef;
    --ok: #1a9e58;
    --warn: #b26a00;
    --err: #c0392b;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(27, 35, 48, .08), 0 6px 18px rgba(27, 35, 48, .05);
}

* { box-sizing: border-box; }

/* author 的 display 会盖掉 hidden 属性，统管回来 */
[hidden] { display: none !important; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

/* ---------- 顶栏 ---------- */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 26px;
    background: var(--card);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand { display: flex; align-items: baseline; gap: 10px; }

.logo-dot {
    width: 12px; height: 12px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #3b6fd4);
    align-self: center;
    box-shadow: 0 0 0 3px rgba(30, 64, 120, .15);
}

.brand-name { font-size: 18px; font-weight: 700; letter-spacing: .4px; color: var(--primary); }
.brand-sub { font-size: 12px; color: var(--ink-3); }

.backend {
    font-size: 12px;
    color: var(--primary);
    background: var(--primary-soft);
    border: 1px solid #c9d6ea;
    border-radius: 999px;
    padding: 3px 12px;
}

/* ---------- 步骤卡片 ---------- */

.steps {
    max-width: 940px;
    margin: 22px auto 40px;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 22px;
}

.card-head {
    display: flex;
    align-items: center;
    gap: 16px;
}

.num {
    flex: 0 0 auto;
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.titles { flex: 1 1 auto; min-width: 0; }
.titles h2 { margin: 0; font-size: 16.5px; }
.titles h2 em {
    font-style: normal;
    font-weight: 400;
    font-size: 12.5px;
    color: var(--ink-3);
    margin-left: 8px;
}
.titles p { margin: 3px 0 0; font-size: 12.5px; color: var(--ink-2); }

.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- 按钮 ---------- */

.btn {
    flex: 0 0 auto;
    font: inherit;
    font-size: 13.5px;
    padding: 8px 18px;
    border-radius: 7px;
    border: 1px solid var(--primary);
    background: #fff;
    color: var(--primary);
    cursor: pointer;
    transition: background .15s, transform .05s;
}
.btn:hover { background: var(--primary-soft); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn.primary {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    padding: 9px 26px;
}
.btn.primary:hover:not(:disabled) { background: #2a529a; }

.btn.ghost { border-color: var(--line); color: var(--ink-2); }
.btn.ghost:hover { background: #f2f5fa; }

/* ---------- 路径 / 错误 ---------- */

.path {
    margin-top: 12px;
    font-size: 12.5px;
    color: var(--ink-2);
    background: #f7f9fd;
    border: 1px dashed var(--line);
    border-radius: 6px;
    padding: 7px 12px;
    word-break: break-all;
    user-select: text;
}

.path.ok { border-style: solid; border-color: #bfe4cd; background: #f2fbf6; color: var(--ok); }

.error {
    margin-top: 10px;
    font-size: 13px;
    color: var(--err);
    background: #fdeeec;
    border: 1px solid #f3c9c3;
    border-radius: 6px;
    padding: 8px 12px;
    white-space: pre-wrap;
}

/* ---------- 预览 ---------- */

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.chip {
    font-size: 12.5px;
    padding: 4px 12px;
    border-radius: 999px;
    background: #f1f4f9;
    border: 1px solid var(--line);
    color: var(--ink-2);
}
.chip.blue { background: var(--primary-soft); border-color: #c9d6ea; color: var(--primary); font-weight: 600; }
.chip.green { background: #e9f6ee; border-color: #bfe4cd; color: var(--ok); }

.table-wrap { margin-top: 12px; overflow-x: auto; }

table { border-collapse: collapse; width: 100%; font-size: 13px; }

th {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    text-align: left;
    padding: 8px 10px;
    border: 1px solid #93a5c2;
    white-space: nowrap;
}

td {
    padding: 7px 10px;
    border: 1px solid #ccd5e4;
    color: var(--ink);
}
tbody tr:nth-child(even) td { background: #f7f9fc; }

.band-cell { color: var(--accent); font-weight: 700; }

.cefr-cell { text-align: center; font-weight: 600; }
.c-A1, .c-A2 { color: #6b7385; }
.c-B1 { color: #1565c0; }
.c-B2 { color: #2e7d32; }
.c-C1 { color: #b26a00; }
.c-C2 { color: #c0392b; }

/* ---------- 问题列表 ---------- */

.issues {
    margin-top: 14px;
    border: 1px solid #f0d9b8;
    background: #fffaf1;
    border-radius: 7px;
    padding: 10px 14px;
}
.issues h3 {
    margin: 0 0 6px;
    font-size: 13.5px;
    color: var(--warn);
    display: flex;
    align-items: center;
    gap: 8px;
}
.issues .badge {
    background: var(--warn);
    color: #fff;
    border-radius: 999px;
    font-size: 11.5px;
    padding: 1px 8px;
}
.issues ul { margin: 0; padding-left: 20px; }
.issues li { font-size: 12.5px; color: #7a5b26; margin: 3px 0; }

/* ---------- 进度 ---------- */

.progress { margin-top: 16px; }

.bar {
    height: 12px;
    background: #e8edf5;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--line);
}
.fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), #3b6fd4);
    border-radius: 999px;
    transition: width .25s ease;
}

.p-text {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--ink-2);
}

/* ---------- 结果 ---------- */

.result {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.ok-line { margin: 0; color: var(--ok); font-size: 14px; }
.ok-line b { font-size: 16px; }

/* 服务器模式：ZIP 下载链接（<a class="btn">）与结果操作区 */
.result-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
a.btn { text-decoration: none; display: inline-block; }
a.btn.primary:hover { background: #2a529a; }

/* ---------- 顶栏右侧操作 ---------- */

.topbar-actions { display: flex; align-items: center; gap: 12px; }

.btn.sm { padding: 5px 13px; font-size: 12.5px; }

/* ---------- 等级对照表弹窗 ---------- */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(20, 28, 44, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 24px;
}

.modal-card {
    background: var(--card);
    border-radius: 12px;
    width: min(720px, 100%);
    max-height: min(84vh, 780px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 18px 50px rgba(15, 23, 42, .35);
    overflow: hidden;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 10px;
}
.modal-head h3 { margin: 0; font-size: 16.5px; color: var(--primary); }
.modal-head h3 em { font-style: normal; font-weight: 400; font-size: 12px; color: var(--ink-3); margin-left: 8px; }

.modal-close {
    border: 0;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    color: var(--ink-3);
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 6px;
}
.modal-close:hover { background: #eef1f6; color: var(--ink); }

.tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 20px 12px; border-bottom: 1px solid var(--line); }
.tab {
    font: inherit;
    font-size: 12.5px;
    padding: 5px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #f5f7fb;
    color: var(--ink-2);
    cursor: pointer;
    transition: all .12s;
}
.tab:hover { border-color: #c9d6ea; }
.tab.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

.modal-body { padding: 14px 20px 18px; overflow-y: auto; }
.modal-body td { padding: 5.5px 10px; }
.modal-body .score-cell { font-variant-numeric: tabular-nums; white-space: nowrap; }

.conc-note {
    margin: 10px 0 0;
    font-size: 12px;
    color: var(--warn);
    background: #fffaf1;
    border: 1px solid #f0d9b8;
    border-radius: 6px;
    padding: 7px 10px;
}

.conc-src { margin: 10px 0 0; font-size: 11.5px; color: var(--ink-3); line-height: 1.6; }

/* ---------- 底栏 ---------- */

.footer {
    max-width: 940px;
    margin: 0 auto 26px;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 11.5px;
    color: var(--ink-3);
    flex-wrap: wrap;
}

@media (max-width: 720px) {
    .card-head { flex-wrap: wrap; }
    .btn { width: 100%; }
    .result { flex-direction: column; align-items: flex-start; }
}
