:root {
  --color-bg: #f8fafc;
  --color-text: #1e293b;
  --color-text-secondary: #64748b;
  --color-border: #e2e8f0;
  --color-primary: #3b82f6;
  --color-primary-hover: #2563eb;
  --color-card: #ffffff;
  --color-success: #22c55e;
  --color-danger: #ef4444;
  --color-warning: #f59e0b;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 900px;
}

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

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px;
}

/* ===== Hero Section ===== */
.hero {
  text-align: center;
  padding: 60px 20px 50px;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.hero .tagline {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 8px;
}

.hero .hero-desc {
  color: var(--color-text-secondary);
  font-size: 1.1rem;
}

/* ===== Quick Selector ===== */
.selector {
  margin-bottom: 50px;
}

.selector h2 {
  text-align: center;
  margin-bottom: 24px;
  font-size: 1.3rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.choice-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.choice-card {
  background: var(--color-card);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  border: 2px solid var(--color-border);
  transition: all 0.2s ease;
}

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

.choice-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.choice-card h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
  color: var(--color-text);
}

.choice-card p {
  color: var(--color-text-secondary);
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.choice-link {
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.95rem;
}

/* ===== Licenses Section ===== */
.licenses-section {
  margin-bottom: 50px;
}

.licenses-section h2 {
  text-align: center;
  margin-bottom: 24px;
  font-size: 1.3rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.licenses {
  display: grid;
  gap: 24px;
}

.license-card {
  background: var(--color-card);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.license-badge {
  position: absolute;
  top: 20px;
  right: 20px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #dbeafe;
  color: #1e40af;
}

.license-badge.copyleft {
  background: #fce7f3;
  color: #9d174d;
}

.license-card h2 {
  font-size: 2rem;
  margin-bottom: 4px;
  color: var(--color-text);
}

.license-card .subtitle {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.license-desc {
  margin-bottom: 24px;
}

.license-desc p {
  margin-bottom: 16px;
  color: var(--color-text);
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  list-style: none;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.feature-list:last-child {
  margin-bottom: 0;
}

.feature-list.forbidden {
  color: var(--color-danger);
}

.feature-list.conditions {
  color: var(--color-warning);
}

.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  text-align: center;
}

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

.btn-primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
}

/* ===== Comparison Table ===== */
.comparison {
  margin-bottom: 50px;
}

.comparison h2 {
  text-align: center;
  margin-bottom: 24px;
  font-size: 1.3rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.table-wrapper {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.compare-table th,
.compare-table td {
  padding: 16px 20px;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}

.compare-table th {
  background: #f8fafc;
  font-weight: 600;
  color: var(--color-text);
}

.compare-table th a {
  color: var(--color-primary);
  text-decoration: none;
}

.compare-table th a:hover {
  text-decoration: underline;
}

.compare-table tbody tr:hover {
  background: #f8fafc;
}

.compare-table td:first-child {
  text-align: left;
  font-weight: 500;
}

.compare-table .yes {
  color: var(--color-success);
  font-weight: 600;
}

.compare-table .no {
  color: var(--color-danger);
  font-weight: 600;
}

/* ===== Usage Section ===== */
.usage {
  margin-bottom: 50px;
}

.usage h2 {
  text-align: center;
  margin-bottom: 24px;
  font-size: 1.3rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
}

.step {
  background: var(--color-card);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
}

.step-num {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--color-primary), #8b5cf6);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 auto 16px;
}

.step h4 {
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.step p {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

/* ===== FAQ Section ===== */
.faq {
  margin-bottom: 50px;
}

.faq h2 {
  text-align: center;
  margin-bottom: 24px;
  font-size: 1.3rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.faq-list {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.faq-list details {
  border-bottom: 1px solid var(--color-border);
}

.faq-list details:last-child {
  border-bottom: none;
}

.faq-list summary {
  padding: 20px 24px;
  cursor: pointer;
  font-weight: 500;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}

.faq-list summary:hover {
  background: #f8fafc;
}

.faq-list summary::after {
  content: "▼";
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  transition: transform 0.2s;
}

.faq-list details[open] summary::after {
  transform: rotate(180deg);
}

.faq-list details p {
  padding: 0 24px 20px;
  color: var(--color-text-secondary);
}

/* ===== Footer ===== */
footer {
  text-align: center;
  padding: 40px 20px;
  border-top: 1px solid var(--color-border);
}

.footer-links {
  margin-bottom: 16px;
}

.footer-links a {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--color-primary);
}

.footer-links .divider {
  margin: 0 12px;
  color: var(--color-border);
}

.copyright {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

/* ===== License Detail Page ===== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-text-secondary);
  text-decoration: none;
  margin-bottom: 24px;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--color-primary);
}

.license-header {
  background: var(--color-card);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
}

.license-header h1 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.license-header .version {
  color: var(--color-text-secondary);
  margin-bottom: 16px;
}

.license-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.license-actions button {
  padding: 10px 20px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
  font-family: inherit;
}

.license-actions button:hover,
.license-actions .btn-download:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.license-actions button.copied {
  background: var(--color-success);
  color: white;
  border-color: var(--color-success);
}

.license-actions .btn-download {
  display: inline-block;
  padding: 10px 20px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
  font-family: inherit;
  color: var(--color-text);
  text-decoration: none;
  text-align: center;
}

.license-content {
  background: var(--color-card);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
}

.license-text {
  font-family: "SF Mono", Monaco, Inconsolata, "Fira Code", "Noto Sans Mono", monospace;
  font-size: 0.9rem;
  line-height: 1.8;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: var(--color-text);
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .hero {
    padding: 40px 16px;
  }
  
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .hero .tagline {
    font-size: 1.2rem;
  }
  
  .feature-list {
    grid-template-columns: 1fr;
  }
  
  .compare-table th,
  .compare-table td {
    padding: 12px 8px;
    font-size: 0.85rem;
  }
  
  .license-actions button {
    flex: 1;
    min-width: 140px;
  }
  
  .license-content {
    padding: 20px;
  }
  
  .license-text {
    font-size: 0.8rem;
  }
  
  .footer-links .divider {
    display: block;
    margin: 8px 0;
  }
}

/* ===== Print ===== */
@media print {
  .selector,
  .comparison,
  .usage,
  .faq,
  .back-link,
  .license-actions,
  footer {
    display: none;
  }
  
  .license-content {
    box-shadow: none;
    border: none;
  }
  
  .hero h1 {
    background: none;
    -webkit-text-fill-color: #000;
  }
}
