:root {
  color-scheme: light;
  --bg: #eef2f7;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --line: #d8e2ee;
  --text: #172433;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-2: #0f766e;
  --green: #198754;
  --amber: #b7791f;
  --red: #b91c1c;
  --shadow: 0 16px 40px rgba(23, 36, 51, 0.1);
  --radius: 10px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 28%),
    radial-gradient(circle at left 20%, rgba(15, 118, 110, 0.06), transparent 26%),
    var(--bg);
  color: var(--text);
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 10px 12px;
  color: var(--text);
  outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
a { color: var(--accent); text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 26px; letter-spacing: 0; }
h2 { font-size: 18px; }

.hidden { display: none !important; }
.page { max-width: 1480px; margin: 0 auto; padding: 22px; }
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
}
.auth-card {
  width: min(460px, calc(100vw - 32px));
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 24px;
  display: grid;
  gap: 16px;
}
.auth-copy { color: var(--muted); margin-top: 6px; line-height: 1.5; }
.auth-tabs { display: flex; gap: 10px; }
.tab-btn {
  flex: 1;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 10px 12px;
  font-weight: 700;
}
.tab-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.auth-form { display: grid; gap: 12px; }
.auth-error { min-height: 20px; color: var(--red); font-size: 13px; }
.auth-note { color: var(--muted); font-size: 12px; }

.topbar,
.hero-grid,
.board-head,
.board-tools,
.qa-row,
.dialog-actions {
  display: flex;
  gap: 14px;
}
.topbar {
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  background: rgba(255,255,255,0.84);
  border: 1px solid rgba(216,226,238,0.9);
  border-radius: var(--radius);
  padding: 16px 18px;
  backdrop-filter: blur(10px);
}
.eyebrow,
.section-kicker {
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.sync-pill {
  min-width: 130px;
  text-align: center;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}
.user-pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #eef6ff;
  border: 1px solid #cfe0ff;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 800;
}
.primary-btn,
.secondary-btn,
.ghost-btn,
.icon-btn {
  border-radius: var(--radius);
  border: 1px solid transparent;
  min-height: 38px;
  font-weight: 700;
}
.primary-btn { background: var(--accent); color: #fff; padding: 9px 14px; }
.secondary-btn { background: #fff; border-color: var(--line); color: var(--text); padding: 9px 14px; }
.ghost-btn { background: transparent; border-color: var(--line); color: var(--muted); padding: 9px 14px; }
.danger-btn { background: #fff1f2; border: 1px solid #fecdd3; color: var(--red); padding: 9px 14px; border-radius: var(--radius); min-height: 38px; font-weight: 800; }
.icon-btn { width: 38px; background: var(--surface-soft); color: var(--text); font-size: 20px; }
.toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  min-width: 180px;
  max-width: calc(100vw - 32px);
  padding: 10px 14px;
  border-radius: 999px;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  background: #e8f7ef;
  border: 1px solid #b7e3c8;
  color: var(--green);
  box-shadow: var(--shadow);
}
.toast.error { background: #fff1f2; border-color: #fecdd3; color: var(--red); }

.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 14px; margin-bottom: 16px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric,
.qa-card,
.column,
.detail-panel,
.qa-result,
.task-card,
.comment-item,
.attachment-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(23, 36, 51, 0.03);
}
.metric { padding: 16px; }
.metric .label { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.metric .value { font-size: 28px; font-weight: 800; }
.qa-card { padding: 16px; display: grid; gap: 12px; }
.qa-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.qa-row { align-items: center; }
.board-head { justify-content: space-between; align-items: center; margin-bottom: 14px; }
.board-tools { align-items: center; }
.search { width: min(320px, 48vw); }
.board-shell { min-height: 620px; }
.board-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.board-focus { display: grid; grid-template-columns: minmax(320px, 0.95fr) minmax(540px, 1.05fr); gap: 14px; align-items: start; }
.column {
  min-height: 560px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.column-head { display: flex; justify-content: space-between; align-items: center; padding: 13px 14px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #fbfdff, #f7f9fc); }
.column-title { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.dot { width: 9px; height: 9px; border-radius: 999px; background: var(--muted); }
.dot.claim { background: #64748b; }
.dot.progress { background: var(--accent); }
.dot.done { background: var(--green); }
.count-pill { background: var(--surface-soft); color: var(--muted); font-size: 12px; padding: 3px 8px; border-radius: 999px; }
.column-body { padding: 12px; display: grid; gap: 10px; }
.column--focus { min-height: 760px; }
.task-card {
  text-align: left;
  width: 100%;
  padding: 13px;
  display: grid;
  gap: 10px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.task-card:hover { transform: translateY(-1px); border-color: #b7c6d8; }
.task-card.active { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.task-top { display: flex; justify-content: space-between; gap: 10px; }
.task-title { font-weight: 800; line-height: 1.35; }
.task-desc { color: var(--muted); font-size: 13px; line-height: 1.55; }
.task-meta { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; }
.progress-line { width: 100%; height: 6px; border-radius: 999px; background: #e5edf6; overflow: hidden; }
.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.badge-row, .tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px; font-size: 12px; background: var(--surface-soft); color: var(--muted); }
.badge.high { color: var(--red); background: #fdecec; }
.badge.medium { color: var(--amber); background: #fff6e6; }
.badge.low { color: var(--green); background: #e8f7ef; }
.detail-panel {
  padding: 18px;
  box-shadow: var(--shadow);
  min-height: 760px;
}
.detail-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.detail-title { display: grid; gap: 8px; }
.detail-actions, .action-row { display: flex; gap: 10px; flex-wrap: wrap; }
.section { margin-top: 18px; }
.section h3 { margin-bottom: 10px; font-size: 16px; }
.detail-grid, .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.full { grid-column: 1 / -1; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.timeline, .comment-list, .attachment-list { display: grid; gap: 10px; }
.comment-item, .attachment-item { padding: 12px; background: var(--surface-soft); }
.muted, time, .small-note { color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface-soft); padding: 14px; }
.qa-result { min-height: 96px; padding: 14px; }
.qa-title { font-weight: 800; margin-bottom: 6px; }
.dialog { border: 0; padding: 0; background: transparent; }
.dialog::backdrop { background: rgba(15, 23, 42, 0.45); backdrop-filter: blur(3px); }
.dialog-card { width: min(720px, calc(100vw - 32px)); background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.dialog-actions { justify-content: flex-end; margin-top: 16px; }
@media (max-width: 1200px) {
  .hero-grid, .board-focus { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-panel { min-height: auto; }
}
@media (max-width: 900px) {
  .board-grid, .stats, .detail-grid, .form-grid { grid-template-columns: 1fr; }
  .search { width: 100%; }
  .topbar, .board-head, .qa-head, .qa-row { flex-direction: column; align-items: stretch; }
}
