@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=Noto+Sans+SC:wght@400;500;700&display=swap");

:root {
  --bg: #eef2f6;
  --bg-elevated: #f7f9fc;
  --card: #ffffff;
  --text: #142033;
  --text-secondary: #3d4f66;
  --muted: #6b7c93;
  --line: #d8e0ea;
  --line-strong: #b8c5d6;
  --brand: #0c6e6b;
  --brand-hover: #095956;
  --brand-soft: #e6f4f3;
  --brand-ink: #064e4c;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --warn: #b54708;
  --warn-soft: #fffaeb;
  --ok: #027a48;
  --ok-soft: #ecfdf3;
  --info: #175cd3;
  --info-soft: #eff8ff;
  --shadow: 0 1px 2px rgba(20, 32, 51, 0.06), 0 8px 24px rgba(20, 32, 51, 0.06);
  --radius: 12px;
  --radius-sm: 8px;
  --focus: 0 0 0 3px rgba(12, 110, 107, 0.28);
  --font: "IBM Plex Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --topbar-h: 60px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(1200px 400px at 10% -10%, rgba(12, 110, 107, 0.08), transparent 60%),
    radial-gradient(900px 360px at 100% 0%, rgba(23, 92, 211, 0.06), transparent 55%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--brand);
  text-decoration: none;
}
a:hover { color: var(--brand-hover); text-decoration: underline; }
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: 8px 14px;
  z-index: 1000;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus {
  left: 0;
  box-shadow: var(--focus);
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 28, 46, 0.96);
  backdrop-filter: blur(10px);
  color: #fff;
  min-height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff !important;
  text-decoration: none !important;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.01em;
  flex-shrink: 0;
}
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(145deg, #1aa6a1, #0c6e6b);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
}
.nav-toggle:hover { background: rgba(255, 255, 255, 0.08); }

.topbar-menus {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  justify-content: flex-end;
  min-width: 0;
}
.topbar-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}
.topbar-nav a {
  color: #c9d6e5;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 10px;
  border-radius: 8px;
  white-space: nowrap;
}
.topbar-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}
.topbar-nav a.is-active,
.topbar-nav a[aria-current="page"] {
  color: #fff;
  background: rgba(26, 166, 161, 0.28);
}
.topbar-nav a.nav-muted {
  color: #8a9bb0;
  font-weight: 400;
}
.topbar-nav a.nav-muted:hover { color: #d5e0ec; }
.topbar-nav a.nav-muted.is-active,
.topbar-nav a.nav-muted[aria-current="page"] {
  color: #e8eef5;
  background: rgba(255, 255, 255, 0.1);
}
.topbar-account {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}
.nav-user-name {
  font-size: 13px;
  color: #9eb0c4;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-logout {
  color: #c9d6e5;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
}
.nav-logout:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}
/* ---------- Layout ---------- */
.wrap {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 18px;
}
.page-header h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.page-desc {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  max-width: 56ch;
}
.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.card-title {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 650;
}
.card-flush { padding: 0; overflow: hidden; }
.card-flush .card-body { padding: 16px 20px; }

h1, h2, h3 { color: var(--text); }
h2 { margin: 0 0 12px; font-size: 18px; }
.muted { color: var(--muted); font-size: 14px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ---------- Flash ---------- */
.flash-list { margin-bottom: 16px; display: grid; gap: 8px; }
.flash {
  background: var(--ok-soft);
  color: var(--ok);
  border: 1px solid #a6f4c5;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
}

/* ---------- Buttons ---------- */
.btn,
button,
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--brand);
  color: #fff;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 560;
  font-family: inherit;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover,
button:hover,
input[type="submit"]:hover {
  background: var(--brand-hover);
  color: #fff;
  text-decoration: none;
}
.btn-secondary {
  background: #44566e;
}
.btn-secondary:hover { background: #334557; }
.btn-danger {
  background: var(--danger);
}
.btn-danger:hover { background: #912018; }
.btn-ghost {
  background: transparent;
  color: var(--brand-ink);
  border-color: var(--line-strong);
}
.btn-ghost:hover {
  background: var(--brand-soft);
  color: var(--brand-ink);
  border-color: #9fd0cd;
}
.btn-sm {
  padding: 5px 10px;
  font-size: 13px;
}
.btn-link {
  background: transparent;
  color: var(--brand);
  border: none;
  padding: 4px 6px;
  font-weight: 500;
}
.btn-link:hover {
  background: var(--brand-soft);
  color: var(--brand-hover);
}

/* ---------- Forms ---------- */
.form-row { margin-bottom: 14px; }
.form-row label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-secondary);
}
.form-hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}
.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.field-row .form-row { flex: 1; min-width: 160px; }

input[type="text"],
input[type="password"],
input[type="number"],
input[type="datetime-local"],
input[type="search"],
select,
textarea {
  width: 100%;
  max-width: 560px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:hover,
select:hover,
textarea:hover { border-color: #8ea0b5; }
input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: var(--focus);
}
textarea { min-height: 120px; max-width: 100%; resize: vertical; }
.input-sm { max-width: 220px; }
.input-xs { max-width: 120px; }

.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  margin: 8px 0;
}
.check-inline input { width: auto; max-width: none; }

/* ---------- Toolbar / filters ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}

/* Word 导入预览：顶部操作 + 吸底操作，避免长列表滚到底才确认 */
.import-preview {
  padding-bottom: 0;
}
.import-preview .import-actions {
  margin-bottom: 16px;
}
.import-preview .import-actions-sticky {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin: 16px -22px 0;
  padding: 12px 22px;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 -6px 16px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(6px);
}
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  padding: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}
.filter-bar .form-row {
  margin: 0;
  min-width: 140px;
}
.filter-bar label {
  font-size: 12px;
  margin-bottom: 4px;
}
.filter-bar select,
.filter-bar input {
  max-width: 200px;
}

/* ---------- Table ---------- */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: #fff;
}
table.data-table th,
table.data-table td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}
table.data-table th {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
table.data-table tbody tr:hover { background: #f8fbfb; }
table.data-table tbody tr:last-child td { border-bottom: none; }
table.data-table .col-actions {
  white-space: nowrap;
  min-width: 120px;
  width: 1%;
}
.actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.num {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* ---------- Badge / status ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--info-soft);
  color: var(--info);
  line-height: 1.5;
}
.badge.draft { background: var(--warn-soft); color: var(--warn); }
.badge.published { background: var(--ok-soft); color: var(--ok); }
.badge.submitted { background: var(--info-soft); color: var(--info); }
.badge.graded { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }

.next-step {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 16px;
  padding: 14px 18px;
  background: var(--brand-soft);
  border: 1px solid rgba(12, 110, 107, 0.22);
  border-radius: var(--radius);
}
.next-step strong { display: block; color: var(--brand-ink); }
.next-step p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
}
.next-step-soft {
  background: var(--bg-elevated);
  border-color: var(--line);
}
.next-step-soft strong { color: var(--text); }

/* ---------- Empty / pager / stats ---------- */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}
.empty-state strong {
  display: block;
  color: var(--text);
  font-size: 16px;
  margin-bottom: 6px;
}
.pager {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}
.pager a {
  display: inline-flex;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text-secondary);
  text-decoration: none;
}
.pager a:hover {
  background: var(--brand-soft);
  border-color: #9fd0cd;
  color: var(--brand-ink);
}

.stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 0 16px;
}
.stat {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  min-width: 110px;
}
.stat b {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: var(--brand-ink);
  line-height: 1.2;
}
.stat span {
  font-size: 12px;
  color: var(--muted);
}

.preview-q {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 10px;
  background: #fcfdff;
}
.preview-q + .preview-q { margin-top: 0; }
.rich { min-height: 160px; background: #fff; }
.inline-form { display: inline; }
.option-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}
.option-row input[type="text"]:first-child { max-width: 64px; }
.two-col {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
  align-items: start;
}

/* ---------- Assemble page ---------- */
.assemble-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
}
.assemble-main { min-width: 0; }
.assemble-basket {
  position: sticky;
  top: calc(var(--topbar-h) + 12px);
  max-height: calc(100vh - var(--topbar-h) - 40px);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.assemble-basket-head {
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.assemble-basket-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px;
  min-height: 0;
}
.assemble-basket-foot {
  padding: 12px 18px 16px;
  border-top: 1px solid var(--line);
  background: var(--bg-elevated);
  flex-shrink: 0;
}
.assemble-stats {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}
.assemble-stats .stat {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
}
.assemble-stats .stat b { font-size: 18px; }
.assemble-title-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.assemble-title-row input { flex: 1; max-width: none; }
.assemble-meta-row {
  display: flex;
  gap: 8px;
  align-items: end;
  margin-top: 8px;
}
.assemble-meta-row .meta-field {
  flex: 1;
  min-width: 0;
}
.assemble-meta-row label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 3px;
}
.assemble-meta-row input {
  width: 100%;
  max-width: none;
  font-size: 13px;
  padding: 6px 8px;
}

.tab-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  padding: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.tab-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
}
.tab-btn:hover { color: var(--text); background: #fff; }
.tab-btn.is-active {
  background: var(--brand-soft);
  color: var(--brand-ink);
  box-shadow: inset 0 0 0 1px rgba(12, 110, 107, 0.25), 0 1px 2px rgba(20, 32, 51, 0.08);
}
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

.scroll-panel {
  max-height: clamp(280px, calc(100vh - 380px), 640px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.scroll-panel .data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  box-shadow: 0 1px 0 var(--line);
}
.scroll-panel-sm { max-height: min(42vh, 360px); }

.random-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 12px;
}
.random-grid .form-row { margin-bottom: 0; }
.random-grid label { font-size: 12px; margin-bottom: 4px; }
.random-grid input { max-width: none; }

.basket-table { table-layout: fixed; width: 100%; }
.basket-table td { font-size: 13px; padding: 8px 10px; }
.basket-table .basket-title {
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.basket-table .col-idx { width: 28px; color: var(--muted); }
.basket-table .col-score { width: 44px; text-align: right; }
.basket-empty {
  padding: 48px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.assemble-pool-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  margin-bottom: 12px;
}
.assemble-pool-bar .form-row { margin: 0; flex: 1; min-width: 140px; }
.assemble-pool-bar label { font-size: 12px; margin-bottom: 4px; }
.assemble-pool-bar select { max-width: none; }
.assemble-pool-meta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.pool-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.pool-actions .assemble-pool-meta { margin: 0; flex: 1; min-width: 160px; }
.pool-picked {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-ink);
  background: var(--brand-soft);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.pool-actions button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
.content-html img { max-width: 100%; height: auto; }
.content-html .katex { font-size: 1.05em; }
.content-html .katex-display { margin: 0.4em 0; overflow-x: auto; overflow-y: hidden; }

/* 批改页：选项与解析 */
.option-list {
  list-style: none;
  margin: 8px 0 12px;
  padding: 0;
  display: grid;
  gap: 6px;
}
.option-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  font-size: 14px;
}
.option-item.is-correct {
  border-color: rgba(2, 122, 72, 0.4);
  background: var(--ok-soft);
}
.option-item.is-picked:not(.is-correct) {
  border-color: rgba(180, 35, 24, 0.35);
  background: var(--danger-soft);
}
.option-key {
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.option-content { flex: 1; min-width: 0; }
.option-item .badge { flex-shrink: 0; }
.analysis-block {
  margin: 10px 0 4px;
  padding: 10px 14px;
  border-left: 3px solid var(--brand);
  background: var(--brand-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 14px;
}
.analysis-block > strong {
  display: block;
  color: var(--brand-ink);
  font-size: 13px;
  margin-bottom: 4px;
}

.share-meta {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: start;
}
.share-qr {
  width: 168px;
  height: 168px;
  background: #fff;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.share-link {
  word-break: break-all;
  font-size: 13px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  flex: 1;
  min-width: 0;
}
.share-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
}
.share-link-row .btn {
  flex-shrink: 0;
  align-self: center;
}
.toast-copy {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: #142033;
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 1100;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.toast-copy.is-show { opacity: 1; }

/* ---------- Dropdown ---------- */
.dropdown {
  position: relative;
  display: inline-block;
}
.dropdown-toggle {
  min-width: 64px;
}
.dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 132px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 40;
}
.dropdown.is-open .dropdown-menu { display: block; }
.dropdown-menu a,
.dropdown-menu button,
.dropdown-menu .dropdown-item {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: flex-start;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
}
.dropdown-menu a:hover,
.dropdown-menu button:hover,
.dropdown-menu .dropdown-item:hover {
  background: var(--brand-soft);
  color: var(--brand-ink);
  text-decoration: none;
}
.dropdown-menu .is-danger,
.dropdown-menu button.is-danger {
  color: var(--danger);
}
.dropdown-menu .is-danger:hover,
.dropdown-menu button.is-danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
}
.dropdown-menu form { margin: 0; }
.dropdown-menu .dropdown-sep {
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}
.actions-compact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}
.actions-compact .action-wide { display: inline-flex; }
.actions-compact .action-narrow { display: none; }
.meta-list {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}
.meta-list li {
  display: flex;
  gap: 8px;
  font-size: 14px;
}
.meta-list .k {
  color: var(--muted);
  min-width: 72px;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 20px 0;
  border: 0;
}

/* ---------- Auth ---------- */
body.auth-layout .topbar-nav a.is-active {
  background: rgba(26, 166, 161, 0.28);
}
.auth-shell {
  min-height: calc(100vh - var(--topbar-h));
  display: grid;
  place-items: center;
  padding: 32px 16px;
}
.auth-box {
  width: 100%;
  max-width: 420px;
  margin: 0;
}
.auth-box h1 {
  margin: 0 0 6px;
  font-size: 24px;
}
.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}
.auth-actions .btn,
.auth-actions button {
  min-width: 96px;
}

.site-footer {
  margin-top: auto;
  padding: 16px 20px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 960px) {
  .two-col { grid-template-columns: 1fr; }
  .assemble-shell { grid-template-columns: 1fr; }
  .assemble-basket {
    position: static;
    max-height: none;
  }
  .scroll-panel { max-height: 360px; }
  .random-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .share-meta { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .topbar-menus {
    display: none;
    position: absolute;
    top: var(--topbar-h);
    left: 0;
    right: 0;
    background: #0f1c2e;
    padding: 10px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .topbar-menus.is-open { display: flex; }
  .topbar-nav {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
  }
  .topbar-nav a { padding: 10px 12px; }
  .topbar-account {
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 4px 4px;
    justify-content: space-between;
  }
  .nav-user-name { max-width: none; }
  .page-header h1 { font-size: 22px; }
  .actions-compact .action-wide { display: none; }
  .actions-compact .action-narrow { display: flex; }
  .col-actions { min-width: 88px; }
}
