:root {
  --bg: #f5f6fb;
  --bg-grad: radial-gradient(1200px 600px at 10% -10%, #e8ecff 0%, transparent 60%),
             radial-gradient(900px 500px at 100% 0%, #e6f7f4 0%, transparent 55%);
  --surface: #ffffff;
  --surface-2: #fafbff;
  --ink: #0f172a;
  --ink-2: #344054;
  --muted: #7a8699;
  --line: #e8eaf3;
  --brand: #4f46e5;
  --brand-2: #6366f1;
  --brand-soft: #eef0ff;
  --ok: #0e9f6e;
  --ok-soft: #e8f8f1;
  --busy: #e8590c;
  --busy-soft: #fff2e8;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 32px -12px rgba(16, 24, 40, .12);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding-bottom: 60px;
  overflow-x: hidden;
}

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h3 { font-size: 16px; }
p { margin: 0; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 28px;
  background: rgba(255, 255, 255, .78);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -.02em;
  white-space: nowrap;
}

.logo {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), #8b5cf6);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  box-shadow: 0 4px 12px -4px rgba(79, 70, 229, .6);
}

.tabs {
  display: flex;
  gap: 4px;
  margin-left: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: .16s;
}
.tab:hover { color: var(--ink-2); background: rgba(15, 23, 42, .04); }
.tab.active { color: var(--brand); background: var(--brand-soft); font-weight: 600; }

.who { margin-left: auto; }

/* ---------- layout ---------- */
main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 26px 20px 0;
}

.view { display: none; animation: fade .22s ease; }
.view.active { display: block; }

@keyframes fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin-bottom: 16px;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.spacer { flex: 1; }

/* ---------- buttons ---------- */
.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 550;
  padding: 9px 16px;
  cursor: pointer;
  transition: .16s;
  white-space: nowrap;
}
.btn.primary {
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
  color: #fff;
  box-shadow: 0 6px 16px -8px rgba(79, 70, 229, .9);
}
.btn.primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn.primary:active { transform: none; }
.btn.primary:disabled { opacity: .55; cursor: not-allowed; transform: none; }

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

.btn.sm { padding: 7px 13px; font-size: 13px; }
.btn.xs { padding: 5px 10px; font-size: 12px; border-radius: 8px; }

/* ---------- upload banner（主页首屏入口） ---------- */
.upload-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 20px;
  margin-bottom: 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 52%, #0ea5e9 100%);
  color: #fff;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 12px 30px -16px rgba(79, 70, 229, .95);
  transition: transform .16s, box-shadow .16s;
}
.upload-banner:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px -16px rgba(79, 70, 229, 1);
}
.upload-banner:active { transform: none; }

.ub-icon {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 19px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .18);
  backdrop-filter: blur(4px);
}
.ub-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ub-text b { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.ub-text span {
  font-size: 12.5px;
  opacity: .88;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ub-arrow { margin-left: auto; font-size: 17px; opacity: .85; flex: none; }

/* ---------- query panel ---------- */
.query-panel { padding: 18px 22px 16px; }

.q-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 0;
}
.q-row + .q-row { border-top: 1px dashed var(--line); }

.q-label {
  width: 42px;
  flex: none;
  font-size: 13px;
  color: var(--muted);
  font-weight: 550;
}

.chips { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }

.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font: inherit;
  font-size: 13.5px;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: .15s;
  white-space: nowrap;
}
.chip:hover { border-color: #cdd3e6; background: var(--surface-2); }
.chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px -5px rgba(79, 70, 229, .8);
}
.chip .today-dot {
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  margin-left: 5px;
  vertical-align: middle;
  opacity: .65;
}

.timepick {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

input[type="time"], input[type="text"], input[type="password"], select {
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  padding: 8px 11px;
  outline: none;
  transition: .15s;
}
input[type="time"]:focus, input[type="text"]:focus, input[type="password"]:focus, select:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .14);
}
input[type="time"] { width: 118px; font-variant-numeric: tabular-nums; }

.tilde { color: var(--muted); }

.quick { display: flex; gap: 4px; margin-left: 6px; }
.quick button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  padding: 5px 9px;
  border-radius: 8px;
  cursor: pointer;
}
.quick button:hover { background: var(--brand-soft); color: var(--brand); }

.q-hint {
  font-size: 12.5px;
  color: var(--muted);
  padding-top: 6px;
}

/* ---------- friends ---------- */
.friends-panel { padding: 16px 20px; }

.friend-add {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.friend-add input { flex: 1 1 220px; min-width: 0; }
#friendHint { flex: 1 1 100%; }

.friend-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.friend-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px 5px 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font: inherit;
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
  transition: .15s;
}
.friend-chip:hover { border-color: #cdd3e6; background: var(--surface-2); }
.friend-chip.active {
  background: var(--brand-soft);
  border-color: #c7ccff;
  color: var(--brand);
  font-weight: 600;
}

.fc-avatar {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 11px;
  font-weight: 650;
  flex: none;
}
.fc-name { max-width: 8em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-x {
  font-style: normal;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
  border-radius: 4px;
  opacity: .35;
  transition: .15s;
}
.friend-chip:hover .fc-x { opacity: 1; }
.fc-x:hover { color: #b42318; background: #fef2f2; }

.friend-empty { font-size: 12.5px; color: var(--muted); line-height: 1.6; }

/* 待处理好友请求 */
.friend-requests { margin-bottom: 12px; }
.req-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 12px;
  margin-bottom: 8px;
  background: #fffaeb;
  border: 1px solid #fde3a7;
  border-radius: 10px;
  font-size: 13px;
  color: #7a4a03;
}
.req-who { flex: 1 1 auto; min-width: 0; }

/* AI 识别次数 */
.ai-quota {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}
.ai-quota.used { color: #b42318; font-weight: 550; }

/* ---------- results ---------- */
.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.res { margin-bottom: 16px; padding: 18px 20px; }

.res-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex: none;
}
.dot.ok { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.dot.busy { background: var(--busy); box-shadow: 0 0 0 4px var(--busy-soft); }

.count {
  font-size: 12px;
  font-weight: 650;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.people-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 420px;
  overflow-y: auto;
}

.person {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid transparent;
  transition: .14s;
}
.person:hover { border-color: var(--line); }
.person.selectable { cursor: pointer; }
.person.selected {
  background: var(--brand-soft);
  border-color: #c7ccff;
}

.avatar {
  width: 28px; height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 12.5px;
  font-weight: 650;
  color: #fff;
  flex: none;
  letter-spacing: -.02em;
}

.person-name { font-size: 14px; font-weight: 550; }

.person-note {
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
  text-align: right;
  line-height: 1.45;
  max-width: 58%;
}

.tag-busy {
  display: inline-block;
  font-size: 11.5px;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--busy-soft);
  color: #b8500a;
  margin-left: 4px;
  font-weight: 600;
}

.empty {
  color: var(--muted);
  font-size: 13.5px;
  padding: 14px 4px;
  text-align: center;
}

/* ---------- cofree ---------- */
#cofreeBody {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 6px 28px;
}
.cofree-day { margin-bottom: 12px; }
.cofree-day:last-child { margin-bottom: 0; }
.cofree-dt {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cofree-dt .badge {
  font-size: 11px;
  color: var(--ok);
  background: var(--ok-soft);
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 600;
}
.slot {
  display: inline-block;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  background: var(--ok-soft);
  color: #0b7a55;
  border-radius: 9px;
  padding: 6px 11px;
  margin: 0 6px 6px 0;
  font-weight: 550;
}

/* ---------- week grid ---------- */
.grid-wrap {
  overflow-x: auto;
  padding-bottom: 6px;
}

.grid {
  min-width: 820px;
  position: relative;
}

.grid-head {
  display: flex;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 2;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}

.grid-name-col {
  width: 96px;
  flex: none;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: flex-end;
  padding-bottom: 4px;
}

.grid-hours {
  flex: 1;
  position: relative;
  height: 22px;
}
.grid-hours span {
  position: absolute;
  font-size: 11.5px;
  color: var(--muted);
  transform: translateX(-50%);
  font-variant-numeric: tabular-nums;
  top: 2px;
}

.grid-row {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
  min-height: 46px;
}
.grid-row:last-child { border-bottom: 0; }

.grid-row .grid-name-col {
  align-items: center;
  padding-bottom: 0;
  font-size: 13px;
  color: var(--ink);
  font-weight: 550;
  display: flex;
  gap: 8px;
}

.grid-track {
  flex: 1;
  position: relative;
  height: 46px;
  background-image: repeating-linear-gradient(to right, #eceefa 0 1px, transparent 1px 100%);
  background-size: calc(100% / 14) 100%;
}

.bar {
  position: absolute;
  top: 7px;
  bottom: 7px;
  border-radius: 7px;
  font-size: 11.5px;
  padding: 0 7px;
  display: flex;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
  color: #fff;
  font-weight: 550;
  text-overflow: ellipsis;
  box-shadow: 0 2px 8px -4px rgba(16, 24, 40, .4);
  cursor: default;
}
.bar:hover { filter: brightness(1.05); z-index: 3; }
.bar span { overflow: hidden; text-overflow: ellipsis; }

.legend { display: flex; gap: 12px; font-size: 12px; color: var(--muted); align-items: center; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--brand); margin-right: 5px; vertical-align: -1px; }

.grid-row.me .grid-name-col { color: var(--brand); font-weight: 700; }
.grid-row.me { background: linear-gradient(90deg, rgba(99, 102, 241, .05), transparent 40%); }

.bar.special {
  background: repeating-linear-gradient(45deg, #94a3b8, #94a3b8 5px, #b6c0d0 5px, #b6c0d0 10px) !important;
}

.row-empty {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 11.5px;
  color: #c2c9d6;
  pointer-events: none;
}

.now-line {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: #ef4444;
  border-radius: 2px;
  opacity: .5;
  pointer-events: none;
  z-index: 4;
}

.week-summary {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.week-summary b { color: var(--ink-2); font-weight: 650; }

/* ---------- add / sub tabs ---------- */
.sub-tabs {
  display: inline-flex;
  background: var(--bg);
  border-radius: 12px;
  padding: 3px;
  gap: 2px;
  margin-bottom: 18px;
}
.sub-tab {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13.5px;
  font-weight: 550;
  color: var(--muted);
  padding: 7px 16px;
  border-radius: 9px;
  cursor: pointer;
}
.sub-tab.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.sub-view { display: none; }
.sub-view.active { display: block; }

/* ---------- dropzone ---------- */
.dropzone {
  border: 2px dashed #cfd5ea;
  border-radius: 16px;
  padding: 48px 20px;
  text-align: center;
  cursor: pointer;
  transition: .18s;
  background: var(--surface-2);
}
.dropzone:hover, .dropzone.drag {
  border-color: var(--brand-2);
  background: var(--brand-soft);
}
.dz-icon { font-size: 26px; color: var(--brand); margin-bottom: 8px; }
.dz-title { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.dz-sub { font-size: 12.5px; color: var(--muted); }

.preview { margin-top: 16px; text-align: center; }
.preview img {
  max-width: 100%;
  max-height: 380px;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.preview-actions { margin-top: 14px; display: flex; gap: 10px; justify-content: center; }

.ai-status {
  margin-top: 14px;
  font-size: 13.5px;
  padding: 12px 15px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  display: flex;
  align-items: center;
  gap: 10px;
}
.ai-status.error { background: #fef2f2; color: #b42318; }

.spinner {
  width: 15px; height: 15px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- manual form ---------- */
.manual-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 16px;
}
.manual-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 550;
}
.manual-form input, .manual-form select { width: 100%; }
.form-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

/* ---------- edit table ---------- */
.edit-table-wrap { overflow-x: auto; }

.edit-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
  min-width: 860px;
}
.edit-table .sec-input { width: 72px; text-align: center; }
.edit-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 0 8px 8px;
}
.edit-table td { padding: 4px 6px; }
.edit-table input, .edit-table select {
  width: 100%;
  padding: 7px 9px;
  font-size: 13.5px;
  border-radius: 8px;
}
.edit-table .del {
  border: 0;
  background: transparent;
  color: #b42318;
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  border-radius: 8px;
}
.edit-table .del:hover { background: #fef2f2; }
.edit-table tr.dim td { opacity: .45; }

/* ---------- modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .42);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 20px;
  animation: fade .18s ease;
}
.modal-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 26px 26px 22px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 24px 60px -20px rgba(15, 23, 42, .4);
}
.modal-card h2 { font-size: 19px; margin-bottom: 6px; }
.modal-card p { margin-bottom: 18px; line-height: 1.55; }
.modal-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 550;
  margin-bottom: 14px;
}
.modal-card input { width: 100%; }
.modal-card input[list] { padding-right: 32px; }

/* 学校联想下拉 */
.school-field { position: relative; }
.school-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 32px -12px rgba(16, 24, 40, .22);
  padding: 4px;
  z-index: 20;
  max-height: 220px;
  overflow-y: auto;
}
.ss-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink-2);
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.ss-item:hover { background: var(--brand-soft); color: var(--brand); }
.ss-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-meta { font-size: 11.5px; color: var(--muted); flex: none; }
.ss-empty {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
  padding: 8px 10px;
}

.modal-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 9px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  background: #101828;
  color: #fff;
  font-size: 13.5px;
  padding: 11px 18px;
  border-radius: 12px;
  box-shadow: 0 12px 32px -12px rgba(0, 0, 0, .5);
  opacity: 0;
  pointer-events: none;
  transition: .22s;
  z-index: 200;
  max-width: 90vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- mine ---------- */
.school-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  padding: 12px 14px;
  margin-bottom: 16px;
}
.school-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.school-name { font-size: 14px; font-weight: 650; }
.src-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}
.src-badge.ok { background: var(--ok-soft); color: #0b7a55; }
.src-badge.warn { background: #fff7e6; color: #b45309; }

.sections-panel { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.sec-tip { margin-bottom: 10px; line-height: 1.6; }
.sec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 8px 14px;
  margin-bottom: 12px;
}
.sec-row { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.sec-no { width: 48px; color: var(--muted); flex: none; }
.sec-row input[type="time"] { width: 98px; padding: 5px 7px; font-size: 12.5px; }
.sec-dash { color: var(--muted); }

.mine-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

.course-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  margin-bottom: 7px;
  font-size: 13.5px;
}
.course-row .cday {
  font-size: 12px;
  font-weight: 650;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 3px 8px;
  border-radius: 7px;
  flex: none;
}
.course-row .ctime { font-variant-numeric: tabular-nums; color: var(--ink-2); flex: none; }
.course-row .ctitle { font-weight: 550; }
.course-row .cmeta { color: var(--muted); font-size: 12.5px; }
.course-row .del {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: #b42318;
  cursor: pointer;
  font-size: 15px;
  padding: 2px 7px;
  border-radius: 7px;
}
.course-row .del:hover { background: #fef2f2; }

/* ---------- 账号按钮 / 账号弹窗 ---------- */
.account-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font: inherit;
  font-size: 13.5px;
  font-weight: 550;
  color: var(--ink-2);
  cursor: pointer;
  transition: .15s;
}
.account-btn:hover { border-color: #cdd3e6; background: var(--surface-2); }
.acc-av {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 12px;
  font-weight: 650;
  flex: none;
}
.acc-nm { max-width: 7em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.acc-card {
  max-width: 580px;
  padding: 22px 24px 16px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
}
.acc-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}
.acc-avatar {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 18px;
  font-weight: 650;
  flex: none;
}
.acc-id { min-width: 0; }
.acc-id h2 { font-size: 17px; }
.acc-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--muted);
}
.acc-close {
  margin-left: auto;
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 0 8px;
  border-radius: 8px;
}
.acc-close:hover { background: var(--bg); color: var(--ink); }

.acc-body { overflow-y: auto; flex: 1; }
.acc-section { padding: 13px 0; border-bottom: 1px solid var(--line); }
.acc-section:last-of-type { border-bottom: 0; }
.acc-sec-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13.5px;
}
.acc-courses { max-height: 240px; overflow-y: auto; }
.acc-sub-actions { margin-top: 8px; }
.acc-sec-fold summary {
  cursor: pointer;
  font-size: 13.5px;
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 0 0 10px;
}
.acc-sec-fold summary::marker { color: var(--muted); }
.acc-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  margin-top: 4px;
  border-top: 1px solid var(--line);
}

/* ---------- 上传区（内嵌主页） ---------- */
.upload-panel { padding: 18px 20px; }
.upload-panel .sub-tabs {
  display: flex;
  align-items: center;
  width: 100%;
  background: transparent;
  padding: 0;
  margin-bottom: 14px;
}
.upload-panel .sub-tab { background: transparent; }
.upload-panel .sub-tab.active { background: var(--brand-soft); color: var(--brand); }
.upload-panel .dropzone { padding: 34px 20px; }

/* ---------- tips ---------- */
.panel.tips h3 { margin-bottom: 16px; }
.tips-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.tip { display: flex; gap: 12px; align-items: flex-start; }
.tip-n {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.tip b { font-size: 13.5px; font-weight: 650; display: block; margin-bottom: 4px; }
.tip p { font-size: 12.5px; color: var(--muted); line-height: 1.6; }

/* ---------- responsive ---------- */
@media (max-width: 780px) {
  .topbar { padding: 10px 12px; gap: 6px; flex-wrap: nowrap; }
  .brand span:last-child { display: none; }
  .tabs { margin-left: 0; margin-right: 0; flex: 1 1 auto; min-width: 0; }
  .who { flex: none; }
  .who .muted { display: none; }
  main { padding: 16px 12px 0; }
  .panel { padding: 16px; border-radius: 16px; }
  .result-grid { grid-template-columns: 1fr; }
  .upload-banner { padding: 13px 15px; gap: 12px; border-radius: 14px; }
  .ub-icon { width: 34px; height: 34px; font-size: 17px; border-radius: 10px; }
  .ub-text b { font-size: 14px; }
  .ub-text span { font-size: 11.5px; }
  .q-row { display: block; }
  .q-row + .q-row { padding-top: 12px; }
  .q-label { width: auto; margin-bottom: 8px; }
  .q-row .chips { width: 100%; }
  .timepick { width: 100%; }
  .manual-form { grid-template-columns: 1fr 1fr; }
  .quick { margin-left: 0; }
  .person-note { max-width: 50%; }
  .tips-grid { grid-template-columns: 1fr; gap: 16px; }
  #cofreeBody { grid-template-columns: 1fr; }
  .acc-nm { max-width: 4.5em; }
  .acc-card { padding: 18px 16px 14px; max-height: 90vh; }
  .acc-avatar { width: 36px; height: 36px; font-size: 16px; border-radius: 11px; }
  .acc-id h2 { font-size: 16px; }
  .upload-panel { padding: 14px; }
  .upload-panel .dropzone { padding: 26px 14px; }
}
