/* ========================================
   医学生电脑硬件配置推荐网站 - 样式表
   Vanilla CSS - 现代简洁风格
   ======================================== */

/* CSS Variables */
:root {
  --primary-color: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --secondary-color: #10b981;
  --accent-color: #f59e0b;
  --danger-color: #ef4444;
  
  --bg-color: #f8fafc;
  --bg-card: #ffffff;
  --bg-dark: #1e293b;
  
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-light: #94a3b8;
  --text-white: #ffffff;
  
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  
  --transition: all 0.2s ease-in-out;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans SC', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-color);
  min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.5em;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p { margin-bottom: 1rem; }

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-dark);
}

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

.section {
  padding: 4rem 0;
}

/* Header & Navigation */
.header {
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.nav-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-brand svg {
  width: 32px;
  height: 32px;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary-color);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* Mobile Menu */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: var(--transition);
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }
  
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    flex-direction: column;
    padding: 1rem;
    gap: 0;
    box-shadow: var(--shadow-md);
    display: none;
  }
  
  .nav-links.active {
    display: flex;
  }
  
  .nav-links a {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
  }
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 45%, #10b981 100%);
  color: var(--text-white);
  padding: 7rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0) 40%),
    radial-gradient(circle at 80% 20%, rgba(245, 158, 11, 0.22) 0%, rgba(245, 158, 11, 0) 45%),
    radial-gradient(circle at 70% 85%, rgba(16, 185, 129, 0.18) 0%, rgba(16, 185, 129, 0) 45%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.55) 0%, rgba(15, 23, 42, 0.25) 60%, rgba(15, 23, 42, 0.45) 100%);
  pointer-events: none;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 2;
}

/* Hero carousel (auto sliding) */
.hero-carousel {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1.5rem;
  pointer-events: none;
  z-index: 1;
  opacity: 0.42; /* make it a colorful background element */
}

.hero-carousel-viewport {
  width: min(1200px, 100%);
  height: 440px;
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.55);
  transform: translateZ(0);
  background: rgba(15, 23, 42, 0.55);
}

.hero-carousel-track {
  display: flex;
  height: 100%;
  will-change: transform;
  animation: heroCarouselSlide 10s ease-in-out infinite;
}

.hero-slide {
  flex: 0 0 100%;
  height: 100%;
}

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* show full image without cropping */
  filter: saturate(1.1) contrast(1.1) brightness(0.88);
}

@keyframes heroCarouselSlide {
  0%,
  20% {
    transform: translateX(0);
  }
  50%,
  70% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(0);
  }
}

@media (max-width: 768px) {
  .hero {
    padding: 5.25rem 0;
  }

  .hero-carousel {
    opacity: 0.28;
  }

  .hero-carousel-viewport {
    height: 280px;
  }
}

/* 强制所有用户启用轮播动画：不再在 prefers-reduced-motion 下禁用 */

/* (legacy) hero images: keep for compatibility if any page still uses them */
.hero-img {
  position: absolute;
  top: 50%;
  height: 280px;
  width: auto;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  opacity: 0.6;
  transition: all 0.4s ease;
  object-fit: cover;
  filter: brightness(0.8) contrast(1.1);
}

.hero-img:hover {
  transform: translateY(-50%) scale(1.1);
  opacity: 1;
  filter: brightness(1);
  z-index: 3;
}

.hero-img-left {
  left: 2%; /* Closer to edge */
  transform: translateY(-50%) rotate(-8deg);
}

.hero-img-right {
  right: 2%; /* Closer to edge */
  transform: translateY(-50%) rotate(8deg);
}

@media (max-width: 1200px) {
  .hero-img {
    height: 200px;
    opacity: 0.4;
  }
}

@media (max-width: 768px) {
  .hero-img {
    display: none; /* Hide on mobile */
  }
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.25rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 2rem;
}

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* Requirement Cards */
.requirement-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
}

.requirement-card:hover {
  border-color: var(--primary-light);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.requirement-card.selected {
  border-color: var(--primary-color);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(37, 99, 235, 0.1) 100%);
}

.requirement-card .icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
}

.requirement-card h3 {
  margin-bottom: 0.5rem;
}

.requirement-card p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.requirement-card .specs {
  background: var(--bg-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-size: 0.8rem;
  text-align: left;
}

.requirement-card .specs span {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--text-secondary);
}

.requirement-card .budget {
  margin-top: 1rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

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

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

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

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

.btn-success {
  background: var(--secondary-color);
  color: var(--text-white);
}

.btn-success:hover {
  background: #059669;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

/* Tables */
.table-container {
  overflow-x: auto;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead {
  background: var(--bg-color);
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

tbody tr:hover {
  background: var(--bg-color);
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
}

.badge-primary {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary-color);
}

.badge-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--secondary-color);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--accent-color);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger-color);
}

/* Builder Form */
.builder-form {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-color);
  transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.range-value {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  background: var(--border-color);
  border-radius: 4px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: var(--primary-color);
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

/* Config Result */
.config-result {
  background: linear-gradient(135deg, var(--bg-dark) 0%, #0f172a 100%);
  border-radius: var(--radius-xl);
  padding: 2rem;
  color: var(--text-white);
}

.config-result h3 {
  color: var(--text-white);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.config-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
}

.config-item:last-child {
  margin-bottom: 0;
}

.config-item .label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.config-item .label .icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.config-item .model {
  font-weight: 500;
}

.config-item .spec {
  font-size: 0.875rem;
  color: var(--text-light);
}

.config-item .price {
  font-weight: 600;
  color: var(--secondary-color);
}

.config-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  margin-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.config-total .label {
  font-size: 1.125rem;
}

.config-total .price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-color);
}

/* Tier Chart */
.tier-chart {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tier-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--primary-color);
}

.tier-item.tier-1 { border-left-color: #f59e0b; }
.tier-item.tier-2 { border-left-color: #10b981; }
.tier-item.tier-3 { border-left-color: #3b82f6; }
.tier-item.tier-4 { border-left-color: #8b5cf6; }
.tier-item.tier-5 { border-left-color: #64748b; }

.tier-item .rank {
  font-weight: 700;
  color: var(--text-secondary);
  min-width: 30px;
}

.tier-item .name {
  flex: 1;
  font-weight: 500;
}

.tier-item .score {
  font-weight: 600;
  color: var(--primary-color);
}

.tier-item .price {
  color: var(--secondary-color);
  font-weight: 500;
}

/* Tips Section */
.tips-card {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.tips-card h4 {
  color: var(--accent-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tips-card ul {
  list-style: none;
}

.tips-card li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
}

.tips-card li::before {
  content: '💡';
  position: absolute;
  left: 0;
}

/* Image Gallery */
.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.gallery-item {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
}

.gallery-item .caption {
  padding: 1rem;
  font-weight: 500;
  text-align: center;
}

/* Footer */
.footer {
  background: var(--bg-dark);
  color: var(--text-light);
  padding: 3rem 0;
  text-align: center;
}

.footer a {
  color: var(--text-light);
}

.footer a:hover {
  color: var(--text-white);
}

/* Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.hidden { display: none; }

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

/* Loading Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 1.75rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  .section {
    padding: 2rem 0;
  }
  
  .card-grid {
    grid-template-columns: 1fr;
  }
  
  table {
    font-size: 0.75rem;
  }
  
  th, td {
    padding: 0.5rem;
  }
}

