:root {
  color-scheme: light;
  --ink: #101114;
  --muted: #667085;
  --line: #d9dee8;
  --surface: #f7f8fb;
  --panel: #ffffff;
  --accent: #2563eb;
  --accent-strong: #1749b7;
  --success: #0f9f6e;
  --danger: #dc2626;
  --warning: #b45309;
  --shadow: 0 20px 60px rgba(16, 17, 20, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
}

button:hover,
a:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.primary-button,
.secondary-button,
.danger-button,
.ghost-button,
.ghost-link,
.tiny-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 16px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.primary-button {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.22);
}

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

.secondary-button {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.danger-button {
  background: #fff;
  border-color: rgba(220, 38, 38, 0.28);
  color: var(--danger);
}

.ghost-button,
.ghost-link {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.tiny-button {
  min-height: 32px;
  padding: 0 10px;
  background: #eef4ff;
  color: var(--accent);
}

.admin-page {
  min-height: 100vh;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px clamp(18px, 4vw, 48px);
  background: rgba(247, 248, 251, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.admin-topbar h1,
.workspace-head h2,
.admin-panel h2 {
  margin: 0;
}

.admin-topbar h1 {
  font-size: clamp(24px, 3vw, 38px);
}

.admin-shell {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr) minmax(280px, 360px);
  gap: 20px;
  padding: 24px clamp(18px, 4vw, 48px) 48px;
}

.admin-panel,
.admin-workspace {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.admin-panel {
  padding: 22px;
}

.upload-panel,
.notification-panel {
  align-self: start;
  position: sticky;
  top: 108px;
}

.upload-form {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.upload-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.upload-form input,
.upload-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 12px 13px;
  outline: none;
}

.upload-form input:focus,
.upload-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.file-drop {
  border: 1px dashed #aeb8c9;
  border-radius: 8px;
  padding: 14px;
  background: #fbfcff;
}

.file-drop input {
  border: 0;
  padding: 0;
}

.file-drop strong {
  color: var(--ink);
}

.file-drop small {
  color: var(--muted);
}

.file-size-warning {
  display: block;
  border: 1px solid rgba(180, 83, 9, 0.22);
  border-radius: 8px;
  background: #fffbeb;
  color: #92400e;
  padding: 8px 10px;
  font-size: 12px;
  font-style: normal;
  line-height: 1.5;
}

.file-size-warning.is-error {
  border-color: rgba(220, 38, 38, 0.22);
  background: #fef2f2;
  color: #b42318;
}

.switch-list {
  display: grid;
  gap: 10px;
}

.switch-row {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 10px !important;
  color: var(--ink) !important;
}

.switch-row input {
  width: 18px;
  height: 18px;
}

.form-status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
}

.form-status.is-error {
  color: var(--danger);
  font-weight: 700;
}

.admin-workspace {
  min-width: 0;
  padding: 22px;
}

.workspace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.document-list,
.event-list {
  display: grid;
  gap: 12px;
}

.document-row,
.event-row,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.document-row {
  padding: 18px;
}

.document-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 18px;
}

.document-main h3,
.event-row h3,
.empty-state h3 {
  margin: 8px 0 6px;
}

.document-main p,
.event-row p,
.empty-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--success);
  background: rgba(15, 159, 110, 0.1);
  font-size: 12px;
  font-weight: 700;
}

.status-dot.archived {
  color: var(--muted);
  background: #eef0f5;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.stats-grid div {
  border-left: 1px solid var(--line);
  padding-left: 12px;
}

.stats-grid dt {
  color: var(--muted);
  font-size: 12px;
}

.stats-grid dd {
  margin: 4px 0 0;
  font-size: 24px;
  font-weight: 750;
}

.document-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.event-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
}

.event-row.important {
  border-color: rgba(37, 99, 235, 0.35);
  background: #f8fbff;
}

.event-row span {
  color: var(--muted);
  font-size: 12px;
}

.empty-state {
  padding: 24px;
  text-align: center;
}

.empty-state.compact {
  padding: 18px;
}

.viewer-page {
  min-height: 100vh;
  background: #101114;
  color: #f7f8fb;
}

.copy-protected .reader-app,
.copy-protected .document-stage,
.copy-protected .reader-intro,
.copy-protected .reader-title {
  user-select: none;
  -webkit-user-select: none;
}

.copy-protected img,
.copy-protected canvas {
  -webkit-user-drag: none;
}

.reader-app {
  min-height: 100vh;
}

.reader-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 16px clamp(16px, 4vw, 56px) 12px;
  background: rgba(16, 17, 20, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(18px);
}

.reader-title h1 {
  margin: 0;
  overflow: hidden;
  color: #fff;
  font-size: clamp(20px, 2.6vw, 34px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-variant-numeric: tabular-nums;
}

.reader-meta span {
  min-width: 68px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 8px 10px;
  text-align: center;
}

.reader-meta .warning {
  border-color: rgba(180, 83, 9, 0.5);
  color: #fbbf24;
}

.progress-track {
  grid-column: 1 / -1;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: #6ea8ff;
  transition: width 180ms ease;
}

.reader-layout {
  width: min(960px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 140px;
}

.reader-intro {
  margin-bottom: 22px;
}

.reader-intro p {
  max-width: 720px;
  margin: 0 0 16px;
  color: rgba(247, 248, 251, 0.78);
  line-height: 1.7;
}

.reader-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reader-rules span {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 7px 11px;
  color: rgba(247, 248, 251, 0.78);
  font-size: 13px;
}

.document-stage {
  min-height: 70vh;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
}

.docx-html {
  padding: clamp(24px, 5vw, 68px);
  line-height: 1.85;
}

.docx-html h1,
.docx-html h2,
.docx-html h3 {
  line-height: 1.25;
}

.docx-html img {
  max-width: 100%;
}

.document-image {
  display: block;
  width: 100%;
  height: auto;
}

.video-frame {
  display: grid;
  gap: 12px;
  padding: clamp(12px, 3vw, 24px);
  background: #0f1115;
}

.document-video {
  display: block;
  width: 100%;
  max-height: 76vh;
  border-radius: 8px;
  background: #000;
}

.video-frame p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  text-align: center;
}

.pdf-pages {
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 14px;
  background: #e9edf5;
}

.pdf-pages canvas {
  max-width: 100%;
  height: auto !important;
  background: #fff;
  box-shadow: 0 10px 30px rgba(16, 17, 20, 0.12);
}

.pdf-loading,
.pdf-fallback {
  margin: 0;
  padding: 34px;
  color: #475467;
  text-align: center;
}

.pdf-fallback {
  display: grid;
  justify-items: center;
  gap: 14px;
}

.reader-actions {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(960px, calc(100% - 32px));
  gap: 16px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(16, 17, 20, 0.86);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.reader-actions p {
  margin: 0;
  color: rgba(247, 248, 251, 0.74);
}

.reader-actions div {
  display: flex;
  gap: 10px;
}

.social-guide,
.policy-notice,
.identity-modal,
.terminal-state {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #101114;
}

.watermark-layer {
  position: fixed;
  inset: 0;
  z-index: 24;
  display: grid;
  grid-template-columns: repeat(6, minmax(180px, 1fr));
  gap: 46px 22px;
  padding: 32px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.11;
  mix-blend-mode: screen;
}

.watermark-layer span {
  color: #ffffff;
  font-size: 13px;
  line-height: 1.3;
  text-align: center;
  transform: rotate(-24deg);
  white-space: nowrap;
}

.watermark-layer.is-image-watermark {
  opacity: 0.18;
  mix-blend-mode: normal;
}

.watermark-layer .watermark-image-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.watermark-layer .watermark-image-mark img {
  display: block;
  max-width: 120px;
  max-height: 64px;
  object-fit: contain;
  filter: grayscale(1) contrast(1.12);
  opacity: 0.72;
  user-select: none;
  -webkit-user-drag: none;
}

.watermark-layer[data-density="low"] {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 60px 30px;
  opacity: 0.09;
}

.watermark-layer[data-density="high"] {
  grid-template-columns: repeat(8, minmax(150px, 1fr));
  gap: 34px 16px;
  opacity: 0.14;
}

.protection-shield {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(16, 17, 20, 0.96);
  color: #fff;
}

.protection-shield > div {
  width: min(560px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: clamp(24px, 5vw, 44px);
  background: #17191f;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

.protection-shield h1 {
  margin: 0 0 12px;
  color: #fff;
  font-size: clamp(28px, 8vw, 48px);
  line-height: 1.12;
}

.protection-shield p {
  color: rgba(247, 248, 251, 0.74);
  line-height: 1.7;
}

.guide-panel,
.policy-notice-box,
.identity-box,
.terminal-state > div {
  width: min(520px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: clamp(24px, 5vw, 44px);
  background: #17191f;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

.policy-notice-box {
  width: min(640px, 100%);
}

.policy-notice-box h1 {
  margin: 0 0 12px;
  color: #fff;
  font-size: clamp(28px, 7vw, 44px);
  line-height: 1.12;
}

.policy-notice-box > p {
  margin: 0;
  color: rgba(247, 248, 251, 0.72);
  line-height: 1.7;
}

.policy-notice-list {
  display: grid;
  gap: 9px;
  margin: 22px 0;
  padding: 0;
  list-style: none;
}

.policy-notice-list li {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  color: rgba(247, 248, 251, 0.86);
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.policy-notice-list li::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-top: 8px;
  border-radius: 50%;
  background: #4f7cff;
}

.policy-identity-field {
  display: grid;
  gap: 7px;
  margin: 2px 0 14px;
  color: rgba(247, 248, 251, 0.82);
  font-size: 13px;
}

.policy-identity-field span {
  color: #fff;
  font-weight: 700;
}

.policy-identity-field input {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  padding: 0 14px;
  outline: none;
  font-size: 15px;
}

.policy-identity-field input::placeholder {
  color: rgba(247, 248, 251, 0.48);
}

.policy-identity-field input:focus {
  border-color: #5b8cff;
  box-shadow: 0 0 0 4px rgba(91, 140, 255, 0.22);
}

.policy-identity-field small {
  color: rgba(247, 248, 251, 0.58);
  font-size: 12px;
  line-height: 1.5;
}

.policy-notice-error {
  margin: 0 0 12px;
  color: #fecdd3;
  font-size: 13px;
  line-height: 1.5;
}

.policy-notice-box .primary-button {
  width: 100%;
}

.guide-panel h1,
.terminal-state h1,
.identity-box h2 {
  margin: 0 0 12px;
  color: #fff;
  font-size: clamp(28px, 8vw, 48px);
  line-height: 1.12;
}

.guide-panel p,
.terminal-state p,
.identity-box p {
  color: rgba(247, 248, 251, 0.74);
  line-height: 1.7;
}

.identity-box {
  display: grid;
  gap: 14px;
}

.identity-box input {
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  padding: 0 14px;
  outline: none;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1180px) {
  .admin-shell {
    grid-template-columns: minmax(270px, 340px) minmax(0, 1fr);
  }

  .notification-panel {
    grid-column: 1 / -1;
    position: static;
  }
}

@media (max-width: 820px) {
  .admin-topbar,
  .workspace-head,
  .document-foot,
  .reader-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-shell {
    grid-template-columns: 1fr;
  }

  .upload-panel {
    position: static;
  }

  .document-main {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .document-foot,
  .row-actions,
  .reader-actions div {
    width: 100%;
  }

  .row-actions > *,
  .reader-actions button {
    flex: 1 1 auto;
  }

  .reader-topbar {
    grid-template-columns: 1fr;
  }

  .reader-title h1 {
    white-space: normal;
  }

  .reader-meta {
    justify-content: space-between;
  }

  .reader-actions {
    bottom: 0;
    width: 100%;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 8px 8px 0 0;
    transform: translateX(-50%);
  }

  .watermark-layer {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
    gap: 38px 12px;
    padding: 20px 8px;
  }
}

@media print {
  body.copy-protected .reader-app,
  body.copy-protected .identity-modal,
  body.copy-protected .terminal-state,
  body.copy-protected .watermark-layer,
  body.copy-protected .protection-shield {
    display: none !important;
  }

  body.copy-protected::before {
    display: block;
    padding: 40px;
    color: #111827;
    font: 700 24px/1.5 system-ui, sans-serif;
    content: "当前文档已禁止打印";
  }
}

/* Admin redesign */
.admin-page {
  min-height: 100vh;
  background: #f5f6f8;
  color: #15171c;
}

.admin-page .eyebrow,
.admin-page .section-kicker {
  color: #7a828f;
  font-size: 11px;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 74px;
  padding: 12px clamp(20px, 4vw, 44px);
  background: rgba(245, 246, 248, 0.9);
  border-bottom: 1px solid rgba(24, 29, 39, 0.1);
  backdrop-filter: blur(18px);
}

.admin-brand {
  display: grid;
  gap: 2px;
}

.admin-brand h1 {
  margin: 0;
  color: #15171c;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.08;
}

.admin-brand span {
  color: #6b7280;
  font-size: 13px;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.admin-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  order: 1;
  gap: 8px;
}

.admin-toolbar .current-admin {
  order: 2;
}

.admin-toolbar .admin-logout-button {
  order: 3;
}

.admin-actions .secondary-button,
.admin-actions .ghost-link {
  min-height: 38px;
}

.admin-shell {
  display: grid;
  grid-template-columns: minmax(280px, 304px) minmax(0, 1fr) minmax(276px, 304px);
  gap: 18px;
  align-items: start;
  padding: 20px clamp(20px, 4vw, 44px) 40px;
}

.admin-panel,
.admin-workspace {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.publish-panel,
.notification-panel,
.overview-band,
.document-console {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(24, 29, 39, 0.1);
  border-radius: 8px;
}

.publish-panel,
.notification-panel {
  align-self: start;
  position: sticky;
  top: 102px;
  padding: 18px;
}

.admin-workspace {
  display: grid;
  min-width: 0;
  gap: 18px;
  align-content: start;
  padding: 0;
}

.panel-head,
.workspace-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 16px;
}

.panel-head h2,
.workspace-head h2,
.overview-copy h2 {
  margin: 0;
  color: #15171c;
  font-size: 20px;
  line-height: 1.2;
}

.workspace-head p,
.overview-copy p {
  margin: 5px 0 0;
  color: #6b7280;
  font-size: 13px;
}

.overview-band {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: stretch;
  padding: 20px;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  border: 1px solid rgba(24, 29, 39, 0.08);
  border-radius: 8px;
  background: #fbfcfd;
  overflow: hidden;
}

.metric-card {
  display: grid;
  justify-items: start;
  min-width: 0;
  padding: 14px 16px;
  border-right: 1px solid rgba(24, 29, 39, 0.08);
  border-top: 0;
  border-bottom: 0;
  border-left: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.metric-card:hover {
  background: #f5f8ff;
}

.metric-card:last-child {
  border-right: 0;
}

.metric-card span {
  color: #7a828f;
  font-size: 12px;
}

.metric-card strong {
  margin: 5px 0 0;
  color: #15171c;
  font-size: 28px;
  font-weight: 760;
  line-height: 1;
}

.document-console {
  padding: 20px;
}

.upload-form {
  display: grid;
  gap: 13px;
  margin-top: 0;
}

.upload-form label {
  gap: 6px;
  color: #6b7280;
  font-size: 13px;
}

.upload-form input,
.upload-form textarea,
.upload-form select {
  min-height: 40px;
  border-color: rgba(24, 29, 39, 0.12);
  background: #fbfcfd;
  padding: 10px 11px;
}

.upload-form textarea {
  min-height: 78px;
  resize: vertical;
}

.file-drop {
  gap: 7px !important;
  border-color: rgba(31, 94, 255, 0.28);
  background: #f8faff;
  padding: 13px;
}

.file-drop strong {
  font-size: 15px;
}

.switch-list {
  gap: 7px;
  padding: 2px 0;
}

.switch-row {
  min-height: 30px;
  gap: 9px !important;
  color: #363b45 !important;
  font-size: 13px !important;
}

.switch-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #1f5eff;
}

.publish-block {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(24, 29, 39, 0.08);
  border-radius: 8px;
  background: #ffffff;
}

.publish-block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.publish-block-head strong {
  color: #15171c;
  font-size: 14px;
}

.publish-block-head span,
.policy-card summary small,
.policy-preset small,
.policy-edit-banner span,
.policy-preview span,
.publish-submit-bar span {
  color: #7a828f;
  font-size: 12px;
  line-height: 1.5;
}

.policy-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.policy-preset {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 9px !important;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(24, 29, 39, 0.1);
  border-radius: 8px;
  background: #fbfcfd;
  cursor: pointer;
}

.policy-preset.is-selected {
  border-color: rgba(31, 94, 255, 0.38);
  background: #f4f7ff;
}

.policy-preset input {
  width: 16px;
  min-height: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: #1f5eff;
}

.policy-preset strong,
.policy-card summary strong,
.policy-preview strong,
.policy-edit-banner strong {
  display: block;
  min-width: 0;
  color: #15171c;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.policy-preset small {
  display: block;
  margin-top: 3px;
}

.policy-card {
  min-width: 0;
  border: 1px solid rgba(24, 29, 39, 0.08);
  border-radius: 8px;
  background: #fbfcfd;
  overflow: hidden;
}

.policy-card + .policy-card {
  margin-top: 8px;
}

.policy-card summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}

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

.policy-card summary::after {
  content: "展开";
  color: #6b7280;
  font-size: 12px;
}

.policy-card[open] summary {
  border-bottom: 1px solid rgba(24, 29, 39, 0.08);
  background: #ffffff;
}

.policy-card[open] summary::after {
  content: "收起";
}

.policy-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}

.policy-fields > label,
.time-grid > label {
  min-width: 0;
}

.policy-fields > label:has(input[type="text"]),
.policy-fields > label:has(select),
.policy-fields > label:has(input[type="number"]) {
  align-self: start;
}

.policy-fields .switch-row {
  align-self: center;
  min-height: 40px;
}

.time-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.compact-policy-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.policy-preview {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(31, 94, 255, 0.16);
  border-radius: 8px;
  background: #f8faff;
}

.policy-preview ul {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.policy-preview li {
  color: #363b45;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.policy-preview li::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin: 0 7px 2px 0;
  border-radius: 50%;
  background: #1f5eff;
}

.publish-submit-bar {
  position: static;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, auto);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(24, 29, 39, 0.1);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: none;
}

.publish-submit-bar .primary-button {
  width: 100%;
}

.policy-edit-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(31, 94, 255, 0.2);
  border-radius: 8px;
  background: #f4f7ff;
}

.upload-form.is-policy-editing .file-drop {
  opacity: 0.58;
}

.primary-button,
.secondary-button,
.danger-button,
.ghost-button,
.ghost-link,
.tiny-button {
  min-height: 38px;
  border-radius: 7px;
  font-size: 13px;
}

.primary-button {
  background: #1f5eff;
  box-shadow: none;
}

.primary-button:hover {
  background: #1648c7;
}

.secondary-button {
  background: #ffffff;
  border-color: rgba(24, 29, 39, 0.12);
  color: #252a33;
}

.ghost-button,
.ghost-link {
  color: #6b7280;
}

.compact-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.admin-modal[hidden] {
  display: none;
}

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
}

.admin-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 16, 24, 0.42);
  backdrop-filter: blur(8px);
}

.admin-modal-box {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  width: min(560px, 100%);
  max-height: min(720px, calc(100vh - 40px));
  overflow: auto;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 24px 72px rgba(12, 16, 24, 0.22);
}

.admin-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.admin-modal-head h2 {
  margin: 0;
  color: #15171c;
  font-size: 20px;
  line-height: 1.2;
}

.modal-intro {
  margin: 0;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.55;
}

.confirm-details {
  display: grid;
  gap: 8px;
  margin: 0;
}

.confirm-details div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(24, 29, 39, 0.07);
}

.confirm-details dt {
  color: #7a828f;
  font-size: 12px;
  font-weight: 700;
}

.confirm-details dd {
  min-width: 0;
  margin: 0;
  color: #252a33;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.confirm-link-note {
  padding: 10px 12px;
  border-radius: 8px;
  color: #515967;
  background: #f4f7ff;
  font-size: 12px;
  line-height: 1.5;
}

.admin-modal-actions {
  position: sticky;
  bottom: -18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 0 -18px -18px;
  padding: 12px 18px 18px;
  border-top: 1px solid rgba(24, 29, 39, 0.08);
  background: #ffffff;
}

.table-shell {
  overflow-x: auto;
  border: 1px solid rgba(24, 29, 39, 0.1);
  border-radius: 8px;
  background: #ffffff;
}

.document-table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
}

.document-table th,
.document-table td {
  padding: 14px 14px;
  border-bottom: 1px solid rgba(24, 29, 39, 0.08);
  text-align: left;
  vertical-align: middle;
}

.document-table th {
  color: #7a828f;
  background: #fbfcfd;
  font-size: 12px;
  font-weight: 700;
}

.document-table td {
  color: #363b45;
  font-size: 13px;
}

.document-table tbody tr {
  transition: background 160ms ease;
}

.document-table tbody tr:hover {
  background: #f8faff;
}

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

.doc-title-cell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 10px;
  align-items: center;
  min-width: 260px;
}

.doc-title-cell strong {
  overflow: hidden;
  color: #15171c;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-title-cell small {
  grid-column: 2;
  overflow: hidden;
  color: #7a828f;
  font-size: 12px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-dot {
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  color: #0f7a55;
  background: rgba(15, 122, 85, 0.1);
  font-size: 11px;
}

.status-dot.archived {
  color: #7a828f;
  background: #eef0f3;
}

.protection-label {
  display: inline-block;
  max-width: 160px;
  overflow: hidden;
  color: #515967;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inline-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(42px, 1fr));
  gap: 6px;
  min-width: 190px;
}

.inline-stats span {
  display: grid;
  gap: 2px;
  color: #15171c;
  font-weight: 730;
  line-height: 1.1;
}

.inline-stats small {
  color: #7a828f;
  font-size: 11px;
  font-weight: 500;
}

.row-actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 6px;
}

.default-front-switch {
  margin-top: 2px;
  padding: 10px 12px;
  border: 1px solid rgba(24, 29, 39, 0.08);
  border-radius: 8px;
  background: #fbfcfd;
}

.fixed-front-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, auto) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid rgba(31, 94, 255, 0.18);
  border-radius: 8px;
  background: #f8faff;
}

.fixed-front-panel div,
.front-page-title {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.fixed-front-panel span,
.front-page-grid span,
.front-link-row span {
  color: #7a828f;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.fixed-front-panel strong,
.front-page-title strong {
  overflow: hidden;
  color: #15171c;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fixed-front-panel small,
.front-page-title small {
  overflow: hidden;
  color: #6b7280;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.front-entry-help,
.front-page-help {
  color: #5f6876;
  font-size: 12px;
  line-height: 1.55;
}

.front-entry-help {
  margin-top: 4px;
}

.front-entry-help summary,
.front-page-details summary {
  width: fit-content;
}

.front-entry-help p,
.front-page-help {
  margin: 6px 0 0;
  overflow-wrap: anywhere;
}

.front-entry-help p + p {
  margin-top: 3px;
}

.fixed-front-panel code,
.front-link-row code {
  min-width: 0;
  overflow: hidden;
  padding: 7px 9px;
  border: 1px solid rgba(24, 29, 39, 0.08);
  border-radius: 7px;
  color: #363b45;
  background: #ffffff;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.front-page-list {
  display: grid;
  gap: 10px;
}

.front-page-item {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(24, 29, 39, 0.09);
  border-radius: 8px;
  background: #ffffff;
}

.front-page-item.is-default {
  border-color: rgba(31, 94, 255, 0.22);
}

.front-page-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.front-page-title {
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
}

.front-page-title small {
  grid-column: 3;
}

.front-badge {
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  color: #1f5eff;
  background: rgba(31, 94, 255, 0.1);
  font-size: 11px;
  line-height: 22px;
  white-space: nowrap;
}

.front-page-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  color: #7a828f;
  font-size: 12px;
}

.front-page-meta span {
  padding: 4px 7px;
  border-radius: 999px;
  background: #f4f5f7;
}

.front-page-details {
  border-top: 1px solid rgba(24, 29, 39, 0.07);
  padding-top: 8px;
}

.front-page-details summary {
  cursor: pointer;
  color: #515967;
  font-size: 12px;
  font-weight: 700;
}

.front-link-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.front-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, auto);
  gap: 12px;
  align-items: center;
  margin-top: 10px;
}

.front-page-grid > div:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.front-page-grid strong {
  overflow-wrap: anywhere;
  color: #363b45;
  font-size: 13px;
}

.front-page-actions {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.event-list {
  display: grid;
  gap: 8px;
  width: min(560px, 100%);
  overflow: visible;
  padding-right: 0;
}

.event-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(24, 29, 39, 0.08);
  border-radius: 8px;
  background: #ffffff;
}

.event-row.important {
  border-color: rgba(31, 94, 255, 0.26);
  background: #f8faff;
}

.event-row h3 {
  margin: 3px 0 4px;
  color: #15171c;
  font-size: 13px;
}

.event-row p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.event-row span {
  color: #8b93a1;
  font-size: 11px;
}

.event-actions {
  display: grid;
  gap: 6px;
  align-content: start;
  min-width: 58px;
}

.tiny-button.danger-inline {
  background: #fff7f7;
  border-color: rgba(220, 38, 38, 0.22);
  color: var(--danger);
}

.event-row .event-delivery {
  display: inline-flex;
  width: fit-content;
  margin-top: 8px;
  padding: 4px 8px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  line-height: 1.4;
}

.event-row .event-delivery.sent {
  background: #ecfdf3;
  color: #027a48;
}

.event-row .event-delivery.failed {
  background: #fef2f2;
  color: #b42318;
}

.event-row .event-delivery.incomplete {
  background: #fffaeb;
  color: #b54708;
}

.event-live {
  display: grid;
  gap: 3px;
  width: fit-content;
  max-width: 100%;
  margin-top: 8px;
  padding: 6px 8px;
  border: 1px solid rgba(31, 94, 255, 0.16);
  border-radius: 7px;
  background: #f7f9ff;
}

.event-live strong {
  color: #1f5eff;
  font-size: 12px;
  line-height: 1.2;
}

.event-live span {
  color: #5f6b7a;
  font-size: 11px;
  line-height: 1.35;
}

.event-live.idle {
  border-color: rgba(107, 114, 128, 0.16);
  background: #f8fafc;
}

.event-live.idle strong,
.event-live.completed strong {
  color: #475569;
}

.event-live.completed {
  border-color: rgba(22, 163, 74, 0.18);
  background: #f0fdf4;
}

.notification-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 10px;
  width: min(560px, 100%);
  margin-bottom: 14px;
}

.notification-batch-delete {
  grid-column: 1 / -1;
  justify-self: end;
  min-height: 36px;
}

.notification-auto-refresh {
  grid-column: 1 / -1;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(24, 29, 39, 0.09);
  border-radius: 8px;
  background: #fbfcfd;
}

.notification-auto-refresh > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.notification-auto-refresh strong {
  color: #15171c;
  font-size: 13px;
  font-weight: 800;
}

.notification-auto-refresh small {
  color: #6b7280;
  font-size: 12px;
  line-height: 1.45;
}

.notification-auto-refresh input[type='checkbox'] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  accent-color: #1f5eff;
}

.notification-tools label,
.page-jump {
  display: grid;
  gap: 6px;
  color: #6b7280;
  font-size: 12px;
}

.notification-search-field {
  min-width: 0;
}

.notification-search-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 68px;
  gap: 8px;
  align-items: stretch;
  min-width: 0;
}

.notification-tools input:not([type='checkbox']),
.page-jump input {
  min-height: 38px;
  border: 1px solid rgba(24, 29, 39, 0.12);
  border-radius: 8px;
  background: #fbfcfd;
  color: #15171c;
  padding: 8px 10px;
  outline: none;
}

.notification-search-control .compact-button {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}

.notification-tools input:not([type='checkbox']):focus,
.page-jump input:focus {
  border-color: #1f5eff;
  box-shadow: 0 0 0 4px rgba(31, 94, 255, 0.1);
}

.notification-pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  width: min(560px, 100%);
  margin-top: 14px;
  white-space: nowrap;
}

.page-summary {
  color: #515967;
  font-size: 12px;
  text-align: center;
}

.page-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #6b7280;
  font-size: 12px;
}

.page-jump input {
  width: 58px;
  min-height: 32px;
  padding: 6px 8px;
  text-align: center;
}

.event-total-label {
  margin: 0;
  color: #8b93a1;
  font-size: 12px;
}

.empty-state {
  border: 1px solid rgba(24, 29, 39, 0.1);
  border-radius: 8px;
  background: #ffffff;
  padding: 28px;
}

.empty-state h3 {
  margin: 0 0 8px;
  color: #15171c;
}

.empty-state p {
  margin: 0;
  color: #6b7280;
}

@media (max-width: 1240px) {
  .admin-shell {
    grid-template-columns: minmax(280px, 304px) minmax(0, 1fr);
  }

  .notification-panel {
    grid-column: 1 / -1;
    position: static;
  }

  .event-list {
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 900px) {
  .admin-topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px 12px;
  }

  .admin-brand {
    min-width: 0;
  }

  .admin-toolbar {
    display: contents;
  }

  .admin-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    flex-wrap: wrap;
    width: 100%;
    padding-right: 72px;
  }

  .admin-actions .ghost-link {
    flex: 0 0 auto;
  }

  .current-admin {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    justify-self: end;
    margin-top: 24px;
  }

  .admin-logout-button {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
    justify-self: end;
    min-height: 38px;
    padding-right: 16px;
    padding-left: 16px;
  }

  .admin-shell,
  .overview-band {
    grid-template-columns: 1fr;
  }

  .publish-panel {
    position: static;
  }

  .metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-card:nth-child(2) {
    border-right: 0;
  }

  .metric-card:nth-child(-n + 2) {
    border-bottom: 1px solid rgba(24, 29, 39, 0.08);
  }
}

/* Admin bottom navigation sections */
.admin-page {
  padding-bottom: 112px;
}

.admin-shell {
  display: block;
  width: min(1120px, calc(100% - clamp(32px, 7vw, 88px)));
  margin: 0 auto;
  padding: 20px 0 40px;
}

.admin-section {
  display: none;
  animation: sectionFade 180ms ease both;
}

.admin-section.is-active {
  display: block;
}

.admin-section[hidden] {
  display: none !important;
}

.admin-section.publish-panel,
.admin-section.notification-panel,
.admin-section.settings-panel,
.admin-section.document-console {
  position: static;
  width: min(860px, 100%);
  margin: 0 auto;
}

.admin-section.document-console {
  width: 100%;
}

.admin-section.notification-panel {
  width: min(680px, 100%);
}

.overview-band,
.overview-grid,
.publish-panel,
.notification-panel,
.settings-panel,
.document-console {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(24, 29, 39, 0.1);
  border-radius: 8px;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 18px;
  margin-top: 18px;
  padding: 20px;
}

.overview-note h2 {
  margin: 0 0 8px;
  color: #15171c;
  font-size: 20px;
}

.overview-note p {
  margin: 0;
  color: #6b7280;
  line-height: 1.7;
}

.front-link-panel {
  display: grid;
  align-content: center;
  gap: 8px;
  min-height: 118px;
  padding: 18px;
  border: 1px solid rgba(31, 94, 255, 0.18);
  border-radius: 8px;
  background: #f8faff;
  color: #15171c;
  text-decoration: none;
}

.front-link-panel span {
  color: #6b7280;
  font-size: 12px;
}

.front-link-panel strong {
  overflow-wrap: anywhere;
  color: #1f5eff;
  font-size: 15px;
}

.settings-panel {
  padding: 20px;
}

.settings-summary {
  display: grid;
  gap: 5px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(31, 94, 255, 0.16);
  border-radius: 8px;
  background: #f8faff;
  color: #15171c;
}

.settings-summary[data-status="incomplete"] {
  border-color: rgba(180, 83, 9, 0.22);
  background: #fff9f0;
}

.settings-summary[data-status="configured"] {
  border-color: rgba(15, 122, 85, 0.2);
  background: #f3fbf7;
}

.settings-summary[data-status="sent"] {
  border-color: rgba(15, 122, 85, 0.24);
  background: #effbf4;
}

.settings-summary[data-status="failed"] {
  border-color: rgba(190, 18, 60, 0.22);
  background: #fff4f6;
}

.settings-summary strong {
  font-size: 14px;
}

.settings-summary span {
  color: #5b6472;
  font-size: 13px;
  line-height: 1.6;
}

.compact-summary {
  margin: 0;
}

.settings-form {
  display: grid;
  gap: 16px;
}

.settings-form fieldset {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.settings-form fieldset + fieldset {
  padding-top: 16px;
  border-top: 1px solid rgba(24, 29, 39, 0.08);
}

.settings-form legend {
  margin-bottom: 2px;
  color: #15171c;
  font-size: 14px;
  font-weight: 740;
}

.settings-form label {
  display: grid;
  gap: 7px;
  color: #6b7280;
  font-size: 13px;
}

.settings-form input,
.settings-form textarea,
.settings-form select {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(24, 29, 39, 0.12);
  border-radius: 8px;
  background: #fbfcfd;
  color: #15171c;
  padding: 10px 11px;
  outline: none;
}

.settings-form textarea {
  resize: vertical;
}

.settings-form input:focus,
.settings-form textarea:focus,
.settings-form select:focus {
  border-color: #1f5eff;
  box-shadow: 0 0 0 4px rgba(31, 94, 255, 0.1);
}

.settings-form small,
.settings-note {
  color: #7a828f;
  font-size: 12px;
  line-height: 1.6;
}

.settings-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.settings-actions.single-action {
  grid-template-columns: minmax(0, 1fr);
}

.front-access-form,
.media-settings-form {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(24, 29, 39, 0.08);
}

.settings-check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.settings-check-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid rgba(24, 29, 39, 0.1);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 0 10px;
  color: #363b45;
}

.settings-check-grid input {
  width: 16px;
  min-height: 16px;
  height: 16px;
  accent-color: #1f5eff;
}

.radio-row,
.settings-form .switch-row {
  display: flex !important;
  align-items: center;
  gap: 10px !important;
  min-height: 34px;
  color: #363b45 !important;
}

.radio-row input,
.settings-form .switch-row input {
  width: 16px;
  min-height: 16px;
  height: 16px;
  accent-color: #1f5eff;
}

.wechat-settings {
  padding-top: 2px;
}

.guide-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  margin-top: 18px;
  text-decoration: none;
}

.guide-domain {
  margin-top: 10px !important;
  color: rgba(247, 248, 251, 0.54) !important;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.current-admin {
  display: grid;
  grid-template-columns: auto;
  grid-template-areas:
    "name"
    "role";
  align-items: center;
  column-gap: 0;
  row-gap: 0;
  min-width: 0;
  min-height: 38px;
  max-width: 100%;
  padding: 5px 12px;
  border: 1px solid rgba(24, 29, 39, 0.1);
  border-radius: 8px;
  background: #ffffff;
}

.current-admin span {
  grid-area: name;
  overflow: visible;
  color: #15171c;
  font-size: 13px;
  font-weight: 740;
  line-height: 1.1;
  text-overflow: clip;
  white-space: nowrap;
}

.current-admin small {
  grid-area: role;
  overflow: visible;
  color: #7a828f;
  font-size: 11px;
  line-height: 1.2;
  text-overflow: clip;
  white-space: nowrap;
}

.current-admin .compact-button {
  grid-area: logout;
  align-self: center;
}

.auth-gate {
  display: grid;
  min-height: calc(100vh - 86px);
  place-items: center;
  padding: 24px;
}

.admin-page.is-auth-pending {
  padding-bottom: 0;
}

.auth-box {
  width: min(440px, 100%);
  padding: 28px;
  border: 1px solid rgba(24, 29, 39, 0.1);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(21, 23, 28, 0.1);
}

.auth-box h2 {
  margin: 0 0 8px;
  color: #15171c;
  font-size: 24px;
}

.auth-box p {
  color: #6b7280;
  line-height: 1.7;
}

.auth-form {
  display: grid;
  gap: 13px;
  margin-top: 18px;
}

.auth-form label,
.permission-form label,
.account-controls label,
.role-edit-grid label {
  display: grid;
  gap: 6px;
  color: #6b7280;
  font-size: 13px;
}

.auth-form input,
.permission-form input,
.permission-form select,
.account-controls input,
.account-controls select,
.role-edit-grid input {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(24, 29, 39, 0.12);
  border-radius: 8px;
  background: #fbfcfd;
  color: #15171c;
  padding: 10px 11px;
  outline: none;
}

.auth-form input:focus,
.permission-form input:focus,
.permission-form select:focus,
.account-controls input:focus,
.account-controls select:focus,
.role-edit-grid input:focus {
  border-color: #1f5eff;
  box-shadow: 0 0 0 4px rgba(31, 94, 255, 0.1);
}

.event-filter-collapse {
  width: min(560px, 100%);
  margin: 0 0 12px;
  border: 1px solid rgba(24, 29, 39, 0.09);
  border-radius: 8px;
  background: #ffffff;
}

.event-filter-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 0 12px;
  cursor: pointer;
  list-style: none;
}

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

.event-filter-summary span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.event-filter-summary strong {
  color: #15171c;
  font-size: 14px;
}

.event-filter-summary small {
  overflow: hidden;
  color: #6b7280;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-filter-summary em {
  min-width: 34px;
  color: #6b7280;
  font-size: 12px;
  font-style: normal;
  text-align: right;
}

.event-filter-summary em::before {
  content: '展开';
}

.event-filter-collapse[open] .event-filter-summary em::before {
  content: '收起';
}

.event-filter-collapse.has-active-filter {
  border-color: rgba(31, 94, 255, 0.22);
  background: #f8faff;
}

.event-filter-collapse[open] .event-filter-tabs {
  border-top: 1px solid rgba(24, 29, 39, 0.08);
}

.event-filter-collapse:not([open]) .event-filter-tabs {
  display: none;
}

.event-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 12px;
}

.filter-tab {
  min-height: 34px;
  border: 1px solid rgba(24, 29, 39, 0.1);
  border-radius: 8px;
  background: #ffffff;
  color: #515967;
  padding: 0 12px;
  cursor: pointer;
}

.filter-tab.is-active {
  border-color: #15171c;
  background: #15171c;
  color: #ffffff;
}

.permissions-panel {
  padding: 20px;
}

.overview-permissions {
  margin-top: 18px;
}

.permission-layout,
.permission-block,
.account-list,
.role-list,
.audit-list {
  display: grid;
  gap: 12px;
}

.permission-layout {
  margin-top: 14px;
}

.permission-block {
  padding: 14px;
  border: 1px solid rgba(24, 29, 39, 0.09);
  border-radius: 8px;
  background: #ffffff;
}

.permission-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.permission-block-head div,
.role-main,
.account-main > div {
  display: grid;
  gap: 4px;
}

.permission-block-head strong,
.role-main strong,
.account-main strong {
  color: #15171c;
  font-size: 14px;
}

.permission-block-head span,
.role-main span,
.account-main span {
  color: #6b7280;
  font-size: 12px;
  line-height: 1.5;
}

.audit-log-block {
  display: block;
}

.audit-log-summary {
  list-style: none;
  cursor: pointer;
}

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

.audit-log-summary em {
  min-width: 44px;
  color: #6b7280;
  font-size: 12px;
  font-style: normal;
  text-align: right;
}

.audit-log-summary em::before {
  content: '展开';
}

.audit-log-block[open] .audit-log-summary em::before {
  content: '收起';
}

.audit-log-summary:hover strong {
  color: #1f5eff;
}

.audit-log-block .audit-list {
  margin-top: 12px;
}

.permission-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.permission-form .primary-button,
.permission-form .form-status,
.permission-collapse,
.permission-checklist {
  grid-column: 1 / -1;
}

.permission-collapse {
  border: 1px solid rgba(24, 29, 39, 0.08);
  border-radius: 8px;
  background: #fbfcfd;
}

.permission-collapse summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  color: #15171c;
  cursor: pointer;
  list-style: none;
}

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

.permission-collapse summary span {
  font-size: 13px;
  font-weight: 740;
}

.permission-collapse summary small {
  margin-left: auto;
  color: #7a828f;
  font-size: 12px;
}

.permission-collapse summary em {
  min-width: 34px;
  color: #6b7280;
  font-size: 12px;
  font-style: normal;
  text-align: right;
}

.permission-collapse summary em::before {
  content: '展开';
}

.permission-collapse[open] summary em::before {
  content: '收起';
}

.permission-collapse[open] .permission-checklist {
  border-top: 1px solid rgba(24, 29, 39, 0.08);
}

.permission-checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
}

.permission-check {
  display: flex !important;
  align-items: center;
  gap: 8px !important;
  min-height: 32px;
  color: #363b45 !important;
  font-size: 12px !important;
}

.permission-check input {
  width: 15px;
  height: 15px;
  accent-color: #1f5eff;
}

.account-item,
.role-item,
.audit-item {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(24, 29, 39, 0.08);
  border-radius: 8px;
  background: #fbfcfd;
}

.account-main {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.account-main em,
.role-main em {
  justify-self: start;
  border-radius: 999px;
  padding: 3px 8px;
  color: #6b7280;
  background: #eef0f3;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.account-main .state-active {
  color: #0f7a55;
  background: rgba(15, 122, 85, 0.1);
}

.account-main .state-disabled {
  color: #7a828f;
  background: #eef0f3;
}

.account-controls,
.role-edit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.role-edit-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.audit-item span {
  color: #7a828f;
  font-size: 12px;
}

.audit-item strong {
  color: #363b45;
  font-size: 13px;
  line-height: 1.5;
}

.bottom-nav {
  position: fixed;
  right: 0;
  left: 0;
  bottom: 18px;
  z-index: 80;
  display: grid;
  grid-template-columns: repeat(5, minmax(88px, 1fr));
  gap: 6px;
  width: min(720px, calc(100% - 32px));
  margin: 0 auto;
  padding: 8px;
  border: 1px solid rgba(24, 29, 39, 0.12);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(21, 23, 28, 0.1);
  transform: none;
}

.bottom-nav-item {
  display: grid;
  gap: 2px;
  align-content: center;
  min-height: 52px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #374151;
  cursor: pointer;
  text-align: center;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  letter-spacing: 0;
  transform: none !important;
  -webkit-font-smoothing: auto;
  text-rendering: auto;
}

.bottom-nav-item:hover {
  transform: none !important;
}

.bottom-nav-item span {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.12;
}

.bottom-nav-item small {
  color: inherit;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.12;
}

.bottom-nav-item.is-active {
  background: #15171c;
  color: #ffffff;
}

@keyframes sectionFade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 760px) {
  .admin-page {
    padding-bottom: 100px;
  }

  .admin-shell {
    width: min(100% - 28px, 1120px);
    padding-top: 16px;
  }

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

  .bottom-nav {
    bottom: 10px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: calc(100% - 20px);
    padding: 6px;
  }

  .bottom-nav-item {
    min-height: 50px;
  }

  .bottom-nav-item span {
    font-size: 13px;
  }

  .notification-tools {
    grid-template-columns: 1fr;
  }

  .notification-batch-delete {
    width: 100%;
  }

  .event-row {
    grid-template-columns: 1fr;
  }

  .event-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-check-grid {
    grid-template-columns: 1fr;
  }

  .event-filter-tabs {
    gap: 6px;
  }

  .filter-tab {
    flex: 1 1 calc(33.333% - 6px);
    padding: 0 8px;
  }

  .permission-form,
  .account-controls,
  .role-edit-grid {
    grid-template-columns: 1fr;
  }

  .permission-checklist {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 10px;
  }

  .permission-check {
    min-height: 34px;
    align-items: center;
  }

  .account-main {
    display: grid;
  }

  .notification-pagination {
    gap: 3px;
    justify-content: flex-start;
    overflow: visible;
    padding-bottom: 2px;
  }

  .notification-pagination .compact-button {
    min-height: 30px;
    padding: 0 4px;
    font-size: 12px;
  }

  #eventPrevPage,
  #eventNextPage {
    width: 44px;
  }

  #eventGoPage {
    width: 36px;
  }

  .page-summary,
  .page-jump,
  .event-total-label {
    font-size: 11px;
  }

  .page-jump {
    gap: 3px;
  }

  .page-jump input {
    width: 42px;
    min-height: 30px;
    padding: 4px 6px;
  }

  .publish-panel {
    padding: 16px;
  }

  .publish-block,
  .policy-preview {
    padding: 12px;
  }

  .publish-block-head,
  .policy-edit-banner {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .publish-block-head {
    display: grid;
  }

  .policy-presets,
  .policy-fields,
  .compact-policy-grid,
  .policy-preview,
  .publish-submit-bar {
    grid-template-columns: 1fr;
  }

  .policy-card summary {
    padding: 11px 12px;
  }

  .policy-fields {
    padding: 12px;
  }

  .time-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .policy-preview ul {
    gap: 5px;
  }

  .fixed-front-panel,
  .front-page-main,
  .front-link-row,
  .front-page-grid,
  .confirm-details div {
    grid-template-columns: 1fr;
  }

  .fixed-front-panel {
    align-items: stretch;
  }

  .front-page-title {
    grid-template-columns: auto auto minmax(0, 1fr);
  }

  .front-page-meta {
    justify-content: flex-start;
  }

  .front-link-row .secondary-button,
  .fixed-front-panel .secondary-button {
    width: 100%;
  }

  .front-page-actions .compact-button,
  .front-page-actions .secondary-button,
  .front-page-actions .ghost-button {
    flex: 1 1 120px;
  }

  .settings-actions {
    grid-template-columns: 1fr;
  }

  .admin-modal {
    align-items: end;
    padding: 12px;
  }

  .admin-modal-box {
    max-height: calc(100dvh - 24px);
    padding: 16px;
  }

  .admin-modal-head,
  .admin-modal-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .admin-modal-actions .primary-button,
  .admin-modal-actions .secondary-button {
    width: 100%;
  }

  .admin-modal-actions {
    bottom: -16px;
    margin: 0 -16px -16px;
    padding: 12px 16px 16px;
  }

  .publish-submit-bar {
    align-items: stretch;
  }

  .publish-submit-bar span {
    overflow-wrap: anywhere;
  }
}
