:root { color-scheme: light; --bg:#eef3f8; --surface:#fff; --soft:#f6f8fb; --text:#1f2937; --muted:#667085; --line:#d8e0ea; --accent:#2563eb; --accent-soft:#eaf1ff; --admin:#0f766e; }
* { box-sizing: border-box; }
html,body { width:100%; height:100%; overflow:hidden; }
body { margin:0; background:#eef3f8; color:var(--text); font-family:"Microsoft YaHei","Segoe UI",sans-serif; }
button,textarea,input { font:inherit; }
button { cursor:pointer; }
.feedback-app { width:min(920px,calc(100% - 28px)); height:100dvh; min-height:0; margin:auto; padding:16px 0; display:grid; grid-template-rows:auto minmax(0,1fr); gap:14px; }
.topbar { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:48px; }
.topbar-actions { display:flex; align-items:center; gap:10px; }
.view-switcher { display:flex; padding:3px; border:1px solid var(--line); border-radius:10px; background:rgba(255,255,255,.76); }
.view-button { min-height:30px; padding:0 13px; border:0; border-radius:7px; background:transparent; color:var(--muted); font-weight:700; }
.view-button.is-active { background:var(--accent); color:#fff; box-shadow:0 3px 8px rgba(37,99,235,.2); }
.brand { display:flex; align-items:center; gap:11px; }
.brand > span { display:grid; place-items:center; width:42px; height:42px; border-radius:8px; background:var(--accent); color:#fff; font-size:22px; font-weight:900; }
.brand small { color:var(--accent); font-weight:800; }
h1 { margin:1px 0 0; font-size:24px; }
.chat-panel { min-height:0; display:grid; grid-template-rows:auto minmax(0,1fr) auto; overflow:hidden; border:1px solid var(--line); border-radius:8px; background:var(--surface); box-shadow:0 18px 42px rgba(31,41,55,.12); }
.chat-panel[hidden] { display:none; }
.chat-meta { display:flex; justify-content:space-between; gap:12px; padding:14px 16px; border-bottom:1px solid var(--line); }
.chat-meta strong,.chat-meta span { display:block; }
.chat-meta span { margin-top:3px; color:var(--muted); font-size:13px; }
.language-button { min-width:52px; height:36px; padding:0 12px; border:1px solid var(--line); border-radius:8px; background:#fff; color:var(--accent); font-weight:800; }
.icon-button { width:40px; height:40px; border:1px solid var(--line); border-radius:8px; background:#fff; font-weight:800; }
.message-list { min-height:0; overflow-y:auto; padding:18px; background:var(--soft); }
.message-row { display:flex; margin-bottom:12px; }
.message-user { justify-content:flex-end; }
.message-admin { justify-content:flex-start; }
.message-bubble { max-width:min(620px,82%); padding:11px 12px 8px; border:1px solid var(--line); border-radius:8px; background:#fff; box-shadow:0 8px 18px rgba(31,41,55,.06); }
.message-user .message-bubble { border-color:rgba(37,99,235,.28); background:#eaf1ff; }
.message-admin .message-bubble { border-color:rgba(15,118,110,.28); }
.message-bubble p { margin:0 0 7px; white-space:pre-wrap; line-height:1.58; overflow-wrap:anywhere; }
.message-attachments { display:grid; gap:8px; margin:8px 0; }
.message-attachments a { display:block; width:min(320px,100%); overflow:hidden; border:1px solid var(--line); border-radius:8px; background:#fff; }
.message-attachments img { display:block; width:100%; max-height:360px; object-fit:contain; }
.attachment-error { display:grid; min-height:72px; place-items:center; padding:12px; color:var(--muted); font-size:13px; text-decoration:none; }
.attachment-error[hidden] { display:none; }
.message-bubble time { color:var(--muted); font-size:12px; }
.composer { display:grid; grid-template-columns:1fr auto; gap:10px; padding:12px; border-top:1px solid var(--line); }
.composer-main { display:grid; gap:8px; min-width:0; }
.composer textarea { width:100%; min-height:44px; max-height:150px; resize:vertical; padding:10px 12px; border:1px solid var(--line); border-radius:8px; outline:none; }
.composer textarea:focus { border-color:var(--accent); box-shadow:0 0 0 3px rgba(37,99,235,.14); }
.attachment-tray { display:flex; flex-wrap:wrap; gap:8px; }
.attachment-preview { position:relative; width:96px; height:72px; overflow:hidden; border:1px solid var(--line); border-radius:8px; background:#fff; }
.attachment-preview img { width:100%; height:100%; object-fit:cover; }
.attachment-preview button { position:absolute; top:4px; right:4px; width:24px; height:24px; border:0; border-radius:50%; background:rgba(31,41,55,.82); color:#fff; line-height:1; }
.primary-button { min-width:84px; min-height:40px; align-self:end; padding:0 18px; border:0; border-radius:8px; background:var(--accent); color:#fff; font-weight:800; }
.primary-button:disabled { cursor:not-allowed; opacity:.55; }
.empty-state { display:grid; place-items:center; min-height:130px; border:1px dashed var(--line); border-radius:8px; color:var(--muted); }

.guide-panel { position:relative; min-height:0; display:grid; grid-template-columns:286px minmax(0,1fr); overflow:hidden; border:1px solid var(--line); border-radius:10px; background:var(--surface); box-shadow:0 18px 42px rgba(31,41,55,.12); }
.guide-panel[hidden] { display:none; }
.guide-sidebar { min-height:0; display:grid; grid-template-rows:auto auto minmax(0,1fr); border-right:1px solid var(--line); background:#f8fafc; }
.guide-sidebar-head { display:flex; align-items:center; justify-content:space-between; padding:18px 18px 10px; }
.guide-sidebar-head strong,.guide-sidebar-head span { display:block; }
.guide-sidebar-head strong { font-size:16px; }
.guide-sidebar-head span { margin-top:3px; color:var(--muted); font-size:12px; }
.guide-close { display:none; width:34px; height:34px; border:0; border-radius:8px; background:var(--soft); color:var(--muted); font-size:22px; }
.guide-search { display:grid; grid-template-columns:auto 1fr; align-items:center; gap:7px; margin:2px 14px 12px; padding:0 10px; border:1px solid var(--line); border-radius:8px; background:#fff; color:var(--muted); }
.guide-search:focus-within { border-color:var(--accent); box-shadow:0 0 0 3px rgba(37,99,235,.11); }
.guide-search input { min-width:0; height:38px; border:0; outline:0; background:transparent; color:var(--text); }
.guide-nav { min-height:0; overflow-y:auto; padding:0 10px 18px; }
.guide-group { margin:0 0 13px; }
.guide-group summary { padding:8px; border-radius:7px; color:#344054; cursor:pointer; font-size:13px; font-weight:800; list-style:none; }
.guide-group summary::-webkit-details-marker { display:none; }
.guide-group summary::before { content:"›"; display:inline-block; margin-right:7px; color:var(--muted); transform:rotate(90deg); transition:transform .15s ease; }
.guide-group:not([open]) summary::before { transform:rotate(0); }
.guide-link { display:block; width:100%; margin:2px 0; padding:8px 10px 8px 24px; border:0; border-radius:7px; background:transparent; color:#475467; text-align:left; line-height:1.35; }
.guide-link:hover { background:#edf2f7; color:var(--text); }
.guide-link.is-active { background:var(--accent-soft); color:#1d4ed8; font-weight:800; }
.guide-empty-search { padding:28px 12px; color:var(--muted); text-align:center; line-height:1.6; }
.guide-search-summary { padding:4px 8px 10px; color:var(--muted); font-size:12px; font-weight:700; }
.guide-search-result { display:block; width:100%; margin:0 0 8px; padding:10px; border:1px solid transparent; border-radius:8px; background:#fff; color:var(--text); text-align:left; }
.guide-search-result:hover { border-color:#cbd5e1; background:#f8fafc; }
.guide-search-result.is-active { border-color:#bfd1f7; background:var(--accent-soft); }
.guide-search-result strong,.guide-search-result span { display:block; }
.guide-search-result strong { font-size:13px; line-height:1.4; }
.guide-search-result-meta { margin-top:4px; color:#667085; font-size:11px; line-height:1.4; }
.guide-search-result-excerpt { display:-webkit-box !important; overflow:hidden; margin-top:6px; color:#475467; font-size:12px; line-height:1.55; -webkit-box-orient:vertical; -webkit-line-clamp:3; }
.guide-search-clear { display:block; margin:12px auto 0; padding:7px 12px; border:1px solid var(--line); border-radius:7px; background:#fff; color:var(--accent); font-weight:700; }
.search-highlight { padding:0 .08em; border-radius:2px; background:#fde68a; color:inherit; }
.guide-backdrop { display:none; }
.guide-reader { min-width:0; min-height:0; display:grid; grid-template-rows:auto minmax(0,1fr); background:#fff; }
.guide-reader-head { min-height:66px; display:flex; align-items:center; gap:12px; padding:10px 20px; border-bottom:1px solid var(--line); background:rgba(255,255,255,.96); }
.guide-breadcrumb { min-width:0; flex:1; }
.guide-breadcrumb span,.guide-breadcrumb strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.guide-breadcrumb span { color:var(--accent); font-size:12px; font-weight:800; }
.guide-breadcrumb strong { margin-top:3px; font-size:15px; }
.catalog-button,.copy-link-button { min-height:36px; padding:0 12px; border:1px solid var(--line); border-radius:8px; background:#fff; color:#344054; font-weight:700; }
.catalog-button { display:none; }
.copy-link-button.is-copied { border-color:#86d2b4; background:#ecfdf3; color:#067647; }
.guide-content-scroll { min-height:0; overflow:auto; scroll-behavior:smooth; }
.markdown-body { width:min(820px,calc(100% - 52px)); margin:0 auto; padding:38px 0 70px; color:#263142; font-size:15px; line-height:1.82; overflow-wrap:anywhere; }
.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4 { color:#172033; line-height:1.35; scroll-margin-top:20px; }
.markdown-body h1 { margin:0 0 24px; padding-bottom:16px; border-bottom:1px solid var(--line); font-size:30px; letter-spacing:-.02em; }
.markdown-body h2 { margin:36px 0 14px; font-size:23px; }
.markdown-body h3 { margin:28px 0 10px; font-size:18px; }
.markdown-body h4 { margin:22px 0 8px; font-size:16px; }
.markdown-body p { margin:10px 0; }
.markdown-body a { color:var(--accent); text-decoration:none; }
.markdown-body a:hover { text-decoration:underline; }
.markdown-body code { padding:2px 5px; border-radius:5px; background:#f1f5f9; color:#9f1239; font-family:Consolas,"SFMono-Regular",monospace; font-size:.91em; }
.markdown-body pre { overflow:auto; margin:16px 0; padding:15px 17px; border-radius:8px; background:#172033; color:#e5edf8; line-height:1.6; }
.markdown-body pre code { padding:0; background:transparent; color:inherit; }
.markdown-body blockquote { margin:16px 0; padding:10px 16px; border-left:4px solid #93b4f5; background:#f6f9ff; color:#475467; }
.markdown-body blockquote p { margin:0; }
.markdown-body hr { margin:28px 0; border:0; border-top:1px solid var(--line); }
.markdown-body .table-scroll { max-width:100%; overflow-x:auto; margin:16px 0 22px; border:1px solid var(--line); border-radius:8px; }
.markdown-body table { width:100%; border-collapse:collapse; background:#fff; font-size:14px; line-height:1.55; }
.markdown-body th,.markdown-body td { min-width:130px; padding:10px 12px; border-right:1px solid var(--line); border-bottom:1px solid var(--line); text-align:left; vertical-align:top; }
.markdown-body th { background:#f5f8fc; color:#344054; font-weight:800; }
.markdown-body tr:last-child td { border-bottom:0; }
.markdown-body th:last-child,.markdown-body td:last-child { border-right:0; }
.md-list { margin:10px 0; }
.md-list-item { display:grid; grid-template-columns:24px minmax(0,1fr); margin:5px 0; }
.md-list-item[data-level="1"] { margin-left:24px; }
.md-list-item[data-level="2"] { margin-left:48px; }
.md-list-marker { color:#667085; text-align:right; }
.md-list-text { padding-left:8px; }
.guide-loading,.guide-error { display:grid; min-height:240px; place-items:center; color:var(--muted); text-align:center; }
.guide-error strong { display:block; margin-bottom:6px; color:var(--text); }

@media (min-width:1100px) { .feedback-app:has(.guide-panel:not([hidden])) { width:min(1180px,calc(100% - 36px)); } }
@media (max-width:760px) {
  .feedback-app { width:calc(100% - 16px); padding:8px 0; }
  .brand > span { width:38px; height:38px; }
  h1 { font-size:19px; }
  .topbar-actions { gap:6px; }
  .view-button { padding:0 9px; font-size:13px; }
  .language-button { min-width:45px; padding:0 8px; }
  .message-list { padding:12px; }
  .message-bubble { max-width:92%; }
  .composer { grid-template-columns:1fr; }
  .primary-button { justify-self:end; }
  .guide-panel { grid-template-columns:1fr; }
  .guide-sidebar { position:absolute; z-index:4; inset:0 auto 0 0; width:min(88vw,320px); border-right:1px solid var(--line); box-shadow:12px 0 32px rgba(31,41,55,.2); transform:translateX(-105%); transition:transform .2s ease; }
  .guide-panel.is-catalog-open .guide-sidebar { transform:translateX(0); }
  .guide-panel.is-catalog-open .guide-backdrop { position:absolute; z-index:3; inset:0; display:block; border:0; background:rgba(15,23,42,.32); }
  .guide-close,.catalog-button { display:block; }
  .guide-reader-head { min-height:60px; padding:8px 10px; }
  .copy-link-button { padding:0 9px; font-size:13px; }
  .markdown-body { width:calc(100% - 28px); padding:26px 0 54px; font-size:14px; }
  .markdown-body h1 { font-size:24px; }
  .markdown-body h2 { font-size:20px; }
}
@media (max-width:500px) {
  .topbar { align-content:center; flex-wrap:wrap; }
  .topbar-actions { width:100%; justify-content:space-between; }
  .brand small { display:none; }
  .brand { gap:8px; }
  .view-button { padding:0 10px; }
  .catalog-button span { display:none; }
  .guide-breadcrumb span { display:none; }
  .guide-breadcrumb strong { margin:0; }
}
