/*
 * 教学文档协作平台 · 原型视觉规范（墨档 · 朱批）
 *
 * 概念：像在纸上批阅卷宗。纸面打底、墨蓝结构、朱砂红只留给「批改 / 印章 / 警示」
 * 这类强语义动作，不再到处贴渐变色块。标题用宋体系（印刷文档的语感），正文用
 * 系统黑体；两者分得很开，语义也成立。
 *
 * 约定：
 * - app.js 会拼出 card / table / btn / status-badge / search-select 等 class，
 *   这些 class 名是界面契约，只覆盖样式，不改名。
 * - 图标与装饰全部用内联 SVG + CSS 实现，不依赖图片、字体或 CDN。
 * - 桌面端设计（1280–1920），不设移动端断点。
 */

:root {
  /* 纸与墨 */
  --paper: #f6f5f1;
  --paper-deep: #eeebe3;
  --surface: #fffefb;
  --surface-2: #fbfaf6;
  --line: #e4e1d8;
  --line-strong: #d1cdc1;

  /* 墨蓝（结构 / 主操作） */
  --ink-soft: #edf2f6;
  --ink-tint: #d9e3ec;
  --ink: #345b7d;
  --ink-strong: #284c6b;
  --ink-deep: #1e3a53;

  /* 朱砂（批改 / 印章 / 警示） */
  --cinnabar-soft: #f8ece8;
  --cinnabar-tint: #eccdc4;
  --cinnabar: #b13a2c;
  --cinnabar-deep: #942f23;

  /* 兼容旧变量名，避免误引用失效 */
  --brand-50: var(--ink-soft);
  --brand-100: var(--ink-tint);
  --brand-500: var(--ink);
  --brand-600: var(--ink-strong);
  --brand-700: var(--ink-deep);
  --accent: var(--cinnabar);
  --brand: var(--ink-strong);
  --brand-dark: var(--ink-deep);

  /* 中性色 */
  --text: #2b323a;
  --heading: #1d2833;
  --muted: #6c747e;
  --border: var(--line);
  --border-strong: var(--line-strong);
  --bg: var(--paper);

  /* 语义色 */
  --ok-bg: #eaf2ed;
  --ok-border: #c6dccb;
  --ok-line: #4c8a64;
  --ok-text: #286244;
  --warn-bg: #f6efe2;
  --warn-border: #e5d2b0;
  --warn-line: #b98a3f;
  --warn-text: #7a521e;
  --danger: var(--cinnabar);
  --danger-dark: var(--cinnabar-deep);
  --wechat: #07c160;
  --wechat-dark: #06ad56;

  /* 尺度 */
  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 10px;
  --shadow-card: 0 1px 0 rgba(29, 40, 51, 0.03);
  --shadow-hover: 0 10px 24px rgba(29, 40, 51, 0.08);
  --shadow-pop: 0 12px 32px rgba(29, 40, 51, 0.14);
  --container: 1120px;

  /* 动效 */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --t-fast: 140ms;
  --t: 170ms;
  --t-slow: 200ms;

  /* 字体 */
  --font-display: "Source Han Serif SC", "Noto Serif SC", "STZhongsong", "STSong",
    "SimSun", "Songti SC", serif;
  --font-sans: "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB",
    sans-serif;

  /* 图标（mask 用的内联 SVG，颜色由 currentColor 决定） */
  --icon-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6%209l6%206%206-6'/%3E%3C/svg%3E");
  --icon-logout: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9%2021H5a2%202%200%200%201-2-2V5a2%202%200%200%201%202-2h4'/%3E%3Cpath d='M16%2017l5-5-5-5'/%3E%3Cpath d='M21%2012H9'/%3E%3C/svg%3E");
  --icon-alert: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12%208v5'/%3E%3Cpath d='M12%2016.4h.01'/%3E%3C/svg%3E");
  --icon-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M8%2012.5l2.6%202.6L16%209.7'/%3E%3C/svg%3E");
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 280px);
  background-repeat: no-repeat;
}

::selection {
  background: rgba(177, 58, 44, 0.16);
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

code {
  font-family: "Cascadia Mono", Consolas, "Courier New", monospace;
  font-size: 0.92em;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--ink-soft);
  color: var(--ink-deep);
}

/* ------------------------------------------------------------------ 顶栏 */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 10px 32px;
  background: rgba(255, 254, 251, 0.96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-deep);
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  display: block;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  transition: transform var(--t) var(--ease);
}

.brand:hover .brand-mark {
  transform: translateY(-1px);
}

#topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

.admin-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.admin-nav a {
  padding: 7px 12px;
  border-radius: 4px;
  color: var(--ink-strong);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.admin-nav a:hover {
  background: var(--ink-soft);
  color: var(--ink-deep);
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-deep);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  vertical-align: middle;
  border: 1px solid var(--line);
}

.tag-wechat {
  display: inline-block;
  margin-left: 2px;
  padding: 1px 7px;
  border-radius: 4px;
  background: #e8f9ef;
  color: #067647;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.7;
}

#logoutButton {
  padding: 6px 13px;
  font-size: 13px;
}

#logoutButton::before {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: var(--icon-logout) center / contain no-repeat;
  mask: var(--icon-logout) center / contain no-repeat;
}

/* ------------------------------------------------------------ 容器与页头 */

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 32px 32px 64px;
  animation: page-in var(--t) var(--ease) both;
}

.page-head {
  position: relative;
  margin: 0 0 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.page-title,
.page-head h1 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.25;
  color: var(--heading);
}

.page-subtitle,
.subtitle {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

/* 文档管理模块页眉：用档案印签建立模块身份 */
.module-masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  align-items: end;
  gap: 36px;
  margin: 0 0 34px;
  padding: 8px 0 26px;
  border-bottom: 1px solid var(--line-strong);
}

.module-identity {
  display: flex;
  align-items: center;
  gap: 18px;
}

.module-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 4px;
  background: var(--cinnabar);
  color: #fff7ef;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
  box-shadow: 5px 5px 0 var(--cinnabar-soft);
}

.module-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.15;
  color: var(--ink-deep);
}

.module-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.module-side {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.module-note {
  margin: 0;
  padding-left: 18px;
  border-left: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.module-actions {
  display: flex;
  justify-content: flex-end;
}

.section-index-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}

.section-index-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--heading);
}

.section-index-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.section-count {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 7px;
  padding-bottom: 2px;
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: 600;
}

.section-count::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 1px;
  background: var(--cinnabar);
}

/* --------------------------------------------------------------- 卡片 */

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.card + .card {
  margin-top: 16px;
}

.card h2,
.form-grid h2 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--heading);
}

.card h2::before,
.form-grid h2::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--ink);
  transform: translateY(-1px);
}

.card > .detail-list:last-child {
  margin-bottom: 0;
}

/* 空状态：全宽居中 + 虚线边框 */
.card.muted {
  text-align: center;
  color: var(--muted);
  background: rgba(255, 254, 251, 0.6);
  border-style: dashed;
  border-color: var(--line-strong);
  padding: 40px 24px;
  box-shadow: none;
}

.grid > .card.muted {
  grid-column: 1 / -1;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

/* 网格里的间距由 gap 负责 */
.grid > .card + .card {
  margin-top: 0;
}

/* ------------------------------------------------------- 分类卡片 */

.category-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
}

.category-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-hover);
}

.category-card h3 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--heading);
}

.category-card h3::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--ink);
}

.category-card p {
  flex: 1;
  margin: 0;
  min-height: 44px;
  font-size: 14px;
  color: var(--muted);
}

.count {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-strong);
}

.category-card .count::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: var(--cinnabar);
}

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

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

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

.table thead th {
  background: var(--surface-2);
  color: var(--ink-deep);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border-bottom: 1px solid var(--line-strong);
}

.table tbody tr {
  transition: background-color var(--t-fast) var(--ease);
}

.table tbody tr:hover {
  background: var(--surface-2);
}

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

.table td a {
  color: var(--ink-strong);
  font-weight: 600;
  text-decoration: none;
}

.table td a:hover {
  color: var(--ink-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

td.muted {
  padding: 40px 18px;
  text-align: center;
  color: var(--muted);
}

td.actions {
  display: table-cell;
  white-space: nowrap;
}

td.actions .btn + .btn {
  margin-left: 8px;
}

td.notice {
  border-radius: 0;
}

td.notice::before {
  content: none;
}

/* --------------------------------------------------------------- 工具栏 */

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

.toolbar strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  color: var(--heading);
}

.toolbar strong::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--ink);
}

/* 文档清单：新建入口与文档内容共用同一套卡片网格 */
.document-toolbar {
  margin-bottom: 18px;
}

.document-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 16px;
}

.document-card-list {
  display: contents;
}

.document-card {
  display: flex;
  min-width: 0;
  min-height: 260px;
  padding: 21px 22px 18px;
  flex-direction: column;
  gap: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  color: var(--text);
  text-decoration: none;
  transition:
    border-color var(--t) var(--ease),
    box-shadow var(--t) var(--ease),
    transform var(--t) var(--ease);
}

.document-card:hover {
  border-color: var(--ink-tint);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.document-card-top {
  display: flex;
  min-height: 26px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.document-card-category {
  overflow: hidden;
  color: var(--ink-strong);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-card-title {
  display: -webkit-box;
  min-height: 52px;
  overflow: hidden;
  color: var(--heading);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.document-card-description {
  display: -webkit-box;
  min-height: 42px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.document-card-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  margin-top: auto;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.document-card-footer > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.document-card-footer strong {
  overflow: hidden;
  color: var(--ink-deep);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-card-label,
.document-card-time {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.document-card-time {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-grid-empty {
  display: flex;
  min-height: 160px;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}

.create-document-card {
  display: flex;
  width: 100%;
  min-height: 260px;
  margin: 0;
  padding: 30px 24px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink-deep);
  text-align: center;
  text-decoration: none;
  transition:
    border-color var(--t) var(--ease),
    background-color var(--t) var(--ease),
    box-shadow var(--t) var(--ease),
    transform var(--t) var(--ease);
}

.create-document-card:hover {
  border-color: var(--ink);
  background-color: rgba(237, 242, 246, 0.52);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.create-document-card:focus-visible {
  border-color: var(--ink);
  outline-offset: 4px;
}

.create-document-card-icon {
  display: inline-flex;
  width: 58px;
  height: 58px;
  align-items: center;
  justify-content: center;
  flex: none;
  border-radius: 50%;
  background: var(--ink-soft);
  color: var(--ink-deep);
}

.create-document-card-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.create-document-card-copy {
  display: grid;
  gap: 5px;
}

.create-document-card-copy strong {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.35;
}

.create-document-card-copy span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

#createDocumentLink[hidden] {
  display: none !important;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease),
    transform var(--t-fast) var(--ease);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--ink);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--ink-strong);
}

.btn-outline {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink-strong);
}

.btn-outline:hover:not(:disabled) {
  background: var(--ink-soft);
  border-color: var(--ink);
  color: var(--ink-deep);
}

.btn-danger {
  background: var(--cinnabar);
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  background: var(--cinnabar-deep);
}

.btn-wechat {
  background: var(--wechat);
  color: #fff;
}

.btn-wechat:hover:not(:disabled) {
  background: var(--wechat-dark);
}

.btn-wechat:disabled {
  background: #9fd6b6;
  box-shadow: none;
}

.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* --------------------------------------------------------------- 表单 */

.form-grid {
  display: grid;
  gap: 18px;
}

.form-grid label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #333b44;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  padding: 10px 14px;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}

.form-grid input:hover,
.form-grid select:hover,
.form-grid textarea:hover {
  border-color: var(--line-strong);
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(52, 91, 125, 0.16);
}

.form-grid textarea {
  min-height: 84px;
  resize: vertical;
}

.form-grid input[type="file"] {
  padding: 9px 12px;
  background: var(--surface-2);
  cursor: pointer;
}

/* ---------------------------------------------------- 新建文档流程 */

.create-document-page {
  max-width: 1040px;
}

.create-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.page-kicker {
  margin: 0 0 7px;
  color: var(--cinnabar);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.create-document-form {
  display: grid;
  gap: 18px;
}

.create-document-form[hidden] {
  display: none;
}

.form-section {
  padding: 24px 28px 28px;
}

.form-section-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.form-section-head h2 {
  margin: 0 0 3px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--heading);
}

.form-section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 34px;
  height: 34px;
  border: 1px solid var(--ink-tint);
  border-radius: 50%;
  background: var(--ink-soft);
  color: var(--ink-deep);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
}

.form-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 20px;
}

.form-field {
  min-width: 0;
}

.form-field-wide {
  grid-column: 1 / -1;
}

.required-mark,
.optional-mark {
  margin-left: 5px;
  font-size: 11px;
  font-weight: 500;
}

.required-mark {
  color: var(--cinnabar);
}

.optional-mark {
  color: var(--muted);
}

.field-hint,
.field-error {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.5;
}

.field-hint {
  color: var(--muted);
  text-align: right;
}

.field-error {
  display: none;
  color: var(--cinnabar);
}

.field-error:not(:empty) {
  display: block;
}

.form-field.invalid input,
.form-field.invalid textarea,
.form-field.invalid .search-select-trigger {
  border-color: var(--cinnabar);
  box-shadow: 0 0 0 3px rgba(177, 58, 44, 0.1);
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.file-drop {
  display: flex !important;
  min-height: 158px;
  margin: 0 !important;
  padding: 22px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(237, 242, 246, 0.65), rgba(255, 255, 255, 0.4)),
    var(--surface);
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease),
    background-color var(--t-fast) var(--ease);
}

.file-drop:hover,
.file-drop.dragging {
  border-color: var(--ink);
  background-color: var(--ink-soft);
}

.file-drop[hidden] {
  display: none !important;
}

.file-drop strong {
  color: var(--ink-deep);
  font-size: 15px;
}

.file-drop span:last-child {
  font-size: 12px;
}

.file-drop-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 18px;
  line-height: 1;
}

.selected-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.selected-file[hidden] {
  display: none;
}

.selected-file strong,
.selected-file span {
  display: block;
}

.selected-file strong {
  color: var(--heading);
  font-size: 14px;
  word-break: break-all;
}

.selected-file span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.advanced-options {
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.advanced-options summary {
  padding: 14px 0 0;
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.advanced-options[open] summary {
  margin-bottom: 14px;
}

.create-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 2px 0 12px;
}

@media (max-width: 960px) {
  .document-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .module-masthead {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .module-seal {
    width: 48px;
    height: 48px;
    font-size: 24px;
  }

  .module-title {
    font-size: 30px;
  }

  .module-note {
    padding: 14px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .section-index-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .create-page-head,
  .selected-file {
    align-items: stretch;
    flex-direction: column;
  }

  .form-grid-two {
    grid-template-columns: 1fr;
  }

  .form-field-wide {
    grid-column: auto;
  }

  .form-section {
    padding: 20px;
  }

  .create-form-actions {
    flex-direction: column-reverse;
  }

  .create-form-actions .btn {
    width: 100%;
  }

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

/* ----------------------------------------------------- 可搜索下拉选择 */

.search-select {
  position: relative;
  width: 100%;
}

.search-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}

.search-select-trigger:hover {
  border-color: var(--line-strong);
}

.search-select-trigger[aria-expanded="true"] {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(52, 91, 125, 0.16);
}

.search-select-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-select-value.placeholder {
  color: var(--muted);
}

.search-select-caret {
  flex: none;
  width: 16px;
  height: 16px;
  font-size: 0;
  color: var(--muted);
  background: currentColor;
  -webkit-mask: var(--icon-chevron) center / contain no-repeat;
  mask: var(--icon-chevron) center / contain no-repeat;
  transition: transform var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.search-select-trigger:hover .search-select-caret,
.search-select-trigger[aria-expanded="true"] .search-select-caret {
  color: var(--ink-strong);
}

.search-select-trigger[aria-expanded="true"] .search-select-caret {
  transform: rotate(180deg);
}

.search-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  animation: pop-in 140ms var(--ease) both;
}

.search-select-menu[hidden] {
  display: none;
}

.search-select-input {
  width: 100%;
  margin-bottom: 10px;
  padding: 9px 12px;
  font: inherit;
  font-size: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}

.search-select-input:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(52, 91, 125, 0.14);
}

.search-select-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 260px;
  overflow-y: auto;
}

.search-select-option {
  position: relative;
  padding: 9px 12px 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.search-select-option::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 50%;
  width: 3px;
  height: 16px;
  border-radius: 1px;
  background: var(--cinnabar);
  transform: translateY(-50%) scaleY(0);
  transition: transform var(--t-fast) var(--ease);
}

.search-select-option:hover,
.search-select-option.highlighted {
  background: var(--ink-soft);
}

.search-select-option.highlighted::before,
.search-select-option.selected::before {
  transform: translateY(-50%) scaleY(1);
}

.search-select-option.selected {
  color: var(--ink-deep);
  font-weight: 600;
}

.search-select-empty {
  padding: 18px 12px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

/* --------------------------------------------------------- 详情与提示 */

.detail-list {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 0 16px;
  margin: 0 0 22px;
}

.detail-list dt,
.detail-list dd {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.detail-list dt {
  font-size: 14px;
  color: var(--muted);
}

.detail-list dd {
  margin: 0;
  color: #2d3640;
}

.detail-list dt:last-of-type,
.detail-list dd:last-of-type {
  padding-bottom: 0;
  border-bottom: 0;
}

.notice {
  position: relative;
  margin-bottom: 16px;
  padding: 12px 16px 12px 42px;
  font-size: 14px;
  color: var(--warn-text);
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-left: 3px solid var(--warn-line);
  border-radius: var(--radius-sm);
}

.notice::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 14px;
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask: var(--icon-alert) center / contain no-repeat;
  mask: var(--icon-alert) center / contain no-repeat;
}

.notice.notice-ok {
  background: var(--ok-bg);
  border-color: var(--ok-border);
  border-left-color: var(--ok-line);
  color: var(--ok-text);
}

.notice.notice-ok::before {
  -webkit-mask: var(--icon-check) center / contain no-repeat;
  mask: var(--icon-check) center / contain no-repeat;
}

.muted {
  color: var(--muted);
}

/* --------------------------------------------------------- 状态徽标 */

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 9px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}

.status-badge::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: currentColor;
}

.review-card-state {
  padding: 2px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  font-size: 11px;
  font-weight: 600;
}

.review-card-warning {
  border-color: var(--warn-border);
  background: var(--warn-bg);
  color: var(--warn-text);
}

.review-card-success {
  border-color: var(--ok-border);
  background: var(--ok-bg);
  color: var(--ok-text);
}

.review-card-info {
  border-color: var(--ink-tint);
  background: var(--ink-soft);
  color: var(--ink-deep);
}

.status-active {
  background: var(--ink-soft);
  color: var(--ink-deep);
}

.status-archived {
  background: #f0f0ed;
  color: #6a706f;
}

.status-deprecated {
  background: var(--cinnabar-soft);
  color: var(--cinnabar-deep);
}

/* ------------------------------------------------------------- 登录页 */

.login-wrap {
  position: relative;
  max-width: 460px;
  margin: 6vh auto 0;
}

.login-wrap::before {
  content: "";
  position: absolute;
  z-index: 0;
  pointer-events: none;
  left: 50%;
  top: -52px;
  width: 460px;
  height: 220px;
  background: radial-gradient(closest-side, rgba(52, 91, 125, 0.1), rgba(52, 91, 125, 0));
  transform: translateX(-50%);
}

.login-wrap > * {
  position: relative;
  z-index: 1;
}

.login-seal {
  display: block;
  width: 54px;
  height: 54px;
  margin: 0 auto 16px;
}

.login-wrap h1 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  color: var(--heading);
}

.login-wrap .subtitle {
  margin: 0 0 24px;
  font-size: 14px;
  text-align: center;
  color: var(--muted);
}

.login-wrap .card {
  padding: 28px;
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 40px rgba(29, 40, 51, 0.08);
}

.wechat-login {
  display: grid;
  gap: 10px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed var(--line-strong);
}

.wechat-login[hidden] {
  display: none;
}

.wechat-hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
}

.wechat-advanced {
  margin-top: 4px;
}

.wechat-advanced summary {
  padding: 4px 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-strong);
  cursor: pointer;
}

.wechat-advanced[open] summary {
  margin-bottom: 4px;
}

.wechat-advanced .form-grid {
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
}

/* ------------------------------------------------------------- 动效 */

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

/* 卡片标题行：标题在左，操作按钮靠右 */
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-head h2 {
  margin: 0;
}

/* 小尺寸按钮 */
.btn-sm {
  padding: 5px 10px;
  font-size: 13px;
}

/* 文档决议：由问答话题回写的最终结论 */
.decision-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.decision-item {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.decision-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.decision-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.decision-head a {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.decision-head a:hover {
  color: var(--ink-deep);
}

.decision-meta {
  flex: none;
  font-size: 12px;
  color: var(--muted);
}

.decision-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}

/* ------------------------------------------------------------------ AI 问答 / 预审 */

.review-workflow {
  position: relative;
  margin-bottom: 18px;
  padding: 18px 20px 18px 24px;
  border: 1px solid var(--line-strong);
  border-left: 5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.review-workflow-warning {
  border-left-color: var(--warn-line);
  background: linear-gradient(90deg, var(--warn-bg), var(--surface) 55%);
}

.review-workflow-success {
  border-left-color: var(--ok-line);
  background: linear-gradient(90deg, var(--ok-bg), var(--surface) 55%);
}

.review-workflow-danger {
  border-left-color: var(--danger);
  background: linear-gradient(90deg, var(--cinnabar-soft), var(--surface) 55%);
}

.review-workflow-info {
  border-left-color: var(--ink);
}

.review-workflow-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}

.review-workflow-head strong {
  color: var(--heading);
  font-family: var(--serif, "Noto Serif SC", "Songti SC", serif);
  font-size: 20px;
}

.review-workflow-kicker {
  padding: 2px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.review-workflow p {
  margin: 4px 0 12px;
  color: var(--text);
  line-height: 1.7;
}

.review-workflow .actions {
  margin-top: 0;
}

.review-resubmit-context {
  margin: 14px 0;
  padding: 14px 16px;
  border: 1px solid var(--warn-border);
  border-left: 4px solid var(--warn-line);
  border-radius: var(--radius-sm);
  background: var(--warn-bg);
}

.review-resubmit-context strong {
  color: var(--warn-text);
}

.review-resubmit-context ul {
  margin: 8px 0;
  padding-left: 20px;
}

.review-evidence {
  margin: 8px 0;
  padding: 8px 10px;
  border-left: 3px solid var(--ink-tint);
  background: var(--ink-soft);
  color: var(--ink-deep);
  font-size: 13px;
}

.checklist-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 13px;
}

.checklist-count,
.checklist-status {
  padding: 2px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  font-size: 12px;
  font-weight: 600;
}

.checklist-pass {
  border-color: var(--ok-border);
  background: var(--ok-bg);
  color: var(--ok-text);
}

.checklist-fail {
  border-color: var(--cinnabar-tint);
  background: var(--cinnabar-soft);
  color: var(--cinnabar-deep);
}

.checklist-unknown {
  border-color: var(--warn-border);
  background: var(--warn-bg);
  color: var(--warn-text);
}

.checklist-results {
  display: grid;
  gap: 9px;
}

.checklist-result {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.checklist-result.checklist-pass {
  border-left-color: var(--ok-line);
  background: var(--surface);
}

.checklist-result.checklist-fail {
  border-left-color: var(--cinnabar);
  background: var(--surface);
}

.checklist-result.checklist-unknown {
  border-left-color: var(--warn-line);
  background: var(--surface);
}

.checklist-result-head {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.checklist-result-head strong {
  color: var(--heading);
}

.checklist-location {
  margin: 4px 0;
  color: var(--muted);
  font-size: 12px;
}

.checklist-result p {
  margin: 6px 0;
  line-height: 1.65;
}

.review-previous-checks {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.version-review-state {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  color: var(--muted);
  font-size: 12px;
}

.version-review-approved {
  border-color: var(--ok-border);
  background: var(--ok-bg);
  color: var(--ok-text);
}

.version-review-returned {
  border-color: var(--warn-border);
  background: var(--warn-bg);
  color: var(--warn-text);
}

.version-review-pending {
  border-color: var(--ink-tint);
  background: var(--ink-soft);
  color: var(--ink-deep);
}

.ai-card {
  padding-bottom: 22px;
}

.ai-tag {
  flex: none;
  padding: 3px 10px;
  border: 1px solid var(--ink-tint);
  border-radius: 3px;
  background: var(--ink-soft);
  color: var(--ink-deep);
  font-size: 12px;
  font-weight: 600;
}

.ai-help {
  margin: -8px 0 16px;
}

.ai-chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.ai-message {
  max-width: 82%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  white-space: pre-wrap;
  word-break: break-word;
}

.ai-message.assistant {
  align-self: flex-start;
}

.ai-message.user {
  align-self: flex-end;
  border-color: var(--ink);
  background: var(--ink);
  color: #ffffff;
}

.ai-message.error {
  border-color: var(--cinnabar-tint);
  background: var(--cinnabar-soft);
  color: var(--cinnabar-deep);
}

.ai-compose {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.ai-compose textarea {
  flex: 1;
  min-height: 52px;
  max-height: 140px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font: inherit;
  resize: vertical;
}

.ai-status {
  min-height: 20px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

.review-controls {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.review-specs {
  flex: 1;
  min-width: 0;
}

.field-label {
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--heading);
}

.spec-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  max-height: 160px;
  overflow-y: auto;
}

.spec-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13px;
}

.spec-option input {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 3px;
  padding: 0;
}

.spec-option small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.review-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.review-summary strong {
  flex: 1 1 100%;
}

.review-summary .actions {
  flex: 1 1 100%;
  margin-top: 2px;
}

.review-summary.verdict-pass {
  border-color: var(--ok-border);
  background: var(--ok-bg);
}

.review-summary.verdict-risk {
  border-color: var(--warn-border);
  background: var(--warn-bg);
}

.review-meta {
  color: var(--muted);
  font-size: 12px;
}

.review-verdict {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 3px;
  background: var(--ink-soft);
  color: var(--ink-deep);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.review-verdict.verdict-pass {
  background: var(--ok-bg);
  color: var(--ok-text);
}

.review-verdict.verdict-risk {
  background: var(--warn-bg);
  color: var(--warn-text);
}

.review-block {
  margin-top: 18px;
}

.review-block h3 {
  margin: 0 0 8px;
  font-size: 15px;
  color: var(--heading);
}

.review-issue {
  margin-bottom: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.review-issue.severity-high {
  border-left-color: var(--cinnabar);
}

.review-issue.severity-medium {
  border-left-color: var(--warn-line);
}

.review-issue-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.severity-badge {
  padding: 1px 8px;
  border-radius: 3px;
  background: var(--warn-bg);
  color: var(--warn-text);
  font-size: 12px;
  font-weight: 600;
}

.severity-high .severity-badge {
  background: var(--cinnabar-soft);
  color: var(--cinnabar-deep);
}

.severity-low .severity-badge {
  background: var(--ink-soft);
  color: var(--ink-deep);
}

.review-suggestion {
  color: var(--ink-deep);
  font-size: 14px;
}

.review-check-list,
.review-change-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.review-check-list li,
.review-change-list li {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.check-mark {
  margin-right: 8px;
  font-size: 12px;
  font-weight: 600;
}

.check-mark.ok {
  color: var(--ok-text);
}

.check-mark.bad {
  color: var(--danger);
}

.review-history {
  margin-top: 20px;
}

.review-history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 6px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.review-history-item:hover {
  border-color: var(--line-strong);
  background: var(--ink-soft);
}

.review-history-item .review-verdict {
  flex: none;
}

.review-history-item .muted {
  flex: none;
  margin-left: auto;
  font-size: 12px;
}

.review-raw {
  white-space: pre-wrap;
  word-break: break-word;
}

.btn-warning {
  background: #a16f2f;
  color: #ffffff;
}

.btn-warning:hover:not(:disabled) {
  background: #855922;
}

.review-decision {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.review-decision textarea {
  width: 100%;
  min-height: 70px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font: inherit;
  resize: vertical;
}

.review-human-state {
  align-self: center;
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
}

.has-confirm-modal {
  overflow: hidden;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(29, 40, 51, 0.42);
  backdrop-filter: blur(3px);
}

.confirm-dialog {
  width: min(460px, calc(100vw - 48px));
  padding: 24px 26px 22px;
  border: 1px solid var(--line-strong);
  border-top: 3px solid var(--ink);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
}

.confirm-dialog-kicker {
  margin-bottom: 5px;
  color: var(--cinnabar);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.confirm-dialog h2 {
  margin: 0 0 10px;
  color: var(--heading);
  font-family: var(--font-display);
  font-size: 23px;
  line-height: 1.35;
}

.confirm-dialog p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.confirm-dialog-verdict {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 17px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 13px;
}

.confirm-dialog-verdict span {
  color: var(--muted);
}

.confirm-dialog-verdict strong {
  color: var(--heading);
}

.confirm-dialog-verdict.verdict-risk strong {
  color: var(--danger);
}

.confirm-dialog-verdict.verdict-unknown strong {
  color: var(--warn-text);
}

.confirm-dialog .confirm-dialog-warning {
  margin-top: 10px;
  color: var(--warn-text);
  font-size: 13px;
}

.confirm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

@media (prefers-reduced-motion: reduce) {
  .confirm-modal {
    backdrop-filter: none;
  }
}

.review-verdict.status-pending {
  background: #ecece9;
  color: #62696a;
}

.review-verdict.status-running {
  background: var(--ink-soft);
  color: var(--ink-deep);
}

.review-verdict.status-failed {
  background: var(--cinnabar-soft);
  color: var(--cinnabar-deep);
}

.review-verdict.status-skipped {
  background: var(--warn-bg);
  color: var(--warn-text);
}

.review-summary.status-pending,
.review-summary.status-running {
  border-color: var(--ink-tint);
  background: var(--ink-soft);
}

.review-summary.status-failed {
  border-color: var(--cinnabar-tint);
  background: var(--cinnabar-soft);
}

.review-summary.status-skipped {
  border-color: var(--warn-border);
  background: var(--warn-bg);
}
