/* ============================================================
   测试记录工作台 —— Apple 风格 UI
   ============================================================ */

:root {
  --bg-sub: #f5f5f7;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;
  --line: rgba(0, 0, 0, 0.08);
  --line-soft: rgba(0, 0, 0, 0.05);
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --green: #34c759;
  --orange: #ff9500;
  --red: #ff3b30;
  --radius-l: 20px;
  --radius-m: 14px;
  --radius-s: 10px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.04);
  --shadow-2: 0 2px 10px rgba(0, 0, 0, 0.08), 0 24px 64px rgba(0, 0, 0, 0.14);
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --nav-h: 52px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; height: 100%; }

body {
  font-family: "SF Pro Text", "SF Pro Display", -apple-system, BlinkMacSystemFont,
    "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg-sub);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

button, input, textarea, select { font-family: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; padding: 0; }
svg { width: 16px; height: 16px; flex: none; display: block; }
[hidden] { display: none !important; }

::selection { background: rgba(0, 113, 227, 0.16); }

/* ------------------------------ 顶部导航 ------------------------------ */

.nav {
  position: sticky; top: 0; z-index: 60;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  max-width: 1600px; height: 100%; margin: 0 auto;
  padding: 0 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}

.brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 16px; font-weight: 600; letter-spacing: -0.02em;
  color: var(--text); text-decoration: none; white-space: nowrap;
}
.brand-mark { width: 21px; height: 21px; }

.nav-right { display: flex; align-items: center; gap: 10px; }

.online {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-2); white-space: nowrap;
}
.online .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.16);
  animation: pulse 2.6s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.savestate {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--text-3); min-width: 68px;
  transition: color 0.3s;
}
.savestate i {
  width: 5px; height: 5px; border-radius: 50%;
  background: #c7c7cc; transition: all 0.3s;
}
.savestate.saving i { background: var(--orange); }
.savestate.saved i { background: var(--green); }
.savestate.error { color: var(--red); }
.savestate.error i { background: var(--red); }

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 15px;
  border-radius: 980px;
  font-size: 13px; font-weight: 400; letter-spacing: -0.01em;
  white-space: nowrap;
  transition: background 0.2s var(--ease), color 0.2s, transform 0.15s var(--ease), box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 14px; height: 14px; }

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

.btn-quiet { background: rgba(0, 0, 0, 0.05); color: var(--text); }
.btn-quiet:hover { background: rgba(0, 0, 0, 0.09); }

.btn-lg { height: 40px; padding: 0 24px; font-size: 14px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  color: var(--text-3);
  transition: background 0.18s, color 0.18s;
}
.icon-btn:hover { background: rgba(0, 0, 0, 0.06); color: var(--text); }
.icon-btn.danger:hover { background: rgba(255, 59, 48, 0.1); color: var(--red); }
.icon-btn svg { width: 15px; height: 15px; }

/* ------------------------------- 布局 -------------------------------- */

.layout {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 22px 60px;
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

/* ------------------------------ 侧栏 -------------------------------- */

.sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 20px);
  padding-top: 26px;
}

.sidebar-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 10px 10px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-3);
}
.sidebar-head .count {
  font-size: 11px; letter-spacing: 0;
  background: rgba(0, 0, 0, 0.06); color: var(--text-2);
  padding: 1px 7px; border-radius: 999px;
}

.project-list { display: flex; flex-direction: column; gap: 2px; }

.project-item {
  position: relative;
  display: block; width: 100%; text-align: left;
  padding: 9px 34px 9px 11px;
  border-radius: var(--radius-s);
  transition: background 0.16s var(--ease);
  color: var(--text);
}
.project-item:hover { background: rgba(0, 0, 0, 0.045); }
.project-item.active { background: #fff; box-shadow: var(--shadow-1); }

.pi-name {
  display: block; font-size: 13.5px; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  letter-spacing: -0.015em;
}
.project-item.active .pi-name { color: var(--blue); }
.pi-meta {
  display: block; margin-top: 2px;
  font-size: 11px; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.pi-del {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); opacity: 0;
  transition: opacity 0.16s, background 0.16s, color 0.16s;
}
.pi-del svg { width: 13px; height: 13px; }
.project-item:hover .pi-del { opacity: 1; }
.pi-del:hover { background: rgba(255, 59, 48, 0.1); color: var(--red); }

.side-add {
  margin-top: 10px; width: 100%;
  height: 34px; border-radius: var(--radius-s);
  border: 1px dashed rgba(0, 0, 0, 0.14);
  color: var(--text-2); font-size: 13px;
  transition: all 0.18s var(--ease);
}
.side-add:hover { border-color: var(--blue); color: var(--blue); background: rgba(0, 113, 227, 0.04); }

/* ------------------------------ 内容区 ------------------------------- */

.content { padding-top: 26px; min-width: 0; }

.proj-head { margin-bottom: 20px; }

.proj-title-row { display: flex; align-items: center; gap: 8px; }

.proj-title {
  display: inline-block;
  margin: 0; padding: 2px 4px; margin-left: -4px;
  font-size: 32px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.2;
  border-radius: 8px; outline: none;
  min-width: 60px;
  transition: background 0.18s;
}
.proj-title:hover { background: rgba(0, 0, 0, 0.035); }
.proj-title:focus { background: #fff; box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.18); }
.proj-title:empty::before {
  content: attr(data-placeholder);
  color: var(--text-3);
}

.stats {
  display: flex; align-items: center; gap: 22px;
  margin-top: 14px; flex-wrap: wrap;
}
.stat { display: flex; align-items: baseline; gap: 5px; }
.stat b {
  font-size: 21px; font-weight: 600; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat b.ok { color: var(--green); }
.stat b.warn { color: var(--orange); }
.stat span { font-size: 12px; color: var(--text-3); }

.progress {
  flex: 1; min-width: 80px; max-width: 240px; margin-left: 2px;
  height: 4px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.07);
  overflow: hidden;
}
.progress-bar {
  height: 100%; width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #34c759, #30d158);
  transition: width 0.5s var(--ease);
}

/* ------------------------------ 工具条 ------------------------------- */

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

.chips { display: flex; gap: 6px; flex-wrap: wrap; }

.chip {
  height: 30px; padding: 0 14px;
  border-radius: 980px;
  font-size: 13px; color: var(--text-2);
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.18s var(--ease);
  white-space: nowrap;
}
.chip:hover { background: rgba(0, 0, 0, 0.05); color: var(--text); }
.chip.active {
  background: var(--text); color: #fff;
  border-color: var(--text);
}

.toolbar-right { display: flex; align-items: center; gap: 10px; }

.search {
  position: relative;
  display: flex; align-items: center;
}
.search svg {
  position: absolute; left: 11px;
  width: 14px; height: 14px; color: var(--text-3);
  pointer-events: none;
}
.search input {
  width: 210px; height: 32px;
  padding: 0 12px 0 32px;
  border-radius: 980px;
  border: 1px solid transparent;
  background: rgba(0, 0, 0, 0.05);
  font-size: 13px; outline: none;
  transition: all 0.2s var(--ease);
}
.search input::placeholder { color: var(--text-3); }
.search input:focus {
  background: #fff; border-color: rgba(0, 113, 227, 0.5);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
  width: 250px;
}

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

.table-card {
  background: #fff;
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}

.table-scroll {
  max-height: calc(100vh - 330px);
  min-height: 120px;
  overflow: auto;
  overscroll-behavior: contain;
}
.table-scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.table-scroll::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.16);
  border-radius: 99px;
  border: 3px solid #fff;
}
.table-scroll::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.28); }

table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }

thead th {
  position: sticky; top: 0; z-index: 3;
  padding: 10px 14px;
  font-size: 12px; font-weight: 500; color: var(--text-3);
  text-align: left; letter-spacing: 0;
  background: #fafafc;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th.col-center { text-align: center; }
th.col-seq { text-align: center; }

tbody tr { transition: background 0.14s; }
tbody tr:hover { background: #fafafa; }
tbody tr.dragging { opacity: 0.4; }
tbody tr.drop-above td { box-shadow: inset 0 2px 0 var(--blue); }
tbody tr.drop-below td { box-shadow: inset 0 -2px 0 var(--blue); }

tbody td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
  font-size: 14px;
}
tbody tr:last-child td { border-bottom: none; }

td.col-seq {
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  padding-top: 14px;
}
.seq-wrap { position: relative; display: flex; align-items: center; justify-content: center; }
.drag-handle {
  position: absolute; left: -2px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 20px; cursor: grab;
  color: #d2d2d7; opacity: 0;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.16s, color 0.16s;
}
.drag-handle svg { width: 12px; height: 12px; }
tr:hover .drag-handle { opacity: 1; }
.drag-handle:hover { color: var(--text-3); }
.drag-handle:active { cursor: grabbing; }
.seq-num { flex: none; min-width: 18px; text-align: center; }

td.col-center { text-align: center; }

/* 可编辑单元格 */

.cell {
  display: block; width: 100%;
  padding: 4px 7px; margin: -4px -7px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  resize: none; overflow: hidden;
  font: inherit; line-height: 1.45;
  letter-spacing: -0.005em;
  color: var(--text);
  outline: none;
  transition: background 0.16s, border-color 0.16s, box-shadow 0.16s;
  min-height: 29px;
  word-break: break-word;
}
.cell::placeholder { color: #c7c7cc; }
.cell:hover { background: rgba(0, 0, 0, 0.028); }
.cell:focus {
  background: #fff;
  border-color: rgba(0, 113, 227, 0.55);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
}
tbody tr.row-done .cell-descr { color: var(--text-3); }

/* 完成状态开关 */

.switch-cell { display: flex; align-items: center; justify-content: center; gap: 7px; padding-top: 2px; }
.switch {
  position: relative; width: 42px; height: 25px;
  border-radius: 999px; background: #e5e5ea;
  transition: background 0.26s var(--ease);
  flex: none;
}
.switch::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 21px; height: 21px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
  transition: transform 0.26s var(--ease);
}
.switch.on { background: var(--green); }
.switch.on::after { transform: translateX(17px); }
.switch-label { font-size: 12.5px; color: var(--text-2); width: 14px; flex: none; }
.switch.on + .switch-label { color: var(--green-deep, #248a3d); }

/* 下拉框 */

.mini-select {
  -webkit-appearance: none; appearance: none;
  height: 28px; padding: 0 24px 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background-color: #fff;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
  background-size: 11px;
  font-size: 12.5px;
  color: var(--text);
  outline: none;
  cursor: pointer;
  transition: all 0.18s var(--ease);
  min-width: 68px;
}
.mini-select:hover { border-color: rgba(0, 0, 0, 0.18); }
.mini-select:focus { border-color: rgba(0, 113, 227, 0.55); box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12); }
.mini-select.is-yes { color: #248a3d; border-color: rgba(52, 199, 89, 0.5); background-color: rgba(52, 199, 89, 0.07); }
.mini-select.is-no { color: var(--text-2); }

/* 图片单元格 */

.img-cell { display: flex; flex-direction: column; gap: 6px; }
.img-grid { display: flex; flex-wrap: wrap; gap: 6px; }

.thumb {
  position: relative; flex: none;
  width: 52px; height: 52px;
  border-radius: 9px;
  overflow: hidden;
  background: #f0f0f2 center/cover no-repeat;
  cursor: zoom-in;
  border: 1px solid var(--line-soft);
  transition: transform 0.18s var(--ease), box-shadow 0.2s;
}
.thumb:hover { transform: scale(1.04); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.13); }
.thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.thumb .rm {
  position: absolute; top: 2px; right: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.16s;
  -webkit-backdrop-filter: blur(4px);
}
.thumb .rm svg { width: 9px; height: 9px; }
.thumb:hover .rm { opacity: 1; }
.thumb .rm:hover { background: var(--red); }

.img-add {
  flex: none;
  width: 52px; height: 52px;
  border-radius: 9px;
  border: 1px dashed rgba(0, 0, 0, 0.16);
  color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.18s var(--ease);
  background: transparent;
}
.img-add:hover { border-color: var(--blue); color: var(--blue); background: rgba(0, 113, 227, 0.05); }
.img-add svg { width: 16px; height: 16px; }
.img-add.pulse { border-color: var(--blue); background: rgba(0, 113, 227, 0.1); }

.img-hint {
  font-size: 11px; color: #b0b0b5;
  line-height: 1.3;
}

.uploading-mask {
  position: absolute; inset: 0;
  background: rgba(255, 255, 255, 0.82);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--text-2);
}

/* 删除行按钮 */

td.col-act { text-align: center; padding-top: 12px; }
.row-del { opacity: 0; transition: opacity 0.16s, background 0.16s, color 0.16s; }
tr:hover .row-del { opacity: 1; }

/* 表尾 */

.add-row-strip {
  display: block; width: 100%;
  padding: 13px;
  text-align: center;
  font-size: 13px; color: var(--text-3);
  border-top: 1px solid var(--line-soft);
  background: transparent;
  transition: all 0.18s var(--ease);
}
.add-row-strip:hover { background: rgba(0, 113, 227, 0.04); color: var(--blue); }

.table-empty {
  padding: 48px 20px; text-align: center;
  color: var(--text-3); font-size: 13px;
}
.table-empty p { margin: 0; }

.hint {
  margin: 16px 4px 0;
  font-size: 12px; color: var(--text-3); line-height: 1.7;
}
.hint b { color: var(--text-2); font-weight: 500; }
kbd {
  display: inline-block;
  padding: 1px 5px; margin: 0 1px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.06);
  font-family: inherit; font-size: 11px;
  color: var(--text-2);
}

/* ------------------------------ 空状态 -------------------------------- */

.empty {
  text-align: center;
  padding: 90px 20px;
  max-width: 480px;
  margin: 0 auto;
}
.empty-icon {
  width: 62px; height: 62px; margin: 0 auto 22px;
  border-radius: 18px;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  box-shadow: var(--shadow-1);
}
.empty-icon svg { width: 30px; height: 30px; }
.empty h1 {
  font-size: 30px; font-weight: 600; letter-spacing: -0.03em;
  margin: 0 0 10px;
}
.empty p {
  font-size: 14px; color: var(--text-2); line-height: 1.65;
  margin: 0 0 26px;
}

/* -------------------------------- 弹窗 -------------------------------- */

.modal-mask {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0, 0, 0, 0.34);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn 0.22s var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%; max-width: 396px;
  background: #fff;
  border-radius: 22px;
  padding: 28px 26px 22px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1), 0 32px 80px rgba(0, 0, 0, 0.22);
  animation: popIn 0.32s var(--ease);
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
  to { opacity: 1; transform: none; }
}

.modal h2 {
  margin: 0 0 6px;
  font-size: 21px; font-weight: 600; letter-spacing: -0.025em;
}
.modal-sub {
  margin: 0 0 20px;
  font-size: 13px; color: var(--text-2); line-height: 1.5;
}

.field {
  display: block; width: 100%;
  height: 42px; padding: 0 14px;
  margin-bottom: 10px;
  border-radius: 11px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #fafafa;
  font-size: 14px; outline: none;
  transition: all 0.2s var(--ease);
}
.field::placeholder { color: #b0b0b5; }
.field:focus {
  background: #fff;
  border-color: rgba(0, 113, 227, 0.6);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
}

.modal-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 18px;
}
.modal-actions .btn { height: 36px; padding: 0 20px; font-size: 13.5px; }

/* ------------------------------- 灯箱 --------------------------------- */

.lightbox {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0, 0, 0, 0.86);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  display: flex; flex-direction: column;
  animation: fadeIn 0.2s var(--ease);
}
.lb-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 20px;
  color: rgba(255, 255, 255, 0.9);
}
.lb-name {
  font-size: 13px; color: rgba(255, 255, 255, 0.65);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lb-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.lb-btn {
  background: rgba(255, 255, 255, 0.14) !important;
  color: #fff !important;
  -webkit-backdrop-filter: blur(10px);
}
.lb-btn:hover { background: rgba(255, 255, 255, 0.24) !important; }

.lb-stage {
  flex: 1; padding: 0 24px 28px;
  display: flex; align-items: center; justify-content: center;
  overflow: auto;
}
.lb-stage img {
  max-width: 100%; max-height: 100%;
  border-radius: 10px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  object-fit: contain;
}

/* ----------------------------- 拖拽遮罩 ------------------------------- */

.drop-overlay {
  position: fixed; inset: 0; z-index: 250;
  background: rgba(0, 113, 227, 0.14);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.drop-box {
  padding: 18px 32px;
  border-radius: 16px;
  border: 2px dashed rgba(0, 113, 227, 0.5);
  background: #fff;
  color: var(--blue);
  font-size: 15px; font-weight: 500;
  box-shadow: var(--shadow-2);
}

/* -------------------------------- Toast ------------------------------- */

.toast {
  position: fixed; left: 50%; bottom: 36px; z-index: 400;
  transform: translate(-50%, 16px);
  padding: 10px 20px;
  border-radius: 980px;
  background: rgba(29, 29, 31, 0.92);
  -webkit-backdrop-filter: blur(20px);
  color: #fff; font-size: 13px;
  opacity: 0; pointer-events: none;
  transition: all 0.3s var(--ease);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.24);
  max-width: calc(100vw - 40px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============================== 响应式 ================================ */

@media (max-width: 1080px) {
  .layout { grid-template-columns: 190px minmax(0, 1fr); gap: 18px; }
  .search input { width: 170px; }
  .search input:focus { width: 200px; }
}

@media (max-width: 860px) {
  :root { --nav-h: 50px; }

  .nav-inner { padding: 0 14px; gap: 8px; }
  .online span { display: inline; }
  .savestate span { display: none; }
  .savestate { min-width: 0; }
  .brand span { font-size: 15px; }
  .btn-quiet span { display: none; }
  .btn-quiet { padding: 0 10px; }

  .layout {
    display: block;
    padding: 0 12px 90px;
  }

  /* 侧栏变为横向项目条 */
  .sidebar {
    position: sticky; top: var(--nav-h); z-index: 40;
    display: flex; align-items: center; gap: 8px;
    margin: 0 -12px; padding: 10px 12px;
    background: rgba(245, 245, 247, 0.94);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
  }
  .sidebar-head { display: none; }
  .project-list {
    flex: 1 1 auto; min-width: 0;
    flex-direction: row; gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 0 12px 2px;
    margin: 0 -12px;
    scroll-padding-inline: 12px;
  }
  .project-list::-webkit-scrollbar { display: none; }
  .project-item {
    flex: none;
    padding: 7px 16px 7px 13px;
    border-radius: 980px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    max-width: 180px;
  }
  .project-item.active { background: var(--text); }
  .project-item.active .pi-name { color: #fff; }
  .project-item.active .pi-meta { color: rgba(255, 255, 255, 0.6); }
  .pi-meta { margin-top: 0; }
  .pi-del { display: none; }
  .side-add {
    flex: none; display: inline-flex; align-items: center;
    width: auto; margin: 0; padding: 0 14px; height: 32px;
    border-radius: 980px; border-style: solid;
    background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    font-size: 15px; color: var(--text-2);
  }
  .side-add .sa-text { display: none; }

  .content { padding-top: 16px; }
  .proj-title { font-size: 25px; }
  .stats { gap: 16px; margin-top: 10px; }
  .stat b { font-size: 18px; }
  .progress { order: 10; flex: 1 0 100%; width: 100%; max-width: none; margin-top: 2px; }

  .toolbar { gap: 8px; }
  .chips { width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; padding-bottom: 2px; }
  .chips::-webkit-scrollbar { display: none; }
  .toolbar-right { width: 100%; }
  .search { flex: 1; }
  .search input { width: 100%; }
  .search input:focus { width: 100%; }

  /* 表格转卡片 */
  .table-card { background: transparent; box-shadow: none; border-radius: 0; overflow: visible; }
  .table-scroll { max-height: none; overflow: visible; }
  table, tbody, tr, td { display: block; width: 100%; }
  thead { display: none; }
  colgroup { display: none; }

  tbody tr {
    background: #fff;
    border-radius: var(--radius-l);
    box-shadow: var(--shadow-1);
    padding: 12px 14px 8px;
    margin-bottom: 10px;
    position: relative;
  }
  tbody td {
    border: none !important;
    padding: 4px 0;
    font-size: 14px;
  }
  td.col-seq {
    position: absolute; top: 10px; left: 14px;
    padding: 0; width: auto;
    font-size: 12px; color: var(--text-3);
  }
  .drag-handle { display: none; }
  .seq-num::before { content: '#'; }

  td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    color: var(--text-3);
    margin-bottom: 2px;
    letter-spacing: 0;
  }
  td.col-descr { padding-top: 22px; }
  td.col-descr::before, td.col-act::before { display: none; }
  td.col-descr .cell { font-size: 15px; font-weight: 500; padding: 2px 0; margin: 0; }
  td.col-descr .cell:hover { background: transparent; }
  td.col-done, td.col-verified { display: inline-block; width: auto; margin-right: 20px; padding-top: 10px; }
  td.col-done::before, td.col-verified::before { display: none; }
  .switch-cell::before { content: '完成'; font-size: 11px; color: var(--text-3); margin-right: 2px; }
  .switch-label { display: none; }
  td.col-verified::before {
    content: '验证'; display: block;
    font-size: 11px; color: var(--text-3); margin-right: 6px;
  }
  td.col-verified { padding-top: 10px !important; }
  td.col-done, td.col-verified { display: inline-flex; align-items: center; }
  td.col-imgs { padding-top: 10px; }
  td.col-imgs::before { display: none; }
  .img-hint { display: none; }
  td.col-act {
    position: absolute; top: 8px; right: 8px;
    width: auto; padding: 0;
  }
  .row-del { opacity: 1; }

  .thumb, .img-add { width: 58px; height: 58px; }
  .add-row-strip { background: #fff; border-radius: var(--radius-l); border-top: none; margin-bottom: 10px; box-shadow: var(--shadow-1); }
  .hint { padding: 0 4px; }

  .lb-bar { padding: 12px 14px; flex-wrap: wrap; }
  .lb-name { width: 100%; }
  .lb-stage { padding: 0 12px 16px; }
}

@media (max-width: 400px) {
  .proj-title { font-size: 22px; }
  .nav-right .btn-primary { padding: 0 13px; font-size: 12.5px; }
  .nav-right { gap: 6px; }
}
