/* 图纸协作管理平台 · 样式表
   原则：不引框架（不联网也能开），PC 和手机企微都能看。 */

:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --line: #e4e7ec;
  --text: #1f2329;
  --muted: #77808c;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --red: #dc2626;
  --amber: #d97706;
  --yellow: #eab308;
  --green: #16a34a;
  --purple: #7c3aed;
  --radius: 8px;
}

* { box-sizing: border-box; }

html {
  /* 别让 iOS 横竖屏切换时自己放大字号 */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.65 "Microsoft YaHei", "PingFang SC", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 18px; }

/* ---------------------------------------------------------- 顶栏 */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar .wrap { display: flex; align-items: center; gap: 22px; height: 58px; }
.brand { font-weight: 700; font-size: 16px; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; color: var(--primary); }
.topbar nav { display: flex; gap: 18px; flex: 1; }
.topbar nav a {
  color: var(--muted);
  padding: 5px 0;
  border-bottom: 2px solid transparent;
  font-size: 14px;
}
.topbar nav a:hover { color: var(--text); text-decoration: none; }
.topbar nav a.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.me { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.inline { display: inline; margin: 0; }

.main { padding-top: 22px; padding-bottom: 40px; min-height: 60vh; }
.foot { color: var(--muted); font-size: 12px; padding-bottom: 26px; }
.foot-secret { margin-top: 4px; }

/* ---------------------------------------------------------- 标题区 */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.page-head h1 { font-size: 21px; margin: 0 0 4px; }
.page-head .sub { margin: 0; color: var(--muted); font-size: 13px; }
.section { font-size: 16px; margin: 30px 0 12px; }
.crumb { margin: 0 0 6px; font-size: 13px; }

/* ---------------------------------------------------------- 卡片/表格 */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.card-title { font-size: 14.5px; margin: 0 0 12px; }
.card form, .card label + label { margin-top: 0; }
.card label { margin-bottom: 12px; }
.two-col {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
  align-items: start;
}
.narrow { max-width: 460px; }
.narrow h1 { font-size: 19px; margin: 6px 0 4px; }
.narrow .sub { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.small-text { font-size: 12.5px; }
a.quiet { color: var(--muted); font-size: 13px; }
a.quiet:hover { color: var(--primary); text-decoration: none; }
tr.dim td { color: var(--muted); background: #fcfcfd; }
.table-wrap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
}
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table th { background: #fafbfc; color: var(--muted); font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #fafbfd; }
/* 从「我的活」点图名跳过来时，把那一行高亮一下，好找 */
.table tbody tr:target { background: #fffbe9; box-shadow: inset 3px 0 0 var(--amber); }
.table .num { text-align: center; width: 1%; white-space: nowrap; }
.table .op { width: 1%; white-space: nowrap; }
.table.compact th, .table.compact td { padding: 8px 12px; }

.empty {
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
}
.empty p { margin: 4px 0; }

/* ---------------------------------------------------------- 文字 */
.strong { font-weight: 600; }
.muted { color: var(--muted); }
.mono { font-family: "Cascadia Mono", Consolas, ui-monospace, monospace; font-size: 12.5px; }
/* 图号：中英混排，用 Times New Roman + 宋体，字母才不会显得怪 */
.dwgno { font-family: "Times New Roman", "SimSun", "宋体", serif; font-size: 13px; letter-spacing: .2px; }
.danger { color: var(--red); }

/* ---------------------------------------------------------- 徽标 */
.badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
  border: 1px solid transparent;
}
.b-gray   { background: #f1f3f5; color: #4b5563; border-color: #e5e7eb; }
.b-blue   { background: #eaf1fe; color: #1d4ed8; border-color: #d3e0fd; }
.b-amber  { background: #fef5e7; color: var(--amber); border-color: #fde8c8; }
.b-red    { background: #fdecec; color: var(--red); border-color: #fbd5d5; }
.b-green  { background: #e8f8ee; color: var(--green); border-color: #cdeed9; }
.b-purple { background: #f2ecfe; color: var(--purple); border-color: #e4d8fd; }

/* ---------------------------------------------------------- 按钮/表单 */
.btn {
  display: inline-block;
  padding: 7px 16px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { border-color: #c9cfd8; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn.small { padding: 4px 11px; font-size: 12.5px; }
.btn.wide { width: 100%; padding: 9px; margin-top: 6px; }
button.link {
  background: none; border: none; color: var(--muted);
  font: inherit; font-size: 13px; cursor: pointer; padding: 0;
}
button.link:hover { color: var(--primary); }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}
.form-grid .full { grid-column: 1 / -1; }
label { display: block; font-size: 13px; color: var(--muted); }
/* 只给文本类输入框撑满宽度；单选框/复选框不能被撑开，否则圆点居中、文字被挤到边角 */
label input:not([type="radio"]):not([type="checkbox"]),
label select,
label textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: #fff;
}
label input:not([type="radio"]):not([type="checkbox"]):focus,
label select:focus,
label textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

/* ---------------------------------------------------------- 弹出表单 */
.create { position: relative; }
.create > summary { list-style: none; }
.create > summary::-webkit-details-marker { display: none; }
.pop {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
  width: 420px;
  max-width: calc(100vw - 36px);
  box-shadow: 0 12px 30px rgba(16, 24, 40, .12);
}
.wide-pop { width: 560px; }
/* 表格行内的操作面板。
   注意：这里必须用 fixed。原来用 absolute + top:100% 时，表格里没有定位参照，
   面板会被算到整个窗口下方（屏幕外），点了就像没反应。 */
.op-details { position: relative; }
.op-details > summary { list-style: none; display: inline-block; }
.op-details > summary::-webkit-details-marker { display: none; }
.op-details[open] > summary { background: var(--primary); border-color: var(--primary); color: #fff; }

.row-panel {
  position: fixed;
  top: 82px;
  right: 24px;
  width: min(340px, calc(100vw - 32px));
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 18px 44px rgba(16, 24, 40, .18);
  padding: 14px 16px;
  text-align: left;
  z-index: 60;
}
.row-panel-head { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.panel-block { margin-top: 14px; }
.panel-block + .panel-block { border-top: 1px dashed var(--line); padding-top: 12px; }
.panel-block h3 { font-size: 12px; color: var(--muted); font-weight: 600; margin: 0 0 8px; }
.panel-block form + form {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.panel-foot { margin: 14px 0 0; text-align: center; }
.btn.small.wide { width: 100%; padding: 6px 11px; margin-top: 0; }
.reject-form label { margin: 4px 0 8px; }

/* 操作面板：略加宽 + 收紧间距（保持单列，不做并排） */
.row-panel { width: min(380px, calc(100vw - 32px)); }
.inline-form { display: flex; align-items: center; gap: 8px; }
.inline-form select { flex: 1 1 auto; margin-top: 0; }
.inline-form .btn { flex: 0 0 auto; }
.row-panel .panel-block { margin-top: 12px; }
.row-panel .panel-block h3 { margin-bottom: 6px; }
.row-panel label { font-size: 12.5px; }
.row-panel input,
.row-panel select,
.row-panel textarea { padding: 6px 9px; }

/* ---------------------------------------------------------- 提示条 */
.flash {
  background: #eaf1fe;
  border: 1px solid #d3e0fd;
  color: #1d4ed8;
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 13.5px;
}
.flash-error { background: #fdecec; border-color: #fbd5d5; color: var(--red); }

/* ---------------------------------------------------------- 我的活 */
.card-list { display: flex; flex-direction: column; gap: 10px; }
.task-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.task-card.overdue { border-left-color: var(--red); background: #fffafa; }
/* 操作按钮横排，避免每个 form 各占一行把卡片撑高 */
.task-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  flex: 0 0 auto;
}
.task-actions form { margin: 0; }
@media (max-width: 720px) {
  .task-actions { flex-wrap: wrap; }
}
.task-title { display: flex; gap: 10px; align-items: baseline; margin-bottom: 5px; flex-wrap: wrap; }
.task-meta { display: flex; gap: 10px; align-items: center; font-size: 12.5px; flex-wrap: wrap; }

/* ---------------------------------------------------------- 登录页 */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(140deg, #eef2f8, #f7f8fa 60%);
  padding: 20px;
}
.login-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 34px 32px 26px;
  width: 380px;
  max-width: 100%;
  box-shadow: 0 10px 34px rgba(16, 24, 40, .08);
}
.login-card h1 { font-size: 19px; margin: 0 0 4px; text-align: center; }
.login-card .sub { text-align: center; color: var(--muted); font-size: 13px; margin: 0 0 22px; }
.login-card label { margin-bottom: 14px; }
.login-card .hint { text-align: center; color: var(--muted); font-size: 12px; margin: 16px 0 0; }

/* ---------------------------------------------------------- 批量导入 */
.head-actions { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.step {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.step-no {
  flex: 0 0 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  line-height: 22px;
  text-align: center;
  font-weight: 600;
}
.step b { font-size: 13.5px; }
.step p { margin: 4px 0 10px; color: var(--muted); font-size: 12.5px; }

.upload-card { max-width: 620px; }
.upload-card input[type="file"] {
  border: 1px dashed #c9cfd8;
  background: #fafbfd;
  padding: 14px;
  font-size: 13px;
}

.warn-box { border-color: #fde8c8; background: #fffcf5; margin-bottom: 16px; }
.warn-box b { color: var(--amber); font-size: 13.5px; }
.warn-box ul { margin: 8px 0 0; padding-left: 20px; color: #7a5b22; font-size: 12.5px; }
.warn-box li { margin: 3px 0; }

.confirm-bar {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 16px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.confirm-bar p { margin: 0; flex: 1 1 100%; }

.dup-box { margin-top: 16px; font-size: 13px; }
.dup-box summary { cursor: pointer; color: var(--muted); }
.dup-box ul { color: var(--muted); font-size: 12.5px; }

/* ---------------------------------------------------------- 全局视图 */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.kpi-row.four { grid-template-columns: repeat(4, 1fr); }
.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-top: 3px solid var(--line);
}
.kpi-num { font-size: 26px; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; }
.kpi-num small { font-size: 14px; font-weight: 600; margin-left: 1px; }

.notice {
  background: #fffcf5;
  border: 1px solid #fde8c8;
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 13px;
  color: #7a5b22;
  margin-bottom: 18px;
}
.prose dl { margin: 0; }
.prose dt { font-weight: 600; font-size: 13.5px; margin-top: 12px; }
.prose dt:first-child { margin-top: 0; }
.prose dd { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.kpi-label { font-size: 12.5px; color: var(--muted); }
.kpi-bad { border-top-color: var(--red); }
.kpi-bad .kpi-num { color: var(--red); }
.kpi-warn { border-top-color: var(--amber); }
.kpi-warn .kpi-num { color: var(--amber); }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.section-head .section { margin: 0; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  font-size: 12.5px;
  color: var(--muted);
}
.chip:hover { border-color: #c9cfd8; text-decoration: none; }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip-n { font-size: 11px; opacity: .75; }
.chip.on .chip-n { opacity: .9; }

/* 项目卡片墙：几十个项目也不翻页 */
.card-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 12px;
}
.proj-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--text);
  transition: box-shadow .15s, border-color .15s;
}
.proj-card:hover { text-decoration: none; border-color: #c9cfd8; box-shadow: 0 4px 14px rgba(16, 24, 40, .07); }
.proj-card.is-bad { border-left-color: var(--red); }
.proj-card.is-stale { border-left-color: var(--line); }
.proj-card.is-active { border-left-color: var(--yellow); }
/* 默认只显示前若干张，点「展开全部」再看 */
.proj-card.card-collapsed { display: none; }
.card-wall.expanded .proj-card.card-collapsed { display: block; }
.card-more { text-align: center; margin-top: 14px; }
.proj-name {
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1.45;
  margin-bottom: 9px;
  min-height: 2.9em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* 完成比例：一根单色细条，不做多色堆叠，几十个项目时更清爽 */
.meter { height: 4px; border-radius: 2px; background: #eceff3; overflow: hidden; margin-bottom: 8px; }
.meter > span { display: block; height: 100%; background: #8ba3c7; border-radius: 2px; }
.proj-line { font-size: 12.5px; display: flex; align-items: baseline; gap: 2px; margin-bottom: 8px; }
.proj-pct { margin-left: auto; font-variant-numeric: tabular-nums; }
.proj-badges { display: flex; gap: 5px; flex-wrap: wrap; min-height: 19px; }
.gap-top { margin-top: 8px; }
/* 通用横排工具类：此前模板里用了 .row 但样式缺失，导致按钮竖排 */
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.two-col.wide-left { grid-template-columns: 1.15fr 1fr; gap: 20px; }
.empty.slim { padding: 24px 16px; }

@media (max-width: 1000px) {
  .kpi-row { grid-template-columns: repeat(3, 1fr); }
}

/* ---------------------------------------------------------- 消息 */
.bell {
  position: relative;
  color: var(--muted);
  font-size: 13px;
  padding: 2px 6px;
  border-radius: 6px;
}
.bell:hover { color: var(--primary); text-decoration: none; background: #f4f6f9; }
.bell-dot {
  display: inline-block;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  margin-left: 4px;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
  vertical-align: middle;
}

.msg-list { display: flex; flex-direction: column; gap: 8px; }
.msg {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.msg.is-unread { border-left: 3px solid var(--primary); background: #fbfcff; }
.msg-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.msg-form { margin: 0; display: inline; }
.msg-title {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.msg.is-unread .msg-title { font-weight: 600; }
.msg-title:hover { color: var(--primary); }
.msg-time { margin-left: auto; }
.msg-body {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
  white-space: pre-line;
}

/* 拖动排序 */
.drag-hint { margin: -2px 0 12px; }
.save-tip { color: var(--green); font-weight: 600; margin-left: 6px; }
.proj-card { cursor: grab; }
.proj-card.dragging { opacity: .35; cursor: grabbing; }
/* 拖动时的落点占位：虚线框跟着鼠标走，卡片会绕着它让位 */
.drop-placeholder {
  border: 2px dashed var(--primary);
  background: #f2f6ff;
  border-radius: var(--radius);
  min-height: 90px;
}

/* 顶部数字可以点：点进去看清单 */
a.kpi { color: inherit; text-decoration: none; cursor: pointer; }
a.kpi:hover { text-decoration: none; border-color: #c3cad4; box-shadow: 0 4px 14px rgba(16, 24, 40, .08); }
.kpi-hint { margin: -14px 0 18px; }
.proj-picker select {
  width: 300px; max-width: 100%; height: 36px; box-sizing: border-box;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13.5px;
  background: #fff;
}

/* 通用弹框 */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, .35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
  padding: 16px;
}
.modal-mask[hidden] { display: none; }
.modal {
  background: #fff;
  border-radius: 10px;
  padding: 20px 22px;
  width: min(400px, calc(100vw - 32px));
  box-shadow: 0 24px 60px rgba(16, 24, 40, .25);
}
.modal h3 { margin: 0 0 8px; font-size: 16px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* 待协调事项 */
.blocker-cell { max-width: 220px; }
.blocker-text {
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
  color: var(--amber);
  font-size: 12.5px;
}

/* ---------------------------------------------------------- 资源中心 */
.search-form { display: flex; gap: 6px; }
.search-form input {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  min-width: 200px;
}
.resource-summary { font-size: 14px; color: #3f4753; margin: 0 0 14px; }
.resource-body {
  white-space: pre-wrap;
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--text);
}
.link-url { word-break: break-all; }
.plain-list { margin: 8px 0 0; padding-left: 20px; font-size: 13px; }
.mini-select {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font: inherit;
  font-size: 12.5px;
  background: #fff;
}

/* ---------------------------------------------------------- 趣味时刻 */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.game-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  font: inherit;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.game-card:hover { border-color: #c3cad4; box-shadow: 0 4px 14px rgba(16, 24, 40, .07); }
.game-title { font-weight: 600; font-size: 14.5px; }
.game-desc { font-size: 12.5px; color: var(--muted); }
.game-best { font-size: 12px; color: var(--green); margin-top: 2px; }

.game-stage {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px 16px;
}
.stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
#game-canvas {
  display: block;
  width: 100%;
  border-radius: 8px;
  background: #f7f9fb;
  touch-action: manipulation;
}

.stage-board {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  max-width: 560px;
}

/* 排行榜（榜单式，做小一点，别抢游戏的戏） */
.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.board { padding: 12px 14px; }
.board-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}
.board-title { font-size: 13px; margin: 0; color: #5c6672; }

.rank-head,
.rank-list li {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.rank-head {
  font-size: 11px;
  color: var(--muted);
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.rank-head .rank-name { flex: 1; }

.rank-list {
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
  font-size: 12.5px;
}
.rank-list li {
  padding: 3px 4px;
  border-bottom: 1px dashed var(--line);
}
.rank-list li:last-child { border-bottom: none; }
.rank-list li.is-me {
  background: #f1f6ff;
  border-radius: 5px;
  border-bottom-color: transparent;
}

.rank-idx {
  width: 16px;
  text-align: center;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}
.rank-idx.medal-gold { color: #b45309; font-weight: 700; }
.rank-idx.medal-silver { color: #6b7280; font-weight: 700; }
.rank-idx.medal-bronze { color: #9a6a3f; font-weight: 700; }

.rank-name { flex: 1; }
.rank-score {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.rank-empty { color: var(--muted); font-size: 12px; }
.me-tag {
  display: inline-block;
  margin-left: 6px;
  font-size: 10.5px;
  line-height: 15px;
  color: #1d4ed8;
  background: #e6efff;
  border-radius: 8px;
  padding: 0 5px;
  vertical-align: middle;
}

/* 趣味页里的练习入口 */
.practice-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: #f4f7fb;
  border: 1px solid #dde5ef;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 18px;
}
.practice-strip-title { font-size: 14.5px; margin: 0 0 4px; }
.practice-strip-main p { margin: 0; }
.practice-strip-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------------------- 一建练习 */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-num {
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 12px; color: var(--muted); }

.practice-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.quiz-card { max-width: 760px; }
.quiz-stem {
  font-size: 15px;
  line-height: 1.75;
  margin: 0 0 16px;
}

.opt-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.opt {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.65;
  background: #fff;
  transition: border-color .12s, background .12s;
}
.opt label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  color: var(--text);
  font-size: 13.5px;
  margin: 0;
  width: 100%;
  box-sizing: border-box;
}
.opt:hover { border-color: #c3cad4; background: #fbfcfd; }
.opt.is-picked { border-color: var(--primary); background: #f3f7ff; }
.opt input[type="radio"],
.opt input[type="checkbox"] {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 3px 0 0;
  padding: 0;
  border: none;
  accent-color: var(--primary);
  cursor: pointer;
}
.multi-hint { margin: 0 0 10px; }
.opt-key {
  flex: 0 0 auto;
  font-weight: 600;
  color: var(--muted);
  min-width: 14px;
}
.opt-text {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  word-break: normal;
  overflow-wrap: break-word;
}
.opt.is-right { border-color: #86c89a; background: #f1fbf4; }
.opt.is-wrong { border-color: #e9a3a3; background: #fdf2f2; }
.opt-static {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  width: 100%;
  box-sizing: border-box;
}
.opt-flag {
  flex: 0 0 auto;
  font-size: 11px;
  line-height: 17px;
  padding: 0 7px;
  border-radius: 9px;
  margin-left: 4px;
}
.opt-flag.ok { color: #166534; background: #dcfce7; }
.opt-flag.bad { color: #991b1b; background: #fee2e2; }
.note-line { margin: -6px 0 10px; }

/* 练习进度条 */
.progress {
  height: 4px;
  background: #eceff3;
  border-radius: 2px;
  overflow: hidden;
  margin: 4px 0 14px;
}
.progress span {
  display: block;
  height: 100%;
  background: #8ba3c7;
  border-radius: 2px;
  transition: width .2s;
}

.result-banner {
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;
}
.result-banner.ok { background: #eefaf1; color: #166534; }
.result-banner.bad { background: #fdf2f2; color: #991b1b; }

.explain {
  background: #f7f9fc;
  border-left: 3px solid #c7d2e0;
  padding: 10px 14px;
  border-radius: 6px;
  margin: 14px 0;
  font-size: 13.5px;
  line-height: 1.75;
}
.explain p { margin: 6px 0 0; white-space: pre-wrap; }

.quiz-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 16px;
}
/* 提交按钮宽度固定，倒计时文字变化时不会左右跳 */
#submit-btn {
  min-width: 132px;
  justify-content: center;
}
.done-card { max-width: 520px; }
.done-score { font-size: 30px; font-weight: 600; margin: 0 0 16px; }

/* 积分与兑换 */
.points-big { font-size: 18px; color: #166534; }
.points-gain {
  margin-left: auto;
  color: #166534;
  font-weight: 600;
  font-size: 13px;
}
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.shop-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.shop-name { font-weight: 600; font-size: 13.5px; }
.shop-desc { font-size: 12px; color: var(--muted); }
.shop-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}
.shop-points { font-weight: 600; color: #b45309; font-size: 13px; }
.num-input {
  width: 90px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font: inherit;
  font-size: 12.5px;
}
.points-board { max-width: 420px; }
.done-bonus { color: #166534; font-weight: 600; margin: 0 0 6px; }

/* ---------------------------------------------------------- 手机 */
@media (max-width: 720px) {
  .topbar .wrap { height: auto; padding: 10px 16px; flex-wrap: wrap; gap: 10px; }
  .topbar nav { order: 3; width: 100%; gap: 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .two-col.wide-left { grid-template-columns: 1fr; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  /* iOS 上输入框字号小于 16px 会触发自动放大，这里统一调到 16 */
  label input, label select, label textarea { font-size: 16px; }
  .pop, .wide-pop { position: static; width: auto; box-shadow: none; margin-top: 10px; }
  .row-panel { top: 68px; right: 8px; width: calc(100vw - 16px); max-height: calc(100vh - 90px); }
  .page-head { flex-direction: column; }
  .create > summary.btn { display: inline-block; }
}

/* 表格里不该被挤断的短内容（比如人名） */
.table .nowrap { white-space: nowrap; }
.table .col-project { min-width: 130px; }

/* 表头筛选 */
.filter-row th { background: #fff; border-top: none; padding: 6px 10px; }
.filter-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filter-bar input { width: 220px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; }
.filter-bar select { padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; }
.pager { display: flex; gap: 12px; align-items: center; margin-top: 12px; }

/* Excel 式列头筛选 */
.afx { position: relative; display: inline-block; margin-left: 2px; }
.afx-btn { border: none; background: none; color: var(--muted); cursor: pointer; font-size: 11px; padding: 0 3px; line-height: 1; }
.afx-btn:hover, .afx-btn.af-on { color: #2f6feb; }
.afx-pop { display: none; position: fixed; z-index: 60; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(16, 24, 40, .12); padding: 8px; min-width: 210px; }
.afx-pop.open { display: block; }
.afx-pop select, .afx-pop input { width: 100%; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; background: #fff; }
.afx-pop.wide.open { display: flex; gap: 6px; align-items: center; min-width: 260px; }
.afx-pop.wide input { flex: 1; }

/* 操作面板里的群通知框：确保占满整栏，不被挤窄 */
.panel-block textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 76px;
  padding: 8px;
  font-size: 12px;
  font-family: ui-monospace, Consolas, monospace;
  line-height: 1.5;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfbfc;
  resize: vertical;
  white-space: pre-wrap;
}

/* 项目资料信息卡 */
.proj-info { padding: 12px 16px; }
.proj-info-grid { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.proj-info-grid > div { display: flex; gap: 8px; align-items: baseline; }
.pi-k { color: var(--muted); font-size: 12.5px; min-width: 74px; }
.pi-v { font-weight: 600; font-size: 13.5px; }
.proj-note { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.pi-text { white-space: pre-wrap; font-size: 13px; line-height: 1.6; margin-top: 4px; }
.sub-block { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.sub-title { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.sub-block input[type=file] { font-size: 12px; }

/* 测试版顶部横幅 */
.env-banner {
  background: #6b7280;
  color: #fff;
  text-align: center;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .2px;
}

/* ---------------------------------------------------------- 优化建议 */
.sug-list { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.sug-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
}
.sug-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sug-del { margin-left: auto; }
.sug-content { margin: 8px 0 0; white-space: pre-wrap; line-height: 1.65; }
.sug-imgs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.sug-imgs img {
  width: 132px;
  height: 96px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: block;
}

/* 建议页：Ctrl+V 粘贴的截图预览 */
.sug-preview { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 8px; }
.sug-thumb { position: relative; display: inline-block; }
.sug-thumb img {
  width: 104px;
  height: 78px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: block;
}
.sug-thumb button {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 19px;
  height: 19px;
  border: none;
  border-radius: 50%;
  background: #b42318;
  color: #fff;
  font-size: 12px;
  line-height: 19px;
  padding: 0;
  cursor: pointer;
}

/* 建议页：截图选择 + 可粘贴的文本框 */
.sug-shot-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-top: 4px;
}
.sug-shot-row input[type="file"] { width: auto; flex: 0 0 auto; margin-top: 0; }
.sug-pastebox {
  flex: 1 1 260px;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px 8px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: #fafbfc;
  cursor: text;
}
.sug-pastebox:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.sug-paste-hint { color: var(--muted); font-size: 12.5px; }
.sug-preview { display: flex; gap: 6px; flex-wrap: wrap; margin: 0; }
.sug-thumb { position: relative; display: inline-block; }
.sug-thumb img {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 5px;
  display: block;
  cursor: zoom-in;
}
.sug-thumb button {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: #b42318;
  color: #fff;
  font-size: 12px;
  line-height: 18px;
  padding: 0;
  cursor: pointer;
}

/* 建议页：截图合并成一个框（左粘贴、右选择文件） */
.sug-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.sug-shot-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 42px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: text;
}
.sug-shot-box:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.sug-shot-box .sug-paste-hint { flex: 0 0 auto; }
.sug-shot-box .sug-preview { flex: 1 1 auto; }
.sug-shot-box .btn { margin-left: auto; flex: 0 0 auto; }
.sug-file { display: none; }

/* 页头搜索框 */
.search-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.search-bar input {
  width: 300px; max-width: 100%; height: 36px; box-sizing: border-box;
  padding: 0 10px; border: 1px solid var(--line); border-radius: 6px;
  font-size: 13.5px; background: #fff;
}
.search-bar input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.search-bar .btn { height: 36px; box-sizing: border-box; }

/* 可点击的统计卡片：当前筛选高亮 */
.kpi.on { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .10); }

/* 页脚备案号（工信部要求可见、可点击） */
.foot-icp { margin-top: 4px; font-size: 12px; }
.foot-icp a { color: var(--muted); text-decoration: none; }
.foot-icp a:hover { text-decoration: underline; }
