* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0f1117;
  --panel: #171a23;
  --panel-2: #1d212d;
  --border: #2a2f3d;
  --text: #e8eaf0;
  --text-dim: #8b91a3;
  --accent: #4f8cff;
  --accent-2: #7c5cff;
  --green: #34c77b;
  --yellow: #f0b429;
  --red: #ef5555;
  --gray: #5a6072;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.hidden { display: none !important; }

/* ===== 登录页 ===== */
#login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(1200px 600px at 20% 10%, #1a2040 0%, var(--bg) 55%);
}

.login-box {
  width: 360px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 36px;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
}

.login-logo {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: 2px;
  text-align: center;
  color: var(--text);
}
.login-logo span { color: var(--accent); }

.login-title {
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
  margin: 8px 0 28px;
  letter-spacing: 4px;
}

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  padding: 11px 14px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
}
.field input:focus { border-color: var(--accent); }

.login-error {
  color: var(--red);
  font-size: 13px;
  min-height: 20px;
  margin-bottom: 8px;
}

.btn-primary {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s;
}
.btn-primary:hover { opacity: .9; }

/* ===== 顶栏 ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.logo-mini { font-size: 20px; font-weight: 800; letter-spacing: 1px; }
.logo-mini span { color: var(--accent); }
.topbar-title { font-size: 16px; font-weight: 600; color: var(--text-dim); }

.user-badge {
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  color: var(--text);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all .2s;
}
.btn-ghost:hover { color: var(--text); border-color: var(--gray); }

/* ===== 统计栏 ===== */
.stats-bar {
  display: flex;
  gap: 16px;
  padding: 20px 28px 4px;
  max-width: 1440px;
  margin: 0 auto;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 24px;
  display: flex;
  flex-direction: column;
  min-width: 110px;
}
.stat-num { font-size: 28px; font-weight: 700; }
.stat-label { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

/* ===== 卡片网格 ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  padding: 24px 28px 48px;
  max-width: 1440px;
  margin: 0 auto;
}

.project-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  cursor: pointer;
  transition: transform .15s, border-color .15s, box-shadow .15s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.project-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 12px 32px rgba(79,140,255,.12);
}

.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.card-name { font-size: 17px; font-weight: 700; }
.card-series {
  font-size: 11px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 3px 10px;
  border-radius: 12px;
  white-space: nowrap;
}

.status-pill {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.st-active { background: rgba(79,140,255,.15); color: var(--accent); }
.st-design { background: rgba(124,92,255,.15); color: var(--accent-2); }
.st-sold { background: rgba(52,199,123,.15); color: var(--green); }
.st-paused { background: rgba(90,96,114,.2); color: var(--gray); }

.card-stage { font-size: 13px; color: var(--text-dim); }
.card-stage b { color: var(--text); font-weight: 600; }

.progress-wrap { margin-top: 2px; }
.progress-bar {
  height: 8px;
  background: var(--panel-2);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .5s ease;
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 6px;
}
.progress-meta .pct { font-weight: 700; color: var(--accent); }

.card-todo {
  background: var(--panel-2);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
}
.card-todo .todo-label { color: var(--text-dim); font-size: 12px; margin-bottom: 4px; display: block; }
.card-todo ul { list-style: none; }
.card-todo li { color: var(--text); padding: 2px 0; position: relative; padding-left: 14px; }
.card-todo li::before { content: "•"; color: var(--yellow); position: absolute; left: 0; }
.card-todo .none { color: var(--green); }

/* ===== 详情页 ===== */
.detail-body {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 28px 60px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.detail-hero {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
}
.detail-hero h2 { font-size: 24px; margin-bottom: 6px; }
.detail-hero .desc { color: var(--text-dim); font-size: 14px; margin-bottom: 16px; }
.detail-progress-label { font-size: 13px; color: var(--text-dim); margin-bottom: 8px; }
.detail-progress-label b { color: var(--text); }

.stages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}
.stage-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.stage-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--panel-2);
  border: 2px solid var(--border);
  flex-shrink: 0;
}
.stage-dot.done { background: var(--green); border-color: var(--green); }
.stage-dot.current { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px rgba(79,140,255,.2); }
.stage-name { font-size: 14px; color: var(--text-dim); }
.stage-name.done { color: var(--green); }
.stage-name.current { color: var(--accent); font-weight: 600; }
.stage-line { flex: 1; height: 2px; background: var(--border); }
.stage-line.done { background: var(--green); }

.section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 24px;
}
.section h3 { font-size: 15px; margin-bottom: 12px; color: var(--text); }
.section h3::before { content: ""; display: inline-block; width: 4px; height: 14px; background: var(--accent); border-radius: 2px; margin-right: 8px; vertical-align: -2px; }

.timeline { list-style: none; }
.timeline li {
  position: relative;
  padding: 0 0 18px 22px;
  border-left: 2px solid var(--border);
  margin-left: 6px;
}
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -6px; top: 2px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--panel-2);
  border: 2px solid var(--accent);
}
.timeline .tl-date { font-size: 12px; color: var(--text-dim); }
.timeline .tl-text { font-size: 14px; margin-top: 2px; }

.todo-list { list-style: none; }
.todo-list li {
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 14px;
  color: var(--text);
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.todo-list li:last-child { border-bottom: none; }
.todo-list li::before { content: "▢"; color: var(--yellow); flex-shrink: 0; }

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.info-item { background: var(--panel-2); border-radius: 8px; padding: 10px 14px; }
.info-item .k { font-size: 12px; color: var(--text-dim); }
.info-item .v { font-size: 14px; margin-top: 2px; }

@media (max-width: 640px) {
  .topbar { padding: 12px 16px; }
  .card-grid { padding: 16px; grid-template-columns: 1fr; }
  .detail-body { padding: 16px; }
}
