/* ============================================
   知我 — Design Tokens & Global Styles
   Based on Figma Design (Inter, 1440×1024)
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,100..900&display=swap');

:root {
  /* Colors */
  --color-bg:       #FFFFFF;
  --color-fg:       #000000;
  --color-muted:    rgba(0, 0, 0, 0.49);

  /* Typography */
  --font-family:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --fw-thin:        100;
  --fw-extralight:  200;
  --fw-light:       300;
  --fw-regular:     400;
  --fw-semibold:    600;

  /* Spacing */
  --page-w:         1440px;
  --page-h:         1024px;
  --nav-h:          72px;
  --nav-gap:        21px;

  /* Radii */
  --radius-card:    77px;
  --radius-input:   71px;
  --radius-option:  30px;
  --radius-chip:    77px;

  /* Transitions */
  --ease:           cubic-bezier(0.4, 0, 0.2, 1);
  --dur:            0.25s;
}

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

html, body {
  width: 100%;
  height: 100%;
  font-family: var(--font-family);
  background: var(--color-bg);
  color: var(--color-fg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ============================================
   Page Container (1440×1024 centered)
   ============================================ */
.page {
  width: var(--page-w);
  height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
/* About page - allow scroll, hide scrollbar */
.page-about {
  overflow-y: auto;
  scrollbar-width: none;
}
.page-about::-webkit-scrollbar {
  display: none;
}

/* ============================================
   Top Navigation Bar
   ============================================ */
.nav {
  width: 100%;
  height: var(--nav-h);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}
.nav-links {
  display: flex;
  gap: var(--nav-gap);
}
.nav-link {
  font-family: var(--font-family);
  font-weight: var(--fw-extralight);
  font-size: 20px;
  color: var(--color-fg);
  text-decoration: none;
  transition: opacity var(--dur) var(--ease);
  cursor: pointer;
  background: none;
  border: none;
}
.nav-link:hover {
  opacity: 0.6;
}
.nav-link.active {
  font-weight: var(--fw-regular);
}

/* ============================================
   Main Content Area (fills remaining height)
   ============================================ */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

/* ============================================
   AI Chat Input Bar (bottom-fixed)
   ============================================ */
.chat-input-bar {
  width: 749px;
  height: 77px;
  position: relative;
  margin-top: auto;
  margin-bottom: 30px;
  flex-shrink: 0;
}
.chat-input-bar input {
  width: 100%;
  height: 100%;
  border: 1px solid var(--color-fg);
  border-radius: var(--radius-input);
  padding: 0 90px 0 37px;
  font-family: var(--font-family);
  font-weight: var(--fw-extralight);
  font-size: 20px;
  color: var(--color-fg);
  background: transparent;
  outline: none;
}
.chat-input-bar input::placeholder {
  color: var(--color-muted);
}
.chat-input-bar .send-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 65px;
  height: 65px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--dur) var(--ease);
}
.chat-input-bar .send-btn:hover {
  opacity: 0.7;
}
.chat-input-bar .send-btn img {
  width: 100%;
  height: 100%;
}

/* ============================================
   Home Page — Logo & Intro
   ============================================ */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-height: 0;
}
.hero-logo {
  width: min(599px, 42vw);
  height: auto;
  flex-shrink: 1;
  min-height: 0;
}
.hero-logo img {
  width: 100%;
  height: auto;
  max-height: 35vh;
  object-fit: contain;
}
.hero-intro {
  width: min(782px, 55vw);
  height: auto;
  margin-top: 20px;
  flex-shrink: 1;
  min-height: 0;
}
.hero-intro img {
  width: 100%;
  height: auto;
  max-height: 25vh;
  object-fit: contain;
}

/* Home input bar — fixed to viewport bottom */
.chat-input-bar.home-input {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: min(749px, 90vw);
  margin: 0;
  z-index: 10;
}

/* ============================================
   Scale Selection — Cards
   ============================================ */
.scale-cards {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 45px;
  padding-bottom: 60px;
}
.scale-card {
  position: relative;
  width: 360px;
  height: 485px;
  cursor: pointer;
  transition: transform var(--dur) var(--ease);
}
.scale-card:hover {
  transform: translateY(-4px);
}
.scale-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.scale-card-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 0 32px 60px;
  text-align: center;
}
.scale-card-title {
  font-family: var(--font-family);
  font-weight: var(--fw-regular);
  font-size: 32px;
  line-height: 1.2;
  margin-bottom: 8px;
}
.scale-card-title .title-sub {
  font-size: 0.667em;
}
.scale-card-title-img {
  width: auto;
  height: 48px;
  margin-bottom: 8px;
}
.scale-card-desc {
  font-family: var(--font-family);
  font-weight: var(--fw-light);
  font-size: 20px;
  line-height: 1.5;
  opacity: 0.7;
}

/* ============================================
   Assessment Form
   ============================================ */
.assessment {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 55px;
  position: relative;
  width: 100%;
}
.assessment-header {
  width: 1120px;
  text-align: center;
  margin-bottom: 40px;
}
.assessment-title {
  font-family: var(--font-family);
  font-weight: var(--fw-extralight);
  font-size: 48px;
  letter-spacing: 0.19em;
  text-align: center;
}
.assessment-title strong {
  font-weight: var(--fw-regular);
}
.assessment-subtitle {
  font-family: var(--font-family);
  font-weight: var(--fw-extralight);
  font-size: 36px;
  letter-spacing: 0.19em;
  text-align: center;
  margin-top: 4px;
}
.assessment-form {
  width: 870px;
  position: relative;
}
.question-counter {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 30px;
}
.question-number {
  font-family: var(--font-family);
  font-weight: var(--fw-semibold);
  font-size: 40px;
  display: flex;
  align-items: baseline;
  gap: 0;
}
#currentNum { font-size: 60px; }
#totalNum { font-size: 36px; }
.divider {
  width: 1px;
  height: 32px;
  background: var(--color-fg);
  margin: 0 6px;
}
.question-text {
  font-family: var(--font-family);
  font-weight: var(--fw-extralight);
  font-size: 28px;
}
.options {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.option {
  width: 832px;
  height: 65px;
  display: flex;
  align-items: center;
  border: 1px solid var(--color-fg);
  border-radius: var(--radius-option);
  padding: 0 19px;
  gap: 22px;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  position: relative;
}
.option:hover {
  opacity: 0.7;
}
.option.selected {
  background: var(--color-fg);
  color: var(--color-bg);
}
.option.selected .option-radio {
  border-color: var(--color-bg);
}
.option.selected .option-radio-inner {
  background: var(--color-bg);
}
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--color-fg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.option-radio-inner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: transparent;
  transition: background var(--dur) var(--ease);
}
.option-label {
  font-family: var(--font-family);
  font-weight: var(--fw-extralight);
  font-size: 32px;
}

/* Progress Bar */
.progress-bar-wrap {
  width: 600px;
  margin: 20px auto 0;
}

/* Navigation Buttons */
.nav-btns-wrap {
  display: flex;
  justify-content: center;
  gap: 212px;
  margin-top: 24px;
}
.nav-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  transition: opacity var(--dur) var(--ease);
  opacity: 0.3;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-btn:hover { opacity: 0.6; }
.nav-btn.active { opacity: 1; }
.next-btn img {
  height: 83px;
}

/* ============================================
   Report Page
   ============================================ */
.report {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: 60px;
}
.report-card {
  position: relative;
  width: 508px;
  min-height: 334px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.report-score-row {
  display: flex;
  align-items: baseline;
  gap: 1px;
  margin-bottom: 0;
}
.report-score-num {
  font-family: var(--font-family);
  font-weight: var(--fw-semibold);
  font-size: 256px;
  line-height: 0.9;
  letter-spacing: -0.02em;
}
.report-score-unit {
  height: 96px;
  width: auto;
}
.report-unit-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-top: -3px;
}
.report-chip {
  background: var(--color-fg);
  color: var(--color-bg);
  padding: 9px 24px;
  border-radius: var(--radius-chip);
  font-family: var(--font-family);
  font-weight: var(--fw-semibold);
  font-size: 20px;
  margin-top: -6px;
}
.report-date {
  font-family: var(--font-family);
  font-weight: var(--fw-thin);
  font-size: 20px;
  margin-top: -14px;
  margin-left: 0;
}
.report-desc {
  font-family: var(--font-family);
  font-weight: var(--fw-thin);
  font-size: 20px;
  text-align: center;
  margin-top: 12px;
  max-width: 600px;
  line-height: 1.6;
  word-break: keep-all;
}

/* ============================================
   Chat Page — Unified Panel (matches SVG design)
   ============================================ */
.chat-panel {
  width: 749px;
  height: calc(100vh - 120px);
  border: 1px solid var(--color-fg);
  border-radius: 39px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-top: 30px;
}

/* Messages area — scrollable */
.chat-messages {
  flex: 1;
  min-height: 0;
  padding: 32px 36px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.chat-messages::-webkit-scrollbar {
  width: 0;
  height: 0;
  background: transparent;
}
.chat-messages {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Input inside panel — same as home page input bar */
.chat-panel-input {
  flex-shrink: 0;
  position: relative;
  width: calc(100% - 32px);
  margin: 0 16px 14px;
}
.chat-panel-input input {
  width: 100%;
  height: 77px;
  border: 1px solid var(--color-fg);
  border-radius: var(--radius-input);
  padding: 0 90px 0 37px;
  font-family: var(--font-family);
  font-weight: var(--fw-extralight);
  font-size: 20px;
  color: var(--color-fg);
  background: transparent;
  outline: none;
}
.chat-panel-input input::placeholder {
  color: var(--color-muted);
}
/* Send button — absolute positioned over input right side */
.chat-panel-input .send-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 65px;
  height: 65px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--dur) var(--ease);
}
.chat-panel-input .send-btn:hover {
  opacity: 0.7;
}
.chat-panel-input .send-btn img {
  width: 100%;
  height: 100%;
}

/* ============================================
   Chat Message Bubbles — outlined capsules with tail
   ============================================ */
.chat-msg {
  max-width: 70%;
  padding: 14px 24px;
  font-family: var(--font-family);
  font-weight: var(--fw-light);
  font-size: 18px;
  line-height: 1.55;
  word-break: break-word;
}
.chat-msg.ai {
  align-self: flex-start;
  background: transparent;
  border: 1px solid var(--color-fg);
  border-radius: 28px;
}
.chat-msg.user {
  align-self: flex-end;
  background: transparent;
  border: 1px solid var(--color-fg);
  color: var(--color-fg);
  border-radius: 28px;
}
.chat-typing {
  align-self: flex-start;
  display: flex;
  gap: 6px;
  padding: 16px 22px;
  align-items: center;
}
.chat-typing b {
  font-weight: 400;
  font-size: 14px;
  color: var(--color-fg);
  opacity: 0.5;
  margin-left: 4px;
}
.chat-typing span {
  width: 8px;
  height: 8px;
  background: var(--color-fg);
  border-radius: 50%;
  animation: typing-bounce 1.2s infinite ease-in-out;
}
.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-10px); opacity: 1; }
}

/* 对话结束 — 量表引导按钮 */
.chat-assess-btn {
  align-self: flex-start;
  margin-top: 8px;
  padding: 12px 28px;
  font-family: var(--font-family);
  font-weight: var(--fw-semibold);
  font-size: 16px;
  color: var(--color-fg);
  background: transparent;
  border: 1px solid var(--color-fg);
  border-radius: 71px;
  cursor: pointer;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.chat-assess-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  transform: translateY(-1px);
}

/* ============================================
   About Page
   ============================================ */
.about-content {
  flex: 1;
  width: min(800px, 90vw);
  display: flex;
  flex-direction: column;
  gap: 36px;
  padding: 48px 0 60px;
  overflow-y: auto;
}
.about-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.about-title {
  font-family: var(--font-family);
  font-weight: var(--fw-light);
  font-size: 36px;
  letter-spacing: 0.1em;
}
.about-heading {
  font-family: var(--font-family);
  font-weight: var(--fw-regular);
  font-size: 22px;
  letter-spacing: 0.08em;
}
.about-desc {
  font-family: var(--font-family);
  font-weight: var(--fw-extralight);
  font-size: 24px;
  line-height: 1.6;
  letter-spacing: 0.06em;
}
.about-desc-sm {
  font-family: var(--font-family);
  font-weight: var(--fw-extralight);
  font-size: 18px;
  line-height: 1.6;
  opacity: 0.6;
}
.about-card {
  border: 1px solid var(--color-fg);
  border-radius: 24px;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.about-card-header {
  font-family: var(--font-family);
  font-weight: var(--fw-regular);
  font-size: 20px;
}
.about-card-text {
  font-family: var(--font-family);
  font-weight: var(--fw-extralight);
  font-size: 18px;
  line-height: 1.6;
  opacity: 0.65;
}
.about-section-version {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 40px;
}
.about-version-card {
  border: 1px solid var(--color-fg);
  border-radius: 77px;
  padding: 12px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.about-app-name {
  font-family: var(--font-family);
  font-weight: var(--fw-regular);
  font-size: 22px;
}
.about-version-num {
  font-family: var(--font-family);
  font-weight: var(--fw-extralight);
  font-size: 18px;
  opacity: 0.5;
}
.about-copyright {
  margin-top: 20px;
  text-align: center;
}

/* ============================================
   History Page
   ============================================ */
.history-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.history-empty-icon {
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  font-weight: var(--fw-extralight);
}
.history-empty-img {
  width: 224px;
  height: 224px;
  display: block;
}
.history-empty-text {
  font-family: var(--font-family);
  font-weight: var(--fw-extralight);
  font-size: 20px;
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in {
  animation: fadeIn 0.5s var(--ease) both;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1440px) {
  .page {
    width: 100%;
  }
  .hero-logo { width: min(300px, 42vw); }
  .hero-intro { width: min(400px, 55vw); }
  .chat-input-bar { width: min(749px, 90vw); }
  .chat-input-bar.home-input { width: min(749px, 90vw); }
  .scale-cards { gap: 24px; }
  .scale-card { width: min(360px, 85vw); height: auto; }
  .assessment-form { width: min(870px, 90vw); }
  .progress-bar-wrap { width: min(600px, 90vw); }
  .option { width: 100%; }
  .assessment-header { width: min(1120px, 90vw); }
  .chat-panel { width: min(749px, 94vw); }
  .report-card { width: min(508px, 90vw); }
  .report-score-num { font-size: clamp(120px, 18vw, 256px); }
  .report-score-unit { font-size: clamp(48px, 7vw, 96px); }
}
@media (max-width: 600px) {
  .nav-link { font-size: 16px; }
  .assessment-title { font-size: 28px; letter-spacing: 0.08em; }
  .assessment-subtitle { font-size: 20px; letter-spacing: 0.08em; }
  .question-text { font-size: 26px; }
  .option-label { font-size: 20px; }
  .option { height: 56px; gap: 14px; padding: 0 14px; }
  .option-radio { width: 36px; height: 36px; }
  .option-radio-inner { width: 24px; height: 24px; }
}
