:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --line: #eae5da;
  --text: #232017;
  --dim: #8a8475;
  --faint: #b6afa2;
  --accent: #e8642a;
  --accent-dark: #c9531f;
  --accent-soft: #fff0e6;
  --public: #2f9e63;
  --public-soft: #e7f5ed;
  --private-soft: #f1eee7;
  --danger: #c4452f;
  --danger-soft: #fdf0ed;
  --shadow: 0 8px 24px rgba(35, 32, 23, .06);
  --shadow-hover: 0 16px 36px rgba(35, 32, 23, .10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

/* 始终为纵向滚动条预留空间：页面长短不同时滚动条出现/消失，
   否则居中的版心和顶部导航会左右跳动（管理页来回切换尤其明显）。 */
html {
  scrollbar-gutter: stable;
}

body {
  background:
    radial-gradient(1000px 560px at 8% -12%, #fffdf8 0, rgba(255, 253, 248, 0) 62%),
    radial-gradient(900px 520px at 100% 0%, #f1eadf 0, rgba(241, 234, 223, 0) 58%),
    var(--bg);
  color: var(--text);
  font: 15px/1.7 "PingFang SC", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(232, 100, 42, .18); }

a {
  color: var(--accent-dark);
  text-decoration: none;
  transition: color .18s ease;
}
a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* ---------------------------------------------------------------- 顶部导航 */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 15px clamp(20px, 4vw, 48px);
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 2px 14px rgba(35, 32, 23, .045);
  backdrop-filter: saturate(1.15) blur(14px);
  -webkit-backdrop-filter: saturate(1.15) blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.01em;
}
.brand:hover { color: var(--text); text-decoration: none; }
.brand-mark {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  color: var(--accent);
}

.nav {
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--dim);
  font-size: 14px;
}
.nav a { color: var(--dim); }
.nav a:hover { color: var(--text); text-decoration: none; }
.nav-cta {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark) !important;
  font-weight: 600;
}
.nav-cta:hover { background: #ffe4d3; color: var(--accent-dark) !important; }
.who {
  padding-left: 20px;
  border-left: 1px solid var(--line);
  color: var(--dim);
  font-size: 13px;
}

/* ---------------------------------------------------------------- 版心 */

.wrap {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 42px 24px 80px;
}

h1 {
  margin: 0 0 10px;
  font-size: 30px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.025em;
}
h2 {
  margin: 0 0 14px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -.01em;
}
.lede {
  max-width: 760px;
  margin: 0 0 24px;
  color: var(--dim);
  font-size: 14px;
  line-height: 1.8;
}
.hint { color: var(--dim); font-size: 13px; }
.hint a { font-weight: 600; }
.breadcrumb { margin: 0 0 20px; color: var(--dim); font-size: 13px; }
.breadcrumb a { font-weight: 500; }

/* ---------------------------------------------------------------- 面板与表单 */

.panel {
  margin-bottom: 30px;
  padding: 30px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.panel.narrow {
  max-width: 520px;
  margin: 56px auto;
  padding: 40px;
}
.auth-panel h1 { margin-bottom: 8px; }
.auth-panel .lede { margin-bottom: 28px; }
.auth-panel .hint {
  margin: 26px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.auth-panel button.primary { width: 100%; margin-top: 4px; }

.section { margin-top: 38px; }
/* 标题区后面紧跟的第一个 section：.section 自己的 38px 会和 .page-head 的
   6px 合并成 38px，加上 .lede 的 24px 就成了 62px，比注释里说的 30px 大一倍。
   这里清零，让「说明文字 → 第一个区块标题」回到 30px。 */
.page-head + .section { margin-top: 0; }

/* 我的轨迹在左，上传表单在右；DOM 顺序本身就是左栏在前。 */
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  gap: 28px;
  align-items: start;
}
.dashboard-grid > * { min-width: 0; }
.dashboard-grid > .section { margin-top: 0; }
.dashboard-grid .panel { margin-bottom: 0; }
.dashboard-grid .empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 560px;
}
.auth-panel .stack { max-width: none; }
.stack label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--dim);
  font-size: 13px;
  font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fcfbf8;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
textarea:hover { border-color: #ddd5c8; }
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus {
  border-color: rgba(232, 100, 42, .62);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(232, 100, 42, .12);
}
input::placeholder,
textarea::placeholder { color: var(--faint); }
textarea {
  min-height: 132px;
  line-height: 1.7;
  resize: vertical;
}

input[type="file"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px dashed #ddd5c8;
  border-radius: 10px;
  background: #fcfbf8;
  color: var(--dim);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}
input[type="file"]:hover { border-color: var(--accent); background: #fffbf7; }
input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 8px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover { background: #ffe4d3; }

/* ---------------------------------------------------------------- 按钮 */

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 17px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  text-decoration: none;
  transition: background .18s ease, border-color .18s ease, color .18s ease,
              box-shadow .18s ease, transform .18s ease;
}
button:hover,
.button:hover {
  border-color: #ddd5c8;
  background: #faf7f1;
  color: var(--text);
  text-decoration: none;
}
button:focus-visible,
.button:focus-visible,
.nav a:focus-visible,
.brand:focus-visible,
.card:focus-visible {
  outline: 2px solid rgba(232, 100, 42, .55);
  outline-offset: 3px;
}
button.primary,
.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px rgba(232, 100, 42, .18);
}
button.primary:hover,
.button.primary:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
  color: #fff;
  box-shadow: 0 9px 20px rgba(232, 100, 42, .24);
  transform: translateY(-1px);
}
button.small,
.button.small {
  padding: 7px 13px;
  font-size: 12.5px;
}
button.danger,
.button.danger {
  border-color: #edcec7;
  background: var(--danger-soft);
  color: var(--danger);
}
button.danger:hover,
.button.danger:hover {
  border-color: var(--danger);
  background: #fbe5df;
  color: var(--danger);
}
button:disabled { opacity: .5; cursor: default; transform: none; }

.inline { display: inline; margin: 0; }

.row-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.row-actions .button {
  flex: 0 0 auto;
  padding: 7px 10px;
  white-space: nowrap;
}

/* 可见性列：点击徽标弹出「设为公开 / 设为私有」。 */
.vis-badge-button {
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  cursor: pointer;
}
.vis-badge-button:hover .badge { filter: brightness(.96); }
.vis-badge-button:focus-visible {
  outline: 2px solid rgba(232, 100, 42, .55);
  outline-offset: 3px;
}

dialog.vis-modal { width: min(360px, calc(100vw - 32px)); }
.vis-dialog-options { display: grid; gap: 8px; }
.vis-option {
  justify-content: flex-start;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fcfbf8;
  color: var(--text);
  font-size: 13.5px;
  text-align: left;
}
.vis-option:hover:not(:disabled) { border-color: var(--accent); background: #fff7f0; }
.vis-option:disabled { opacity: .38; cursor: default; }

/* 管理员左侧功能栏：用户管理 / 当前构建 / 注册申请之间切换，右侧显示具体页面。 */
.admin-shell {
  display: flex;
  gap: 28px;
  align-items: flex-start;
}
.admin-sidebar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 160px;
  flex: 0 0 auto;
  position: sticky;
  top: 84px;
}
.admin-nav-link {
  display: block;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--dim);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.admin-nav-link:hover { background: var(--private-soft); color: var(--text); text-decoration: none; }
.admin-nav-link.active { background: var(--accent-soft); color: var(--accent-dark); }
.admin-content { flex: 1 1 auto; min-width: 0; }

/* "用户管理" / "联系方式" 带子项的分组：父级可点击展开/折叠，子项缩进。 */
.admin-nav-group { display: flex; flex-direction: column; }
.admin-nav-parent {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  border: 0;
  background: none;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.admin-nav-parent::after {
  content: "";
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  opacity: .5;
  transition: transform .15s ease;
}
.admin-nav-group.open .admin-nav-parent::after { transform: rotate(45deg); }
.admin-nav-children {
  display: none;
  flex-direction: column;
  gap: 2px;
  margin: 2px 0 0 10px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}
.admin-nav-group.open .admin-nav-children { display: flex; }
.admin-nav-child { font-size: 13px; padding: 8px 12px; }

@media (max-width: 720px) {
  .admin-shell { flex-direction: column; gap: 18px; }
  /* .admin-shell 是 align-items:flex-start，改列方向后子项不会自动拉满，
     宽表格会把 .admin-content 撑到 max-content，整页出现横向滚动。 */
  .admin-content { width: 100%; }
  .admin-sidebar {
    position: static;
    flex-direction: row;
    width: 100%;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 2px;
  }
  .admin-nav-link { flex: 0 0 auto; white-space: nowrap; }
  /* 横向滚动条下没地方做下拉展开动效，子项直接常显，和父级一起排成一行。 */
  .admin-nav-children { display: flex !important; flex-direction: row; margin: 0; padding-left: 0; border-left: 0; }
  .admin-nav-parent::after { display: none; }
  .admin-nav-group { flex-direction: row; }
}

.admin-toggle-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}
.admin-create-form { max-width: none; gap: 16px; }
.admin-create-form .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 18px;
}
.stack label.checkbox-row {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 400;
}
.checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}
.form-actions { display: flex; gap: 10px; }

/* 用户列表里的生成配额：只改上限，不改已用次数。 */
.quota-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}
.quota-usage {
  min-width: 46px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.quota-form {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.quota-form input[type="number"] {
  width: 66px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfbf8;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.quota-form input[type="number"]:focus {
  border-color: rgba(232, 100, 42, .62);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(232, 100, 42, .12);
}

/* ---------------------------------------------------------------- 弹窗 */

dialog.modal {
  width: min(460px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: var(--text);
  overflow: visible;
}
dialog.modal::backdrop {
  background: rgba(35, 32, 23, .46);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.modal-card {
  max-height: calc(100vh - 32px);
  padding: 28px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(35, 32, 23, .22);
  overflow-y: auto;
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.modal-head h2 { margin-bottom: 8px; }
.modal-head .hint { margin: 0; }
.modal-close {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--dim);
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
}
.modal-close:hover {
  background: var(--private-soft);
  color: var(--text);
}
.modal-card .error { margin: 0 0 18px; }

/* 转移轨迹：搜索式选人弹窗 */
dialog.transfer-modal { width: min(420px, calc(100vw - 32px)); }
.transfer-results {
  display: grid;
  gap: 4px;
  max-height: 220px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fcfbf8;
  overflow-y: auto;
}
.transfer-user {
  justify-content: flex-start;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  font-size: 13px;
  text-align: left;
}
.transfer-user:hover {
  border-color: var(--line);
  background: #f3efe7;
}
.transfer-user.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}
.transfer-results[hidden] { display: none; }
.transfer-user[hidden] { display: none; }
.transfer-empty { margin: 0; }
.transfer-actions { justify-content: flex-end; margin-top: 4px; }

/* ---------------------------------------------------------------- 联系我 */

.contact-entry-link {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--dim);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
.contact-entry-link:hover {
  background: none;
  color: var(--text);
  text-decoration: none;
  transform: none;
}

.contact-card { text-align: center; }
.contact-card .modal-head { text-align: left; }
.contact-qr,
.contact-qr-preview img {
  display: block;
  height: auto;
  margin: 0 auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.contact-qr {
  width: min(260px, 100%);
  margin-bottom: 18px;
}
.contact-qr-preview { margin-bottom: 20px; }
.contact-qr-preview img { width: min(180px, 100%); }
.contact-copy {
  margin: 0;
  color: var(--dim);
  font-size: 14px;
  line-height: 1.8;
}

.link-button {
  padding: 4px 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--dim);
  font-size: 14px;
  font-weight: 400;
}
.link-button:hover {
  background: none;
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
  transform: none;
}

/* ---------------------------------------------------------------- 表格 */

.table-wrap {
  overflow-x: auto;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 14px;
}
.table th,
.table td {
  padding: 16px 18px;
  border-bottom: 1px solid #f2ede4;
  text-align: left;
  vertical-align: middle;
}
.table th {
  color: var(--dim);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .04em;
  white-space: nowrap;
}
.table td { color: var(--text); }
.table tbody tr { transition: background .16s ease; }
.table tbody tr:hover { background: #fbf8f2; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .mono { margin: 0; }

/* 轨迹表格：名称/日期/按钮不换行，名称过长时省略并保留完整 title。 */
.table .col-name { white-space: nowrap; }
.table .track-name {
  display: inline-block;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
/* 有错误信息的轨迹名：看起来像链接，点击打开错误弹窗。 */
.table .track-name-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
.table .track-name-button:hover { text-decoration-style: solid; }
.table .track-name-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.table .col-dir,
.table .col-date,
.table .col-quota,
.table .col-actions { white-space: nowrap; }

.mono {
  color: var(--faint);
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 11.5px;
  letter-spacing: .01em;
}

/* ---------------------------------------------------------------- 徽章 */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--private-soft);
  color: #746e61;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.badge.public { background: var(--public-soft); color: var(--public); }
.badge.muted { background: var(--private-soft); color: var(--dim); }
.badge.admin { background: var(--accent-soft); color: var(--accent-dark); }
.badge.failed { background: var(--danger-soft); color: var(--danger); }

/* 构建进度条：管理员「当前构建」和用户「我的轨迹」共用。 */
.build-progress {
  width: 120px;
  max-width: 100%;
  height: 6px;
  margin-top: 6px;
  border-radius: 999px;
  background: var(--private-soft);
  overflow: hidden;
}
.build-progress-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--accent);
  transition: width .4s ease;
}
.build-progress-text {
  margin: 4px 0 0;
  color: var(--dim);
  font-size: 12px;
  line-height: 1.4;
}
@media (prefers-reduced-motion: reduce) {
  .build-progress-fill { transition: none; }
}

/* 可点击的徽标（例如「构建失败」）：点击弹出错误信息。 */
.badge-button {
  border: 0;
  font: inherit;
  line-height: inherit;
  cursor: pointer;
}
.badge-button:hover { filter: brightness(.96); }
.badge-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* 当前构建：错误信息弹窗。正文区域限高，超出后在框内上下/左右滚动。 */
dialog.build-error-modal { width: min(780px, calc(100vw - 32px)); }
.build-error-body {
  max-height: min(52vh, 460px);
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fcfbf8;
  color: var(--text);
  font: 12.5px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, "PingFang SC", monospace;
  white-space: pre-wrap;
  overflow: auto;
  overscroll-behavior: contain;
}
.build-error-body:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- 轨迹卡片 */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.card {
  display: block;
  padding: 24px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover {
  border-color: rgba(232, 100, 42, .12);
  color: var(--text);
  box-shadow: var(--shadow-hover);
  text-decoration: none;
  transform: translateY(-3px);
}
.card-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--faint);
  font-size: 12px;
}
.card h2 { margin-bottom: 8px; font-size: 20px; }
.card .meta { margin: 0 0 10px; color: var(--dim); font-size: 13px; }
.card .mono { margin: 0; }
.card::after {
  content: "查看 3D 效果  →";
  display: block;
  margin-top: 20px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 600;
}

/* ---------------------------------------------------------------- 提示与空状态 */

/* 全体通知：站点级公告，暖白底 + 品牌橙侧边，不抢操作反馈的视觉层级。 */
.broadcast-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 22px;
  padding: 14px 18px;
  border: 1px solid #f2d6c3;
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  background: linear-gradient(180deg, #fffaf5 0%, #fff3e9 100%);
  box-shadow: 0 4px 14px rgba(35, 32, 23, .045);
}
.broadcast-notice-text {
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.75;
  /* 通知是纯文本：保留管理员输入的换行，同时长串/URL 不撑破窄屏。 */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  /* .lede 自己已经带 24px 的下边距（在 flex 子项里不会被外部折叠掉），
     这里再加 24px 会变成 48px，明显比下面白色卡片之间的 30px 间距大。
     这里只再留 6px，让文字到白色卡片的总间距落在 30px，和卡片间距一致。 */
  margin-bottom: 6px;
}

.notice,
.error {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.7;
}
.notice {
  background: #edf7f1;
  color: #246b49;
}
.error,
.status.error {
  background: var(--danger-soft);
  color: var(--danger);
}
.error { margin: 0 0 20px; }
.status { min-height: 22px; margin: 14px 0 0; color: var(--dim); font-size: 13px; }

/* 顶部横条通知：所有 flash 统一走这里，5 秒后自动收起。
   固定定位不占文档流，所以出现/消失都不会推动页面布局。 */
.flash-banners {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
}
.flash-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 12px 20px;
  background: var(--text);
  color: #fff;
  font-size: 13.5px;
  line-height: 1.6;
  box-shadow: 0 8px 24px rgba(35, 32, 23, .18);
  animation: flash-banner-in .22s ease-out;
  transition: transform .25s ease, opacity .2s ease;
}
.flash-banner--success { background: #246b49; }
.flash-banner--error { background: #9c3527; }
.flash-banner.hide { transform: translateY(-100%); opacity: 0; }
.flash-banner-close {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.flash-banner-close:hover { background: rgba(255, 255, 255, .28); }
@keyframes flash-banner-in {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}
.empty {
  margin: 0;
  padding: 34px 24px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--dim);
  text-align: center;
}

/* ---------------------------------------------------------------- 分页 */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 18px;
}
.pagination .button[aria-disabled] {
  opacity: .4;
  cursor: default;
  pointer-events: none;
}
.pagination-info {
  color: var(--dim);
  font-size: 12.5px;
  white-space: nowrap;
}

/* ---------------------------------------------------------------- 窄屏 */

@media (max-width: 720px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 14px 18px 16px;
  }
  .brand { font-size: 17px; }
  .brand-mark { width: 27px; height: 27px; flex-basis: 27px; }
  .nav {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px 18px;
    font-size: 13px;
  }
  .who {
    padding-left: 0;
    border-left: 0;
  }
  .wrap { padding: 28px 16px 56px; }
  h1 { font-size: 26px; }
  h2 { font-size: 18px; }
  .panel { padding: 22px 20px; border-radius: 14px; }
  .panel.narrow { margin: 24px auto; padding: 28px 22px; }
  .auth-panel { padding: 28px 22px; }
  .section { margin-top: 30px; }
  .dashboard-grid { grid-template-columns: 1fr; gap: 26px; }
  .dashboard-grid > .dashboard-upload { order: 1; }
  .dashboard-grid > .dashboard-tracks { order: 2; }
  .dashboard-grid .empty { min-height: 200px; }
  .admin-create-form .form-grid { grid-template-columns: 1fr; }
  dialog.modal { width: calc(100vw - 24px); }
  .modal-card {
    max-height: calc(100vh - 24px);
    padding: 22px 18px;
    border-radius: 14px;
  }
  .modal-head { margin-bottom: 14px; }
  .page-head { flex-direction: column; gap: 10px; }
  .card-grid { grid-template-columns: 1fr; gap: 16px; }
  .table-wrap { border-radius: 14px; }
  .table th,
  .table td { padding: 14px; }
  .empty { padding: 28px 18px; }
}

@media (max-width: 420px) {
  /* 手机窄屏：徽标单独一行，通知正文占满整行，避免被挤成窄柱。 */
  .broadcast-notice {
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 14px;
  }
  .broadcast-notice-text { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
