/* POD Niche Research Dashboard - 样式 */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
               "PingFang SC", "Hiragino Sans GB", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 24px 16px;
}

.header {
  text-align: center;
  margin-bottom: 32px;
}

.header h1 {
  font-size: 2.25rem;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tagline {
  color: var(--text-muted);
  font-size: 1rem;
  margin: 0;
}

/* Card */
.card {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 32px;
  margin-bottom: 24px;
}

.card h2 {
  margin-top: 0;
  color: var(--primary);
}

/* Form */
.form-group {
  margin-bottom: 20px;
  flex: 1;
}

.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 8px;
}

.form-row .form-group {
  flex: 1;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.95rem;
}

input[type="text"],
input[type="number"],
select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  transition: all 0.15s ease;
  background: white;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.hint {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
  padding: 12px;
  background: #f1f5f9;
  border-radius: 8px;
}

/* Rating Buttons */
.rating-fieldset {
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin: 24px 0;
}

.rating-fieldset legend {
  font-weight: 700;
  padding: 0 12px;
  color: var(--primary);
}

.rating-group {
  margin-bottom: 20px;
}

.rating-group label {
  font-weight: 700;
  margin-bottom: 4px;
}

.rating-help {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0 0 10px;
}

.rating-buttons {
  display: flex;
  gap: 8px;
}

.rating-buttons button {
  flex: 1;
  padding: 12px 0;
  font-size: 1rem;
  font-weight: 600;
  border: 2px solid var(--border);
  background: white;
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.rating-buttons button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.rating-buttons button.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: scale(1.05);
}

.rating-buttons button.active.low {
  background: var(--danger);
  border-color: var(--danger);
}

.rating-buttons button.active.high {
  background: var(--success);
  border-color: var(--success);
}

/* Buttons */
.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.btn-primary,
.btn-secondary {
  flex: 1;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
}

.btn-secondary {
  background: white;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg);
}

/* Footer */
.footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 24px 0;
}

.footer code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
}

/* Result/Dashboard 页面适配 */
.result-card {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 32px;
  margin-bottom: 24px;
}

.score-display {
  text-align: center;
  padding: 32px;
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  color: white;
  border-radius: 12px;
  margin-bottom: 24px;
}

.score-display.run { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.score-display.skip { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); }
.score-display.backup { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }

.score-display h2 {
  font-size: 3.5rem;
  margin: 12px 0 8px;
}

.score-display .label {
  font-size: 1.2rem;
  opacity: 0.9;
}

.dimension-row {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  gap: 16px;
}

.dimension-row .name {
  flex: 0 0 180px;
  font-weight: 600;
}

.dimension-row .bar {
  flex: 1;
  height: 24px;
  background: #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.dimension-row .bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.6s ease;
}

.dimension-row.low .bar-fill { background: var(--danger); }
.dimension-row.medium .bar-fill { background: var(--warning); }
.dimension-row.high .bar-fill { background: var(--success); }

.dimension-row .value {
  flex: 0 0 60px;
  text-align: right;
  font-weight: 700;
  font-size: 1.1rem;
}

.warning {
  background: #fef3c7;
  border-left: 4px solid var(--warning);
  padding: 12px 16px;
  margin: 16px 0;
  border-radius: 6px;
}

.warning.danger {
  background: #fee2e2;
  border-color: var(--danger);
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin: 16px 0;
}

.meta-grid .meta {
  background: #f8fafc;
  padding: 12px 16px;
  border-radius: 8px;
}

.meta .key {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.meta .val {
  font-weight: 700;
  font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 640px) {
  .form-row {
    flex-direction: column;
    gap: 0;
  }
  .card { padding: 20px; }
  .header h1 { font-size: 1.75rem; }
  .dimension-row .name { flex: 0 0 110px; font-size: 0.9rem; }
}
