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

:root {
  --gold: #B8860B;
  --gold-light: #D4A843;
  --gold-bg: #FAF6EE;
  --dark: #2C2C2C;
  --text: #444;
  --text-light: #888;
  --white: #fff;
  --border: #E8E0D0;
  --bg: #FDFBF7;
  --card-shadow: 0 2px 16px rgba(0,0,0,0.06);
  --radius: 12px;
}

body {
  font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 24px 20px;
}

/* ===== Pages ===== */
.page {
  display: none;
  min-height: 100vh;
}

.page.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== Welcome Page ===== */
.welcome-container {
  text-align: center;
  padding: 60px 20px;
}

.brand-badge {
  display: inline-block;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 3px;
  color: var(--gold);
  border: 1.5px solid var(--gold);
  padding: 6px 20px;
  border-radius: 20px;
  margin-bottom: 28px;
}

h1 {
  font-size: 32px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 12px;
}

.subtitle {
  font-size: 16px;
  color: var(--text-light);
  margin-bottom: 40px;
}

.welcome-features {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  margin-bottom: 48px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  color: var(--text);
}

.feature-icon {
  font-size: 20px;
}

.note {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 12px;
}

/* ===== Buttons ===== */
.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--white);
  border: none;
  padding: 14px 48px;
  font-size: 16px;
  font-weight: 500;
  border-radius: 28px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(184, 134, 11, 0.3);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: transparent;
  color: var(--text-light);
  border: 1.5px solid var(--border);
  padding: 12px 32px;
  font-size: 15px;
  border-radius: 28px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

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

/* ===== Quiz Page ===== */
.quiz-container {
  padding-top: 40px;
  padding-bottom: 40px;
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: 2px;
  transition: width 0.4s ease;
}

.progress-text {
  font-size: 13px;
  color: var(--text-light);
  text-align: right;
  margin-bottom: 32px;
}

/* Question */
.question-block {
  animation: fadeIn 0.4s ease;
}

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

.question-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 8px;
}

.question-desc {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 24px;
}

/* Options */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
}

.option-item:hover {
  border-color: var(--gold-light);
  background: var(--gold-bg);
}

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

.option-radio {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  transition: border-color 0.2s ease;
}

.option-item.selected .option-radio {
  border-color: var(--gold);
}

.option-item.selected .option-radio::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 10px;
  height: 10px;
  background: var(--gold);
  border-radius: 50%;
}

.option-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0;
  position: relative;
  transition: all 0.2s ease;
}

.option-item.selected .option-checkbox {
  border-color: var(--gold);
  background: var(--gold);
}

.option-item.selected .option-checkbox::after {
  content: '✓';
  position: absolute;
  top: -1px;
  left: 2px;
  color: var(--white);
  font-size: 14px;
  font-weight: 700;
}

.option-text {
  flex: 1;
}

.option-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--dark);
}

.option-hint {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 2px;
}

/* Quiz Nav */
.quiz-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 36px;
}

.quiz-nav .btn-primary {
  margin-left: auto;
}

/* ===== Analyzing Page ===== */
.analyzing-container {
  text-align: center;
}

.analyzing-container h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 8px;
}

.analyzing-container p {
  font-size: 14px;
  color: var(--text-light);
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 24px;
}

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

/* ===== Result Page ===== */
.result-container {
  padding-top: 48px;
  padding-bottom: 60px;
  max-width: 720px;
}

.result-section {
  margin-bottom: 40px;
}

.result-section h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--gold);
  display: inline-block;
}

/* Skin Card */
.skin-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--card-shadow);
  border-left: 4px solid var(--gold);
}

.skin-card .skin-type-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 8px;
}

.skin-card .skin-type-desc {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 12px;
}

.skin-card .skin-chars {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skin-card .char-tag {
  font-size: 13px;
  background: var(--gold-bg);
  color: var(--gold);
  padding: 4px 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
}

/* Concern Tags */
.concern-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.concern-tag {
  background: var(--white);
  border: 1.5px solid var(--gold-light);
  color: var(--dark);
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
}

.concern-tag .concern-advice {
  display: block;
  font-size: 12px;
  color: var(--text-light);
  font-weight: 400;
  margin-top: 4px;
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.product-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--card-shadow);
  transition: transform 0.2s ease;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-2px);
}

.product-brand {
  font-size: 11px;
  color: var(--gold);
  font-weight: 500;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.product-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 8px;
  line-height: 1.4;
}

.product-desc {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 12px;
  flex: 1;
  line-height: 1.5;
}

.product-features {
  margin-bottom: 12px;
}

.product-features li {
  font-size: 12px;
  color: var(--text);
  margin-bottom: 3px;
  list-style: none;
  padding-left: 14px;
  position: relative;
}

.product-features li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--gold);
  font-weight: 700;
}

.product-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
}

.product-price-note {
  font-size: 12px;
  color: var(--text-light);
  font-weight: 400;
}

.product-tag {
  display: inline-block;
  font-size: 11px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--white);
  padding: 2px 10px;
  border-radius: 10px;
  margin-bottom: 8px;
}

/* Set Card */
.set-card {
  background: linear-gradient(135deg, #FFF9EE, #FFF5E0);
  border: 2px solid var(--gold-light);
  border-radius: var(--radius);
  padding: 24px;
}

.set-card .set-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 4px;
}

.set-card .set-price {
  font-size: 24px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 12px;
}

.set-card .set-includes {
  margin-bottom: 12px;
}

.set-card .set-includes li {
  font-size: 14px;
  color: var(--text);
  padding: 4px 0;
  list-style: none;
  padding-left: 20px;
  position: relative;
}

.set-card .set-includes li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--gold);
  font-weight: 700;
}

.set-card .set-reason {
  font-size: 13px;
  color: var(--text-light);
  background: var(--white);
  padding: 12px 16px;
  border-radius: 8px;
  margin-top: 12px;
}

/* Routine Steps */
.routine-steps {
  position: relative;
}

.routine-step {
  display: flex;
  gap: 16px;
  padding-bottom: 24px;
  position: relative;
}

.routine-step:last-child {
  padding-bottom: 0;
}

.step-number {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.routine-step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 18px;
  top: 36px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.step-content {
  flex: 1;
  padding-top: 6px;
}

.step-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 2px;
}

.step-product {
  font-size: 13px;
  color: var(--gold);
  margin-bottom: 2px;
}

.step-note {
  font-size: 13px;
  color: var(--text-light);
}

/* Routine Periods (AM/PM) */
.routine-period {
  margin-bottom: 28px;
}

.routine-period:last-child {
  margin-bottom: 0;
}

.period-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-weight: 600;
  font-size: 16px;
}

.period-header.morning {
  background: linear-gradient(135deg, #FFF8E7, #FFF3D4);
  color: #B8860B;
}

.period-header.evening {
  background: linear-gradient(135deg, #EDE8F5, #E0DAF0);
  color: #5B4A8A;
}

.period-header.extras {
  background: linear-gradient(135deg, #E8F5E9, #D4EDDA);
  color: #2E7D32;
}

.period-icon {
  font-size: 20px;
}

.period-label {
  font-size: 16px;
}

/* Result Footer */
.result-footer {
  text-align: center;
  padding-top: 20px;
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
  h1 {
    font-size: 26px;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .container {
    padding: 20px 16px;
  }

  .question-title {
    font-size: 19px;
  }
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 24px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-light);
}

.ig-link {
  display: inline-flex;
  align-items: center;
  vertical-align: -3px;
  margin-left: 8px;
  color: var(--text-light);
  transition: color 0.2s;
}

.ig-link:hover {
  color: var(--gold);
}
