* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --ink: #1c1917;
  --muted: #78716c;
  --line: #e7e5e4;
  --bg: #faf8f5;
  --card: #ffffff;
  --accent: #c2410c;
  --accent-2: #ea580c;
  --accent-soft: #fdf1e7;
  --green: #15803d;
  --red: #b91c1c;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; }
a { color: var(--accent); text-decoration: none; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 9px; font-size: 14px; font-weight: 500;
  background: var(--accent); color: #fff; transition: .18s;
}
.btn:hover { background: var(--accent-2); }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: #f5f3f1; border-color: #d6d3d1; }
.btn.sm { padding: 5px 12px; font-size: 13px; border-radius: 7px; }
.btn.danger { background: #fff; color: var(--red); border: 1px solid #f3d6d6; }
.btn.danger:hover { background: #fdf2f2; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px;
  font-family: inherit; font-size: 14px; color: var(--ink); background: #fff; outline: none;
  transition: .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(194,65,12,.08); }
textarea { resize: vertical; min-height: 76px; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.hint { font-size: 13px; color: var(--muted); }
.tag {
  display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 12px;
  background: var(--accent-soft); color: var(--accent);
}
.tag.gray { background: #f5f3f1; color: var(--muted); }
.tag.green { background: #ecfdf3; color: var(--green); }

/* 登录页 */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 400px; padding: 36px 34px; background: #fff; border-radius: 18px; border: 1px solid var(--line); box-shadow: 0 18px 50px -24px rgba(28,25,23,.22); }
.auth-card h1 { font-size: 21px; letter-spacing: .5px; margin-bottom: 4px; }
.auth-card .sub { font-size: 13px; color: var(--muted); margin-bottom: 24px; }
.tabs { display: flex; gap: 6px; background: #f5f3f1; padding: 4px; border-radius: 10px; margin-bottom: 22px; }
.tabs button { flex: 1; padding: 8px; border-radius: 7px; background: transparent; font-size: 14px; color: var(--muted); }
.tabs button.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.form-row { margin-bottom: 16px; }
.err { color: var(--red); font-size: 13px; margin-top: 12px; min-height: 18px; }

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 26px; background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .brand { font-weight: 600; font-size: 16px; letter-spacing: .3px; }
.topbar .who { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--muted); }

/* 评委端 */
.judge-layout { display: grid; grid-template-columns: 300px 1fr; min-height: calc(100vh - 61px); }
.side { border-right: 1px solid var(--line); background: #fff; overflow-y: auto; max-height: calc(100vh - 61px); }
.side-head { padding: 16px 18px 10px; font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; }
.stu-item { padding: 12px 18px; border-bottom: 1px solid #f5f3f1; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 8px; transition: .12s; }
.stu-item:hover { background: #fdfaf7; }
.stu-item.on { background: var(--accent-soft); border-left: 3px solid var(--accent); padding-left: 15px; }
.stu-item .n { font-weight: 500; font-size: 14px; }
.stu-item .m { font-size: 12px; color: var(--muted); }
.stu-item .done { font-size: 12px; color: var(--green); white-space: nowrap; }

.stage { padding: 22px 26px 60px; }
.player-box { background: #0b0a09; border-radius: 14px; overflow: hidden; position: relative; min-height: 240px; display: flex; align-items: center; justify-content: center; }
.player-box video { width: 100%; max-height: 62vh; display: block; background: #000; }
.player-box .ph { color: #8a8580; font-size: 14px; padding: 60px 20px; text-align: center; }

.score-panel { margin-top: 20px; padding: 22px 24px; }
.score-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.score-field .in { display: flex; align-items: center; gap: 8px; }
.score-field .in input { text-align: center; font-size: 17px; font-weight: 600; padding: 10px; }
.score-field .in .mx { font-size: 12px; color: var(--muted); white-space: nowrap; }
.total-line { display: flex; align-items: baseline; gap: 10px; margin: 22px 0 0; padding-top: 18px; border-top: 1px dashed var(--line); }
.total-line .v { font-size: 30px; font-weight: 700; color: var(--accent); letter-spacing: -.5px; }
.total-line .lb { font-size: 13px; color: var(--muted); }
.actions { display: flex; gap: 10px; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.toast { font-size: 13px; color: var(--green); }

/* 管理端 */
.admin-wrap { padding: 24px 26px 70px; max-width: 1240px; margin: 0 auto; }
.admin-tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.admin-tabs button { padding: 10px 18px; background: transparent; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; }
.admin-tabs button.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
.panel { padding: 22px 24px; margin-bottom: 18px; }
.panel h2 { font-size: 16px; margin-bottom: 16px; font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 10px; text-align: left; border-bottom: 1px solid #f2efec; vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 500; background: #fcfaf8; }
tr:hover td { background: #fdfbf9; }
.mono { font-variant-numeric: tabular-nums; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.empty { padding: 40px; text-align: center; color: var(--muted); font-size: 14px; }

.modal-mask { position: fixed; inset: 0; background: rgba(28,25,23,.42); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal { background: #fff; border-radius: 16px; padding: 26px; width: 100%; max-width: 520px; box-shadow: 0 24px 60px -20px rgba(0,0,0,.3); }
.modal h3 { font-size: 17px; margin-bottom: 16px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
[hidden] { display: none !important; }

/* 评委分组切换条 */
.cat-bar { display: flex; gap: 10px; padding: 12px 26px 0; background: var(--bg); }
.cat-btn {
  padding: 9px 20px; border-radius: 10px 10px 0 0; font-size: 15px; font-weight: 500;
  background: #f0ede9; color: var(--muted); border: 1px solid var(--line); border-bottom: none;
  display: inline-flex; align-items: center; gap: 9px; transition: .15s;
}
.cat-btn:hover { background: #f7f4f0; }
.cat-btn.on { background: #fff; color: var(--accent); font-weight: 600; border-color: var(--line); position: relative; }
.cat-btn.on::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: #fff; }
.cat-prog { font-size: 12px; background: rgba(0,0,0,.07); color: inherit; padding: 1px 8px; border-radius: 20px; font-variant-numeric: tabular-nums; }
.cat-btn.on .cat-prog { background: var(--accent-soft); color: var(--accent); }
.cat-bar + .judge-layout { border-top: 1px solid var(--line); }

/* 管理端筛选条 */
.filter-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.filter-bar select { width: auto; min-width: 130px; padding: 7px 12px; font-size: 13px; }
.filter-bar .spacer { flex: 1; }
.scan-ok { color: var(--green); }
.scan-exists { color: var(--muted); }
.file-missing { color: var(--red); font-size: 12px; }
