:root {
  --canvas: #eef3f7;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --ink: #172033;
  --muted: #667085;
  --line: #d5dee8;
  --line-strong: #b9c6d4;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eaf1ff;
  --success: #16835d;
  --success-soft: #e7f6ef;
  --accent: #c2410c;
  --accent-dark: #9a3412;
  --warning: #b45309;
  --warning-soft: #fff4df;
  --danger: #c2413b;
  --danger-soft: #fff0ef;
  --shadow: 0 18px 55px rgba(26, 46, 68, 0.11);
  /* 右侧栏宽度：摘要卡片（累计处理等）与标题行的下载卡片共用，保证两者同宽同列 */
  --side-col: 310px;
  --font: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--font);
}

/* 公开页（base.html 的默认 body 类）：内容不足一屏时把页脚压到窗口底部，
   避免备案号与版权行浮在半空；内容超过一屏时按文档流正常跟随。
   运营后台用自己的 admin-body / admin-login-page，不受这里影响。 */
.site-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-body > main {
  flex: 1 0 auto;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

i[data-lucide] {
  width: 18px;
  height: 18px;
  display: inline-block;
  flex: 0 0 auto;
}

.topbar {
  width: 100%;
  border-bottom: 1px solid rgba(185, 198, 212, 0.75);
  background: rgba(255, 255, 255, 0.96);
}

.topbar-inner {
  width: min(1240px, calc(100% - 48px));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 18px;
  font-weight: 750;
  letter-spacing: 0;
}

.brand img {
  width: 34px;
  height: 34px;
  display: block;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--muted);
  font-size: 14px;
}

.topnav a {
  color: inherit;
  text-decoration: none;
}

.topnav a.active {
  color: var(--ink);
  font-weight: 650;
}

/* 界面语言选择：右上角的下拉。用 <details> 实现，没有 JavaScript 也能开合。 */
.lang-switch {
  position: relative;
}

.lang-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  list-style: none;
}

.lang-summary::-webkit-details-marker {
  display: none;
}

.lang-summary:hover,
.lang-switch[open] > .lang-summary {
  border-color: var(--primary);
  color: var(--ink);
}

.lang-summary i[data-lucide] {
  width: 15px;
  height: 15px;
}

.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  display: grid;
  gap: 2px;
  min-width: 150px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(23, 32, 51, 0.14);
}

.topnav .lang-option {
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--ink);
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}

.topnav .lang-option:hover {
  background: var(--primary-soft);
}

.topnav .lang-option.active {
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 650;
}

.login-lang {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 6px;
}

.page {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 24px 0 54px;
}

.page-heading {
  margin-bottom: 24px;
}

.page-heading h1 {
  margin: 0 0 8px;
  font-size: 34px;
  line-height: 1.18;
}

.page-heading p,
.hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.page-heading .page-lead {
  margin: 10px 0 0;
  max-width: 780px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
}

.page-heading.heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.page-heading.heading-row .heading-main {
  /* flex-basis 0 让标题块按剩余空间收缩：否则它的内容宽度会把右侧的卡片挤到下一行，
     标题行就变成上下两段（1280 宽放得下、1024 宽就会换行）。 */
  flex: 1 1 0;
  min-width: 0;
}

.page-heading.heading-row .button {
  flex-shrink: 0;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--side-col);
  gap: 22px;
  align-items: stretch;
}

.side-stack {
  display: grid;
  gap: 18px;
}

.tool-panel,
.side-panel,
.result-panel,
.feedback-panel,
.table-panel,
.detail-panel,
.login-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.tool-panel,
.table-panel {
  overflow: hidden;
}

.panel-head {
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 750;
}

.panel-body {
  padding: 22px;
}

.dropzone {
  min-height: 244px;
  display: grid;
  place-items: center;
  padding: 32px;
  text-align: center;
  border: 1.5px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--surface-soft);
}

.dropzone.dragging {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-soft);
}

.dropzone > span {
  display: block;
}

.dropzone-icon {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 8px;
}

.dropzone-icon i {
  width: 28px;
  height: 28px;
}

.dropzone strong {
  display: block;
  margin-bottom: 8px;
  font-size: 20px;
}

.dropzone small {
  display: block;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 13px;
}

.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
}

.button.primary {
  color: white;
  background: var(--primary);
  border-color: var(--primary);
}

.button.primary:hover {
  background: var(--primary-dark);
}

.button.blue {
  color: white;
  background: var(--primary);
  border-color: var(--primary);
}

.button.ghost {
  background: var(--surface-soft);
}

.button.danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #efc4c1;
}

.button.wide {
  width: 100%;
}

.button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.selected-file {
  margin-top: 16px;
  padding: 13px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.file-badge {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--danger);
  background: var(--danger-soft);
  border-radius: 7px;
}

.file-badge.success {
  color: var(--primary);
  background: var(--primary-soft);
}

.selected-file-main,
.download-box-main {
  min-width: 0;
  flex: 1;
}

.selected-file-main strong,
.selected-file-main span,
.download-box-main strong,
.download-box-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-file-main span,
.download-box-main span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.form-grid,
.detail-panel form {
  margin-top: 18px;
}

.field + .field {
  margin-top: 14px;
}

.field label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
}

.input-wrap {
  position: relative;
}

.input,
.textarea,
.select {
  width: 100%;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  outline: none;
}

.input,
.select {
  height: 42px;
  padding: 0 12px;
}

.input.with-action {
  padding-right: 44px;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.input-action,
.icon-button {
  width: 31px;
  height: 31px;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-decoration: none;
}

.input-action {
  position: absolute;
  top: 50%;
  right: 7px;
  border: 0;
  transform: translateY(-50%);
}

.textarea {
  min-height: 104px;
  padding: 11px 12px;
  resize: vertical;
}

#upload-form > .button {
  margin-top: 20px;
}

.turnstile-wrap {
  margin-top: 16px;
}

.status-chip,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
  flex: 0 0 auto;
}

.status-chip.success,
.badge.succeeded,
.badge.resolved {
  color: var(--success);
  background: var(--success-soft);
  border-color: #bfe7d6;
}

.status-chip.warning,
.badge.reviewing {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: #efd39d;
}

.status-chip.info,
.badge.new {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: #c9d9fc;
}

.side-panel {
  padding: 18px;
}

.side-panel h3 {
  margin: 0 0 14px;
  font-size: 15px;
}

/* 首页右栏的桌面端下载入口：标题 + 一个「去下载」按钮 + 本地安装包的优点 */
.download-panel .download-benefits {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 9px;
}

.download-panel .download-benefits li {
  display: flex;
  gap: 8px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.download-panel .download-benefits i {
  width: 15px;
  height: 15px;
  margin-top: 1px;
  color: var(--success);
}

/* 桌面版下载页：三个入口按钮一排，下面放界面截图与功能卡片 */
.desktop-heading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.desktop-heading h1 {
  margin: 0;
}

.desktop-heading .page-lead {
  margin: 0;
}

.desktop-download-panel {
  padding: 22px;
}

.desktop-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.desktop-actions .button {
  min-height: 52px;
  font-size: 15px;
}

.button.disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button-note {
  margin-left: 2px;
  padding: 2px 6px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 650;
}

.desktop-meta {
  margin: 12px 0 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 6px;
  color: var(--muted);
  font-size: 12px;
}

.desktop-meta span + span::before {
  content: "·";
  margin-right: 6px;
}

.desktop-install-note {
  margin: 10px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.desktop-install-note i {
  width: 14px;
  height: 14px;
}

.desktop-shot-panel {
  margin-top: 22px;
  padding: 16px;
}

.desktop-shot {
  width: 100%;
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.desktop-shot-caption {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.desktop-features {
  margin-top: 28px;
}

.desktop-features h2 {
  margin: 0 0 14px;
  font-size: 22px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.feature-card {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.feature-card i {
  width: 22px;
  height: 22px;
  color: var(--primary);
}

.feature-card h3 {
  margin: 10px 0 6px;
  font-size: 15px;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.desktop-notes {
  margin: 16px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  color: var(--muted);
  font-size: 12px;
}

.stat-panel .stat-value {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.stat-panel .stat-number {
  color: var(--primary);
  font-size: 40px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.stat-panel .stat-value span {
  color: var(--muted);
  font-size: 13px;
}

.info-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.info-list li {
  display: flex;
  gap: 10px;
  padding: 7px 0;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.45;
}

.info-list li:last-child {
  border-bottom: 0;
}

.info-list i {
  color: var(--primary);
  margin-top: 1px;
}

.result-panel,
.feedback-panel {
  padding: 22px;
}

#job-app {
  display: grid;
  gap: 20px;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  background: #e6ebf0;
  border-radius: 999px;
}

.progress-track.large {
  height: 12px;
}

.progress-value {
  height: 100%;
  background: var(--primary);
  border-radius: inherit;
  transition: width 220ms ease;
}

.stage-row {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.result-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.result-hero > .status-chip {
  margin-left: auto;
}

.result-hero h2 {
  margin: 0 0 5px;
  font-size: 22px;
}

.result-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.success-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: white;
  background: var(--success);
  border-radius: 50%;
}

.success-mark.danger {
  background: var(--danger);
}

.success-mark i {
  width: 28px;
  height: 28px;
}

.metrics {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric {
  min-height: 84px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.metric span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  font-size: 21px;
}

.download-box {
  margin-top: 20px;
  padding: 15px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid #c7d6fb;
  border-radius: 8px;
  background: var(--primary-soft);
}

.feedback-panel .panel-title {
  margin-bottom: 8px;
}

.feedback-panel > p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.choice {
  min-height: 39px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 600;
}

.choice input {
  accent-color: var(--primary);
}

.feedback-panel > form .textarea {
  margin-bottom: 14px;
}

.danger-panel .result-hero {
  border-bottom: 0;
}

.inline-error {
  margin-top: 14px;
  padding: 11px 12px;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid #efc4c1;
  border-radius: 7px;
  font-size: 13px;
}

/* 首页「我有话说」：标题行右侧的圆角按钮与留言对话框 */
.contact-button {
  padding: 0 20px;
  color: white;
  background: var(--accent);
  border-color: var(--accent);
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(194, 65, 12, 0.22);
}

.contact-button:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.contact-dialog {
  width: min(480px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: auto;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.contact-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.contact-form {
  padding: 22px;
}

.contact-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.contact-head h2 {
  margin: 0;
  font-size: 20px;
}

.contact-form .field {
  margin-top: 14px;
}

.contact-form .hint {
  margin: 0;
}

.contact-form .button[type="submit"] {
  margin-top: 18px;
}

.contact-success {
  margin: 14px 0 0;
  padding: 11px 12px;
  color: var(--success);
  background: var(--success-soft);
  border: 1px solid #bfe7d6;
  border-radius: 7px;
  font-size: 13px;
}

.spinner {
  width: 15px;
  height: 15px;
  display: inline-block;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.success-feedback {
  display: flex;
  align-items: center;
  gap: 16px;
}

.success-feedback h2 {
  margin: 0 0 5px;
}

.success-feedback p {
  margin: 2px 0;
  color: var(--muted);
  font-size: 13px;
}

.admin-body {
  background: var(--canvas);
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
}

.admin-sidebar {
  padding: 20px 16px;
  color: #dfe8ef;
  background: #17252f;
}

.admin-sidebar .brand {
  margin-bottom: 28px;
  color: white;
}

.admin-nav {
  display: grid;
  gap: 5px;
}

.admin-nav a {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 11px;
  color: #b9c8d3;
  border-radius: 7px;
  text-decoration: none;
  font-size: 13px;
}

.admin-nav a.active {
  color: white;
  background: #203b46;
}

.admin-main {
  min-width: 0;
  padding: 24px 28px 36px;
}

.admin-header {
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.admin-header h1 {
  margin: 0 0 5px;
  font-size: 26px;
}

.admin-user {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.admin-user form {
  margin: 0;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric-strip .metric {
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.metric-strip .metric:nth-child(4n) {
  border-right: 0;
}

.metric-strip .metric:nth-last-child(-n + 4) {
  border-bottom: 0;
}

.table-panel {
  margin-top: 20px;
  box-shadow: none;
  /* 列多（如任务记录的密码列）时窄屏可横向滚动，避免右侧列被裁掉。 */
  overflow-x: auto;
  overflow-y: hidden;
}

.section-head {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.section-head h2 {
  margin: 0;
  font-size: 16px;
}

/* 后台「下载记录」里，小计列表跟在标题下方 */
.section-head .info-list {
  margin-top: 10px;
}

.filterbar {
  padding: 14px 16px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 160px 160px 120px;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}

.data-table th {
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.col-note {
  margin-left: 4px;
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
}

.job-name {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button.tiny {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  flex: 0 0 auto;
}

.icon-button.tiny svg {
  width: 16px;
  height: 16px;
}

.icon-button.tiny:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.password-cell {
  min-width: 118px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-all;
}

.source-cell {
  min-width: 136px;
}

.source-cell span,
.cell-note {
  display: block;
}

.cell-note {
  margin-top: 2px;
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-all;
}

.empty-cell {
  color: var(--muted);
  text-align: center !important;
}

.pager {
  padding: 12px 16px;
  border-top: 1px solid #d5dee8;
  color: #667085;
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: break-word;
}

.pager-info {
  color: #667085;
  font-size: 13px;
}

.pager-controls {
  margin-top: 6px;
}

.pager-link {
  min-width: 34px;
  height: 32px;
  display: inline-block;
  margin: 2px 6px 2px 0;
  padding: 0 10px;
  color: #172033;
  background: #ffffff;
  border: 1px solid #d5dee8;
  border-radius: 6px;
  font-size: 13px;
  line-height: 30px;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  white-space: nowrap;
}

.pager-link:hover {
  border-color: #b9c6d4;
}

.pager-link.active,
.pager-link.active:hover {
  color: #ffffff;
  background: #203b46;
  border-color: #203b46;
}

.pager-link.disabled,
.pager-link.disabled:hover {
  color: #b9c6d4;
  background: #f7f9fc;
  border-color: #d5dee8;
}

.pager-ellipsis {
  display: inline-block;
  margin: 2px 6px 2px 0;
  padding: 0 2px;
  color: #667085;
  font-size: 13px;
  line-height: 32px;
  vertical-align: middle;
}

/* 支持 flex 的新内核：信息居左、翻页控件居右；旧内核退化为上下两行。 */
@supports (display: flex) {
  .pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
  }

  .pager-controls {
    margin-top: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
  }
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.detail-panel {
  padding: 20px;
  box-shadow: none;
}

.detail-panel h2 {
  margin: 0 0 16px;
  font-size: 17px;
}

.detail-list {
  margin: 0;
}

.detail-list dt {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.detail-list dd {
  margin: 5px 0 0;
  line-height: 1.55;
  word-break: break-word;
}

.detail-actions {
  margin-top: 20px;
}

.danger-zone {
  margin-top: 18px !important;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.admin-login-page {
  display: grid;
  place-items: center;
}

.login-shell {
  width: min(420px, calc(100% - 32px));
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.login-panel {
  width: 100%;
  padding: 28px;
}

.login-brand {
  margin-bottom: 26px;
}

.login-panel h1 {
  margin: 0 0 8px;
  font-size: 25px;
}

.login-panel form {
  margin-top: 20px;
}

.login-panel form .button {
  margin-top: 18px;
}

/* 站点页脚：备案号、版权、隐私说明入口，宽度与 .page / .topbar 对齐 */
.site-footer {
  width: 100%;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.site-footer-inner {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 22px 0 28px;
}

.site-footer-icp {
  margin: 0 0 14px;
  text-align: center;
  font-size: 13px;
}

.site-footer-contact {
  margin: 0 0 14px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.site-footer-icp a,
.site-footer-contact a,
.site-footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer-icp a:hover,
.site-footer-contact a:hover,
.site-footer-links a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.site-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.site-footer-copy {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 20px;
  font-size: 13px;
}

@media (max-width: 1000px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .admin-shell {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .admin-sidebar .brand span,
  .admin-nav a span {
    display: none;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .topbar-inner,
  .page {
    width: calc(100% - 28px);
  }

  .topbar-inner {
    padding: 12px 0;
    gap: 0 16px;
  }

  .topbar-inner > .status-chip {
    margin-top: 10px;
  }

  /* The language picker stays reachable on narrow screens, so only the
     top-level links and chips are hidden. */
  .topnav > a,
  .topnav > .status-chip {
    display: none;
  }

  .topnav .lang-option {
    display: block;
  }

  .page-heading h1 {
    font-size: 27px;
  }

  .stage-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }

  .stage-row .hint {
    margin-top: 10px;
  }

  .result-hero {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px 14px;
  }

  .result-hero > .status-chip {
    grid-column: 2;
    margin-left: 0;
    justify-self: start;
  }

  .download-box {
    flex-wrap: wrap;
    gap: 0 14px;
  }

  .download-box .button {
    width: 100%;
    margin-top: 12px;
  }

  .metrics,
  .filterbar,
  .metric-strip {
    grid-template-columns: 1fr;
  }

  .choice-grid {
    grid-template-columns: 1fr;
  }

  .metric-strip .metric,
  .metric-strip .metric:nth-last-child(-n + 4) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metric-strip .metric:last-child {
    border-bottom: 0;
  }

  .site-footer-row {
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 720px) {
  .desktop-actions,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .desktop-download-panel,
  .desktop-shot-panel {
    padding: 16px;
  }
}
