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

:root {
  --black: #0d0d0d;
  --dark: #1a1a1a;
  --mid: #2d2d2d;
  --gray: #6b7280;
  --light-gray: #f3f4f6;
  --border: #e5e7eb;
  --white: #ffffff;
  --accent: #e63946;
  --accent-dark: #c1121f;
  --gold: #f4a261;
  --blue: #2563eb;
  --green: #16a34a;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.14);
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', 'Segoe UI', sans-serif;
  background: var(--white);
  color: var(--dark);
  line-height: 1.7;
  font-size: 16px;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 17px;
  color: var(--black);
}

.logo-icon { font-size: 22px; }

.logo-tag {
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

.header-nav {
  display: flex;
  gap: 24px;
}

.header-nav a {
  color: var(--gray);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}

.header-nav a:hover { color: var(--black); text-decoration: none; }

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, #0d0d0d 0%, #1a1a2e 50%, #16213e 100%);
  color: white;
  padding: 80px 24px 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at center, rgba(230,57,70,0.12) 0%, transparent 60%);
  pointer-events: none;
}

.hero-inner { position: relative; z-index: 1; max-width: 700px; margin: 0 auto; }

.hero-title {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}

.highlight {
  background: linear-gradient(135deg, var(--accent), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 16px;
  color: rgba(255,255,255,0.75);
  margin-bottom: 28px;
  line-height: 1.8;
}

.hero-sub strong {
  color: #4ade80;
  font-weight: 700;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 36px;
}

.hero-tags span {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.9);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 14px 36px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.3px;
  transition: background 0.2s, transform 0.1s;
  text-decoration: none;
}

.btn-primary:hover {
  background: var(--accent-dark);
  text-decoration: none;
  transform: translateY(-1px);
}

.hero-quote {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.hero-quote blockquote {
  font-size: 18px;
  font-style: italic;
  color: rgba(255,255,255,0.8);
  font-weight: 500;
}

.hero-quote cite {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  font-style: normal;
}

/* ===== Quick Section ===== */
.quick-section {
  padding: 40px 24px;
  background: var(--light-gray);
  border-bottom: 1px solid var(--border);
}

.quick-inner {
  max-width: 900px;
  margin: 0 auto;
}

.quick-inner h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 16px;
  text-align: center;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.quick-btn {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 14px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
  cursor: pointer;
  text-align: center;
  line-height: 1.5;
  transition: all 0.2s;
  font-family: inherit;
}

.quick-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: #fff5f5;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* ===== Chat Section ===== */
.chat-section {
  padding: 48px 24px;
  background: white;
}

.chat-container {
  max-width: 760px;
  margin: 0 auto;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 24px;
  background: var(--black);
  color: white;
}

.avatar {
  width: 44px;
  height: 44px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: white;
  position: relative;
  flex-shrink: 0;
}

.avatar-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  background: #22c55e;
  border-radius: 50%;
  border: 2px solid var(--black);
}

.chat-title-block strong { font-size: 15px; display: block; }
.chat-subtitle { font-size: 12px; color: rgba(255,255,255,0.5); }

.chat-messages {
  min-height: 300px;
  max-height: 520px;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #fafafa;
}

.msg { display: flex; flex-direction: column; max-width: 85%; }
.msg-ai { align-self: flex-start; }
.msg-user { align-self: flex-end; }

.msg-bubble {
  padding: 14px 18px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.75;
  word-break: break-word;
}

.msg-ai .msg-bubble {
  background: white;
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  color: var(--dark);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.msg-user .msg-bubble {
  background: var(--black);
  color: white;
  border-bottom-right-radius: 4px;
}

.msg-time {
  font-size: 11px;
  color: var(--gray);
  margin-top: 4px;
  padding: 0 4px;
}

.msg-ai .msg-time { text-align: left; }
.msg-user .msg-time { text-align: right; }

/* Typing indicator */
.typing-indicator .msg-bubble {
  padding: 16px 20px;
}

.typing-dots {
  display: flex;
  gap: 5px;
  align-items: center;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  background: var(--gray);
  border-radius: 50%;
  animation: bounce 1.2s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-6px); opacity: 1; }
}

.chat-input-area {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  background: white;
  border-top: 1px solid var(--border);
}

.chat-input-area textarea {
  flex: 1;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  resize: none;
  line-height: 1.6;
  transition: border-color 0.2s;
  background: #fafafa;
}

.chat-input-area textarea:focus {
  outline: none;
  border-color: var(--dark);
  background: white;
}

.chat-input-area button {
  align-self: flex-end;
  padding: 12px 24px;
  background: var(--black);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
  font-family: inherit;
}

.chat-input-area button:hover { background: var(--accent); }
.chat-input-area button:disabled { background: var(--gray); cursor: not-allowed; }

.chat-hint {
  text-align: center;
  font-size: 12px;
  color: var(--gray);
  padding: 8px 20px 16px;
  background: white;
}

/* ===== How Section ===== */
.how-section {
  padding: 64px 24px;
  background: var(--light-gray);
}

.how-inner {
  max-width: 900px;
  margin: 0 auto;
}

.how-inner h2 {
  font-size: 26px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 36px;
  color: var(--black);
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.how-card {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
}

.how-num {
  font-size: 32px;
  font-weight: 900;
  color: var(--border);
  line-height: 1;
  margin-bottom: 12px;
}

.how-card h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--dark);
}

.how-card p {
  font-size: 13px;
  color: var(--gray);
  line-height: 1.7;
}

/* ===== Quotes Section ===== */
.quotes-section {
  padding: 64px 24px;
  background: var(--black);
  color: white;
}

.quotes-inner {
  max-width: 900px;
  margin: 0 auto;
}

.quotes-inner h2 {
  font-size: 26px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 36px;
  color: white;
}

.quotes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.quote-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 20px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  line-height: 1.7;
  transition: background 0.2s;
}

.quote-card:hover {
  background: rgba(230,57,70,0.15);
  border-color: rgba(230,57,70,0.3);
}

/* ===== Disclaimer ===== */
.disclaimer-section {
  padding: 40px 24px;
  background: #fff8f0;
  border-top: 1px solid #fde68a;
}

.disclaimer-inner {
  max-width: 760px;
  margin: 0 auto;
}

.disclaimer-inner h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px;
  color: #92400e;
}

.disclaimer-inner ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.disclaimer-inner li {
  font-size: 13px;
  color: #78350f;
  padding-left: 18px;
  position: relative;
}

.disclaimer-inner li::before {
  content: '·';
  position: absolute;
  left: 6px;
  font-weight: 700;
}

.disclaimer-source {
  margin-top: 16px;
  font-size: 12px;
  color: var(--gray);
}

/* ===== Footer ===== */
.site-footer {
  background: var(--dark);
  color: rgba(255,255,255,0.5);
  padding: 28px 24px;
  text-align: center;
}

.footer-inner p {
  font-size: 13px;
  line-height: 2;
}

.footer-inner a { color: rgba(255,255,255,0.6); }
.footer-inner a:hover { color: white; }

/* ===== Markdown in chat ===== */
.msg-bubble strong { font-weight: 700; }
.msg-bubble em { font-style: italic; }
.msg-bubble code {
  background: rgba(0,0,0,0.08);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
}
.msg-ai .msg-bubble code { background: #f0f0f0; }
.msg-user .msg-bubble code { background: rgba(255,255,255,0.15); }

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .header-nav { display: none; }
  .hero { padding: 56px 20px 48px; }
  .hero-title { font-size: 26px; }
  .hero-sub { font-size: 14px; }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .how-grid { grid-template-columns: 1fr; }
  .quotes-grid { grid-template-columns: 1fr; }
  .chat-messages { max-height: 400px; }
  .msg { max-width: 92%; }
}
