:root {
  --bg: #0f1419;
  --surface: #1a222c;
  --surface2: #232d3a;
  --text: #e8edf4;
  --muted: #8b98a8;
  --line: #2d3a4a;
  --accent: #3d9cf5;
  --accent-dim: #2563ab;
  --ok: #34c759;
  --warn: #ff9f0a;
  --danger: #ff453a;
  --radius: 12px;
  --font: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: radial-gradient(1200px 600px at 10% -10%, #1e3a5f 0%, transparent 55%), var(--bg);
  color: var(--text);
}

a {
  color: var(--accent);
}

.brand h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  max-width: 36rem;
  line-height: 1.5;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}

.panel h2 {
  margin: 0 0 14px;
  font-size: 1.05rem;
  font-weight: 600;
}

.grid-2 {
  display: grid;
  gap: 12px;
}

@media (min-width: 720px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field span {
  font-size: 0.78rem;
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  background: var(--surface2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.92rem;
  font-family: inherit;
}

.field textarea {
  min-height: 72px;
  resize: vertical;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dim) 100%);
  color: #fff;
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-ghost {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--line);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
}

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

.template-chips label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
}

.template-chips input {
  accent-color: var(--accent);
}

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

.project-card {
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.project-card:hover {
  border-color: var(--accent-dim);
}

.project-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.project-card h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.project-card .meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-template {
  background: rgba(61, 156, 245, 0.2);
  color: var(--accent);
}

.badge-risk {
  background: rgba(255, 69, 58, 0.2);
  color: var(--danger);
}

.badge-ok {
  background: rgba(52, 199, 89, 0.18);
  color: var(--ok);
}

.alert-banner {
  background: rgba(255, 159, 10, 0.12);
  border: 1px solid rgba(255, 159, 10, 0.35);
  color: #ffd60a;
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 14px;
  font-size: 0.88rem;
}

.alert-banner strong {
  color: #fff;
}

.alert-banner ul {
  margin: 8px 0 0;
  padding-left: 1.2rem;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 28px 16px;
  font-size: 0.9rem;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
  font-size: 0.85rem;
}
