/* style.css - mingli chat app. Matches the report's ink/gold aesthetic. */
:root {
  --gold: #C8A96E;
  --gold-light: #E8C97E;
  --gold-dim: #8B7245;
  --crimson: #9B2335;
  --ink: #0A0A0F;
  --ink-mid: #12121A;
  --ink-light: #1C1C2A;
  --ivory: #F2EBD9;
  --ivory-dim: #B8AA90;
}

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

body {
  background: var(--ink);
  color: var(--ivory);
  font-family: 'Noto Serif SC', serif;
  min-height: 100vh;
  line-height: 1.7;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(60, 40, 100, 0.3) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(40, 20, 60, 0.4) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.site-header, main, .site-footer {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-header { text-align: center; padding: 48px 20px 32px; }

.header-eyebrow {
  font-size: 11px;
  letter-spacing: 6px;
  color: var(--gold-dim);
  margin-bottom: 14px;
}

.site-header h1 {
  font-family: 'Ma Shan Zheng', serif;
  font-size: clamp(34px, 6vw, 52px);
  color: var(--gold);
  font-weight: 400;
  text-shadow: 0 0 40px rgba(200, 169, 110, 0.3);
}

.header-sub { font-size: 13px; color: var(--ivory-dim); letter-spacing: 2px; margin-top: 10px; }

/* --- Chat panel --- */
.chat-panel {
  background: var(--ink-mid);
  border: 1px solid rgba(200, 169, 110, 0.2);
  border-radius: 4px;
  padding: 16px;
  margin-bottom: 24px;
}

.chat-log {
  height: 340px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px 4px;
}

.bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

.bubble.bot {
  align-self: flex-start;
  background: var(--ink-light);
  border: 1px solid rgba(200, 169, 110, 0.15);
  color: var(--ivory);
}

.bubble.user {
  align-self: flex-end;
  background: rgba(155, 35, 53, 0.25);
  border: 1px solid rgba(155, 35, 53, 0.4);
  color: var(--ivory);
}

.chat-status {
  min-height: 20px;
  font-size: 12px;
  color: var(--gold);
  padding: 4px 6px;
}

.chat-form { display: flex; gap: 8px; }

.chat-form input {
  flex: 1;
  min-width: 0;
  background: var(--ink);
  border: 1px solid rgba(200, 169, 110, 0.3);
  border-radius: 3px;
  color: var(--ivory);
  font-family: inherit;
  font-size: 16px; /* >=16px prevents iOS Safari auto-zoom on focus */
  padding: 11px 14px;
}

.chat-form input:focus { outline: none; border-color: var(--gold); }
.chat-form input:disabled { opacity: 0.5; }

.chat-form button, .chat-actions button {
  background: rgba(200, 169, 110, 0.15);
  border: 1px solid rgba(200, 169, 110, 0.4);
  border-radius: 3px;
  color: var(--gold);
  font-family: inherit;
  font-size: 14px;
  padding: 11px 22px;
  cursor: pointer;
  transition: background 0.2s;
}

.chat-form button:hover:not(:disabled), .chat-actions button:hover:not(:disabled) {
  background: rgba(200, 169, 110, 0.3);
}

.chat-form button:disabled, .chat-actions button:disabled { opacity: 0.4; cursor: default; }

.chat-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.chat-actions button { font-size: 13px; padding: 10px 16px; } /* comfortable touch target */

/* --- Report --- */
.report-wrap { display: none; margin-bottom: 40px; }
.report-wrap.visible { display: block; }

.report-frame {
  width: 100%;
  height: 80vh; /* fallback; JS expands it to full content height */
  min-height: 560px;
  border: 1px solid rgba(200, 169, 110, 0.25);
  border-radius: 4px;
  background: var(--ink);
  display: block;
}

/* --- Content --- */
.content-section { padding: 8px 0 32px; }

.content-section h2 {
  font-size: 15px;
  letter-spacing: 4px;
  color: var(--gold);
  margin: 28px 0 10px;
}

.content-section p { font-size: 14px; color: var(--ivory-dim); }

/* --- Footer --- */
.site-footer {
  text-align: center;
  padding: 28px 20px 44px;
  border-top: 1px solid rgba(200, 169, 110, 0.12);
  font-size: 12px;
  color: var(--ivory-dim);
}

.site-footer a { color: var(--gold-dim); }
.site-footer p { margin-top: 8px; }

@media (max-width: 620px) {
  .chat-log { height: 280px; }
  .bubble { max-width: 95%; }
  .report-frame { height: 70vh; }
}
