:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-soft: #dbeafe;
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #dc2626;
  --border: #e5e7eb;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Microsoft YaHei", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

button, input, select, textarea {
  font: inherit;
}

.app-shell {
  max-width: 1500px;
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: linear-gradient(135deg, #0f172a, #1d4ed8);
  color: white;
  border-radius: 20px;
  box-shadow: var(--shadow);
  gap: 16px;
}

.topbar h1 { margin: 0 0 6px; font-size: 26px; }
.topbar p { margin: 0; color: rgba(255,255,255,0.85); }
.topbar-actions { display: flex; gap: 14px; align-items: center; }
.user-select { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.16); padding: 10px 12px; border-radius: 999px; }
.user-select select { border: 0; border-radius: 999px; padding: 4px 8px; }
.badge { background: rgba(255,255,255,0.2); padding: 8px 12px; border-radius: 999px; font-size: 13px; }

.workspace {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.sidebar {
  display: grid;
  gap: 10px;
  align-content: start;
}

.nav-btn {
  width: 100%;
  text-align: left;
  background: #e2e8f0;
  color: #0f172a;
  border-radius: 12px;
  padding: 12px 14px;
}

.nav-btn.active {
  background: var(--primary);
  color: white;
}

.content-area {
  display: grid;
  min-width: 0;
}

.view-panel {
  display: none;
  gap: 18px;
  grid-template-columns: 1fr 1.2fr;
}

.view-panel.active {
  display: grid;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.create-panel { min-height: 100%; }
.list-panel { min-height: 100%; }
.detail-panel { min-height: 100%; }
.dashboard-panel { grid-column: 1 / 2; }
.notify-panel { grid-column: 2 / 3; }

.section-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.section-heading h2 { margin: 0; font-size: 18px; }
.section-heading span { color: var(--muted); font-size: 13px; }

.stack-form { display: grid; gap: 12px; }
.stack-form label { display: grid; gap: 6px; font-weight: 600; color: var(--muted); }
.stack-form input, .stack-form textarea, .stack-form select {
  width: 100%; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: #f9fafb;
}
.checkbox-grid {
  display: grid;
  gap: 8px;
  padding: 8px 2px;
}
.checkbox-option {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
button {
  border: 0; border-radius: 12px; padding: 10px 14px; cursor: pointer; font-weight: 700; color: white; background: var(--primary);
}
button.secondary { background: #64748b; }
button.success { background: var(--success); }
button.warning { background: var(--warning); }
button.danger { background: var(--danger); }

.task-list, .notification-list { display: grid; gap: 10px; }
.task-card {
  border: 1px solid var(--border); border-radius: 14px; padding: 12px; background: #fcfdff; cursor: pointer; transition: transform 0.2s ease, border-color 0.2s ease;
}
.task-card:hover { transform: translateY(-1px); border-color: var(--primary); }
.task-card.active { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary-soft); }
.task-card h3 { margin: 0 0 8px; font-size: 16px; }
.task-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.progress-row { margin-top: 8px; }
.progress-track { width: 100%; height: 8px; background: #e5e7eb; border-radius: 999px; overflow: hidden; }
.progress-track span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #38bdf8); border-radius: inherit; }
.status-pill { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.status-进行中 { background: #dbeafe; color: #1d4ed8; }
.status-待确认 { background: #fef3c7; color: #92400e; }
.status-已完成 { background: #dcfce7; color: #166534; }
.status-已驳回 { background: #fee2e2; color: #991b1b; }

.detail-card { display: grid; gap: 12px; }
.detail-title { font-size: 20px; margin: 0; }
.info-grid { display: grid; gap: 8px; color: var(--muted); }
.record-form, .action-row { display: flex; flex-wrap: wrap; gap: 8px; }
.record-form input, .record-form textarea { flex: 1; min-width: 220px; }
.record-item { border-top: 1px solid var(--border); padding-top: 10px; }
.record-item p { margin: 4px 0; }
.small { color: var(--muted); font-size: 12px; }

.kanban-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kanban-column { background: #f8fafc; border-radius: 14px; padding: 10px; min-height: 220px; }
.kanban-column h3 { margin: 0 0 10px; font-size: 15px; color: var(--muted); }
.kanban-card { background: white; border-radius: 12px; padding: 10px; margin-bottom: 8px; border: 1px solid var(--border); }
.kanban-card h4 { margin: 0 0 6px; font-size: 14px; }

.notification-item { border: 1px solid var(--border); border-radius: 12px; padding: 10px; background: #fcfdff; }
.notification-item h4 { margin: 0 0 4px; font-size: 14px; }
.notification-item p { margin: 0; color: var(--muted); font-size: 13px; }

.empty-state { color: var(--muted); padding: 20px 0; }

@media (max-width: 1100px) {
  .workspace { grid-template-columns: 1fr; }
  .sidebar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .view-panel { grid-template-columns: 1fr; }
  .dashboard-panel, .notify-panel { grid-column: auto; }
  .kanban-board { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .app-shell { padding: 12px; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; }
  .topbar-actions { width: 100%; flex-direction: column; align-items: stretch; }
  .user-select { justify-content: space-between; }
  .sidebar { grid-template-columns: 1fr; }
  .kanban-board { grid-template-columns: 1fr; }
  .stack-form input, .stack-form textarea, .stack-form select, .record-form input, .record-form textarea {
    min-width: 0;
  }
  .record-form { flex-direction: column; }
}
