/* ===== 调度系统共享设计系统 ===== */
:root {
  --zju: #003F88;
  --zju-ink: #002255;
  --zju-lite: #E8EEF7;
  --zju-line: #D5DCE8;
  --accent: #1565C0;
  --ink: #0B1B33;
  --ink-2: #4A5A73;
  --ink-3: #8C98A8;
  --bg: #FAFBFD;
  --surface: #FFFFFF;
  --line: #ECEEF2;
  --line-2: #F3F5F8;
  --success: #2E7D32;
  --success-bg: #E8F5E9;
  --warning: #E65100;
  --warning-bg: #FFF3E0;
  --error: #C62828;
  --error-bg: #FFEBEE;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(11,27,51,0.04), 0 0 0 1px var(--line);
  --shadow-lg: 0 4px 24px rgba(11,27,51,0.08), 0 0 0 1px var(--line);
  --font: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'SF Mono', 'Menlo', 'Consolas', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

body.page-app {
  max-width: 520px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

a { color: inherit; text-decoration: none; }
button { font-family: var(--font); cursor: pointer; }

/* ===== Hero (页面顶部深蓝块) ===== */
.hero {
  margin: 0 -20px 24px;
  padding: 32px 24px 36px;
  background:
    radial-gradient(110% 90% at 20% 0%, rgba(255,255,255,0.06), transparent 60%),
    linear-gradient(155deg, var(--zju-ink) 0%, var(--zju) 48%, var(--accent) 100%);
  color: white;
  border-radius: 0 0 24px 24px;
  position: relative;
}
.hero .top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: rgba(255,255,255,0.72);
  margin-bottom: 18px;
  letter-spacing: 1px;
}
.hero .top-bar a { color: rgba(255,255,255,0.85); }
.hero .top-bar .right { display: flex; gap: 12px; align-items: center; }
.hero .top-bar .online {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px;
}
.hero .top-bar .online::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: #4FC3F7; box-shadow: 0 0 6px rgba(79,195,247,0.6);
}
.hero .top-bar .online.offline::before { background: #E57373; box-shadow: none; }

.hero h1 {
  font-size: 26px; font-weight: 700;
  letter-spacing: 4px;
  margin-bottom: 6px;
}
.hero .sub { font-size: 12px; color: rgba(255,255,255,0.62); letter-spacing: 2px; }
.hero .session-tag {
  display: inline-flex; align-items: center;
  margin-top: 18px;
  padding: 6px 14px;
  font-size: 12px; letter-spacing: 1px;
  color: rgba(255,255,255,0.88);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 20px;
  font-family: var(--mono);
}

/* ===== 分组标签 ===== */
.group { margin-bottom: 24px; }
.group-label {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 0 2px 10px;
}
.group-label .zh {
  font-size: 13px; color: var(--ink-2);
  font-weight: 600; letter-spacing: 2px;
}
.group-label .en {
  font-size: 10px; color: var(--ink-3);
  letter-spacing: 2px;
}
.group-label .count {
  font-size: 12px; color: var(--ink-3);
  font-family: var(--mono);
}

/* ===== 卡片 ===== */
.card {
  display: block;
  width: 100%;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  box-sizing: border-box;
}
.card h2 {
  font-size: 15px; font-weight: 600;
  color: var(--ink);
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}
.card .hint { font-size: 12px; color: var(--ink-3); margin-top: 6px; line-height: 1.6; }

.card.list-card { padding: 0; overflow: hidden; }
.card.list-card h2 { padding: 18px 18px 12px; margin-bottom: 0; }
.card.list-card .row { padding: 16px 18px; }
.card.list-card .subject-row { padding-left: 18px; padding-right: 18px; }

/* ===== 表单 ===== */
.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 12px;
  color: var(--ink-2); margin-bottom: 6px;
  font-weight: 500; letter-spacing: 0.5px;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 11px 13px;
  font-size: 16px;
  font-family: var(--font);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--ink);
  transition: border-color .15s, background .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #F8FBFF;
}
.field input.mono { font-family: var(--mono); letter-spacing: 1px; }
.field .help { font-size: 11px; color: var(--ink-3); margin-top: 4px; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--ink);
  cursor: pointer;
  transition: background .15s, transform .08s, border-color .15s;
  gap: 6px;
  letter-spacing: 0.5px;
}
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--zju); color: white; border-color: var(--zju); }
.btn.primary:active { background: var(--zju-ink); }
.btn.danger  { background: var(--error); color: white; border-color: var(--error); }
.btn.success { background: var(--success); color: white; border-color: var(--success); }
.btn.ghost   { background: transparent; border-color: var(--line); }
.btn.full    { width: 100%; }
.btn.sm      { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

/* ===== 徽章 / 状态 ===== */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 12px;
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.5px;
}
.badge.gray    { background: #F0F2F5; color: var(--ink-2); }
.badge.blue    { background: #E3F2FD; color: var(--accent); }
.badge.green   { background: var(--success-bg); color: var(--success); }
.badge.yellow  { background: #FFF8E1; color: #8A6D00; }
.badge.orange  { background: var(--warning-bg); color: var(--warning); }
.badge.red     { background: var(--error-bg); color: var(--error); }
.badge.indigo  { background: #EEF2FF; color: #4338CA; }
.badge.ad8 {
  border: 1px solid rgba(0,0,0,0.06);
  white-space: nowrap;
}

.ad8-stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}
.ad8-stat {
  border-radius: var(--radius-sm);
  padding: 8px 4px;
  text-align: center;
  background: #F0F2F5;
  color: var(--ink-2);
}
.ad8-stat .l {
  font-size: 10px;
  color: currentColor;
  line-height: 1.2;
}
.ad8-stat .v {
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  color: currentColor;
}
.ad8-stat.green { background: var(--success-bg); color: var(--success); }
.ad8-stat.yellow { background: #FFF8E1; color: #8A6D00; }
.ad8-stat.orange { background: var(--warning-bg); color: var(--warning); }
.ad8-stat.red { background: var(--error-bg); color: var(--error); }
.ad8-stat.gray { background: #F0F2F5; color: var(--ink-2); }

/* ===== 大编号 ===== */
.daily-num {
  font-size: 56px;
  font-weight: 700;
  color: var(--zju);
  letter-spacing: 2px;
  font-family: var(--mono);
  text-align: center;
  padding: 6px 0;
}

/* ===== 子任务进度 (三项) ===== */
.progress-pills {
  display: flex; gap: 6px;
  flex-wrap: wrap;
}
.progress-pills .pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: 11px;
  font-size: 11px;
  border: 1px solid var(--line);
  background: #F7F9FB;
  color: var(--ink-3);
  letter-spacing: 0.5px;
}
.progress-pills .pill.done {
  background: var(--success-bg);
  color: var(--success);
  border-color: #A5D6A7;
}
.progress-pills .pill.doing {
  background: var(--warning-bg);
  color: var(--warning);
  border-color: #FFCC80;
}
.progress-pills .pill.interrupted {
  background: #EEF2FF;
  color: #4338CA;
  border-color: #C7D2FE;
}
.progress-pills .pill .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: currentColor;
}

/* ===== 老人行 ===== */
.subject-row {
  display: flex; align-items: center;
  padding: 14px 0;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.subject-row:last-child { border-bottom: none; }
.subject-row-partial { background: linear-gradient(90deg, #F0F6FF 0%, transparent 35%); }
.subject-row .num {
  font-size: 20px; font-weight: 700;
  color: var(--zju);
  font-family: var(--mono);
  min-width: 38px;
  letter-spacing: 0;
}
.subject-row .info { flex: 1; min-width: 0; }
.subject-row .info .name { font-size: 15px; color: var(--ink); font-weight: 600; }
.subject-row .info .meta { font-size: 11px; color: var(--ink-3); margin-top: 2px; font-family: var(--mono); }
.subject-row .info .progress-pills { margin-top: 6px; }

/* ===== 工位 tile ===== */
.ws-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.workstation {
  display: flex; align-items: center;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: white;
  margin-bottom: 8px;
  gap: 12px;
  transition: border-color .15s;
}
.ws-grid .workstation {
  margin-bottom: 0;
  min-height: 108px;
  align-items: flex-start;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
}
.workstation.idle { border-color: #A5D6A7; background: #FAFFF9; }
.workstation.busy { border-color: #FFCC80; background: #FFFCF5; }
.workstation .ws-label {
  font-size: 13px; font-weight: 600;
  color: var(--ink);
  min-width: 86px;
  letter-spacing: 0.5px;
}
.workstation .ws-body {
  flex: 1; font-size: 13px; color: var(--ink-2);
  line-height: 1.4;
}
.ws-grid .workstation .ws-label { min-width: 0; width: 100%; }
.ws-grid .workstation .ws-body { width: 100%; }
.workstation .ws-done {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 4px;
  line-height: 1.35;
}
.workstation .ws-actions {
  display: flex;
  gap: 6px;
  width: 100%;
}
.workstation .ws-actions .btn { flex: 1; }
.workstation .ws-body .sid {
  font-family: var(--mono); font-weight: 700;
  color: var(--zju);
}
.workstation .ws-body .elapsed {
  font-size: 11px; color: var(--ink-3);
  margin-left: 6px;
}
.workstation .ws-body .idle-txt { color: var(--success); font-weight: 500; }

/* ===== 人员完成表 ===== */
.completion-table-wrap {
  padding: 0 18px 16px;
  overflow-x: auto;
}
table.subjects {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
table.subjects th,
table.subjects td {
  padding: 8px 4px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.subjects th {
  color: var(--ink-3);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 1px;
}
table.subjects td.num {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--zju);
}
table.subjects td.time {
  font-family: var(--mono);
  color: var(--ink-3);
  font-size: 11px;
}
table.completion-table { min-width: 640px; }
table.completion-table th,
table.completion-table td {
  text-align: center;
  vertical-align: middle;
}
table.completion-table th:nth-child(2),
table.completion-table td:nth-child(2) {
  text-align: left;
}
table.completion-table .badge {
  vertical-align: middle;
}

/* ===== Toast ===== */
.toast {
  position: fixed; top: 20px; left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: rgba(11,27,51,0.92);
  color: white;
  padding: 11px 20px;
  border-radius: 24px;
  font-size: 13px;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s, transform .2s;
  letter-spacing: 0.5px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--error); }
.toast.success { background: var(--success); }

/* ===== Modal ===== */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(11,27,51,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 9998;
  padding: 20px;
}
.modal {
  background: white;
  border-radius: var(--radius-lg);
  padding: 22px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal h3 {
  font-size: 17px; font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: 1px;
}

/* ===== 空状态 ===== */
.empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--ink-3);
  font-size: 13px;
  letter-spacing: 1px;
}
.empty .big { font-size: 36px; color: var(--line); margin-bottom: 8px; font-family: var(--mono); font-weight: 300; }

/* ===== Stat 卡片(管理统计) ===== */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.stat-card {
  background: white;
  border-radius: var(--radius-sm);
  padding: 16px;
  box-shadow: var(--shadow);
}
.stat-card .label {
  font-size: 11px; color: var(--ink-3);
  letter-spacing: 1.5px;
  font-weight: 500;
}
.stat-card .value {
  font-size: 30px; font-weight: 700;
  color: var(--ink);
  margin-top: 4px;
  font-family: var(--mono);
  letter-spacing: -1px;
}
.stat-card.accent .value { color: var(--zju); }
.stat-card.green .value  { color: var(--success); }
.stat-card.orange .value { color: var(--warning); }
.stat-card.red .value    { color: var(--error); }

/* ===== Tabs (顶部分段) ===== */
.tabs {
  display: flex; gap: 4px;
  background: #EDF0F4;
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 16px;
}
.tabs .tab {
  flex: 1;
  text-align: center;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--ink-2);
  border-radius: 8px;
  font-weight: 500;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.tabs .tab.active {
  background: white;
  color: var(--zju);
  box-shadow: 0 1px 2px rgba(11,27,51,0.08);
}

/* ===== FAB 浮动按钮 ===== */
.fab {
  position: fixed;
  right: 18px; bottom: 22px;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--zju);
  color: white;
  font-size: 28px;
  font-weight: 300;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,63,136,0.4);
  border: none;
  z-index: 100;
  cursor: pointer;
}
.fab:active { background: var(--zju-ink); }

/* ===== 竖屏 / 小屏优化 (师兄没做,我们来) ===== */
@media (max-width: 480px) {
  body.page-app { padding: 0 12px 60px; }
  .hero { padding: 26px 18px 32px; }
  .hero h1 { font-size: 22px; letter-spacing: 3px; }
  .card { padding: 14px; }
  .card.list-card .row, .card.list-card .subject-row { padding: 12px 14px; }
  .subject-row { padding: 12px 0; gap: 8px; }
  .subject-row .num { font-size: 18px; min-width: 32px; }
  .subject-row .info .name { font-size: 14px; }
  .subject-row .info .meta { font-size: 10px; }
  .workstation { padding: 10px 12px; gap: 8px; flex-wrap: wrap; }
  .workstation .ws-label { min-width: 60px; font-size: 13px; }
  .workstation .ws-body { font-size: 12px; }
  .workstation .btn.sm { padding: 4px 8px; font-size: 11px; min-height: 30px; }
  .daily-num { font-size: 44px; }
  .btn { min-height: 40px; padding: 8px 14px; font-size: 14px; }
  .btn.sm { min-height: 28px; padding: 4px 10px; font-size: 11px; }
  .modal { padding: 18px; }
  .modal h3 { font-size: 15px; margin-bottom: 12px; }
  .field input, .field select, .field textarea { padding: 10px 12px; font-size: 15px; }
  .tiny-stat-grid { grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .tiny-stat { padding: 8px 4px; }
  .tiny-stat .v { font-size: 18px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .stat-card { padding: 12px; }
  .stat-card .value { font-size: 24px; }
  .progress-pills { gap: 4px; }
  .progress-pills .pill { padding: 2px 7px; font-size: 10px; }
  .group-label .zh { font-size: 12px; }
  .group-label .en, .group-label .count { font-size: 9px; }
}
