/* ==========================================================================
   homework.3n7er.space — 作业提交看板
   视觉参考：Qount（深色底 #1a1a1a + 柠檬绿 #dafa45 + 胶囊按钮 + 圆角）
   布局：以「课程 → 作业表」为主体，不放横幅和统计大卡
   ========================================================================== */

:root {
    --bg:            #1a1a1a;
    --bg-deep:       #161616;
    --surface:       #1f1f1f;
    --surface-2:     #242424;
    --surface-3:     #2a2a2a;
    --border:        #2e2e2e;
    --border-soft:   #262626;

    --text:          #ffffff;
    --text-dim:      #9a9a9a;
    --text-faint:    #6e6e6e;

    --lime:          #dafa45;
    --red:           #ff6b6b;
    --amber:         #ffb84d;

    --radius:        16px;
    --radius-sm:     10px;
    --radius-pill:   999px;

    --maxw:          1280px;

    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
            "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
    font-size: 15px;
    line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
code {
    font-family: var(--mono);
    font-size: .88em;
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
    border-radius: 5px;
    padding: 1px 5px;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

/* ---------- 顶部导航 ---------- */

.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(26, 26, 26, .9);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-soft);
}

.nav-inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 13px 28px;
    display: flex;
    align-items: center;
    gap: 34px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: .1em;
    text-transform: uppercase;
    white-space: nowrap;
}

.brand-mark { width: 25px; height: 25px; flex: none; }
.brand-mark .hex { fill: none; stroke: var(--lime); stroke-width: 3.2; }
.brand-mark .dot { fill: var(--lime); }

.nav-links {
    display: flex;
    gap: 26px;
    font-size: 14px;
    color: var(--text-dim);
    margin-left: auto;
}
.nav-links a { transition: color .15s; }
.nav-links a:hover, .nav-links a.on { color: var(--text); }

.nav-actions { display: flex; align-items: center; gap: 10px; }

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

.btn {
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    padding: 9px 20px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: transform .12s, background .15s, border-color .15s;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }

.btn-lime { background: var(--lime); color: #121212; }
.btn-lime:hover:not(:disabled) { background: #e4ff5e; }

.btn-white { background: #fefefe; color: #121212; }
.btn-white:hover:not(:disabled) { background: #e6e6e6; }

.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); border-color: #3a3a3a; }

.btn-sm { padding: 6px 14px; font-size: 13px; }

.icon-btn { gap: 6px; }
.icon-btn svg { flex: none; opacity: .85; }
.icon-btn:hover svg { opacity: 1; }

/* ---------- 主区域 ---------- */

.board {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 38px 28px 60px;
}

.crumb {
    font-size: 13px;
    color: var(--text-faint);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.crumb a:hover { color: var(--text); }
.crumb span { opacity: .6; }

.block-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}
.block-head h2 {
    font-size: 30px;
    font-weight: 300;
    letter-spacing: -.02em;
    margin: 0;
}

.sub-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    font-size: 19px;
    font-weight: 500;
    margin: 6px 0 14px;
}

.muted { color: var(--text-faint); font-size: 13px; font-weight: 400; }

/* ---------- 课程块 ---------- */

.course-block { margin-bottom: 46px; }

.course-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2px;
}

.course-id { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.course-id h2 {
    font-size: 27px;
    font-weight: 300;
    letter-spacing: -.02em;
    margin: 0;
}
.course-repo {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-faint);
}

.course-stat { text-align: right; flex: none; }
.course-pct {
    display: block;
    font-size: 26px;
    font-weight: 300;
    color: var(--lime);
    letter-spacing: -.02em;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}
.course-pct i { font-style: normal; font-size: .62em; margin-left: 1px; }
.course-sub { display: block; font-size: 12px; color: var(--text-faint); }

/* ---------- 作业表 ---------- */

.hw-table { width: 100%; border-collapse: collapse; }

.hw-table thead th {
    font-size: 10.5px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-faint);
    font-weight: 500;
    text-align: left;
    padding: 12px 14px 10px;
    border-bottom: 1px solid var(--border-soft);
    white-space: nowrap;
}

.hw-tr { border-bottom: 1px solid var(--border-soft); }
.hw-tr:hover { background: rgba(255, 255, 255, .022); }
.hw-tr td { padding: 11px 14px; vertical-align: middle; }

.col-name { width: 118px; }
.col-due  { width: 110px; }
.col-left { width: 130px; }
.col-num  { width: 96px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.col-miss { width: 108px; text-align: right; }
.col-bar  { min-width: 150px; }

/* 进度条占满它那一列；列宽由表格分配，别在中间留出空档 */
.col-bar .bar { width: 100%; }

.lab {
    font-size: 14.5px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.due { font-size: 13px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.due-none { font-size: 12.5px; color: var(--text-faint); }

.col-num b { font-size: 15px; font-weight: 500; }
.col-num span { font-size: 12.5px; color: var(--text-faint); }

/* 提交率：上面是比例，下面是实交/应交 */
.col-rate { width: 104px; text-align: right; }

.col-rate b {
    display: block;
    font-size: 15.5px;
    font-weight: 500;
    line-height: 1.35;
    font-variant-numeric: tabular-nums;
}
.col-rate b.rate-low { color: var(--amber); }
.col-rate b.rate-zero { color: var(--text-faint); }

.col-rate span {
    display: block;
    font-size: 11.5px;
    color: var(--text-faint);
    font-variant-numeric: tabular-nums;
}

/* 剩余时间标签 */
.tag {
    display: inline-block;
    font-size: 12px;
    line-height: 1.5;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.tag.ok     { color: var(--lime);      border-color: rgba(218, 250, 69, .32);  background: rgba(218, 250, 69, .07); }
.tag.soon   { color: var(--amber);     border-color: rgba(255, 184, 77, .34);  background: rgba(255, 184, 77, .08); }
.tag.urgent { color: var(--red);       border-color: rgba(255, 107, 107, .4);  background: rgba(255, 107, 107, .1); }
.tag.past   { color: var(--text-faint); border-color: var(--border);           background: transparent; }
.tag.none   { color: var(--text-faint); border-color: transparent;             background: transparent; }

/* 进度条 */
.bar {
    height: 5px;
    background: var(--surface-3);
    border-radius: var(--radius-pill);
    overflow: hidden;
}
.bar-fill {
    height: 100%;
    background: var(--lime);
    border-radius: var(--radius-pill);
    transition: width .5s cubic-bezier(.4, 0, .2, 1);
}
.bar-fill.low { background: var(--amber); }
.bar-fill.zero { background: transparent; }

/* 未交按钮 */
.miss-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    border-radius: var(--radius-pill);
    padding: 4px 12px;
    font-size: 12.5px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-variant-numeric: tabular-nums;
    transition: color .15s, border-color .15s, background .15s;
}
.miss-btn:hover { color: var(--text); border-color: #3f3f3f; background: var(--surface-2); }
.miss-btn .caret { font-size: 9px; opacity: .6; }

.miss-none { font-size: 12.5px; color: var(--lime); opacity: .85; }

/* 展开的未交名单 */
.missing-tr td {
    padding: 0 14px 16px;
    background: rgba(255, 255, 255, .016);
    border-bottom: 1px solid var(--border-soft);
}

.chips { display: flex; flex-wrap: wrap; gap: 7px; padding-top: 4px; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 4px 12px;
    font-size: 13px;
}
.chip .sid {
    font-size: 11px;
    color: var(--text-faint);
    font-family: var(--mono);
}

/* ---------- 通用表格（学生明细） ---------- */

.table-wrap {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    overflow: auto;
}

.grid-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

.grid-table th {
    text-align: left;
    font-size: 11px;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--text-faint);
    font-weight: 500;
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    position: sticky;
    top: 0;
    background: var(--surface);
}

.grid-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-soft);
    vertical-align: middle;
    white-space: nowrap;
}
.grid-table tbody tr:last-child td { border-bottom: none; }
.grid-table tbody tr:hover { background: var(--surface-2); }

.grid-table .col-num { text-align: right; font-variant-numeric: tabular-nums; }
.grid-table .col-num b { font-weight: 500; }
.grid-table .col-num span { color: var(--text-faint); font-size: 12.5px; }

.st-name { font-weight: 500; }
.mono { font-family: var(--mono); font-size: 12.5px; color: var(--text-dim); }
.gh { color: var(--text-faint); }

.flag {
    margin-left: 8px;
    font-size: 11px;
    color: var(--amber);
    border: 1px solid rgba(255, 184, 77, .3);
    border-radius: var(--radius-pill);
    padding: 1px 8px;
}

.dot-col { width: 40px; }

/* 表头默认左对齐，这里跟格子一起居中，否则编号对不上列 */
.grid-table th.dot-col,
.grid-table td.dot-col { text-align: center; }

/* 学生明细：名次 + 未交作业清单 */
.grid-table th.rank,
.grid-table td.rank {
    width: 52px;
    text-align: right;
    color: var(--text-faint);
    font-variant-numeric: tabular-nums;
    font-size: 12.5px;
}

.grid-table th.col-missing,
.grid-table td.col-missing {
    white-space: normal;
    min-width: 200px;
    max-width: 280px;
}

.miss-list { display: flex; flex-wrap: wrap; gap: 4px; }

.miss-tag {
    font-size: 11.5px;
    line-height: 1.55;
    padding: 1px 8px;
    border-radius: var(--radius-pill);
    color: var(--red);
    border: 1px solid rgba(255, 107, 107, .3);
    background: rgba(255, 107, 107, .08);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.dot {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    background: var(--surface-3);
    font-size: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-faint);
}
.dot.on { background: var(--lime); color: #121212; font-weight: 700; }

/* ---------- 提示 ---------- */

.notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border-radius: var(--radius-sm);
    padding: 13px 17px;
    font-size: 13.5px;
    margin-bottom: 18px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-dim);
    line-height: 1.65;
    flex-wrap: wrap;
}
.notice.warn { border-color: rgba(255, 184, 77, .32); background: rgba(255, 184, 77, .06); color: #ffd9a0; }
.notice.err  { border-color: rgba(255, 107, 107, .34); background: rgba(255, 107, 107, .06); color: #ffc0c0; }

/* ---------- 加载 ---------- */

.spinner {
    width: 26px; height: 26px;
    border: 2.5px solid var(--surface-3);
    border-top-color: var(--lime);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    margin: 90px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 后台表单 ---------- */

.card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 24px;
}

.card-title { font-size: 19px; font-weight: 500; margin: 0 0 3px; }
.card-sub { font-size: 12px; color: var(--text-faint); font-family: var(--mono); }

.field { margin-bottom: 18px; }
.field label {
    display: block;
    font-size: 12px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 7px;
}

.input {
    width: 100%;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 11px 14px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
}
.input:focus { border-color: var(--lime); }

.hint { font-size: 12.5px; color: var(--text-faint); margin-top: 6px; line-height: 1.7; }
.hint a { color: var(--lime); text-decoration: underline; }

/* 后台：课程行编辑器 */
.repo-row {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}
.repo-row .input { padding: 9px 12px; font-size: 13.5px; }

/* ---------- 页脚 ---------- */

footer {
    border-top: 1px solid var(--border-soft);
    padding: 26px 0 44px;
    color: var(--text-faint);
    font-size: 12.5px;
}
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer a { color: var(--text-dim); }

/* ---------- 响应式 ---------- */

@media (max-width: 900px) {
    .col-due { display: none; }
}

@media (max-width: 720px) {
    .wrap, .nav-inner, .board { padding-left: 18px; padding-right: 18px; }
    .nav-links { display: none; }
    .course-head { flex-direction: column; align-items: flex-start; gap: 6px; }
    .course-stat { text-align: left; }
    .col-left { display: none; }
    .col-name { width: 74px; }
    .course-id h2 { font-size: 22px; }
    .block-head h2 { font-size: 24px; }
}

@media (max-width: 560px) {
    .col-bar { display: none; }
    .icon-btn-text { display: none; }
    .repo-row { grid-template-columns: 1fr; }
}
