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

:root {
  --blue: #1A73E8;
  --blue-light: #E8F0FE;
  --blue-dark: #1557B0;
  --orange: #F77F00;
  --orange-light: #FFF3E0;
  --orange-dark: #BF6A00;
  --bg: #FFFFFF;
  --text: #333333;
  --text-light: #666666;
  --text-muted: #999999;
  --border: #E5E7EB;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-hover: 0 4px 20px rgba(0,0,0,0.12);
  --radius: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ===== Header ===== */
.header {
  text-align: center;
  padding: 60px 20px 40px;
}

.header h1 {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.header .subtitle {
  font-size: 1rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.header .subtitle .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--orange);
  display: inline-block;
}

/* ===== Early Bird Banner ===== */
.early-bird {
  background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
  border: 1px solid #FFCC80;
  border-radius: var(--radius);
  text-align: center;
  padding: 16px 24px;
  margin-bottom: 32px;
}

.early-bird .main {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--orange);
}

.early-bird .sub {
  font-size: 0.85rem;
  color: var(--orange-dark);
  margin-top: 4px;
}

/* ===== Nav ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

.nav .container {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.nav .container::-webkit-scrollbar { display: none; }

.nav a {
  flex-shrink: 0;
  text-decoration: none;
  color: var(--text-light);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: 20px;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav a:hover,
.nav a.active {
  background: var(--blue);
  color: #fff;
}

/* ===== Section Title ===== */
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  padding-top: 48px;
}

.section-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ===== Cards Grid ===== */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 48px;
}

/* ===== Card ===== */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.card.has-backend {
  background: var(--blue-light);
  border-left: 4px solid var(--blue);
}

.card .tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--blue);
  background: #E8F0FE;
  padding: 4px 12px;
  border-radius: 12px;
  margin-bottom: 16px;
  align-self: flex-start;
}

.card.has-backend .tag {
  background: #D2E3FC;
}

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

.card .price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}

.card .original-price {
  font-size: 1rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

.card .early-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--orange);
}

.card .price-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.card .meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  font-size: 0.85rem;
  color: var(--text-light);
}

.card .meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.card .meta .label { color: var(--text-muted); }
.card .meta .value { font-weight: 600; color: var(--blue); }

.card .features {
  list-style: none;
  padding: 0;
  margin-bottom: 20px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.card .features li {
  font-size: 0.88rem;
  color: var(--text-light);
  padding: 4px 0;
  padding-left: 18px;
  position: relative;
}

.card .features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--blue);
  font-weight: 700;
  font-size: 0.8rem;
}

.card .btn {
  margin-top: auto;
  display: block;
  text-align: center;
  text-decoration: none;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 0;
  border-radius: 24px;
  transition: background 0.2s;
}

.card .btn:hover {
  background: var(--blue-dark);
}

/* ===== Badge ===== */
.badge {
  position: absolute;
  top: -10px;
  right: 20px;
  background: var(--orange);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 12px;
  letter-spacing: 1px;
}

/* ===== Bundle Card ===== */
.bundle-card {
  background: var(--blue-light);
  border: 1px solid #D2E3FC;
}

.bundle-card .savings {
  display: inline-block;
  background: #D2E3FC;
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 8px;
  margin-left: 8px;
}

/* ===== Portfolio Section ===== */
.portfolio-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 48px;
  max-width: 600px;
}

.portfolio-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.portfolio-img {
  height: 220px;
  overflow: hidden;
}

.portfolio-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portfolio-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.portfolio-body h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.portfolio-body p {
  font-size: 0.88rem;
  color: var(--text-light);
  margin-bottom: 14px;
  flex: 1;
}

.portfolio-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.portfolio-tags span {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--blue);
  background: #E8F0FE;
  padding: 4px 12px;
  border-radius: 12px;
}

.portfolio-link {
  font-size: 0.9rem;
  color: var(--blue);
  font-weight: 600;
}

/* ===== Upgrade Section ===== */
.upgrade-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 48px;
}

.upgrade-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.upgrade-item .desc {
  font-size: 0.85rem;
  color: var(--text-light);
}

.upgrade-item .price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--orange);
  white-space: nowrap;
}

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

.footer .flow {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 16px;
}

.footer .flow .step {
  background: var(--blue-light);
  color: var(--blue);
  padding: 6px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.85rem;
}

.footer .flow .arrow {
  color: var(--orange);
  font-weight: 700;
}

.footer .note {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ============ consult.html Styles ============ */

.consult-layout {
  display: flex;
  gap: 24px;
  min-height: calc(100vh - 200px);
  margin-bottom: 40px;
}

.chat-panel {
  flex: 0 0 68%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.chat-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--blue-light);
}

.chat-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--blue);
}

.chat-header p {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 4px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 500px;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.message {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.6;
  word-break: break-word;
  animation: fadeIn 0.3s ease;
}

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

.message.ai {
  align-self: flex-start;
  background: #F3F4F6;
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.message.user {
  align-self: flex-end;
  background: var(--blue);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.message.typing {
  align-self: flex-start;
  background: #F3F4F6;
  color: var(--text-muted);
  border-bottom-left-radius: 4px;
  font-style: italic;
}

.chat-hint {
  text-align: center;
  font-size: 0.8rem;
  color: var(--orange);
  padding: 8px 24px;
  background: var(--orange-light);
  border-top: 1px solid #FFCC80;
  display: none;
}

.chat-hint.show {
  display: block;
}

.chat-input-area {
  display: flex;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

.chat-input-area input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.chat-input-area input:focus {
  border-color: var(--blue);
}

.chat-input-area button {
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 10px 24px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}

.chat-input-area button:hover {
  background: var(--blue-dark);
}

.chat-input-area button:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
}

/* ===== Contact Sidebar ===== */
.contact-sidebar {
  flex: 0 0 28%;
}

.contact-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 20px;
  text-align: center;
  position: sticky;
  top: 80px;
}

.contact-card .qr-img {
  display: block;
  margin: 0 auto 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.contact-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.contact-card .wechat-id {
  font-size: 0.85rem;
  color: var(--text-muted);
  background: #F9FAFB;
  padding: 6px 16px;
  border-radius: 16px;
  display: inline-block;
  margin-bottom: 12px;
}

.contact-card .desc {
  font-size: 0.82rem;
  color: var(--text-light);
  line-height: 1.6;
}

.contact-card .back-link {
  display: inline-block;
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--blue);
  text-decoration: none;
  font-weight: 500;
}

.contact-card .back-link:hover {
  text-decoration: underline;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .header h1 { font-size: 1.8rem; }

  .cards-grid,
  .upgrade-grid {
    grid-template-columns: 1fr;
  }

  .consult-layout {
    flex-direction: column;
  }

  .chat-panel { flex: 1 1 auto; }
  .contact-sidebar { flex: 1 1 auto; }

  .contact-card {
    position: static;
  }

  .message {
    max-width: 90%;
  }

  .chat-messages {
    max-height: 400px;
  }
}

@media (max-width: 480px) {
  .header h1 { font-size: 1.5rem; }
  .header { padding: 40px 16px 28px; }

  .card { padding: 22px 18px; }
  .card h3 { font-size: 1.1rem; }
  .card .early-price { font-size: 1.3rem; }

  .footer .flow { gap: 8px; }
  .footer .flow .step { padding: 5px 12px; font-size: 0.78rem; }

  .upgrade-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}
