/* ========== 设计变量 ========== */
:root {
  --bg: #f0f2f7;
  --bg-accent: rgba(99, 102, 241, 0.06);
  --card: #ffffff;
  --surface-raised: #fafbfc;
  --text: #0f172a;
  --text-secondary: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;
  --accent-muted: #c7d2fe;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --ok: #059669;
  --ok-soft: #ecfdf5;
  --warn-bg: #fffbeb;
  --warn-text: #b45309;
  --edited-bg: #e2e8f0;
  --new-text: #dc2626;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 10px 24px -6px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 40px -8px rgba(15, 23, 42, 0.12);
  --ring: rgba(79, 70, 229, 0.22);
  --header-h: 56px;
  /* 顶栏与主内容区同一水平宽度，避免与卡片错位 */
  --layout-width: 80%;
  --layout-pad-x: 22px;
  /* 页脚：备案/版权条（与顶栏呼应的轻量表面） */
  --site-foot-legal-bg: rgba(255, 255, 255, 0.58);
  --site-foot-legal-edge: rgba(148, 163, 184, 0.2);
  --site-foot-legal-text: rgba(71, 85, 105, 0.92);
  --site-foot-legal-text-soft: rgba(100, 116, 139, 0.88);
  --site-foot-home-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(248, 250, 252, 0.5) 100%);
  --site-foot-home-edge: rgba(199, 210, 254, 0.35);
  --font-sans: "Segoe UI", system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse 100% 80% at 100% 0%, var(--bg-accent), transparent 52%),
    radial-gradient(ellipse 70% 50% at 0% 100%, rgba(59, 130, 246, 0.05), transparent 50%),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-family: var(--font-sans);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent-soft);
  color: var(--accent-hover);
}

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}
a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* ========== 顶栏（前台） ========== */
header.site-header {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  width: var(--layout-width);
  max-width: 100%;
  margin: 0 auto;
  padding: 0 var(--layout-pad-x);
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}
.brand-link:hover {
  color: var(--accent);
  text-decoration: none;
}
.brand-with-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.site-logo {
  max-height: 36px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  display: block;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 14px;
}

.nav-links a {
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-links a:hover {
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
}

.nav-links .muted {
  padding: 0 6px;
  font-size: 13px;
}

/* ========== 主内容区 ========== */
main.layout {
  width: var(--layout-width);
  max-width: 100%;
  margin: 0 auto;
  padding: 28px var(--layout-pad-x) 64px;
  box-sizing: border-box;
}

/* 首页底部含备案/版权时，避免主栏与页脚之间过大空白 */
main.layout:has(.site-foot--home) {
  padding-bottom: 32px;
}

/* ========== 前台页脚：备案号 + 首页自定义 HTML ========== */

/**
 * site-foot — 首页底部备案/版权区（位于 main 末尾，与主栏同宽）
 * site-foot-home — 首页主栏内，后台「首页底部文案」原样渲染区
 */

.site-foot {
  margin-top: 0;
  box-sizing: border-box;
}

/**
 * 首页备案/版权：轻表面 + 细线轮廓，与顶栏同为「薄玻璃」语言；层次靠间距与分割线而非重阴影。
 */
.site-foot--home {
  --site-foot-pad-y: 22px;
  width: 100%;
  margin-top: 30px;
  border-radius: var(--radius-lg);
  box-sizing: border-box;
  overflow: clip;
  background: var(--site-foot-legal-bg);
  border: 1px solid var(--site-foot-legal-edge);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.65) inset, 0 12px 40px -28px rgba(15, 23, 42, 0.12);
}

.site-foot--home::before {
  content: "";
  display: block;
  height: 2px;
  margin: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(79, 70, 229, 0) 12%,
    rgba(79, 70, 229, 0.22) 42%,
    rgba(79, 70, 229, 0.28) 50%,
    rgba(79, 70, 229, 0.22) 58%,
    rgba(79, 70, 229, 0) 88%,
    transparent 100%
  );
  opacity: 0.85;
}

.site-foot-home + .site-foot--home {
  margin-top: 18px;
}

.site-foot__inner {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: var(--site-foot-pad-y) var(--layout-pad-x) calc(var(--site-foot-pad-y) + 2px);
  text-align: center;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* 在 main 内时不再叠加 main 的左右 padding，与 .card 水平留白接近 */
.site-foot--home .site-foot__inner {
  padding-left: 28px;
  padding-right: 28px;
  padding-top: calc(var(--site-foot-pad-y) - 4px);
}

.site-foot__copyright {
  width: 100%;
  max-width: 38rem;
  font-size: 12.5px;
  line-height: 1.7;
  letter-spacing: 0.02em;
  color: var(--site-foot-legal-text-soft);
  text-align: center;
  min-width: 0;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.site-foot__copyright > :first-child {
  margin-top: 0;
}

.site-foot__copyright > :last-child {
  margin-bottom: 0;
}

.site-foot__copyright :where(p) {
  margin: 0.4em 0;
}

.site-foot__copyright :where(p):first-child {
  margin-top: 0;
}

.site-foot__copyright :where(p):last-child {
  margin-bottom: 0;
}

.site-foot__copyright :where(small) {
  font-size: 0.92em;
  opacity: 0.92;
}

.site-foot__copyright :where(a),
.site-foot__copyright :where(a):visited {
  color: var(--site-foot-legal-text);
  text-decoration: underline;
  text-decoration-color: rgba(79, 70, 229, 0.28);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
  transition: color 0.18s ease, text-decoration-color 0.18s ease;
}

.site-foot__copyright :where(a):hover {
  color: var(--accent);
  text-decoration-color: rgba(79, 70, 229, 0.45);
}

/* 版权与备案并存时：全宽发丝分割线 + 略收紧的备案行 */
.site-foot__inner > .site-foot__copyright + .site-foot__icp {
  align-self: stretch;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--site-foot-legal-edge);
}

.site-foot__icp {
  display: inline-block;
  max-width: 100%;
  min-width: 0;
  font-size: 12.5px;
  line-height: 1.55;
  letter-spacing: 0.04em;
  font-weight: 500;
  color: var(--site-foot-legal-text);
  text-decoration: none;
  padding: 2px 2px 3px;
  border-radius: 4px;
  overflow-wrap: anywhere;
  box-sizing: border-box;
  transition: color 0.18s ease, text-decoration-color 0.18s ease, background 0.18s ease;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
  text-decoration-color: transparent;
}

.site-foot__icp:hover {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(79, 70, 229, 0.35);
  background: rgba(238, 242, 255, 0.35);
}

.site-foot__icp:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.site-foot-home {
  margin-top: 32px;
  padding: 22px 22px 24px;
  border: 1px solid var(--site-foot-home-edge);
  border-radius: var(--radius-lg);
  background: var(--site-foot-home-bg);
  box-shadow: var(--shadow-sm);
  font-size: 0.94rem;
  line-height: 1.68;
  color: var(--text-secondary);
  box-sizing: border-box;
}

.site-foot-home > :first-child {
  margin-top: 0;
}

.site-foot-home > :last-child {
  margin-bottom: 0;
}

.site-foot-home :where(h1, h2, h3, h4) {
  margin: 1.15em 0 0.45em;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.35;
}

.site-foot-home :where(h1):first-child,
.site-foot-home :where(h2):first-child,
.site-foot-home :where(h3):first-child,
.site-foot-home :where(h4):first-child {
  margin-top: 0;
}

.site-foot-home :where(p) {
  margin: 0.55em 0;
}

.site-foot-home :where(ul, ol) {
  margin: 0.55em 0;
  padding-inline-start: 1.35em;
}

.site-foot-home :where(li) {
  margin: 0.25em 0;
}

.site-foot-home :where(a),
.site-foot-home :where(a):visited {
  color: inherit;
}

.site-foot-home :where(a) {
  font-weight: inherit;
  text-decoration: none;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.22em;
  border-radius: 4px;
  word-break: break-word;
  overflow-wrap: anywhere;
  transition: text-decoration-color 0.16s ease, box-shadow 0.16s ease;
}

.site-foot-home :where(a):hover {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: currentColor;
}

.site-foot-home :where(a):focus-visible {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: currentColor;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.site-foot-home :where(a):active {
  color: inherit;
}

.site-foot-home :where(img) {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}

.site-foot-home :where(table) {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
}

.site-foot-home :where(th, td) {
  border: 1px solid var(--line);
  padding: 8px 10px;
}

@media (max-width: 640px) {
  .site-foot--home {
    margin-top: 24px;
    border-radius: var(--radius);
  }

  .site-foot--home::before {
    opacity: 0.75;
  }

  .site-foot__inner {
    padding-inline: 16px;
  }

  .site-foot--home .site-foot__inner {
    padding-inline: 16px;
  }

  .site-foot-home {
    padding: 18px 16px 20px;
    margin-top: 24px;
  }
}

/* 注册开发者页：系统设置中的副文案 */
.register-developer-blurb {
  margin: 0 0 14px;
  line-height: 1.65;
  max-width: 36rem;
}

/* 后台：代码类多行输入 */
.code-area {
  width: 100%;
  max-width: 100%;
  min-height: 140px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.45;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-raised);
  resize: vertical;
}

body.admin-area main.layout {
  padding-top: 26px;
}

/* 后台：顶栏大类换行 + 主区侧栏 */
body.admin-area .admin-topnav {
  flex-wrap: wrap;
  row-gap: 6px;
  justify-content: flex-end;
}

body.admin-area .admin-layout-main > .admin-shell {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  width: 100%;
}

body.admin-area .admin-subnav {
  flex: 0 0 200px;
  position: sticky;
  top: calc(var(--header-h) + 18px);
  align-self: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 8px 0;
}

body.admin-area .admin-subnav__inner {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

body.admin-area .admin-subnav a {
  display: block;
  padding: 9px 16px;
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 0;
  border-left: 3px solid transparent;
}

body.admin-area .admin-subnav a:hover {
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
}

body.admin-area .admin-subnav a.is-active {
  background: rgba(99, 102, 241, 0.08);
  color: var(--accent);
  font-weight: 600;
  border-left-color: var(--accent);
}

body.admin-area .admin-page {
  flex: 1;
  min-width: 0;
}

/* 后台 · 开发者资料 · 上传文件缩略图预览 */
.admin-dev-previews {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 8px 0 18px;
  max-width: 920px;
}

.admin-dev-preview-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px 16px;
  align-items: start;
}

.admin-dev-preview-label {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text);
  padding-top: 4px;
}

.admin-dev-preview-body {
  min-width: 0;
}

.admin-dev-preview-body--wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 14px;
  align-items: flex-start;
}

.admin-dev-preview-body--idpair {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  align-items: flex-start;
}

.admin-dev-id-side {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.admin-dev-id-side-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.admin-dev-preview-item {
  flex: 0 0 auto;
}

.admin-dev-thumb-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  text-decoration: none;
  color: inherit;
  border-radius: 8px;
}

.admin-dev-thumb-wrap:hover .admin-dev-thumb {
  border-color: rgba(99, 102, 241, 0.65);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.18);
}

.admin-dev-thumb {
  width: 88px;
  height: 88px;
  object-fit: contain;
  object-position: center;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.55);
  background: rgba(248, 250, 252, 0.9);
  display: block;
}

.admin-dev-thumb-hint {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.2;
}

.admin-dev-file-link {
  font-size: 0.9rem;
  word-break: break-all;
}

@media (max-width: 520px) {
  .admin-dev-preview-row {
    grid-template-columns: 1fr;
  }

  .admin-dev-preview-label {
    padding-top: 0;
  }
}

.btn.small {
  padding: 6px 10px;
  font-size: 13px;
}

.admin-menu-sec__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 12px;
}

.admin-menu-inline {
  display: inline-block;
  margin: 0;
}

.admin-menu-sec__form {
  flex: 1 1 220px;
  min-width: 0;
}

.admin-menu-item-save {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.admin-menu-add-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 14px;
}

.admin-menu-add-row select {
  min-width: 240px;
  max-width: 100%;
}

.admin-user-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.admin-user-search input[type="search"] {
  min-width: 200px;
  max-width: 100%;
  flex: 1 1 220px;
}

@media (max-width: 860px) {
  body.admin-area .admin-layout-main > .admin-shell {
    flex-direction: column;
  }

  body.admin-area .admin-subnav {
    position: static;
    flex: none;
    width: 100%;
  }

  body.admin-area .admin-subnav__inner {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px;
  }

  body.admin-area .admin-subnav a {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border-left: none;
  }

  body.admin-area .admin-subnav a.is-active {
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.35) inset;
  }
}

section.card + section.card {
  margin-top: 22px;
}

/* ========== 卡片 ========== */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 26px 28px;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  border-color: rgba(99, 102, 241, 0.12);
  box-shadow: var(--shadow-lg);
}

.card.narrow {
  max-width: 480px;
  margin: 40px auto;
}

.grid-2 > .card {
  box-shadow: var(--shadow-sm);
  border-color: rgba(226, 232, 240, 0.95);
}
.grid-2 > .card:hover {
  box-shadow: var(--shadow);
}

/* ========== 首页 · 双视角流程 ========== */
.home-flow {
  padding: 28px 28px 30px;
  overflow: hidden;
}

.home-flow__intro {
  text-align: center;
  max-width: 52rem;
  margin: 0 auto 26px;
}

.home-flow__title {
  margin: 0 0 10px;
  font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.home-flow__lead {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--muted);
}

.home-flow__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}

@media (max-width: 900px) {
  .home-flow__grid {
    grid-template-columns: 1fr;
  }
}

.home-flow__panel {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 22px 22px 20px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  background: var(--card);
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.home-flow__panel:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.home-flow__panel--demander {
  background: linear-gradient(155deg, rgba(79, 70, 229, 0.07) 0%, rgba(255, 255, 255, 0.92) 42%, var(--card) 100%);
  border-color: rgba(129, 140, 248, 0.35);
}

.home-flow__panel--developer {
  background: linear-gradient(155deg, rgba(5, 150, 105, 0.08) 0%, rgba(255, 255, 255, 0.92) 42%, var(--card) 100%);
  border-color: rgba(52, 211, 153, 0.4);
}

.home-flow__panel-top {
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.95);
}

.home-flow__badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.home-flow__panel--demander .home-flow__badge {
  background: linear-gradient(120deg, var(--accent-soft), rgba(199, 210, 254, 0.65));
  color: var(--accent-hover);
  border: 1px solid rgba(165, 180, 252, 0.5);
}

.home-flow__panel--developer .home-flow__badge {
  background: linear-gradient(120deg, #ecfdf5, rgba(167, 243, 208, 0.55));
  color: var(--ok);
  border: 1px solid rgba(110, 231, 183, 0.55);
}

.home-flow__panel-title {
  margin: 12px 0 6px;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.home-flow__panel-sub {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.home-flow__steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.home-flow__step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px 16px;
  padding: 14px 0;
  border-top: 1px dashed rgba(203, 213, 225, 0.85);
}

.home-flow__steps .home-flow__step:first-child {
  border-top: none;
  padding-top: 0;
}

.home-flow__step-index {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-top: 2px;
}

.home-flow__panel--demander .home-flow__step-index {
  background: linear-gradient(145deg, #eef2ff, #e0e7ff);
  color: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(199, 210, 254, 0.8);
}

.home-flow__panel--developer .home-flow__step-index {
  background: linear-gradient(145deg, #ecfdf5, #d1fae5);
  color: #047857;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(167, 243, 208, 0.85);
}

.home-flow__step-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.home-flow__step-text strong {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.home-flow__step-text > span {
  font-size: 0.88rem;
  line-height: 1.58;
  color: var(--muted);
}

/* ========== 首页 · 完整项目流程示意图 ========== */
.home-pipeline {
  padding: 28px 24px 32px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.9) 0%, var(--card) 18%, var(--card) 100%);
}

.home-pipeline__intro {
  text-align: center;
  max-width: 40rem;
  margin: 0 auto 28px;
}

.home-pipeline__title {
  margin: 0 0 10px;
  font-size: clamp(1.2rem, 1rem + 0.9vw, 1.55rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.home-pipeline__lead {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--muted);
}

.home-pipeline__outer {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  padding-left: 8px;
}

.home-pipeline__rail {
  position: absolute;
  z-index: 0;
  /* 与首列网格对齐：outer 左内边距 8px + 列宽 52px 的中点 − 竖线宽度一半 */
  left: calc(8px + 52px / 2 - 2px);
  top: 18px;
  bottom: 18px;
  width: 4px;
  border-radius: 4px;
  background: linear-gradient(
    180deg,
    #6366f1 0%,
    #8b5cf6 18%,
    #a855f7 36%,
    #0d9488 58%,
    #eab308 78%,
    #22c55e 100%
  );
  opacity: 0.88;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.25);
}

.home-pipeline__items {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.home-pipeline__row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 14px 18px;
  align-items: stretch;
  padding-bottom: 14px;
}

.home-pipeline__row:not(.home-pipeline__row--end) {
  margin-bottom: 2px;
}

.home-pipeline__row--span {
  padding-bottom: 18px;
}

.home-pipeline__node {
  position: relative;
  z-index: 2;
  justify-self: center;
  align-self: start;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.75);
  border: 2px solid rgba(255, 255, 255, 0.95);
}

.home-pipeline__node--linear {
  background: linear-gradient(145deg, #eef2ff, #e0e7ff);
  color: var(--accent);
  border-color: rgba(199, 210, 254, 0.95);
}

.home-pipeline__node--loop {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(145deg, #f5f3ff, #ede9fe);
  color: #6d28d9;
  border-color: rgba(196, 181, 253, 0.95);
  font-size: 1.15rem;
}

.home-pipeline__node--loop-warn {
  background: linear-gradient(145deg, #fffbeb, #fef3c7);
  color: #b45309;
  border-color: rgba(253, 224, 71, 0.85);
}

.home-pipeline__node--pay {
  background: linear-gradient(145deg, #fffbeb, #fef9c3);
  color: #a16207;
  border-color: rgba(253, 224, 71, 0.9);
  font-size: 0.78rem;
}

.home-pipeline__node--done {
  background: linear-gradient(145deg, #ecfdf5, #d1fae5);
  color: #047857;
  border-color: rgba(167, 243, 208, 0.95);
}

/* 末行右侧卡片常高于左侧节点：节点列下方留白会让竖线穿出；用与流程区底色一致的条盖住竖线在节点以下的延伸 */
.home-pipeline__row--end {
  position: relative;
}

.home-pipeline__row--end::before {
  content: '';
  position: absolute;
  z-index: 1;
  /* 与竖线同一中心轴（首列宽 52px 的中点） */
  left: calc(52px / 2 - 10px);
  top: 22px;
  width: 20px;
  bottom: 0;
  background: var(--card);
  pointer-events: none;
}

.home-pipeline__glyph {
  line-height: 1;
  font-size: 1.25rem;
}

.home-pipeline__card {
  background: var(--surface-raised);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.home-pipeline__row:hover .home-pipeline__card:not(.home-pipeline__card--done) {
  border-color: rgba(165, 180, 252, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), 0 4px 14px rgba(99, 102, 241, 0.08);
}

.home-pipeline__card--highlight {
  background: linear-gradient(120deg, rgba(254, 252, 232, 0.95), rgba(255, 255, 255, 0.98));
  border-color: rgba(250, 204, 21, 0.45);
}

.home-pipeline__card--done {
  background: linear-gradient(120deg, rgba(236, 253, 245, 0.95), rgba(255, 255, 255, 0.98));
  border-color: rgba(52, 211, 153, 0.5);
}

.home-pipeline__text {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
}

.home-pipeline__card--highlight .home-pipeline__text strong {
  color: #a16207;
}

.home-pipeline__loop {
  border-radius: var(--radius-lg);
  padding: 16px 18px 14px;
  border: 1px dashed rgba(139, 92, 246, 0.45);
  background: linear-gradient(165deg, rgba(245, 243, 255, 0.75), rgba(255, 255, 255, 0.92));
  box-shadow: 0 6px 24px rgba(109, 40, 217, 0.06);
}

.home-pipeline__loop--complaint {
  border-color: rgba(245, 158, 11, 0.5);
  background: linear-gradient(165deg, rgba(255, 251, 235, 0.85), rgba(255, 255, 255, 0.95));
  box-shadow: 0 6px 24px rgba(180, 83, 9, 0.06);
}

.home-pipeline__loop-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #6d28d9;
  background: rgba(237, 233, 254, 0.95);
  border: 1px solid rgba(196, 181, 253, 0.6);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.home-pipeline__loop--complaint .home-pipeline__loop-tag {
  color: #b45309;
  background: rgba(254, 243, 199, 0.95);
  border-color: rgba(253, 224, 71, 0.55);
}

.home-pipeline__loop-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.home-pipeline__loop-flow--triple {
  gap: 8px 6px;
}

.home-pipeline__chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.home-pipeline__loop--complaint .home-pipeline__chip {
  background: rgba(255, 255, 255, 0.96);
}

.home-pipeline__arrow {
  display: inline-block;
  width: 18px;
  height: 8px;
  flex-shrink: 0;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.35), rgba(99, 102, 241, 0.55));
  clip-path: polygon(0 35%, 60% 35%, 60% 0, 100% 50%, 60% 100%, 60% 65%, 0 65%);
  opacity: 0.9;
}

.home-pipeline__loop-hint {
  margin: 12px 0 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted);
}

.home-pipeline__fork {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

@media (max-width: 640px) {
  .home-pipeline__fork {
    grid-template-columns: 1fr;
  }
}

.home-pipeline__branch {
  border-radius: var(--radius);
  padding: 12px 14px 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
}

.home-pipeline__branch--dispute {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(255, 255, 255, 0.75);
}

.home-pipeline__branch--praise {
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(236, 253, 245, 0.35);
}

.home-pipeline__branch-title {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.home-pipeline__branch-hint {
  margin: 10px 0 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--muted);
}

.home-pipeline__branch-praise {
  display: flex;
  align-items: center;
  min-height: 40px;
}

.home-pipeline__chip--accent {
  background: linear-gradient(120deg, #ecfdf5, #d1fae5);
  border-color: rgba(52, 211, 153, 0.55);
  color: #047857;
  font-size: 0.88rem;
}

.home-vote {
  margin-top: 18px;
  border: 1px solid rgba(99, 102, 241, 0.22);
  background: linear-gradient(165deg, rgba(79, 70, 229, 0.06), rgba(255, 255, 255, 0.95) 28%, #fff 100%);
}
.home-vote__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.home-vote__title {
  margin: 0;
  font-size: 1.12rem;
}
.home-vote__badge {
  font-size: 12px;
  color: #4338ca;
  background: rgba(99, 102, 241, 0.14);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}
.home-vote__desc {
  margin: 0 0 10px;
}
.home-vote__note {
  margin: 0 0 8px;
}
.home-vote__tip {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.home-vote__tip--ok {
  color: #14532d;
  background: #ecfdf3;
  border: 1px solid #86efac;
}
.home-vote__tip--warn {
  color: #92400e;
  background: #fff7ed;
  border: 1px solid #fdba74;
}
.home-vote__tip.is-hiding {
  opacity: 0;
  transform: translateY(-4px);
}
.home-vote__form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.home-vote__option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.home-vote__option:hover {
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}
.home-vote__option input[type='radio'] {
  accent-color: var(--accent);
}
.home-vote__option-tag {
  font-size: 12px;
  font-weight: 700;
  color: #3730a3;
  background: rgba(99, 102, 241, 0.16);
  border-radius: 7px;
  padding: 2px 7px;
}
.home-vote__option-text {
  font-size: 14px;
  color: var(--text);
}
.home-vote__filters {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.home-vote__filter {
  text-decoration: none;
  font-size: 13px;
  border: 1px solid rgba(148, 163, 184, 0.42);
  color: #334155;
  background: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  transition: all 0.15s ease;
}
.home-vote__filter:hover {
  border-color: rgba(99, 102, 241, 0.45);
  color: #312e81;
}
.home-vote__filter.is-active {
  color: #fff;
  border-color: rgba(67, 56, 202, 0.9);
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  box-shadow: 0 8px 18px rgba(67, 56, 202, 0.26);
}
.home-vote__stats {
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px dashed rgba(148, 163, 184, 0.42);
  border-radius: 12px;
  padding: 12px;
}
.home-vote__scope {
  margin-bottom: 8px;
}
.home-vote__split-wrap {
  margin-top: 10px;
  position: relative;
}
.home-vote__split {
  display: flex;
  position: relative;
  width: 100%;
  height: 44px;
  background: linear-gradient(135deg, #1d4ed8, #4338ca);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.home-vote__split-left,
.home-vote__split-right {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.01em;
  min-width: 0;
  overflow: hidden;
}
.home-vote__split-left {
  background: linear-gradient(135deg, #f97316, #ef4444);
  animation: homeVoteGrowLeft 0.65s ease both;
  transform-origin: left center;
}
.home-vote__split-right {
  background: linear-gradient(135deg, #1d4ed8, #4338ca);
  animation: homeVoteGrowRight 0.65s ease both;
  transform-origin: right center;
}
.home-vote__split-left span,
.home-vote__split-right span {
  font-size: 15px;
  line-height: 1;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
}
.home-vote__pct {
  padding: 0 6px;
}
.home-vote__pct.is-hidden {
  display: none;
}
.home-vote__split-labels {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-top: 8px;
}
.home-vote__split-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.home-vote__split-label strong {
  font-size: 17px;
  line-height: 1;
}
.home-vote__split-label span {
  color: var(--muted);
  font-size: 12px;
}
.home-vote__split-label--yes strong {
  color: #ef4444;
}
.home-vote__split-label--no strong {
  color: #1d4ed8;
}
.home-vote__voted-badge {
  position: absolute;
  bottom: 6px;
  font-size: 11px;
  font-style: normal;
  color: #fff;
  background: rgba(15, 23, 42, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  padding: 2px 7px;
  line-height: 1.2;
  pointer-events: none;
}
.home-vote__voted-badge--left {
  left: 8px;
}
.home-vote__voted-badge--right {
  right: 8px;
}
.home-vote__total {
  margin-top: 8px;
}
@keyframes homeVoteGrowLeft {
  from { transform: scaleX(0.15); opacity: 0.55; }
  to { transform: scaleX(1); opacity: 1; }
}
@keyframes homeVoteGrowRight {
  from { transform: scaleX(0.15); opacity: 0.55; }
  to { transform: scaleX(1); opacity: 1; }
}

/* ========== 需求方个人中心（宽度随 main.layout，与其它卡片页一致）========== */
.page-demander-center__head {
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.page-demander-center__title {
  margin: 0 0 10px;
  font-size: clamp(1.2rem, 1rem + 1vw, 1.55rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.page-demander-center__alert {
  margin: 0 0 12px;
}

.page-demander-center__lead {
  margin: 0;
  max-width: 52ch;
  line-height: 1.65;
}

.page-demander-center__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.page-demander-center__balance {
  background: linear-gradient(165deg, var(--surface-raised) 0%, rgba(238, 242, 255, 0.55) 100%);
  border: 1px solid rgba(199, 210, 254, 0.45);
  border-radius: var(--radius);
  padding: 20px 22px 22px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.page-demander-center__balance-title {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.page-demander-center__balance-value {
  margin: 0 0 18px;
  line-height: 1.15;
}

.page-demander-center__balance-num {
  font-size: clamp(1.75rem, 1.2rem + 2.5vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--accent);
}

.page-demander-center__balance-unit {
  margin-left: 4px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
}

.page-demander-center__withdraw {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 320px;
}

.page-demander-center__withdraw input,
.page-demander-center__withdraw select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--card);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.page-demander-center__withdraw input:hover,
.page-demander-center__withdraw select:hover {
  border-color: var(--line-strong);
}

.page-demander-center__withdraw input:focus,
.page-demander-center__withdraw select:focus {
  outline: none;
  border-color: var(--accent-muted);
  box-shadow: 0 0 0 3px var(--ring);
}

.page-demander-center__foot {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.page-demander-center__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ========== 项目工作台：可编辑标题 + 固定时间后缀 ========== */
.project-workspace-head-text {
  min-width: 0;
  flex: 1 1 auto;
}

h1.project-title-h1 {
  margin: 0 0 6px;
  font-size: clamp(1.2rem, 1rem + 1.1vw, 1.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.35;
  color: var(--text);
}

.project-title-line {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  max-width: 100%;
  gap: 0;
}

.project-title-name-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  vertical-align: baseline;
  padding: 4px 52px 4px 6px;
  margin: -4px -6px 2px -6px;
}

.project-title-name {
  cursor: pointer;
  border-radius: 6px;
  padding: 2px 4px;
  margin: -2px -4px;
  transition: background 0.12s ease;
  outline: none;
}

.project-title-name:hover {
  background: rgba(99, 102, 241, 0.08);
}

.project-title-name:focus-visible {
  box-shadow: 0 0 0 2px var(--ring);
}

.project-title-edit {
  position: absolute;
  top: 4px;
  right: 4px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
}

.project-title-time {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.86em;
  letter-spacing: 0;
}

.project-title-input {
  font: inherit;
  font-weight: 700;
  font-size: inherit;
  letter-spacing: inherit;
  color: var(--text);
  min-width: 10em;
  max-width: min(100%, 440px);
  padding: 5px 11px;
  margin: 0;
  border: 1px solid var(--accent-muted);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 0 0 3px var(--ring);
}

/* ========== 标题 ========== */
h1 {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin: 0 0 14px;
  color: var(--text);
}

h2 {
  font-size: 1.1rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  color: var(--text-secondary);
}

h3 {
  font-size: 0.98rem;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--muted);
  letter-spacing: -0.01em;
}

/* ========== 文案状态 ========== */
.muted {
  color: var(--muted);
}
.small {
  font-size: 13px;
  line-height: 1.5;
}
.ok {
  color: var(--ok);
  background: var(--ok-soft);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin: 0 0 12px;
  display: block;
  border: 1px solid rgba(5, 150, 105, 0.15);
}
p.ok a {
  color: #047857;
  font-weight: 600;
}
p.ok a:hover {
  color: #065f46;
}
.err {
  color: var(--danger);
}

/* ========== 按钮 ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--card);
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  line-height: 1.25;
  text-decoration: none;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, box-shadow 0.15s ease, border-color 0.15s ease,
    background 0.15s ease, color 0.15s ease;
}
.btn:hover {
  border-color: var(--line-strong);
  background: var(--surface-raised);
  text-decoration: none;
  color: var(--text);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}
.btn:active {
  transform: translateY(0);
}

.btn.primary {
  background: linear-gradient(165deg, #6366f1 0%, var(--accent) 45%, #4338ca 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
}
.btn.primary:hover {
  filter: brightness(1.06);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.btn:disabled,
.btn[disabled] {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  filter: none;
  pointer-events: none;
}
.btn:disabled:hover,
.btn[disabled]:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
}
.btn.primary:disabled,
.btn.primary[disabled] {
  opacity: 1;
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #94a3b8;
  box-shadow: none;
}
.btn.primary:disabled:hover,
.btn.primary[disabled]:hover {
  filter: none;
  box-shadow: none;
  color: #94a3b8;
}

/* 发送中等：与 disabled 同视觉，不依赖浏览器对 disabled 的重绘时机 */
.btn.primary.btn--sending {
  cursor: not-allowed !important;
  pointer-events: none !important;
  opacity: 1 !important;
  background: #e2e8f0 !important;
  border-color: #cbd5e1 !important;
  color: #94a3b8 !important;
  box-shadow: none !important;
  filter: none !important;
  transform: none !important;
}

.btn.ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--muted);
}
.btn.ghost:hover {
  background: var(--surface-raised);
  color: var(--accent);
}

.btn.danger {
  border-color: #fecaca;
  background: var(--danger-soft);
  color: var(--danger);
}
.btn.danger:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.btn:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ========== 表单 ========== */
.form-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 14px 18px;
  align-items: center;
}

.form-grid label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  font: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s 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 {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
  outline: none;
}

.form-grid textarea {
  min-height: 100px;
  resize: vertical;
}

/* ========== 表格 ========== */
table.data {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

table.data th,
table.data td {
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}

table.data tr:last-child td {
  border-bottom: none;
}

table.data tbody tr {
  transition: background 0.12s ease;
}
table.data tbody tr:hover {
  background: rgba(99, 102, 241, 0.03);
}

table.data th {
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

table.tasks-table th:nth-child(2),
table.tasks-table th:nth-child(3),
table.tasks-table th:nth-child(4),
table.tasks-table td:nth-child(2),
table.tasks-table td:nth-child(3),
table.tasks-table td:nth-child(4) {
  white-space: nowrap;
  vertical-align: middle;
}

table.tasks-table td:nth-child(4) form {
  display: inline;
}

/* ========== 徽章 ========== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent-hover);
  border: 1px solid rgba(99, 102, 241, 0.15);
}
.badge.warn {
  background: var(--warn-bg);
  color: var(--warn-text);
  border-color: rgba(245, 158, 11, 0.25);
}

/* 未读消息红点（导航/按钮右上角） */
.notify-dot-anchor {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.notify-red-dot {
  position: absolute;
  right: 6px;
  top: 2px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #ef4444;
  box-shadow: 0 0 0 2px #fff;
}

/* 用户勋章（后台颁发，个人中心展示） */
.user-badges__title {
  font-size: 1.05rem;
  margin: 0 0 10px;
  font-weight: 600;
}
.user-badges__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: flex-start;
}
.user-badges__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  max-width: 88px;
  text-align: center;
}
.user-badges__img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2, #f8fafc);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.user-badges__name {
  font-size: 12px;
  line-height: 1.25;
  color: var(--muted, #64748b);
  word-break: break-word;
}

/* 附件页内查看器 */
.attachment-viewer[hidden] { display: none; }
.attachment-viewer {
  position: fixed;
  inset: 0;
  z-index: 9999;
}
.attachment-viewer__mask {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.66);
}
.attachment-viewer__panel {
  position: relative;
  width: min(96vw, 1100px);
  height: min(92vh, 860px);
  margin: 2vh auto 0;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 18px 56px rgba(15, 23, 42, 0.35);
  display: flex;
  flex-direction: column;
}
.attachment-viewer__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.attachment-viewer__body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: #f8fafc;
  overflow: auto;
  padding: 8px;
}
.attachment-viewer__body img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
  background: #fff;
  margin: auto;
}
.attachment-viewer__body iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
}
.attachment-viewer__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 56px;
  border: 0;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.attachment-viewer__nav:hover {
  background: rgba(15, 23, 42, 0.75);
}
.attachment-viewer__nav--prev { left: 10px; }
.attachment-viewer__nav--next { right: 10px; }
.attachment-viewer__close {
  position: absolute;
  right: 8px;
  top: 6px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 999px;
  font-size: 20px;
  line-height: 1;
  background: #e2e8f0;
  color: #0f172a;
  cursor: pointer;
}
.admin-dev-thumb-wrap {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}
.admin-dev-file-link {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: inherit;
  padding: 6px 10px;
  cursor: pointer;
}

/* 开发者资料页：附件与上传合并展示 */
.devp-form {
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px 16px;
}
.devp-form > label {
  font-weight: 600;
  color: #1e293b;
}
.devp-attach-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
}
.devp-attach-row > input[type="file"] {
  flex: 1 1 260px;
  min-width: 220px;
  max-width: 100%;
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 6px 8px;
}
.devp-skill-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  padding: 10px 12px;
}
.devp-skill-list {
  margin-bottom: 8px;
}
.devp-skill-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.devp-skill-upload {
  margin-top: 4px;
  width: 100%;
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 6px 8px;
}
.devp-help {
  grid-column: 1 / -1;
  margin: -2px 0 2px;
  padding-left: 4px;
}
.devp-form .admin-dev-thumb {
  width: 72px;
  height: 72px;
}
.devp-form .admin-dev-file-link {
  font-size: 13px;
}

/* 参选开发者详情页 */
.talent-candidate-page {
  max-width: 920px;
}
.talent-candidate-meta {
  margin-bottom: 14px;
}
.talent-candidate-sec-title {
  margin-top: 20px;
  margin-bottom: 10px;
  font-size: 1.03rem;
}
.talent-candidate-table {
  max-width: 720px;
  margin-top: 8px;
}
.talent-candidate-table td {
  line-height: 1.55;
}
.talent-candidate-badges {
  margin-top: 8px;
}
.talent-candidate-skill-wrap {
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
}
.talent-candidate-keywords {
  margin-top: 8px;
  line-height: 1.8;
  padding: 10px 12px;
  border: 1px dashed rgba(99, 102, 241, 0.25);
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.03);
}
.talent-candidate-action {
  margin-top: 22px;
}
@media (max-width: 640px) {
  .talent-candidate-page {
    max-width: 100%;
  }
  .talent-candidate-table {
    max-width: 100%;
  }
}
@media (max-width: 760px) {
  .devp-form {
    grid-template-columns: 1fr;
  }
  .devp-attach-row {
    align-items: stretch;
  }
  .devp-attach-row > input[type="file"] {
    min-width: 100%;
    flex-basis: 100%;
  }
}

/* ========== 栅格 ========== */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 860px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ========== 对话 ========== */
.chat-box {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  max-height: none;
  overflow: visible;
  font-size: 14px;
  box-shadow: none;
}
body.workspace-chat-lockscroll {
  overflow: hidden;
}
.chat-layout {
  display: flex;
  flex-direction: column;
  min-height: 360px;
  overflow: hidden;
}
.chat-layout .chat-box {
  flex: 1 1 auto;
  overflow: auto;
  padding: 8px 2px 14px;
  overscroll-behavior: contain;
}
.chat-dock {
  position: relative;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -8px 18px rgba(15, 23, 42, 0.06);
  padding-top: 8px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 20;
  overflow: visible;
}
.chat-dock .toolbar {
  margin: 8px 0;
  padding: 0 8px;
  overflow: visible;
}
.chat-dock .toolbar textarea {
  box-sizing: border-box;
}
.apply-floating-mask {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  background: rgba(2, 6, 23, 0.52);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: block;
  pointer-events: auto;
}
.apply-floating-hint {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  min-width: 220px;
  max-width: 420px;
  padding: 16px 20px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.96));
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 18px 42px rgba(2, 6, 23, 0.45);
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: 0.2px;
  text-align: center;
  pointer-events: auto;
  z-index: 2147483647;
}

/* 首次生成前：项目命名弹窗 */
.rename-before-apply[hidden] {
  display: none !important;
}
.rename-before-apply {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
}
.rename-before-apply__mask {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.52);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
}
.rename-before-apply__panel {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 32px));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 18px 42px rgba(2, 6, 23, 0.32);
  padding: 18px 18px 14px;
}
.rename-before-apply__panel h3 {
  margin: 0 0 8px;
  font-size: 1.08rem;
}
.rename-before-apply__input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  margin-top: 8px;
}
.rename-before-apply__input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
  outline: none;
}
.chat-row {
  margin-bottom: 14px;
}
.chat-turn {
  border: 1px solid #dbe3ee;
  background: #ffffff;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.chat-turn .chat-row:last-child {
  margin-bottom: 0;
}
.chat-row-user {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.chat-row-ai {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.chat-row .who {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 5px;
  font-weight: 500;
}
.chat-row .bubble {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px 12px 12px 4px;
  padding: 12px 14px;
  white-space: pre-wrap;
  box-shadow: var(--shadow-sm);
  max-width: 86%;
}
.chat-row-user .bubble {
  background: #eff6ff;
  border-color: #bfdbfe;
  border-radius: 12px 12px 4px 12px;
}
.chat-row-ai .bubble {
  background: #ffffff;
  border-color: var(--line);
}

/* ========== 工具条 ========== */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
  align-items: center;
}

.toolbar input[type="text"],
.toolbar input[type="number"],
.toolbar input[type="month"],
.toolbar input[type="date"],
.toolbar input[type="email"],
.toolbar input[type="password"],
.toolbar select {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  font: inherit;
  background: #fff;
  min-height: 38px;
}
.toolbar input:focus,
.toolbar select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
  outline: none;
}

/* ========== 任务市场（公开列表） ========== */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 10px;
}
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}
.task-market-table {
  table-layout: fixed;
  width: 100%;
}
.task-market-table th,
.task-market-table td {
  padding: 10px 10px;
}
/* 任务名占一截；简介吃剩余宽度；日期/金额/状态尽量窄 */
.task-market-table th:nth-child(1),
.task-market-table td:nth-child(1) {
  width: 20%;
  min-width: 0;
}
.task-market-table th:nth-child(2),
.task-market-table td:nth-child(2) {
  width: 9.5rem;
  max-width: 9.5rem;
  padding-left: 8px;
  padding-right: 8px;
}
.task-market-table th:nth-child(3),
.task-market-table td:nth-child(3) {
  width: auto;
  min-width: 0;
}
.task-market-table th:nth-child(4),
.task-market-table td:nth-child(4) {
  width: 7rem;
  max-width: 7rem;
  text-align: right;
  padding-left: 8px;
  padding-right: 8px;
}
.task-market-table th:nth-child(5),
.task-market-table td:nth-child(5) {
  width: 5.25rem;
  max-width: 5.25rem;
  padding-left: 8px;
  padding-right: 8px;
}
.task-market-table .task-market-summary {
  white-space: normal;
  word-break: break-word;
}
/* 除「简介」外不换行；任务名称过长用省略号 */
.task-market-table th:nth-child(1),
.task-market-table th:nth-child(2),
.task-market-table th:nth-child(4),
.task-market-table th:nth-child(5),
.task-market-table td:nth-child(1),
.task-market-table td:nth-child(2),
.task-market-table td:nth-child(4),
.task-market-table td:nth-child(5) {
  white-space: nowrap;
}
.task-market-table td:nth-child(1) {
  overflow: hidden;
  text-overflow: ellipsis;
}
.task-market-table td {
  vertical-align: top;
}
.h-as-label {
  font-size: 1rem;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}
.task-detail-summary {
  white-space: pre-wrap;
  word-break: break-word;
}

/* ========== 排期表（工作台） ========== */
.schedule-wrap {
  margin-top: 14px;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
  /* 横向滚动；吸顶表头为 position:fixed，若纵向用 clip 可能被裁切，故不再用 clip */
  overflow-x: auto;
  overflow-y: visible;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.sched-version-select {
  min-width: 15rem;
  max-width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  font: inherit;
  font-size: 13px;
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.sched-version-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
  outline: none;
}

.schedule-wrap table#schedTable.sched-table.data {
  width: 98%;
  margin-left: auto;
  margin-right: auto;
  table-layout: fixed;
  margin-top: 0;
  margin-bottom: 0;
  border: none;
  border-radius: 0;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset;
  border-collapse: separate;
  border-spacing: 0;
  overflow: visible;
  font-size: 14px;
  background: #fff;
}

/* 表头：默认随表滚动；吸顶由 JS 加 .sched-table--head-pinned + fixed（避免父级 overflow-x 导致 sticky 失效） */
.schedule-wrap table#schedTable.sched-table.data thead.sched-thead {
  box-shadow: 0 8px 20px -8px rgba(15, 23, 42, 0.18);
}
.schedule-wrap table#schedTable.sched-table.data thead.sched-thead th {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  vertical-align: middle;
  border: 1px solid #c6ccda;
}
.schedule-wrap table#schedTable.sched-table.data thead.sched-thead th:first-child {
  padding-left: 18px;
  border-radius: 10px 0 0 10px;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}
/* 预算(元)～删除列表头：左右各 10px、居中（列类名与 PHP thead 一致） */
.schedule-wrap table#schedTable.sched-table.data thead.sched-thead th.sched-col-mid {
  white-space: nowrap;
  text-align: center !important;
  padding: 14px 10px !important;
}
.schedule-wrap table#schedTable.sched-table--head-pinned thead.sched-thead th {
  position: fixed;
  top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  z-index: 42;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  box-shadow: 0 6px 16px -6px rgba(15, 23, 42, 0.2);
}
.schedule-wrap table#schedTable.sched-table--head-pinned thead.sched-thead th:first-child {
  justify-content: flex-start;
  text-align: left;
}
.schedule-wrap table#schedTable.sched-table--head-pinned thead.sched-thead th.sched-col-mid {
  justify-content: center;
  text-align: center;
}
.schedule-wrap table#schedTable.sched-table.data tbody tr.sched-pin-spacer {
  display: none;
}
.schedule-wrap table#schedTable.sched-table.data tbody tr.sched-pin-spacer.is-active {
  display: table-row;
}
.schedule-wrap table#schedTable.sched-table.data tbody tr.sched-pin-spacer td {
  padding: 0;
  border: none;
  vertical-align: top;
  line-height: 0;
  font-size: 0;
  background: transparent;
}

/* 未吸顶：表头与首行数据之间固定 10px（吸顶时由占位行承担，隐藏此行避免重复间距） */
.schedule-wrap table#schedTable.sched-table.data tbody tr.sched-thead-gap td {
  padding: 0;
  border: none;
  height: 10px;
  line-height: 0;
  font-size: 0;
  background: transparent;
  box-shadow: none;
}
.schedule-wrap table#schedTable.sched-table--head-pinned tbody tr.sched-thead-gap {
  display: none;
}
.schedule-wrap table#schedTable.sched-table.data thead.sched-thead th:last-child {
  border-radius: 0 10px 10px 0;
}

/* 排期表内取消 data 表默认行悬停底色（避免与卡片块冲突） */
.schedule-wrap table#schedTable.sched-table.data tbody tr.sched-main:hover,
.schedule-wrap table#schedTable.sched-table.data tbody tr.sched-detail:hover,
.schedule-wrap table#schedTable.sched-table.data tbody tr.sched-block-spacer:hover,
.schedule-wrap table#schedTable.sched-table.data tbody tr.sched-thead-gap:hover {
  background: transparent;
}

/* 功能块：主行 + 说明行 */
.schedule-wrap tbody tr.sched-main > td {
  background: linear-gradient(180deg, #ffffff 0%, #f8f9ff 100%);
  border: 1px solid rgba(99, 102, 241, 0.16);
  border-bottom: none !important;
  padding: 14px 16px;
  vertical-align: middle;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.schedule-wrap table#schedTable.sched-table.data tbody tr.sched-main > td:first-child {
  border-top-left-radius: 10px;
  padding-left: 18px;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}
.schedule-wrap table#schedTable.sched-table.data tbody tr.sched-main > td:not(:first-child) {
  white-space: nowrap;
  text-align: center !important;
  padding: 14px 10px !important;
  vertical-align: middle;
}
.schedule-wrap tbody tr.sched-main > td:first-child {
  border-top-left-radius: 10px;
  padding-left: 18px;
}
.schedule-wrap table#schedTable.sched-table.data tbody tr.sched-main > td:last-child {
  border-top-right-radius: 10px;
}

/* 主行第 2～6 列：flex 容器居中（td 的 text-align 对 date/number 等控件不可靠） */
.schedule-wrap #schedTable.sched-table tbody tr.sched-main > td:not(:first-child) .sched-td-mid {
  display: flex;
  flex-flow: row nowrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: min-content;
  box-sizing: border-box;
}
.schedule-wrap #schedTable.sched-table tbody tr.sched-main > td:not(:first-child) .sched-td-mid > * {
  flex: 0 0 auto;
}

.schedule-wrap tbody tr.sched-main[data-platform-fixed="1"] > td {
  background: linear-gradient(180deg, #f1f5f9 0%, #e8ecf8 100%);
  border-color: rgba(100, 116, 139, 0.28);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.schedule-wrap tbody tr.sched-detail > td {
  background: linear-gradient(180deg, #fafbff 0%, #f3f4ff 100%);
  border: 1px solid rgba(99, 102, 241, 0.16);
  border-top: 1px solid rgba(99, 102, 241, 0.1);
  border-bottom: 1px solid rgba(99, 102, 241, 0.16) !important;
  padding: 12px 16px 16px 18px;
  vertical-align: top;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  box-shadow: 0 4px 12px -4px rgba(79, 70, 229, 0.12);
}
.schedule-wrap tbody tr.sched-detail-platform > td {
  background: linear-gradient(180deg, #f1f5f9 0%, #e8ecf4 100%);
  border-color: rgba(100, 116, 139, 0.26);
  border-top-color: rgba(100, 116, 139, 0.14);
  border-bottom-color: rgba(100, 116, 139, 0.26) !important;
  padding: 12px 18px 16px;
  box-shadow: 0 3px 10px -4px rgba(15, 23, 42, 0.08);
}

/* 块间距 */
.schedule-wrap tbody tr.sched-block-spacer td {
  height: 18px !important;
  min-height: 18px;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  line-height: 0;
  font-size: 0;
  vertical-align: middle;
}
.schedule-wrap tbody tr.sched-block-spacer:hover td {
  background: transparent !important;
}


.schedule-wrap .sched-detail-inner {
  max-width: 100%;
}
.schedule-wrap .sched-detail-inner > label.muted,
.schedule-wrap .sched-detail-inner > span.muted {
  display: block;
  margin-bottom: 2px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.schedule-wrap .sched-detail-input {
  width: 100%;
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.55);
  font: inherit;
  line-height: 1.55;
  resize: none;
  min-height: 56px;
  overflow-y: hidden;
  box-sizing: border-box;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.schedule-wrap .sched-detail-input:hover {
  border-color: rgba(99, 102, 241, 0.35);
}
.schedule-wrap .sched-detail-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
  outline: none;
}

.schedule-wrap .sched-detail-readonly {
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  line-height: 1.6;
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* 主行内表单控件 */
.schedule-wrap #schedTable.sched-table input[type="text"],
.schedule-wrap #schedTable.sched-table input[type="number"],
.schedule-wrap #schedTable.sched-table input[type="date"],
.schedule-wrap #schedTable.sched-table select {
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.55);
  padding: 8px 10px;
  font: inherit;
  font-size: 14px;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.schedule-wrap #schedTable.sched-table input[type="text"]:hover,
.schedule-wrap #schedTable.sched-table input[type="number"]:hover,
.schedule-wrap #schedTable.sched-table input[type="date"]:hover,
.schedule-wrap #schedTable.sched-table select:hover {
  border-color: rgba(99, 102, 241, 0.35);
}
.schedule-wrap #schedTable.sched-table input[type="text"]:focus,
.schedule-wrap #schedTable.sched-table input[type="number"]:focus,
.schedule-wrap #schedTable.sched-table input[type="date"]:focus,
.schedule-wrap #schedTable.sched-table select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
  outline: none;
}
.schedule-wrap #schedTable.sched-table input[readonly],
.schedule-wrap #schedTable.sched-table select:disabled {
  background: rgba(248, 250, 252, 0.95);
  color: var(--muted);
  cursor: not-allowed;
  box-shadow: none;
}
.schedule-wrap #schedTable.sched-table .btn.rowDel {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 8px;
}

/* 第 2～6 列：再压过 table.data td 的左对齐与内边距（与 .sched-td-mid 配合） */
.schedule-wrap #schedTable.sched-table tbody tr.sched-main > td:not(:first-child) {
  text-align: center !important;
  padding: 14px 10px !important;
  vertical-align: middle;
}
.schedule-wrap #schedTable.sched-table thead.sched-thead th.sched-col-mid {
  text-align: center !important;
  padding: 14px 10px !important;
}

.schedule-wrap #schedTable.sched-table tbody tr.sched-main strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
}

/* 显示修改痕迹 */
.cell-new {
  color: var(--new-text);
  font-weight: 600;
}
.schedule-wrap tr.sched-row-new > td {
  color: var(--new-text);
  font-weight: 600;
}
.schedule-wrap tr.sched-row-new > td input:not([type="hidden"]),
.schedule-wrap tr.sched-row-new > td select {
  color: var(--new-text);
  font-weight: 600;
}
table.latest-only tr.sched-row-new > td input:not([type="hidden"]),
table.latest-only tr.sched-row-new > td select {
  color: inherit;
  font-weight: inherit;
}

.schedule-wrap .sched-diff-del {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  color: var(--new-text);
  font-weight: 600;
}
.schedule-wrap .sched-diff-del + .sched-detail-manual-chunk {
  margin-left: 0.35em;
}
.schedule-wrap .sched-detail-manual-chunk {
  color: var(--new-text);
  font-weight: 600;
}
.schedule-wrap .sched-detail-diff-preview {
  margin-top: 10px;
  padding: 10px 12px;
  line-height: 1.55;
  border-radius: 9px;
  border: 1px dashed rgba(99, 102, 241, 0.35);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
}
.schedule-wrap .sched-title-diff-preview {
  margin-top: 6px;
  padding: 8px 10px;
  line-height: 1.45;
  border-radius: 8px;
  border: 1px dashed rgba(99, 102, 241, 0.35);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font-size: 13px;
}
table.latest-only .sched-detail-diff-preview {
  display: none !important;
}
table.latest-only .sched-title-diff-preview {
  display: none !important;
}

/* 功能名称：仅最新 / 修改痕迹 切换（有 title_diff_base 时） */
.schedule-wrap table#schedTable.sched-table .sched-title-plain {
  display: inline;
}
.schedule-wrap table#schedTable.sched-table .sched-title-mark {
  display: none;
}
.schedule-wrap table#schedTable.sched-table:not(.latest-only) .sched-title-plain {
  display: none !important;
}
.schedule-wrap table#schedTable.sched-table:not(.latest-only) .sched-title-mark {
  display: inline;
}
.schedule-wrap table#schedTable.sched-table.latest-only .sched-title-mark {
  display: none !important;
}
.schedule-wrap table#schedTable.sched-table.latest-only .sched-title-plain {
  display: inline;
}


table.latest-only tr.sched-row-new > td {
  color: inherit;
  font-weight: inherit;
}
table.latest-only .cell-new {
  color: inherit;
  font-weight: inherit;
}

tr.inbox-unread td {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.08), transparent);
}

/* ========== 标签页 ========== */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
  padding-bottom: 0;
}
.tabs a {
  padding: 10px 16px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  margin-bottom: -1px;
  transition: background 0.15s ease, color 0.15s ease;
}
.tabs a:hover {
  color: var(--accent);
  background: rgba(99, 102, 241, 0.06);
  text-decoration: none;
}
.tabs a.active {
  background: var(--card);
  border: 1px solid var(--line);
  border-bottom-color: var(--card);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 -2px 8px rgba(15, 23, 42, 0.04);
}

/* ========== 分页 ========== */
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
  font-size: 14px;
}

/* ========== 安装页 ========== */
body.page-install {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
body.page-install .card.narrow {
  margin: 0;
  width: 100%;
  max-width: 440px;
}

/* ========== 思维导图（逻辑图：根在左、大类竖排向右展开；标题可折叠子级） ========== */
.mindmap.mindmap-canvas.mindmap-logical {
  --mm-root-bg: linear-gradient(165deg, #3d5afe 0%, #2f4fe8 52%, #1e3a8a 100%);
  --mm-node-bg: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  --mm-node-border: #e2e8f0;
  --mm-node-text: #1e293b;
  --mm-line: #94a3b8;
  --mm-line-soft: #cbd5e1;
  --mm-branches-gap: 16px;
  --mm-sub-gap: 12px;
  --mm-rail-branches: 15px;
  --mm-rail-sub: 15px;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 28px;
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px 20px 26px 22px;
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.mindmap-logical .mindmap-root {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 200px;
  min-width: min(160px, 100%);
  margin: 0;
  padding: 0;
}

.mindmap-logical .mindmap-root-only {
  max-width: none;
  width: auto;
}

.mindmap-logical .mindmap-root-only .mindmap-label {
  display: block;
  padding: 13px 20px;
  font-size: clamp(0.95rem, 0.85rem + 0.5vw, 1.08rem);
  font-weight: 700;
  color: #fff;
  text-align: center;
  line-height: 1.35;
  letter-spacing: 0.02em;
  background: var(--mm-root-bg);
  border-radius: 10px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 6px 20px rgba(30, 58, 138, 0.22);
}

.mindmap-logical .mindmap-toggle {
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  text-align: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: nowrap;
}

.mindmap-logical .mindmap-toggle-root {
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.mindmap-logical .mindmap-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 10px;
}

.mindmap-logical .mindmap-toggle-root .mindmap-label {
  display: block;
  padding: 13px 20px;
  font-size: clamp(0.95rem, 0.85rem + 0.5vw, 1.08rem);
  font-weight: 700;
  color: #fff;
  text-align: center;
  line-height: 1.35;
  letter-spacing: 0.02em;
  background: var(--mm-root-bg);
  border-radius: 10px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 6px 20px rgba(30, 58, 138, 0.22);
}

.mindmap-logical .mindmap-toggle:not(.mindmap-toggle-root) .mindmap-label {
  display: block;
  padding: 9px 14px 9px 12px;
  font-weight: 600;
  font-size: 13px;
  color: var(--mm-node-text);
  text-align: left;
  letter-spacing: -0.01em;
  line-height: 1.45;
  background: var(--mm-node-bg);
  border: 1px solid var(--mm-node-border);
  border-radius: 8px;
  max-width: min(280px, 100%);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.mindmap-logical .mindmap-toggle:not(.mindmap-toggle-root):hover .mindmap-label {
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.mindmap-logical .mindmap-chevron {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #64748b;
  flex-shrink: 0;
  opacity: 0.85;
  transition: transform 0.18s ease, opacity 0.15s ease;
}

.mindmap-logical .mindmap-toggle:not(.mindmap-toggle-root):hover .mindmap-chevron {
  opacity: 1;
}

.mindmap-logical .mindmap-toggle-root .mindmap-chevron {
  border-top-color: rgba(255, 255, 255, 0.85);
}

.mindmap-logical .mindmap-toggle[aria-expanded="false"] .mindmap-chevron {
  transform: rotate(-90deg);
}

.mindmap-logical .mindmap-branches {
  list-style: none;
  margin: 0;
  padding: 0 0 0 var(--mm-rail-branches);
  flex: 1 1 auto;
  min-width: min(100%, 280px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--mm-branches-gap);
  border-left: none;
}

.mindmap-logical .mindmap-branches > .mindmap-branch {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 14px;
  margin: 0;
  padding: 0;
  min-width: 0;
}

/* 横线：干线 → 节点中线 */
.mindmap-logical .mindmap-branches > .mindmap-branch::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: calc(-1 * var(--mm-rail-branches));
  top: 50%;
  width: calc(var(--mm-rail-branches) - 3px);
  height: 1px;
  background: var(--mm-line-soft);
  transform: translateY(-50%);
}

/* 竖线：仅连接相邻大类中线，不超出首尾行 */
.mindmap-logical .mindmap-branches > .mindmap-branch:only-child::after {
  content: none;
}

.mindmap-logical .mindmap-branches > .mindmap-branch:first-child:not(:only-child)::after {
  content: "";
  position: absolute;
  z-index: 0;
  left: calc(-1 * var(--mm-rail-branches));
  top: 50%;
  bottom: calc(-0.5 * var(--mm-branches-gap));
  width: 1px;
  background: var(--mm-line-soft);
}

.mindmap-logical .mindmap-branches > .mindmap-branch:last-child:not(:first-child)::after {
  content: "";
  position: absolute;
  z-index: 0;
  left: calc(-1 * var(--mm-rail-branches));
  top: calc(-0.5 * var(--mm-branches-gap));
  bottom: 50%;
  width: 1px;
  background: var(--mm-line-soft);
}

.mindmap-logical .mindmap-branches > .mindmap-branch:not(:first-child):not(:last-child)::after {
  content: "";
  position: absolute;
  z-index: 0;
  left: calc(-1 * var(--mm-rail-branches));
  top: calc(-0.5 * var(--mm-branches-gap));
  bottom: calc(-0.5 * var(--mm-branches-gap));
  width: 1px;
  background: var(--mm-line-soft);
}

.mindmap-logical .mindmap-sub {
  list-style: none;
  margin: 0;
  padding: 0 0 0 var(--mm-rail-sub);
  flex: 1 1 auto;
  min-width: min(200px, 100%);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--mm-sub-gap);
  border-left: none;
}

.mindmap-logical .mindmap-sub[hidden] {
  display: none !important;
}

.mindmap-logical .mindmap-sub > .mindmap-branch {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.mindmap-logical .mindmap-sub > .mindmap-branch::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: calc(-1 * var(--mm-rail-sub));
  top: 50%;
  width: calc(var(--mm-rail-sub) - 3px);
  height: 1px;
  background: var(--mm-line-soft);
  transform: translateY(-50%);
}

.mindmap-logical .mindmap-sub > .mindmap-branch:only-child::after {
  content: none;
}

.mindmap-logical .mindmap-sub > .mindmap-branch:first-child:not(:only-child)::after {
  content: "";
  position: absolute;
  z-index: 0;
  left: calc(-1 * var(--mm-rail-sub));
  top: 50%;
  bottom: calc(-0.5 * var(--mm-sub-gap));
  width: 1px;
  background: var(--mm-line-soft);
}

.mindmap-logical .mindmap-sub > .mindmap-branch:last-child:not(:first-child)::after {
  content: "";
  position: absolute;
  z-index: 0;
  left: calc(-1 * var(--mm-rail-sub));
  top: calc(-0.5 * var(--mm-sub-gap));
  bottom: 50%;
  width: 1px;
  background: var(--mm-line-soft);
}

.mindmap-logical .mindmap-sub > .mindmap-branch:not(:first-child):not(:last-child)::after {
  content: "";
  position: absolute;
  z-index: 0;
  left: calc(-1 * var(--mm-rail-sub));
  top: calc(-0.5 * var(--mm-sub-gap));
  bottom: calc(-0.5 * var(--mm-sub-gap));
  width: 1px;
  background: var(--mm-line-soft);
}

.mindmap-logical .mindmap-leaf {
  align-items: center;
}

.mindmap-logical .mindmap-leaf-label {
  display: inline-block;
  padding: 6px 11px;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  letter-spacing: -0.01em;
  line-height: 1.45;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  max-width: min(320px, 100%);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

@media (max-width: 640px) {
  .mindmap.mindmap-canvas.mindmap-logical {
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
  }

  .mindmap-logical .mindmap-root {
    max-width: none;
    justify-content: flex-start;
  }

  .mindmap-logical .mindmap-toggle-root .mindmap-label {
    text-align: left;
  }

  .mindmap-logical .mindmap-branches {
    padding-left: 0;
    border-top: 1px solid var(--mm-line-soft);
    padding-top: 16px;
  }

  .mindmap-logical .mindmap-branches > .mindmap-branch::before,
  .mindmap-logical .mindmap-branches > .mindmap-branch::after {
    display: none;
  }

  .mindmap-logical .mindmap-sub > .mindmap-branch::before,
  .mindmap-logical .mindmap-sub > .mindmap-branch::after {
    display: none;
  }

  .mindmap-logical .mindmap-sub {
    padding-left: 14px;
    border-left: 1px solid var(--mm-line-soft);
  }
}

/* ========== 需求文档块 ========== */
pre.doc {
  white-space: pre-wrap;
  background: linear-gradient(160deg, #0f172a 0%, #1e293b 100%);
  color: #e2e8f0;
  padding: 18px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.55;
  font-family: var(--font-mono);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 8px 32px rgba(15, 23, 42, 0.2);
  margin: 12px 0 0;
}

/* ========== 管理后台：顶栏 ========== */
body.admin-area {
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-soft: #eef2ff;
  --ring: rgba(99, 102, 241, 0.25);
  background: #eef0f5;
}

body.admin-area header.site-header {
  background: linear-gradient(125deg, #1e1b4b 0%, #312e81 42%, #4338ca 100%);
  border-bottom: none;
  box-shadow: 0 4px 24px rgba(30, 27, 75, 0.35);
  width: 100%;
}

/* 后台顶栏与正文与前台同一水平宽度 */
body.admin-area .header-inner {
  width: var(--layout-width);
  max-width: 100%;
  margin: 0 auto;
  padding: 0 var(--layout-pad-x);
}

body.admin-area .nav-links {
  flex: 1;
  min-width: 0;
  justify-content: flex-end;
}

body.admin-area .brand {
  color: #fff;
  font-size: 1rem;
}

body.admin-area .nav-links a {
  color: rgba(255, 255, 255, 0.78);
  padding: 8px 11px;
}
body.admin-area .nav-links a:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  text-decoration: none;
}

body.admin-area .nav-links a.is-active {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35) inset, 0 2px 10px rgba(0, 0, 0, 0.12);
}

body.admin-area .nav-links a.is-active:hover {
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
}

body.admin-area .nav-links .muted {
  color: rgba(255, 255, 255, 0.55);
}

body.admin-area .card:hover {
  border-color: rgba(99, 102, 241, 0.14);
}

/* ========== 管理登录（独立页） ========== */
body.admin-auth {
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(ellipse 80% 60% at 70% 0%, rgba(129, 140, 248, 0.35), transparent 50%),
    linear-gradient(165deg, #1e1b4b 0%, #312e81 38%, #4338ca 100%);
}

body.admin-auth main.layout {
  width: 100%;
  max-width: 420px;
  margin: 0;
  padding: 0;
}

body.admin-auth .card.narrow {
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(8px);
}

body.admin-auth h1 {
  text-align: center;
}

body.admin-auth .btn.primary {
  width: 100%;
  justify-content: center;
}

/* ========== 窄屏 ========== */
@media (max-width: 640px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 16px;
    min-height: auto;
    gap: 12px;
  }

  .nav-links {
    width: 100%;
  }

  body.admin-area .nav-links {
    justify-content: flex-start;
  }

  main.layout {
    width: 100%;
    padding: 20px 16px 48px;
  }

  .card {
    padding: 20px 18px;
    border-radius: var(--radius);
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .form-grid label {
    margin-bottom: -4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
  .btn:hover,
  .card:hover {
    transform: none;
  }
}
