:root {
  --ink: #082b43;
  --muted: #6c8191;
  --cyan: #18d9c5;
  --cyan-deep: #087d73;
  --line: #dce7ea;
  --panel: #ffffff;
  --navy: #07253a;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: #edf3f5;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: #edf3f5; }
body { min-height: 100vh; margin: 0; background: radial-gradient(circle at 82% -8%, rgba(24,217,197,.11), transparent 26%), #edf3f5; }
button, textarea, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }

.policy-app { min-height: 100vh; }
.policy-topbar { position: sticky; top: 0; z-index: 20; display: flex; min-height: 72px; gap: 24px; align-items: center; justify-content: space-between; padding: 11px clamp(18px, 4vw, 58px); border-bottom: 1px solid rgba(18,58,82,.09); background: rgba(255,255,255,.92); backdrop-filter: blur(16px); }
.policy-brand { display: flex; gap: 12px; align-items: center; color: var(--ink); text-decoration: none; }
.policy-brand > span:last-child { display: grid; gap: 2px; }
.policy-brand strong { font-size: 18px; }
.policy-brand small { color: #80919e; font-size: 11px; }
.brand-mark { position: relative; display: block; width: 38px; height: 38px; border-radius: 11px; background: var(--navy); }
.brand-mark i { position: absolute; display: block; width: 7px; border-radius: 8px; background: var(--cyan); }
.brand-mark i:nth-child(1) { left: 9px; bottom: 9px; height: 11px; }
.brand-mark i:nth-child(2) { left: 16px; bottom: 9px; height: 20px; }
.brand-mark i:nth-child(3) { left: 23px; bottom: 9px; height: 15px; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.park-switcher { display: flex; gap: 8px; align-items: center; }
.park-switcher > span { color: #7b8d9b; font-size: 12px; }
.park-switcher select { min-width: 220px; height: 42px; padding: 0 34px 0 12px; color: #17384f; font-size: 13px; font-weight: 700; border: 1px solid var(--line); border-radius: 9px; outline: none; background: #f8fbfb; }
.topbar-actions > a { padding: 11px 13px; color: #416174; font-size: 12px; font-weight: 800; text-decoration: none; border: 1px solid var(--line); border-radius: 9px; background: #fff; }

.policy-main { display: grid; grid-template-columns: minmax(280px, .32fr) minmax(0, .68fr); width: min(1500px, calc(100% - 42px)); min-height: calc(100vh - 114px); margin: 22px auto 20px; overflow: hidden; border: 1px solid rgba(20,63,91,.08); border-radius: 24px; background: var(--panel); box-shadow: 0 28px 80px rgba(15,45,65,.1); }
.knowledge-sidebar { display: flex; min-width: 0; flex-direction: column; color: #e7f3f5; background: linear-gradient(160deg, #061f33 0%, #0a3548 100%); }
.knowledge-hero { padding: clamp(30px, 4vw, 54px); border-bottom: 1px solid rgba(255,255,255,.09); }
.knowledge-hero > span { color: #61e5d8; font-size: 11px; font-weight: 900; letter-spacing: .14em; }
.knowledge-hero h1 { margin: 16px 0 14px; font-size: clamp(32px, 3.5vw, 52px); line-height: 1.13; letter-spacing: -2px; }
.knowledge-hero p { margin: 0; color: #9ab3bf; font-size: 14px; line-height: 1.85; }
.knowledge-status { display: grid; grid-template-columns: auto 1fr; gap: 3px 9px; align-items: center; margin-top: 24px; padding: 12px 13px; border: 1px solid rgba(24,217,197,.2); border-radius: 10px; background: rgba(24,217,197,.06); }
.knowledge-status i, .model-status i { display: block; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px rgba(24,217,197,.8); }
.knowledge-status i { grid-row: 1 / 3; }
.knowledge-status span { color: #9fb8c3; font-size: 11px; }
.knowledge-status strong { color: #66e4d8; font-size: 12px; }
.knowledge-overview, .source-library { padding: 22px clamp(22px, 3vw, 38px); border-bottom: 1px solid rgba(255,255,255,.08); }
.knowledge-overview > header, .source-library > header { display: flex; align-items: center; justify-content: space-between; }
.knowledge-overview header > span, .source-library header > span { color: #dcecef; font-size: 13px; font-weight: 800; }
.knowledge-overview header strong, .source-library header small { color: #87a7b4; font-size: 11px; }
.knowledge-overview header b { color: var(--cyan); }
.category-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.category-list span { padding: 6px 8px; color: #a8bfca; font-size: 11px; border: 1px solid rgba(255,255,255,.09); border-radius: 999px; background: rgba(255,255,255,.035); }
.category-list span b { margin-left: 3px; color: #63dace; }
.source-library { flex: 1; }
.source-library > div { display: grid; gap: 8px; margin-top: 13px; }
.source-item { padding: 11px 12px; border: 1px solid rgba(255,255,255,.08); border-radius: 9px; background: rgba(255,255,255,.035); }
.source-item span { color: #62dacf; font-size: 10px; }
.source-item strong { display: block; margin-top: 4px; overflow: hidden; color: #e4f0f2; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.source-item small { display: block; margin-top: 4px; color: #7e9ba8; font-size: 10px; }
.side-loading { padding: 16px 0; color: #7896a3; font-size: 11px; }

.consultation-panel { display: grid; grid-template-rows: auto auto minmax(340px, 1fr) auto; min-width: 0; min-height: 0; }
.consultation-head { display: flex; gap: 20px; align-items: center; justify-content: space-between; padding: 30px clamp(24px, 4vw, 48px) 21px; }
.consultation-head > div:first-child { display: grid; gap: 5px; }
.consultation-head > div:first-child > span { color: var(--cyan-deep); font-size: 11px; font-weight: 900; letter-spacing: .12em; }
.consultation-head h2 { margin: 0; font-size: clamp(25px, 2.4vw, 36px); letter-spacing: -1px; }
.consultation-head p { margin: 0; color: #738696; font-size: 13px; }
.model-status { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; align-items: center; flex: 0 0 auto; padding: 10px 12px; border: 1px solid #d7e9e8; border-radius: 9px; background: #f1fbf9; }
.model-status i { grid-row: 1 / 3; }
.model-status span { color: #08786f; font-size: 11px; font-weight: 900; }
.model-status small { color: #6f908f; font-size: 9px; }
.quick-questions { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 clamp(24px, 4vw, 48px) 18px; border-bottom: 1px solid #e7edef; }
.quick-questions button { padding: 7px 10px; color: #4f6b7d; font-size: 11px; cursor: pointer; border: 1px solid #dce7ea; border-radius: 999px; background: #f9fbfc; }
.quick-questions button:hover { color: #08776e; border-color: rgba(24,217,197,.45); background: #ecfbf8; }
.chat-log { min-height: 0; overflow: auto; padding: 28px clamp(24px, 4vw, 48px); background: #fbfdfd; }
.chat-message { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 11px; align-items: start; max-width: 900px; margin-bottom: 22px; }
.chat-message.user { grid-template-columns: minmax(0, 1fr) 34px; margin-left: auto; }
.message-avatar { display: grid; place-items: center; width: 34px; height: 34px; color: #06313b; font-size: 10px; font-weight: 900; border-radius: 10px; background: var(--cyan); }
.chat-message.user .message-avatar { grid-column: 2; color: #fff; background: #123c55; }
.chat-message.user .message-content { grid-column: 1; grid-row: 1; justify-self: end; }
.message-content { min-width: 0; }
.message-label { display: block; margin: 0 0 5px; color: #8294a1; font-size: 10px; }
.chat-message.user .message-label { text-align: right; }
.message-bubble { max-width: 780px; padding: 12px 15px; color: #26485c; font-size: 14px; line-height: 1.8; white-space: pre-wrap; border: 1px solid #dce6e9; border-radius: 4px 14px 14px; background: #fff; }
.chat-message.user .message-bubble { color: #eaf4f6; border-color: #123c55; border-radius: 14px 4px 14px 14px; background: #123c55; }
.message-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 7px; color: #8a9aa6; font-size: 9px; }
.message-meta b { color: #087c72; }
.answer-sources { display: grid; gap: 7px; margin-top: 9px; }
.answer-sources > span { color: #718796; font-size: 10px; font-weight: 800; }
.answer-source { padding: 10px 11px; border-left: 3px solid var(--cyan); border-radius: 7px; background: #eef8f7; }
.answer-source header { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.answer-source header strong { color: #234b5b; font-size: 11px; }
.answer-source header span { padding: 2px 5px; color: #08786f; font-size: 9px; border-radius: 4px; background: #dff5f2; }
.answer-source p { margin: 5px 0 0; color: #6b818d; font-size: 10px; line-height: 1.6; }
.typing-bubble { display: flex; gap: 5px; align-items: center; min-height: 48px; }
.typing-bubble i { display: block; width: 6px; height: 6px; border-radius: 50%; background: #78cfc6; animation: typing 1s infinite ease-in-out; }
.typing-bubble i:nth-child(2) { animation-delay: .15s; }
.typing-bubble i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 70%, 100% { transform: translateY(0); opacity: .4; } 35% { transform: translateY(-4px); opacity: 1; } }
.chat-composer { padding: 18px clamp(24px, 4vw, 48px) 25px; border-top: 1px solid #e2eaed; background: #fff; }
.chat-composer label { display: grid; gap: 7px; }
.chat-composer label > span { color: #536d7d; font-size: 11px; font-weight: 800; }
.chat-composer textarea { width: 100%; resize: vertical; min-height: 82px; max-height: 190px; padding: 12px 14px; color: #17394d; font-size: 14px; line-height: 1.7; border: 1px solid #d3e0e4; border-radius: 10px; outline: none; background: #f9fbfc; }
.chat-composer textarea:focus { border-color: rgba(24,217,197,.75); box-shadow: 0 0 0 3px rgba(24,217,197,.09); }
.chat-composer > div { display: flex; gap: 14px; align-items: center; justify-content: space-between; margin-top: 10px; }
.chat-composer small { color: #91a0aa; font-size: 10px; }
.chat-composer button { min-height: 42px; padding: 0 18px; color: #062b34; font-size: 12px; font-weight: 900; cursor: pointer; border: 0; border-radius: 9px; background: var(--cyan); }
.chat-composer button:disabled { cursor: wait; opacity: .55; }
.page-toast { position: fixed; right: 22px; bottom: 22px; z-index: 30; max-width: min(360px, calc(100% - 32px)); padding: 12px 15px; color: #eef8fa; font-size: 12px; border-radius: 9px; background: #0b3148; box-shadow: 0 18px 45px rgba(4,25,39,.25); }

@media (max-width: 980px) {
  .policy-main { grid-template-columns: 1fr; width: min(760px, calc(100% - 28px)); }
  .knowledge-sidebar { display: grid; grid-template-columns: 1fr 1fr; }
  .knowledge-hero { grid-column: 1 / -1; }
  .knowledge-overview, .source-library { min-height: 190px; }
}

@media (max-width: 680px) {
  .policy-topbar { min-height: 64px; padding: 9px 14px; }
  .policy-brand small, .park-switcher > span, .topbar-actions > a { display: none; }
  .policy-brand strong { font-size: 14px; }
  .park-switcher select { min-width: 140px; max-width: 170px; }
  .policy-main { margin-top: 14px; border-radius: 17px; }
  .knowledge-sidebar { display: block; }
  .knowledge-hero { padding: 28px 22px; }
  .knowledge-hero h1 { font-size: 36px; }
  .source-library { display: none; }
  .consultation-head { align-items: flex-start; padding: 24px 20px 17px; }
  .consultation-head p, .model-status { display: none; }
  .quick-questions { padding: 0 20px 15px; }
  .chat-log { padding: 22px 18px; }
  .chat-message { grid-template-columns: 30px minmax(0,1fr); gap: 8px; }
  .chat-message.user { grid-template-columns: minmax(0,1fr) 30px; }
  .message-avatar { width: 30px; height: 30px; }
  .message-bubble { font-size: 13px; }
  .chat-composer { padding: 15px 18px 20px; }
  .chat-composer > div { align-items: flex-end; }
  .chat-composer small { max-width: 170px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
