:root {
  --bg: #eef2f7;
  --bg-soft: #f7f9fc;
  --card: rgba(255, 255, 255, 0.84);
  --card-solid: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(15, 23, 42, 0.08);
  --line-strong: rgba(15, 23, 42, 0.14);
  --primary: #0071e3;
  --primary-hover: #0077ed;
  --primary-soft: rgba(0, 113, 227, 0.08);
  --surface-1: rgba(255, 255, 255, 0.92);
  --surface-2: rgba(248, 250, 255, 0.82);
  --surface-3: rgba(244, 247, 252, 0.9);
  --shadow-sm: 0 10px 28px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 18px 54px rgba(15, 23, 42, 0.09);
  --shadow-lg: 0 30px 90px rgba(15, 23, 42, 0.14);
  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-xl: 34px;
  --blur: blur(24px);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", sans-serif;
  background:
    radial-gradient(1200px 620px at 50% -260px, rgba(255, 255, 255, 0.99) 0%, rgba(242, 246, 252, 0.97) 45%, rgba(238, 242, 247, 1) 100%),
    linear-gradient(180deg, #f8fafe 0%, #f1f5fa 42%, #edf1f6 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.sidebar-open {
  overflow: hidden;
}

.app {
  width: min(1360px, calc(100vw - 24px));
  margin: 0 auto;
  min-height: 100vh;
  padding: calc(16px + env(safe-area-inset-top)) 0 calc(110px + env(safe-area-inset-bottom));
}

.page {
  display: none;
  min-width: 0;
  overflow-x: clip;
}

.page.active {
  display: block;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding: 18px 20px;
  position: sticky;
  top: 0;
  z-index: 12;
  backdrop-filter: var(--blur);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(247, 249, 253, 0.78) 100%);
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 30px;
  box-shadow: var(--shadow-sm);
}

.topbar h1 {
  margin: 0;
  font-size: clamp(34px, 3vw, 46px);
  font-weight: 760;
  letter-spacing: -0.042em;
  line-height: 1.05;
}

.topbar p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 15px;
  letter-spacing: -0.014em;
}

.topbar-copy {
  min-width: 0;
  flex: 1;
}

.topbar-copy h1,
.topbar-copy p {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.device-tag {
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 113, 227, 0.12);
  background: rgba(0, 113, 227, 0.06);
  color: #0b63ce;
  font-size: 12px;
  font-weight: 600;
}

.menu-btn {
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(244, 247, 252, 0.92) 100%);
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: var(--blur);
  box-shadow: var(--shadow-sm);
}

.panel {
  position: relative;
  margin-bottom: 16px;
  padding: 24px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: linear-gradient(180deg, var(--surface-1) 0%, var(--surface-2) 100%);
  backdrop-filter: var(--blur);
  box-shadow: var(--shadow-sm);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 58px;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.44) 0%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

.panel h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 720;
  letter-spacing: -0.03em;
}

.panel-subtext,
.muted {
  color: var(--muted);
}

.panel-subtext {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.6;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.content-area-title {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.muted {
  font-size: 13px;
  line-height: 1.5;
}

input,
textarea,
select {
  width: 100%;
  max-width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  padding: 14px 16px;
  font-size: 15px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

textarea {
  resize: vertical;
  min-height: 120px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(0, 113, 227, 0.38);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
  background: #fff;
}

input[type="checkbox"] {
  width: auto;
  min-width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 10px;
}

.row > * {
  min-width: 0;
}

button {
  appearance: none;
  -webkit-appearance: none;
  max-width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: linear-gradient(180deg, #0a84ff 0%, #0071e3 100%);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, opacity 0.18s ease;
  box-shadow: 0 10px 24px rgba(0, 113, 227, 0.22);
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

button.ghost {
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
}

button.full {
  width: 100%;
  margin-top: 8px;
}

.chip-btn,
.tiny {
  padding: 8px 14px;
  font-size: 12px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.btn-row.compact {
  gap: 8px;
}

.todo-list,
#clipList,
#qaHistory,
#favoriteList,
#folderList {
  display: grid;
  gap: 10px;
}

.todo-item,
.clip-item,
.history-item,
.model-item,
.favorite-item,
.audit-item {
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 20px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}

.todo-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
}

.todo-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.todo-main span {
  word-break: break-word;
}

.todo-remind {
  color: var(--muted);
  font-size: 12px;
}

.todo-item.done .todo-main span {
  text-decoration: line-through;
  opacity: 0.5;
}

.todo-quick-list {
  margin-top: 4px;
  margin-bottom: 8px;
}

.quick-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.qa-quick {
  white-space: nowrap;
}

.quick-list button,
.qa-quick,
.todo-quick-remind {
  background: rgba(255, 255, 255, 0.78);
  color: #424245;
  border: 1px solid var(--line);
  box-shadow: none;
}

.quick-list button:hover,
.qa-quick:hover,
.todo-quick-remind:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.group-block,
.model-wrap,
.spec-section {
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.8);
  overflow: hidden;
}

.group-block {
  margin-bottom: 12px;
}

.group-head,
.series-head,
.spec-head {
  width: 100%;
  border: 0;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  cursor: pointer;
  box-shadow: none;
}

.group-head {
  padding: 18px 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(244,247,252,0.88) 100%);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.series-block {
  margin-bottom: 8px;
}

.series-head {
  margin-bottom: 8px;
  padding: 12px 18px;
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.group-list,
.series-list {
  display: none;
  gap: 8px;
  padding: 10px;
}

.group-list.open,
.series-list.open {
  display: grid;
}

.model-wrap + .model-wrap {
  margin-top: 8px;
}

.model-wrap.open,
.spec-featured-card.active,
.model-wrap.active {
  box-shadow: var(--shadow-sm);
}

.model-wrap.active {
  border-color: rgba(0, 113, 227, 0.2);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.08), var(--shadow-sm);
}

.model-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 14px 18px;
  min-height: 48px;
  cursor: pointer;
}

.model-title {
  flex: 1;
  min-width: 0;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.level-tag,
.right-col-tag {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.right-col-tag {
  min-width: 120px;
  text-align: right;
}

.model-detail {
  display: none;
  padding: 0 12px 12px;
}

.model-wrap.open .model-detail {
  display: block;
}

.spec-hit-bar {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0 16px;
  padding: 14px 16px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 20px;
  background: rgba(250, 252, 255, 0.96);
}

.spec-hit-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  padding-top: 3px;
}

.spec-hit-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.spec-hit-chip {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #424245;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: none;
}

.spec-hit-chip:hover,
.spec-hit-chip.active {
  background: var(--primary-soft);
  border-color: rgba(0, 113, 227, 0.16);
  color: var(--primary);
}

.spec-hit-empty {
  font-size: 12px;
  color: var(--muted);
}

.spec-desktop-detail {
  max-height: calc(100vh - 220px);
  overflow: auto;
}

.spec-featured-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.spec-featured-card {
  height: 380px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-sm);
}

.spec-featured-card.compact {
  min-height: 0;
}

.spec-featured-head {
  padding: 16px 18px;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(244,247,252,0.88) 100%);
  cursor: pointer;
}

.spec-featured-body {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 16px 18px 18px;
  color: #3a3a3c;
  line-height: 1.68;
  white-space: pre-wrap;
}

.spec-featured-body.has-scroll-more::after {
  content: "继续下滑查看更多";
  position: sticky;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  display: inline-block;
  margin-top: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.detail-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 2px;
}

.answer {
  margin: 10px 0 0;
  white-space: pre-wrap;
  line-height: 1.65;
  font-size: 14px;
}

.answer-card {
  padding: 18px 20px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-sm);
}

.answer-card-subtle {
  background: rgba(250, 250, 252, 0.9);
  box-shadow: none;
}

.answer-empty {
  color: var(--muted);
}

.answer-block,
.answer-list,
.answer-section,
.rag-preview-list,
.rag-doc-parts {
  display: grid;
  gap: 10px;
}

.answer-section-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-transform: uppercase;
}

.answer-section-value {
  color: var(--text);
}

.answer-section-value.is-highlight {
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}

.answer-list-item {
  position: relative;
  padding-left: 15px;
}

.answer-list-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(0, 113, 227, 0.55);
}

.answer-section-value.is-正确答案,
.answer-list.is-正确答案 {
  color: #0b63ce;
  font-weight: 800;
  font-size: 16px;
}

.answer-section-正确答案 {
  padding: 14px 16px;
  border: 1px solid rgba(0, 113, 227, 0.14);
  border-radius: 18px;
  background: rgba(0, 113, 227, 0.06);
}

.answer-section-解析,
.answer-section-考核点 {
  padding-left: 14px;
  border-left: 3px solid rgba(0, 113, 227, 0.18);
}

.qa-meta-box {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(250, 250, 252, 0.9);
}

.qa-meta-box p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.qa-snippets-wrap,
.fold-panel {
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  overflow: hidden;
}

.qa-snippets-wrap {
  margin-top: 12px;
}

.qa-snippets-wrap summary,
.fold-summary {
  cursor: pointer;
  list-style: none;
}

.qa-snippets-wrap summary::-webkit-details-marker,
.fold-summary::-webkit-details-marker {
  display: none;
}

.qa-snippets-wrap summary {
  padding: 14px 16px;
  color: #424245;
  font-size: 13px;
  user-select: none;
}

.qa-hit-snippets {
  padding: 0 16px 14px;
  color: #424245;
  font-size: 13px;
  line-height: 1.6;
}

.qa-page {
  padding-bottom: 88px;
}

.qa-page .panel:first-of-type {
  position: sticky;
  top: 86px;
  z-index: 10;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(244, 247, 252, 0.9) 100%);
  box-shadow: var(--shadow-md);
}

#qaAiProvider,
#qaSourceMode {
  min-height: 48px;
}

#qaAiProvider {
  min-width: 260px;
}

#qaAiModeHint {
  margin-top: 8px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--text);
  font-size: 13px;
}

.checkbox-row input[type="checkbox"],
.toggle-line input[type="checkbox"] {
  accent-color: var(--primary);
}

.chat-row {
  display: flex;
}

.chat-row.user {
  justify-content: flex-end;
}

.chat-row.assistant {
  justify-content: flex-start;
}

.chat-bubble {
  max-width: min(78%, 720px);
  padding: 12px 16px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  line-height: 1.55;
  box-shadow: var(--shadow-sm);
  white-space: pre-wrap;
}

.chat-row.user .chat-bubble {
  background: #1d1d1f;
  color: #fff;
  border-color: transparent;
}

.chat-meta {
  margin-top: 6px;
  color: inherit;
  opacity: 0.62;
  font-size: 11px;
}

#qaHistory {
  margin-top: 10px;
}

#qaBaiduList {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.fold-summary .panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  padding: 14px 18px;
  position: relative;
}

.fold-summary .panel-head::after {
  content: "展开";
  color: var(--muted);
  font-size: 12px;
}

.fold-panel[open] .fold-summary .panel-head::after {
  content: "收起";
}

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(1360px, calc(100vw - 24px));
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: var(--blur);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-bottom: 0;
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  box-shadow: 0 -16px 44px rgba(15, 23, 42, 0.08);
  z-index: 18;
}

.tab {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  color: #424245;
  border: 1px solid var(--line);
  box-shadow: none;
}

.tab.active {
  background: linear-gradient(180deg, #0a84ff 0%, #0071e3 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 12px 28px rgba(0, 113, 227, 0.22);
}

.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(380px, 88vw);
  transform: translateX(-112%);
  transition: transform 0.28s cubic-bezier(.2, .8, .2, 1);
  z-index: 30;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(28px);
  border-right: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-lg);
  color: var(--text);
}

.sidebar.show {
  transform: translateX(0);
}

.sidebar-inner {
  height: 100%;
  overflow-y: auto;
  padding: calc(24px + env(safe-area-inset-top)) 18px calc(18px + env(safe-area-inset-bottom));
}

.sidebar-inner h3 {
  margin: 0 0 16px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.toggle-line {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  column-gap: 10px;
  align-items: start;
  justify-items: start;
  margin: 12px 0;
}

.toggle-line span {
  color: var(--text);
  line-height: 1.5;
}

.sidebar-backdrop,
.mask,
.dock-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.24);
}

.sidebar-backdrop {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 29;
}

.sidebar-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
}

.modal.show {
  display: block;
}

.mask {
  position: absolute;
  background: rgba(17, 17, 17, 0.36);
}

.modal-card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(860px, 92vw);
  max-height: 86vh;
  overflow: hidden;
  border-radius: 32px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(26px);
  box-shadow: var(--shadow-lg);
}

.modal-card header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: var(--blur);
}

.modal-card h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.modal-body {
  padding: 18px 20px 20px;
  overflow: auto;
  max-height: 72vh;
}

.modal-subtitle {
  margin: 14px 0 8px;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.rag-advanced,
.rag-doc-part,
.rag-preview-item {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(250, 250, 252, 0.86);
}

.rag-advanced {
  margin-top: 10px;
  padding: 12px 14px;
}

.rag-advanced summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 600;
}

.rag-preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.rag-preview-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  color: #424245;
  font-size: 12px;
  font-weight: 600;
}

.rag-preview-item,
.rag-doc-part {
  padding: 12px 14px;
}

.rag-preview-item h5,
.rag-doc-part-title {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.rag-preview-item p,
.rag-doc-part-text {
  margin: 0;
  color: #424245;
  line-height: 1.6;
  font-size: 13px;
  white-space: pre-wrap;
}

.rag-preview-warn {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  color: #8a5c00;
  font-size: 12px;
}

.rag-doc-item {
  display: grid;
  gap: 10px;
}

.rag-doc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.rag-doc-title {
  font-weight: 700;
  line-height: 1.35;
}

.rag-doc-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.rag-doc-snippet {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
}

.rag-doc-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex-shrink: 0;
}

.rag-doc-delete-btn {
  color: #c73a3a;
}

.rag-doc-detail {
  display: none;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.rag-doc-item.open .rag-doc-detail {
  display: grid;
}

.rag-doc-fulltext {
  max-height: 280px;
  overflow: auto;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  color: #424245;
  white-space: pre-wrap;
  line-height: 1.65;
  font-size: 13px;
}

.changelog-body {
  color: #3a3a3c;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.spec-section {
  margin-bottom: 10px;
}

.spec-head {
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.84) 0%, rgba(248,248,250,0.84) 100%);
  font-weight: 700;
  letter-spacing: -0.015em;
}

.spec-lines {
  display: none !important;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 14px 14px;
}

.spec-section.open .spec-lines {
  display: flex !important;
}

.spec-line-card {
  width: calc((100% - 24px) / 4);
  flex: 0 0 calc((100% - 24px) / 4);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(250, 250, 252, 0.92);
  color: #424245;
  line-height: 1.6;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
}

.spec-kv {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 8px;
  align-items: start;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(250, 250, 252, 0.92);
}

.spec-kv strong {
  color: var(--muted);
  font-size: 12px;
}

.spec-kv span {
  color: var(--text);
  line-height: 1.55;
}

.voice-preview-block {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.voice-preview-block p {
  margin: 10px 0 0;
  line-height: 1.7;
  word-break: break-word;
}

.voice-translate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.favorite-popup {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(146px + env(safe-area-inset-bottom));
  width: min(460px, 92vw);
  z-index: 23;
  display: none;
  padding: 16px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(26px);
  box-shadow: var(--shadow-lg);
}

.favorite-popup.show {
  display: block;
}

.favorite-item {
  cursor: pointer;
}

.audit-ip {
  color: var(--text);
  font-weight: 700;
}

.audit-sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  word-break: break-all;
}

.float-dock {
  position: fixed;
  right: 18px;
  bottom: calc(92px + env(safe-area-inset-bottom));
  z-index: 22;
}

.dock-mask {
  z-index: 20;
  display: none;
}

.dock-mask.show {
  display: block;
}

.dock-actions {
  display: none;
  margin-bottom: 10px;
}

.dock-actions.show {
  display: grid;
  gap: 8px;
}

.dock-btn {
  border-radius: 999px;
  padding: 12px 16px;
}

.sub-btn {
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.main-btn {
  min-width: 72px;
  background: linear-gradient(180deg, #0a84ff 0%, #0071e3 100%);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(16px);
  opacity: 0;
  pointer-events: none;
  z-index: 99;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(29, 29, 31, 0.92);
  color: #fff;
  font-size: 13px;
  box-shadow: var(--shadow-md);
  transition: all 0.22s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 1023px) {
  .app {
    width: calc(100vw - 20px);
    padding: calc(10px + env(safe-area-inset-top)) 0 calc(102px + env(safe-area-inset-bottom));
  }

  .topbar {
    margin-bottom: 14px;
    padding: 14px 16px;
    border-radius: 24px;
  }

  .topbar h1 {
    font-size: 24px;
  }

  .topbar p {
    font-size: 13px;
  }

  .panel {
    padding: 16px;
    border-radius: 24px;
    margin-bottom: 12px;
  }

  .row {
    grid-template-columns: 1fr;
  }

  .btn-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .btn-row.compact,
  .rag-doc-actions,
  .voice-translate-actions {
    display: flex;
  }

  .chat-bubble {
    max-width: 92%;
  }

  .qa-page .panel:first-of-type {
    top: 70px;
  }

  .tabbar {
    width: 100%;
    border-left: 0;
    border-right: 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

  .float-dock {
    right: 12px;
    bottom: calc(78px + env(safe-area-inset-bottom));
  }

  .favorite-popup {
    bottom: calc(128px + env(safe-area-inset-bottom));
  }

  .spec-featured-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .spec-featured-card {
    height: auto;
    min-height: 0;
  }

  .spec-featured-body {
    max-height: 280px;
  }

  .spec-line-card {
    width: 100%;
    flex: 0 0 100%;
  }

  .spec-hit-bar {
    padding: 12px 14px;
  }

  .modal-card {
    width: 96vw;
    max-height: 90vh;
    border-radius: 26px;
  }
}

@media (min-width: 1024px) {
  .app {
    width: min(1460px, calc(100vw - 40px));
    padding-bottom: 108px;
  }

  #page-specs.page.active {
    display: grid;
    grid-template-columns: minmax(380px, 460px) minmax(0, 1fr);
    gap: 18px;
    align-content: start;
  }

  #page-specs .topbar {
    grid-column: 1 / -1;
    margin-bottom: 0;
  }

  #page-specs .search-panel,
  #page-specs .todo-panel,
  #page-specs .folder-panel {
    grid-column: 1;
  }

  #page-specs .folder-panel,
  #page-specs .spec-detail-panel {
    min-height: 460px;
  }

  #page-specs .folder-panel {
    grid-column: 1;
    grid-row: 4;
    max-height: calc(100vh - 390px);
    overflow: auto;
  }

  #page-specs .spec-detail-panel {
    grid-column: 2;
    grid-row: 2 / span 3;
    min-height: 700px;
    max-height: calc(100vh - 130px);
    overflow: auto;
  }

  #page-specs .todo-panel {
    min-height: 260px;
  }
}

#page-specs .search-panel,
#page-voice .panel:first-of-type,
#page-clip .panel:first-of-type,
.qa-page .panel:first-of-type {
  background:
    radial-gradient(420px 160px at top right, rgba(0, 113, 227, 0.08) 0%, rgba(0, 113, 227, 0) 72%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(244, 247, 252, 0.9) 100%);
}

#page-specs .todo-panel,
#page-specs .folder-panel,
#page-specs .spec-detail-panel,
#page-voice .panel,
#page-clip .panel,
.qa-page .panel {
  backdrop-filter: blur(28px);
}
