:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e8edf5;
  --accent: #2f6bff;
  --accent-ink: #1d4ed8;
  --accent-soft: #eef3ff;
  --danger: #e5484d;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.03), 0 10px 28px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 12px 34px rgba(15, 23, 42, 0.1);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(720px 320px at 88% -8%, rgba(139, 92, 246, 0.07), transparent 62%),
    radial-gradient(720px 360px at -4% -10%, rgba(47, 107, 255, 0.09), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }
button { font-family: inherit; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.grow { flex: 1; }

/* ---------- 通用控件 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.15s;
  white-space: nowrap;
}
.btn:hover { background: #f8fafc; border-color: #d8dfe9; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(135deg, #3670ff 0%, #2b5fe6 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 18px rgba(47, 107, 255, 0.28);
}
.btn.primary:hover { background: linear-gradient(135deg, #2c64f2 0%, #2455d4 100%); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: #eef2f7; color: var(--ink); }
.btn.danger { background: var(--danger); border-color: transparent; color: #fff; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; height: 44px; font-size: 15px; }

.icon-btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: #eef2f7; color: var(--ink); }
.icon-btn.round { width: 32px; height: 32px; border: 1px solid var(--line); background: #fff; border-radius: 999px; font-size: 18px; }
.icon-btn.round:hover { background: var(--accent-soft); border-color: #c9d8ff; color: var(--accent-ink); }

.field { display: grid; gap: 6px; }
.field > span {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
}
.field > input,
.field > select {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field > input:focus,
.field > select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(47, 107, 255, 0.12);
}
.field > input::placeholder { color: #b3bccd; }
.field > span .hint {
  margin-left: 8px;
  font-style: normal;
  font-weight: 400;
  font-size: 11.5px;
  color: #9aa4b5;
}

.form-error {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff1f1;
  color: #c62a2f;
  font-size: 13px;
}

.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent-ink);
  font-size: 13px;
  cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }

/* ---------- 登录 ---------- */
.login-view {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  overflow: hidden;
  background:
    radial-gradient(900px 600px at 12% -10%, #e6eeff 0%, rgba(230, 238, 255, 0) 60%),
    radial-gradient(800px 600px at 105% 110%, #e7f7f1 0%, rgba(231, 247, 241, 0) 55%),
    #f7f9fc;
}
.login-deco {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
}
.login-deco-a {
  width: 320px;
  height: 320px;
  top: -120px;
  right: -80px;
  background: linear-gradient(135deg, rgba(47, 107, 255, 0.14), rgba(139, 92, 246, 0.1));
}
.login-deco-b {
  width: 260px;
  height: 260px;
  bottom: -110px;
  left: -60px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(14, 165, 233, 0.12));
}

.login-card {
  position: relative;
  width: 404px;
  max-width: 100%;
  padding: 30px 28px 22px;
  border-radius: 22px;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 28px 70px rgba(17, 24, 39, 0.12), 0 2px 6px rgba(17, 24, 39, 0.05);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.login-brand h1 { font-size: 21px; letter-spacing: -0.2px; }
.login-brand p { font-size: 12.5px; margin-top: 3px; color: var(--muted); }

.logo-mark {
  width: 46px;
  height: 46px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff;
  font-size: 21px;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(59, 130, 246, 0.28);
}
.logo-mark.sm { width: 34px; height: 34px; border-radius: 11px; font-size: 16px; box-shadow: none; }

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 20px;
  background: #f1f3f7;
  border-radius: 11px;
}
.tab {
  flex: 1;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.tab.is-active {
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.auth-form { display: grid; gap: 14px; }
.login-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

/* ---------- 应用布局 ---------- */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 252px;
  flex: 0 0 252px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 14px 14px;
  background: #fff;
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px 16px;
}
.brand-text { display: grid; gap: 2px; }
.brand-text strong { font-size: 15px; letter-spacing: -0.2px; }

.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 6px 8px;
  font-size: 12px;
  font-weight: 600;
  color: #9aa4b5;
  letter-spacing: 0.4px;
}

.class-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 8px;
}
.class-item {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.class-item:hover { background: #f6f8fb; }
.class-item.is-active {
  background: var(--accent-soft);
  border-color: #d5e2ff;
}
.class-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.class-item.is-active .class-name { color: var(--accent-ink); }
.class-meta { font-size: 11.5px; color: var(--muted); }
.class-empty { padding: 14px 10px; font-size: 12.5px; color: #9aa4b5; line-height: 1.7; }

.sidebar-foot { position: relative; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }

.user-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 12px;
}
.user-card:hover { background: #f7f9fc; }
.avatar {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 600;
}
.user-meta { display: grid; gap: 1px; min-width: 0; flex: 1; }
.user-meta strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.popover {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: 30;
  display: grid;
  gap: 2px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}
.popover button {
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
}
.popover button:hover { background: #f3f5f9; }
.popover button.danger { color: var(--danger); }

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 32px 12px;
}
.topbar-title h1 { font-size: 26px; letter-spacing: -0.6px; }
.topbar-title p { margin-top: 4px; font-size: 13px; }
.topbar-actions { display: flex; gap: 8px; }

.date-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 32px 12px;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  flex-wrap: wrap;
}
.date-input {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink-2);
  outline: none;
  cursor: pointer;
}
.date-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.1); }
.date-label { font-size: 13px; color: var(--ink-2); font-weight: 500; margin-left: 4px; }
.stat { font-size: 12.5px; color: var(--muted); }

/* ---------- 作业列表 ---------- */
.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #9aa4b5;
}
.list-head .stat { color: #9aa4b5; font-size: 12px; font-weight: 500; letter-spacing: 0; }

.record-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 32px 44px;
}

.record {
  display: flex;
  gap: 12px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.16s, box-shadow 0.16s, border-color 0.16s;
}
.record:hover {
  transform: translateY(-1px);
  border-color: #dbe4f3;
  box-shadow: var(--shadow-md);
}
.record-main { flex: 1; min-width: 0; }
.record-subject {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 14.5px;
  font-weight: 600;
  margin-bottom: 7px;
}
.subject-dot {
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
}
.record-range {
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f4f9;
  font-size: 11.5px;
  font-weight: 500;
  color: #6b7a90;
}
.record-text {
  font-size: 14px;
  line-height: 1.9;
  color: #3d4757;
  word-break: break-word;
  counter-reset: hw-item;
}
.record-text .line {
  display: block;
  counter-increment: hw-item;
}
.record-text .line::before {
  content: counter(hw-item) '. ';
  color: #8fa3bf;
  font-weight: 600;
}
.record-ops {
  display: flex;
  gap: 2px;
  align-items: flex-start;
  flex: none;
}
.record-ops .icon-btn { width: 28px; height: 28px; font-size: 14px; opacity: 0.4; }
.record:hover .record-ops .icon-btn { opacity: 1; }

.dot { width: 8px; height: 8px; flex: none; border-radius: 50%; }

/* ---------- 科目选择 ---------- */
.pick-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pick {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-2);
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.pick:hover { border-color: #c9d8ff; }
.pick.is-active {
  border-color: #b9ceff;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 600;
}
.pick.is-static { cursor: default; }
.pick .dot { width: 7px; height: 7px; }
.pick-x {
  border: 0;
  background: transparent;
  padding: 0 0 0 2px;
  color: #a8b2c1;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
.pick-x:hover { color: var(--danger); }

.inline-add { display: flex; gap: 10px; }
.inline-add input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 1.5px dashed #d4dbe6;
  border-radius: 12px;
  background: #fff;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, border-style 0.15s;
}
.inline-add input:focus {
  border-style: solid;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(47, 107, 255, 0.1);
}
.inline-add input::placeholder { color: #b3bccd; }
.inline-add .btn { height: 44px; padding: 0 18px; font-size: 14px; }

.empty-day {
  margin: 18px 32px 40px;
  padding: 46px 24px;
  display: grid;
  justify-items: center;
  gap: 14px;
  background: #fff;
  border: 1px dashed #dbe2ec;
  border-radius: 18px;
  text-align: center;
  font-size: 13.5px;
}
.dialog-danger {
  margin-top: 2px;
  padding-top: 14px;
  border-top: 1px solid #f1f3f7;
}

/* ---------- 空状态 ---------- */
.empty-state {
  padding: 70px 32px 100px;
  text-align: center;
}
.empty-art {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 28px;
}
.empty-state h2 { font-size: 18px; margin-bottom: 8px; }
.empty-state p { font-size: 13.5px; margin-bottom: 20px; }

/* ---------- 弹窗 ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(6px);
  animation: fade-in 0.16s ease-out;
  overflow-y: auto;
}
.dialog {
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  margin: auto 0;
  padding: 24px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 32px 90px rgba(15, 23, 42, 0.3);
  animation: pop-in 0.18s ease-out;
}
.dialog h3 { font-size: 16.5px; }
.dialog-body {
  display: grid;
  gap: 14px;
  margin: 16px 0 20px;
}
.dialog-body p.text { font-size: 13.5px; line-height: 1.7; color: var(--ink-2); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }

.item-list {
  display: grid;
  gap: 10px;
}
.item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 8px 0 6px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.item-row:focus-within {
  border-color: var(--accent);
  background: #fdfefe;
  box-shadow: 0 0 0 4px rgba(47, 107, 255, 0.12);
}
.item-no {
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  margin-left: 2px;
  border-radius: 50%;
  background: #eef3ff;
  color: #2f5bff;
  font-size: 14px;
  font-weight: 600;
}
.item-row:not(.has-text) .item-no { background: #f1f4f8; color: transparent; }
.item-input {
  flex: 1;
  min-width: 0;
  display: block;
  height: auto;
  min-height: 48px;
  padding: 12px 2px;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  overflow: hidden;
  resize: none;
  field-sizing: content;
}
.item-input::placeholder { color: #b3bccd; }
.item-row.is-sub { margin-left: 34px; }
.item-row.is-sub .item-no { background: transparent; color: #8fa3bf; }
.item-indent {
  flex: none;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #a8b2c1;
  font-size: 15px;
  cursor: pointer;
  opacity: 0;
  transition: color 0.15s, opacity 0.15s;
}
.item-row:hover .item-indent,
.item-row:focus-within .item-indent { opacity: 1; }
.item-indent:hover { color: var(--accent-ink); }
.item-del {
  flex: none;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #a8b2c1;
  font-size: 15px;
  cursor: pointer;
  opacity: 0;
  transition: color 0.15s, opacity 0.15s;
}
.item-row:hover .item-del,
.item-row:focus-within .item-del { opacity: 1; }
.item-del:hover { color: var(--danger); }
.record-text .line.sub {
  counter-increment: none;
  margin-left: 30px;
  color: #64748b;
}
.record-text .line.sub::before {
  content: '· ';
  color: #8fa3bf;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.add-item { margin-top: 2px; height: 44px; width: 100%; }
.dialog-textarea {
  width: 100%;
  min-height: 132px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink);
  outline: none;
  resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.dialog-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(47, 107, 255, 0.12);
}
.dialog-textarea::placeholder { color: #b3bccd; }

.check-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.check-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.check-chip input { display: none; }
.check-chip:hover { border-color: #c9d8ff; }
.check-chip:has(input:checked) {
  background: var(--accent-soft);
  border-color: #b9ceff;
  color: var(--accent-ink);
  font-weight: 500;
}

.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch {
  width: 24px;
  height: 24px;
  border: 2px solid transparent;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
  transition: transform 0.12s;
}
.swatch:hover { transform: scale(1.1); }
.swatch.is-active { border-color: #fff; outline: 2px solid #93b1ff; outline-offset: 1px; }

.preview-dialog { width: 560px; }
.preview-frame {
  display: flex;
  justify-content: center;
  margin: 14px 0 8px;
  max-height: 58vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(45deg, #f7f8fa 25%, transparent 25%) -8px 0/16px 16px,
    linear-gradient(-45deg, #f7f8fa 25%, transparent 25%) -8px 0/16px 16px,
    linear-gradient(45deg, transparent 75%, #f7f8fa 75%) 0 0/16px 16px,
    linear-gradient(-45deg, transparent 75%, #f7f8fa 75%) 0 0/16px 16px,
    #fcfcfd;
}
.preview-frame img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 56vh;
}
.preview-meta { margin-bottom: 16px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  z-index: 200;
  transform: translateX(-50%);
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.92);
  color: #fff;
  font-size: 13px;
  box-shadow: var(--shadow-md);
  animation: toast-in 0.2s ease-out;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- 移动端 ---------- */
@media (max-width: 880px) {
  .app { display: block; height: auto; min-height: 100vh; }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 40;
    width: auto;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
  }
  .brand { display: none; }
  .brand-text { display: none; }
  .side-head { flex: none; padding: 0; }
  .side-head > span { display: none; }
  .class-list {
    flex-direction: row;
    flex: 1 1 0;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 6px;
    padding: 0;
    scrollbar-width: none;
  }
  .class-list::-webkit-scrollbar { display: none; }
  .class-item { width: auto; flex: 0 0 auto; padding: 7px 12px; white-space: nowrap; }
  .class-meta { display: none; }
  .sidebar-foot { margin: 0; padding: 0; border: 0; flex: none; margin-left: auto; }
  .user-card { padding: 4px; }
  .user-meta, .user-card > .icon-btn { display: none; }
  .popover { left: auto; right: 0; bottom: auto; top: calc(100% + 8px); width: 180px; }

  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 16px 16px 8px;
  }
  .topbar-title h1 { font-size: 21px; }
  .topbar-actions { justify-content: flex-end; }
  .topbar-actions .btn { height: 34px; padding: 0 12px; font-size: 13px; }
  .date-bar { margin: 0 16px 10px; padding: 8px 10px; gap: 6px; row-gap: 6px; border-radius: 14px; }
  .date-bar .grow { display: none; }
  .date-input { width: 126px; flex: none; }
  #todayBtn { order: 9; }
  .date-label { order: 10; flex: 1 1 auto; width: auto; margin-left: 0; font-size: 12.5px; }
  .list-head { padding: 0 16px 6px; }
  .record-list { padding: 0 16px 26px; gap: 10px; }
  .record { padding: 14px 14px; gap: 14px; border-radius: 14px; }
  .record-ops .icon-btn { opacity: 0.55; }
  .empty-day { margin: 14px 16px 30px; padding: 38px 18px; }
  .empty-state { padding: 50px 16px 80px; }
  .dialog { padding: 18px; border-radius: 16px; max-width: none; max-height: calc(100dvh - 28px); }
  .overlay { padding: 14px; }
  .field-row { grid-template-columns: 1fr; }
  .item-row.is-sub { margin-left: 22px; }
  .dialog-body { margin: 14px 0 16px; }
  .preview-dialog { width: 100%; }
  .preview-frame { max-height: 48vh; }
  .preview-frame img { max-height: 46vh; }
  .overlay { padding: 14px; }
}
