/* Rainbow 软件推荐助手 - 样式 */

:root {
  --bg: #0f1117;
  --bg-card: #1a1d27;
  --bg-card-hover: #22263a;
  --bg-selected: #1e2a4a;
  --border: #2a2f42;
  --border-selected: #3b82f6;
  --text: #e8eaed;
  --text-muted: #8b92a8;
  --accent: #3b82f6;
  --accent-light: #60a5fa;
  --success: #22c55e;
  --warning: #f59e0b;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

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

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

/* Header */
.header {
  background: linear-gradient(135deg, #1a1d27 0%, #0f1117 100%);
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.btn-customer-service {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-customer-service:hover {
  background: var(--accent-light);
  border-color: var(--accent-light);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  font-size: 2rem;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo h1 {
  font-size: 1.25rem;
  font-weight: 600;
}

.logo p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.btn-reset {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.btn-reset:hover {
  border-color: var(--accent);
  color: var(--accent-light);
}

/* Main */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Steps */
.steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 2rem;
}

.step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.step.active {
  color: var(--accent-light);
}

.step.done {
  color: var(--success);
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8rem;
}

.step.active .step-num {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.step.done .step-num {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.step-line {
  width: 60px;
  height: 2px;
  background: var(--border);
  margin: 0 0.5rem;
}

/* Panels */
.panel {
  display: none;
}

.panel.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel-header {
  margin-bottom: 1.25rem;
}

.panel-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.selected-info {
  color: var(--accent-light);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.search-box input {
  width: 100%;
  max-width: 360px;
  padding: 0.6rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: var(--accent);
}

.search-box input::placeholder {
  color: var(--text-muted);
}

/* Category tabs */
.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.category-tab {
  padding: 0.4rem 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.category-tab:hover {
  border-color: var(--accent);
  color: var(--text);
}

.category-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Card grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 0.5rem;
}

.card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.4rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  position: relative;
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: #3a4060;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.card.selected {
  border-color: var(--border-selected);
  background: var(--bg-selected);
  box-shadow: 0 0 0 1px var(--border-selected);
}

.card.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.card-img {
  width: 80px;
  height: 80px;
  margin: 0 auto 0.35rem;
  border-radius: 8px;
  object-fit: contain;
  background: #12151f;
}

.card-fallback {
  width: 80px;
  height: 80px;
  margin: 0 auto 0.35rem;
  border-radius: 8px;
  background: linear-gradient(135deg, #1e293b, #334155);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.card-name {
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.3;
}

.card-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.card-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
}

.card-badge-warn {
  background: var(--warning);
  color: #1a1d27;
}

/* Compat hint */
.compat-hint {
  background: #1e2a1e;
  border: 1px solid #2d4a2d;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: #86efac;
  margin-bottom: 1rem;
}

.compat-hint.warn {
  background: #2a2210;
  border-color: #4a3d10;
  color: #fcd34d;
}

/* Buttons */
.btn-back {
  margin-top: 1.5rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.5rem 0;
  transition: color 0.2s;
}

.btn-back:hover {
  color: var(--accent-light);
}

/* Result & selection preview */
.selection-summary {
  margin-top: 0.5rem;
}

.selection-preview {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1.25rem;
  align-items: stretch;
  margin-bottom: 1.5rem;
}

.selection-preview-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 0.875rem 0.875rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.selection-preview-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 0.5rem;
}

.selection-preview-img-wrap {
  position: relative;
  width: 100%;
  max-width: 300px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #12151f;
  border-radius: 10px;
  margin-bottom: 0.625rem;
  padding: 0.4rem;
}

.selection-clear-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(15, 17, 26, 0.78);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.15s;
}

.selection-preview-img-wrap .selection-clear-btn {
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  font-size: 1.4rem;
}

.selection-clear-btn:hover {
  background: rgba(239, 68, 68, 0.92);
  transform: scale(1.06);
}

.card-img-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 0.35rem;
}

.card-img-wrap .card-img,
.card-img-wrap .card-fallback {
  width: 100%;
  height: 100%;
  margin: 0;
}

.selection-preview-img,
.selection-preview-fallback {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.selection-preview-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  background: linear-gradient(135deg, #1e293b, #334155);
  border-radius: 8px;
}

.selection-preview-name {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
}

.selection-preview-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.selection-preview-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.75rem;
  padding: 0 0.25rem;
  user-select: none;
}

.selection-preview--single {
  grid-template-columns: minmax(0, 400px);
  justify-content: start;
  margin-bottom: 1.25rem;
}

.result-note {
  background: var(--bg-card);
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1rem;
  border-radius: 0 8px 8px 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  scroll-margin-top: 5.5rem;
}

.rainbow-notice {
  border-radius: var(--radius);
  padding: 0.875rem 1rem 0.875rem 1.125rem;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.5;
  margin: -0.5rem 0 1.5rem;
  border-left-width: 4px;
  border-left-style: solid;
}

.rainbow-notice--none {
  background: linear-gradient(90deg, rgba(251, 146, 60, 0.18) 0%, rgba(251, 146, 60, 0.06) 100%);
  border: 1px solid rgba(251, 146, 60, 0.55);
  border-left-color: #fb923c;
  color: #fdba74;
  box-shadow: 0 0 0 1px rgba(251, 146, 60, 0.12), 0 4px 16px rgba(251, 146, 60, 0.08);
}

.rainbow-notice--excluded {
  background: linear-gradient(90deg, rgba(248, 113, 113, 0.16) 0%, rgba(248, 113, 113, 0.05) 100%);
  border: 1px solid rgba(248, 113, 113, 0.5);
  border-left-color: #f87171;
  color: #fca5a5;
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.1), 0 4px 16px rgba(248, 113, 113, 0.06);
}

.rainbow-notice--warn {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.16) 0%, rgba(245, 158, 11, 0.05) 100%);
  border: 1px solid rgba(245, 158, 11, 0.5);
  border-left-color: #f59e0b;
  color: #fcd34d;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.1), 0 4px 16px rgba(245, 158, 11, 0.06);
}

/* Software list */
.software-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scroll-margin-top: 5.5rem;
}

.software-card {
  display: flex;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color 0.2s;
}

.software-card:hover {
  border-color: #3a4060;
}

.software-icon {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: contain;
  background: #12151f;
  flex-shrink: 0;
}

.software-icon-fallback {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.software-body {
  flex: 1;
  min-width: 0;
}

.software-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.software-name {
  font-size: 1.1rem;
  font-weight: 600;
}

.software-category {
  font-size: 0.7rem;
  background: #2a2f42;
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 4px;
}

.software-platform {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.software-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.software-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.2s;
}

.btn-download:hover {
  background: var(--accent-light);
}

.btn-download-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.btn-download-outline:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  color: var(--accent-light);
}

.software-empty {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

/* Footer */
.footer {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

.footer code {
  background: var(--bg-card);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
}

/* Responsive */
@media (max-width: 600px) {
  .header-inner {
    flex-wrap: wrap;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .steps .step-label {
    display: none;
  }

  .step-line {
    width: 30px;
  }

  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    gap: 0.4rem;
  }

  .software-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .selection-preview {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .selection-preview--single {
    grid-template-columns: 1fr;
  }

  .selection-preview-divider {
    transform: rotate(90deg);
    padding: 0.25rem 0;
  }

  .selection-preview-img-wrap {
    max-width: none;
    height: 200px;
  }
}
