/* ===== 需求看板 · 深色精装版 ===== */
:root {
  --page: #070a13;
  --panel-bg: rgba(15, 22, 38, 0.78);
  --panel-line: rgba(148, 163, 184, 0.15);
  --field-bg: rgba(8, 12, 22, 0.75);
  --field-line: rgba(148, 163, 184, 0.2);
  --txt: #e8edf6;
  --txt-2: #a7b3c7;
  --txt-3: #6b7a92;
  --a1: #6366f1;
  --a2: #22d3ee;
  --grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 45%, #22d3ee 100%);
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --radius: 16px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--txt);
  background:
    radial-gradient(1100px 560px at 12% -8%, rgba(99, 102, 241, 0.22), transparent 60%),
    radial-gradient(900px 520px at 105% -4%, rgba(34, 211, 238, 0.13), transparent 55%),
    radial-gradient(800px 620px at 50% 115%, rgba(139, 92, 246, 0.10), transparent 60%),
    var(--page);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 880px; margin: 0 auto; padding: 0 20px; }

/* ---------- 顶栏 ---------- */
.hero { padding: 34px 0 6px; }
.hero-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-logo {
  width: 46px; height: 46px; border-radius: 13px; flex: none;
  display: grid; place-items: center; color: #fff;
  background: var(--grad);
  box-shadow: 0 10px 26px rgba(99, 102, 241, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.brand-logo svg { width: 24px; height: 24px; }
.brand-txt h1 {
  margin: 0; font-size: 24px; font-weight: 800; letter-spacing: 0.5px;
  background: linear-gradient(100deg, #fff 30%, #a5b4fc 75%, #67e8f9 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.brand-txt p { margin: 3px 0 0; font-size: 13px; color: var(--txt-3); letter-spacing: 0.3px; }
.today-chip {
  font-size: 12.5px; color: var(--txt-2);
  background: var(--panel-bg); border: 1px solid var(--panel-line);
  padding: 7px 14px; border-radius: 999px;
}

/* ---------- 统计 ---------- */
.stats {
  margin: 26px 0 18px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
.stat {
  background: var(--panel-bg);
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 13px;
  backdrop-filter: blur(8px);
  transition: border-color .2s ease, transform .2s ease;
}
.stat:hover { border-color: rgba(148, 163, 184, 0.3); transform: translateY(-2px); }
.stat-ic {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  background: rgba(99, 102, 241, 0.12); border: 1px solid rgba(99, 102, 241, 0.25);
}
.stat-ic svg { width: 19px; height: 19px; }
.c-indigo { color: #a5b4fc; background: rgba(99,102,241,.14); border-color: rgba(99,102,241,.3); }
.c-cyan   { color: #67e8f9; background: rgba(34,211,238,.12); border-color: rgba(34,211,238,.26); }
.c-green  { color: #6ee7b7; background: rgba(52,211,153,.12); border-color: rgba(52,211,153,.26); }
.c-amber  { color: #fcd34d; background: rgba(251,191,36,.12); border-color: rgba(251,191,36,.26); }
.stat-num { font-size: 22px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-lb  { font-size: 12px; color: var(--txt-3); margin-top: 3px; }

/* ---------- 面板 ---------- */
.panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 18px;
  backdrop-filter: blur(8px);
  box-shadow: 0 16px 40px rgba(2, 6, 16, 0.35);
}
.panel-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-h h2 { margin: 0; font-size: 16.5px; font-weight: 700; }
.panel-sub { margin: 4px 0 0; font-size: 12.5px; color: var(--txt-3); }
.history-head { align-items: center; }
.count-pill {
  font-size: 12px; color: var(--txt-2); white-space: nowrap;
  background: rgba(99, 102, 241, 0.1); border: 1px solid rgba(99, 102, 241, 0.25);
  color: #c7d2fe; padding: 4px 12px; border-radius: 999px;
}

/* ---------- 输入 ---------- */
.field { position: relative; }
.field textarea {
  width: 100%;
  background: var(--field-bg);
  border: 1px solid var(--field-line);
  color: var(--txt);
  border-radius: 12px;
  padding: 13px 14px 26px;
  font: inherit; font-size: 14.5px; line-height: 1.7;
  resize: vertical; min-height: 84px;
  outline: none; transition: border-color .2s ease, box-shadow .2s ease;
}
.field textarea:focus {
  border-color: rgba(129, 140, 248, 0.65);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16);
}
.field textarea::placeholder { color: var(--txt-3); }
.field-bar {
  position: absolute; right: 12px; bottom: 8px;
  font-size: 11px; color: var(--txt-3); font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.submit-row { display: flex; align-items: center; gap: 14px; margin-top: 13px; flex-wrap: wrap; }
.hint { font-size: 12px; color: var(--txt-3); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 0; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 600;
  padding: 9px 18px; border-radius: 11px;
  color: #fff; background: rgba(148, 163, 184, 0.14);
  border: 1px solid rgba(148, 163, 184, 0.2);
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, filter .2s ease;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn.primary {
  background: var(--grad);
  border: none;
  box-shadow: 0 8px 22px rgba(99, 102, 241, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn.primary:hover { box-shadow: 0 10px 28px rgba(99, 102, 241, 0.45), inset 0 1px 0 rgba(255,255,255,.2); }
.btn.ghost { background: rgba(148, 163, 184, 0.08); }
.btn.sm { padding: 6px 13px; font-size: 13px; border-radius: 9px; }

.spinner {
  display: none; width: 14px; height: 14px; flex: none;
  border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite;
}
.btn.loading { pointer-events: none; opacity: .85; }
.btn.loading .spinner { display: inline-block; }

/* ---------- 查询栏 ---------- */
.query {
  display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap;
  background: var(--field-bg);
  border: 1px solid var(--field-line);
  border-radius: 14px;
  padding: 13px 15px;
  margin-bottom: 16px;
}
.q-field { display: flex; flex-direction: column; gap: 5px; }
.q-field label { font-size: 11.5px; color: var(--txt-3); letter-spacing: .4px; }
.q-field input[type="datetime-local"] {
  background: rgba(8, 12, 22, 0.8);
  border: 1px solid var(--field-line);
  color: var(--txt);
  border-radius: 9px; padding: 7px 9px;
  font: inherit; font-size: 13px;
  outline: none; transition: border-color .2s ease;
}
.q-field input:focus { border-color: rgba(129, 140, 248, 0.65); }
.q-sep { color: var(--txt-3); display: grid; place-items: center; padding-bottom: 8px; }
.q-sep svg { width: 16px; height: 16px; }
.quick { display: flex; gap: 6px; padding-bottom: 1px; }
.chip {
  border: 1px solid var(--field-line);
  background: rgba(148, 163, 184, 0.07);
  color: var(--txt-2);
  font: inherit; font-size: 12.5px;
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
  transition: all .18s ease;
}
.chip:hover { color: var(--txt); border-color: rgba(148, 163, 184, 0.4); }
.chip.active {
  background: linear-gradient(135deg, rgba(99,102,241,.28), rgba(34,211,238,.2));
  color: #e0e7ff; border-color: rgba(129, 140, 248, 0.5);
  box-shadow: 0 0 0 1px rgba(99,102,241,.25) inset;
}

/* ---------- 列表 ---------- */
.list { display: grid; gap: 10px; }
.item {
  width: 100%; text-align: left;
  display: block;
  background: rgba(8, 12, 22, 0.6);
  border: 1px solid var(--field-line);
  border-radius: 13px;
  padding: 13px 15px;
  color: var(--txt); font: inherit;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, transform .18s ease, box-shadow .2s ease;
  animation: rise .3s ease both;
}
.item:hover {
  border-color: rgba(129, 140, 248, 0.5);
  background: rgba(11, 16, 30, 0.85);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(2, 6, 16, 0.4);
}
.item-top { display: flex; align-items: flex-start; gap: 11px; }
.item-ic {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: rgba(99, 102, 241, 0.12); color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.22);
  margin-top: 1px;
}
.item-ic svg { width: 17px; height: 17px; }
.item-content {
  flex: 1; margin: 0;
  font-size: 14px; line-height: 1.65; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.item-foot {
  display: flex; align-items: center; gap: 10px;
  margin-top: 9px; padding-left: 45px;
}
.item-meta { font-size: 12px; color: var(--txt-3); display: flex; align-items: center; gap: 6px; }
.item-meta .sep { opacity: .5; }
.item-go { margin-left: auto; color: var(--txt-3); display: inline-flex; align-items: center; transition: transform .18s ease, color .18s ease; }
.item-go svg { width: 15px; height: 15px; }
.item:hover .item-go { color: #a5b4fc; transform: translateX(3px); }

/* 徽章 */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: 999px; flex: none;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.done { color: #6ee7b7; background: rgba(52, 211, 153, 0.11); border: 1px solid rgba(52, 211, 153, 0.24); }
.badge.pending { color: #fcd34d; background: rgba(251, 191, 36, 0.1); border: 1px solid rgba(251, 191, 36, 0.24); }
.badge.pending::before { animation: pulse 1.3s ease infinite; }
.tag-type {
  font-size: 11px; color: var(--txt-2);
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.16);
  padding: 2px 8px; border-radius: 6px;
}

.empty {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 46px 0; color: var(--txt-3); font-size: 13.5px;
}
.empty-ic { width: 52px; height: 52px; color: rgba(148, 163, 184, 0.4); }
.empty-ic svg { width: 52px; height: 52px; }

/* ---------- 详情弹窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; }
.modal.hidden { display: none; }
.backdrop {
  position: absolute; inset: 0;
  background: rgba(3, 6, 13, 0.66);
  backdrop-filter: blur(5px);
  animation: fade .2s ease both;
}
.dialog {
  position: relative;
  width: 100%; max-width: 640px;
  max-height: min(86vh, 820px); overflow: auto;
  background: linear-gradient(180deg, #101a30, #0c1324);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(2, 6, 16, 0.6);
  animation: pop .24s ease both;
}
.dialog-h {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px;
  background: linear-gradient(180deg, rgba(16,26,48,.96), rgba(16,26,48,.86));
  border-bottom: 1px solid var(--panel-line);
  backdrop-filter: blur(8px);
  border-radius: 18px 18px 0 0;
}
.dialog-title { display: flex; align-items: center; gap: 10px; }
.dialog-title h3 { margin: 0; font-size: 16px; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  border: 1px solid transparent; background: rgba(148, 163, 184, 0.1);
  color: var(--txt-2); font-size: 20px; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
  transition: all .18s ease;
}
.icon-btn:hover { color: #fff; background: rgba(148, 163, 184, 0.2); }
.dialog-body { padding: 18px 20px 6px; }

.meta {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin: 0 0 14px;
}
.meta-item {
  background: var(--field-bg); border: 1px solid var(--field-line);
  border-radius: 10px; padding: 8px 11px;
}
.meta-item dt { font-size: 11px; color: var(--txt-3); margin: 0 0 3px; }
.meta-item dd {
  margin: 0; font-size: 12.5px; color: var(--txt-2);
  word-break: break-all; font-variant-numeric: tabular-nums;
}
.content-block {
  background: rgba(8, 12, 22, 0.7);
  border: 1px solid var(--field-line);
  border-left: 3px solid #818cf8;
  border-radius: 10px; padding: 12px 14px; margin-bottom: 16px;
}
.content-label { font-size: 11px; color: var(--txt-3); letter-spacing: .4px; margin-bottom: 6px; }
.content-block p { margin: 0; font-size: 14px; line-height: 1.75; word-break: break-word; white-space: pre-wrap; }
.result-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.result-head h4 { margin: 0; font-size: 13px; color: var(--txt-2); font-weight: 600; }
.result-head .note { font-size: 11px; color: var(--txt-3); }

.media {
  background: radial-gradient(600px 200px at 50% 0%, rgba(99, 102, 241, 0.09), transparent 70%), rgba(5, 8, 15, 0.9);
  border: 1px solid var(--field-line);
  border-radius: 13px;
  padding: 12px;
  margin-bottom: 14px;
}
.media img, .media video { display: block; width: 100%; border-radius: 9px; }
.media-empty { text-align: center; color: var(--txt-3); font-size: 13px; padding: 26px 0; }
.dialog-f {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px 18px;
  position: sticky; bottom: 0;
  background: linear-gradient(0deg, rgba(12,19,36,.97), rgba(12,19,36,.85));
  border-radius: 0 0 18px 18px;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 30px; z-index: 80;
  transform: translate(-50%, 20px);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: #d1fae5;
  font-size: 13.5px;
  padding: 10px 18px; border-radius: 12px;
  box-shadow: 0 12px 30px rgba(2, 6, 16, 0.5);
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  max-width: min(90vw, 480px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: rgba(248, 113, 113, 0.4); color: #fee2e2; }

.foot {
  text-align: center; font-size: 12px; color: var(--txt-3);
  padding: 6px 0 30px;
}

/* ---------- 动画 & 响应式 ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat { padding: 11px 13px; }
  .query { align-items: stretch; flex-direction: column; }
  .q-sep { display: none; }
  .q-field input { width: 100%; }
  .meta { grid-template-columns: 1fr 1fr; }
  .dialog { max-height: 92vh; }
}
@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .item-foot { padding-left: 0; }
}
