:root {
  font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
  color: #0d0d0d;
  background: #f9f9f9;
  font-synthesis: none;
  --background: #f9f9f9;
  --foreground: #0d0d0d;
  --card: #fff;
  --muted: #f0f0f0;
  --muted-foreground: #6b6b6b;
  --accent: #ededed;
  --border: #e3e3e3;
  --input: #dedede;
  --sidebar: #f7f7f8;
  --sidebar-foreground: #262626;
  --sidebar-accent: #ebebeb;
  --destructive: #dc2626;
  --blue: #2563eb;
  --radius: 12px;
  --sidebar-width: 256px;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; }
body { margin: 0; min-width: 320px; overflow: hidden; background: var(--background); }
[hidden], .booting > * { display: none !important; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
button, a { -webkit-tap-highlight-color: transparent; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-sprite { position: fixed; width: 0; height: 0; overflow: hidden; }

input, textarea, select {
  width: 100%;
  color: var(--foreground);
  border: 1px solid var(--input);
  border-radius: 8px;
  outline: 0;
  background: var(--card);
}
input, select { min-height: 40px; padding: 8px 11px; }
textarea { padding: 10px 12px; resize: none; }
input:focus, textarea:focus, select:focus { border-color: #a3a3a3; box-shadow: 0 0 0 3px #0000000d; }
button:focus-visible, a:focus-visible { outline: 2px solid #737373; outline-offset: 2px; }

.primary, .secondary, .danger, .header-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 13px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 550;
}
.primary { color: #fff; background: #171717; }
.primary:hover { background: #303030; }
.secondary, .header-button { color: #404040; border-color: var(--border); background: var(--card); }
.secondary:hover, .header-button:hover { color: var(--foreground); background: var(--accent); }
.danger { color: #fff; background: #b91c1c; }
.danger-text { padding: 7px 10px; border: 0; border-radius: 7px; color: #b91c1c; background: transparent; }
.danger-text:hover { background: #fef2f2; }
.icon-button { display: grid; width: 34px; height: 34px; place-items: center; padding: 0; border: 0; border-radius: 8px; color: var(--muted-foreground); background: transparent; }
.icon-button:hover { color: var(--foreground); background: var(--accent); }
.muted { color: var(--muted-foreground); }
.form-error { min-height: 20px; color: #b91c1c; font-size: 13px; line-height: 1.5; }

/* Tiger 登录页 */
.login-view { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 16px; overflow: auto; background: color-mix(in srgb, var(--muted) 30%, var(--background)); }
.login-card { width: min(448px, 100%); padding: 32px; border: 1px solid var(--border); border-radius: 24px; background: var(--card); box-shadow: 0 22px 55px #00000012; }
.login-heading { text-align: center; }
.login-brand { display: flex; align-items: center; justify-content: center; gap: 10px; }
.login-brand img { width: 64px; height: 64px; object-fit: contain; }
.login-brand h1 { margin: 0; font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif; font-size: 30px; font-weight: 500; }
.login-heading p { margin: 8px 0 0; color: var(--muted-foreground); }
.login-card { display: grid; gap: 8px; }
.login-heading { margin-bottom: 16px; }
.login-card label { display: grid; gap: 4px; color: #404040; font-size: 14px; font-weight: 550; }
.login-card input { min-height: 36px; }
.login-submit { min-height: 36px; }
.auth-mode-toggle { min-height: 32px; border: 0; color: var(--muted-foreground); background: transparent; font-size: 13px; }
.auth-mode-toggle:hover { color: var(--foreground); text-decoration: underline; }
.login-card .form-error:empty { display: none; }

/* Tiger 工作区壳层 */
.app-view { width: 100%; height: 100dvh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); background: var(--background); }
.global-sidebar { min-width: 0; min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--border); background: var(--sidebar); transition: width .2s ease; }
.sidebar-header { height: 56px; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 12px 4px 16px; }
.tiger-brand { min-width: 0; display: flex; align-items: center; gap: 8px; color: var(--foreground); }
.tiger-brand img { width: 32px; height: 32px; flex: none; object-fit: contain; }
.tiger-brand span { overflow: hidden; font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif; font-size: 20px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-main-nav { padding: 2px 8px 8px; display: grid; gap: 2px; }
.sidebar-nav-item, .conversation-item, .sidebar-settings, .settings-menu button {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  color: var(--muted-foreground);
  background: transparent;
  text-align: left;
  font-size: 14px;
}
.sidebar-nav-item:hover, .sidebar-nav-item.active, .conversation-item:hover, .conversation-item.active, .sidebar-settings:hover { color: var(--sidebar-foreground); background: var(--sidebar-accent); }
.sidebar-nav-item svg, .sidebar-settings > svg:first-child { width: 18px; height: 18px; flex: none; }
.sidebar-nav-item span, .conversation-item span, .sidebar-settings span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-section { min-height: 0; flex: 1; padding: 14px 8px 8px; overflow: hidden; }
.recent-section h2 { margin: 0 10px 8px; color: #858585; font-size: 12px; font-weight: 500; }
.conversation-list { height: calc(100% - 28px); display: grid; align-content: start; gap: 2px; overflow: auto; scrollbar-width: thin; }
.conversation-item { position: relative; min-height: 36px; }
.conversation-item::before { width: 4px; height: 4px; flex: none; border-radius: 50%; background: #a3a3a3; content: ""; }
.conversation-empty { margin: 12px 10px; color: #a3a3a3; font-size: 12px; }
.sidebar-footer { position: relative; flex: 0 0 auto; margin-top: auto; padding: 8px; }
.sidebar-settings .chevrons { width: 16px; height: 16px; margin-left: auto; }
.settings-menu { position: absolute; z-index: 45; right: 8px; bottom: 54px; left: 8px; padding: 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); box-shadow: 0 16px 42px #0002; }
.settings-user { min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px; }
.settings-user > span:last-child { min-width: 0; display: grid; gap: 2px; }
.settings-user strong, .settings-user small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-user strong { font-size: 13px; }
.settings-user small { color: var(--muted-foreground); font-size: 11px; }
.user-avatar { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #171717; }
.user-avatar svg { width: 16px; }
.settings-quota { margin: 2px 8px 6px; padding: 7px 9px; border-radius: 7px; color: #525252; background: var(--muted); font-size: 12px; }
.settings-menu button { min-height: 36px; }
.settings-menu button:last-child { margin-top: 4px; border-top: 1px solid var(--border); border-radius: 0 0 7px 7px; }
.workspace-main { min-width: 0; min-height: 0; position: relative; overflow: hidden; }
.route-panel { width: 100%; height: 100%; }
.mobile-sidebar-button { display: none; }

.sidebar-collapsed .app-view { --sidebar-width: 56px; }
.sidebar-collapsed .sidebar-header { justify-content: center; padding: 4px; }
.sidebar-collapsed .tiger-brand { display: none; }
.sidebar-collapsed .sidebar-main-nav { padding-inline: 7px; }
.sidebar-collapsed :is(.sidebar-nav-item, .sidebar-settings) { justify-content: center; padding-inline: 0; }
.sidebar-collapsed :is(.sidebar-nav-item span, .sidebar-settings span, .sidebar-settings .chevrons, .recent-section) { display: none; }
.sidebar-collapsed .settings-menu { width: 232px; right: auto; left: 48px; bottom: 8px; }

/* Tiger 对话与原文侧栏 */
.chat-workspace { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); background: var(--card); }
.chat-workspace.preview-open { grid-template-columns: minmax(420px, 1fr) minmax(400px, 34vw); }
.chat-shell { min-width: 0; min-height: 0; display: grid; grid-template-rows: 56px minmax(0, 1fr) auto; background: var(--card); }
.chat-header { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 20px; border-bottom: 1px solid var(--border); }
.chat-header h1 { min-width: 0; margin: 0; overflow: hidden; font-size: 16px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.chat-header-actions { flex: none; display: flex; align-items: center; gap: 8px; }
.quota-pill { min-height: 34px; display: inline-flex; align-items: center; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted-foreground); background: var(--card); font-size: 13px; }
.header-button { border-color: transparent; font-weight: 450; }
.header-button svg { width: 17px; }
.message-list { min-height: 0; padding: 24px max(24px, calc((100% - 860px) / 2)); overflow: auto; scrollbar-gutter: stable; }
.chat-empty { min-height: 100%; display: grid; place-content: center; text-align: center; }
.chat-empty h2 { margin: 0; font-size: 25px; font-weight: 500; letter-spacing: -.02em; }
.chat-empty p { margin: 10px 0 0; color: var(--muted-foreground); font-size: 14px; }
.message { width: 100%; margin: 0 auto 28px; display: flex; }
.message.user { justify-content: flex-end; }
.message-body { max-width: 88%; color: var(--foreground); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; line-height: 1.75; }
.message.user .message-body { max-width: 72%; padding: 10px 15px; border-radius: 16px 16px 4px 16px; background: var(--accent); }
.message.assistant .message-body { width: 100%; white-space: normal; }
.message.assistant .message-body.stream-status { color: var(--muted-foreground); }
.message.assistant .message-body.stream-status::after { content: ""; display: inline-block; width: 5px; height: 5px; margin-left: 7px; border-radius: 50%; background: currentColor; animation: stream-status-pulse 1s ease-in-out infinite; vertical-align: middle; }
@keyframes stream-status-pulse { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }
.message-markdown { min-width: 0; overflow-wrap: anywhere; }
.message-markdown > :first-child { margin-top: 0; }
.message-markdown > :last-child { margin-bottom: 0; }
.message-markdown p { margin: 0 0 14px; }
.message-markdown .answer-highlight { display: inline-block; margin: 3px 0 8px; padding: 7px 12px; border: 1px solid #f4c95d; border-radius: 9px; color: #713f12; background: #fff7d6; font-weight: 700; }
.message-markdown p.answer-highlight, .message-markdown h1.answer-highlight, .message-markdown h2.answer-highlight, .message-markdown h3.answer-highlight, .message-markdown h4.answer-highlight, .message-markdown h5.answer-highlight, .message-markdown h6.answer-highlight { display: block; width: fit-content; max-width: 100%; }
.message-markdown h1, .message-markdown h2, .message-markdown h3, .message-markdown h4, .message-markdown h5, .message-markdown h6 { margin: 20px 0 8px; line-height: 1.35; font-weight: 650; }
.message-markdown h1 { font-size: 1.45em; }
.message-markdown h2 { font-size: 1.3em; }
.message-markdown h3 { font-size: 1.16em; }
.message-markdown ul, .message-markdown ol { margin: 0 0 14px; padding-left: 26px; }
.message-markdown li + li { margin-top: 4px; }
.message-markdown blockquote { margin: 0 0 14px; padding: 2px 14px; border-left: 3px solid #c7c7c7; color: #525252; }
.message-markdown hr { margin: 18px 0; border: 0; border-top: 1px solid var(--border); }
.message-markdown pre { max-width: 100%; margin: 0 0 14px; padding: 12px 14px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; color: #f5f5f5; background: #202020; line-height: 1.55; white-space: pre; }
.message-markdown pre code { font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre; }
.markdown-inline-code { padding: 2px 5px; border-radius: 5px; color: #404040; background: var(--muted); font: .88em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.markdown-math-inline { display: inline-block; max-width: 100%; margin: 0 2px; overflow-x: auto; overflow-wrap: normal; white-space: nowrap; vertical-align: middle; }
.markdown-math-display { max-width: 100%; margin: 10px 0 16px; overflow-x: auto; overflow-y: hidden; overflow-wrap: normal; text-align: center; white-space: nowrap; }
.markdown-math-display .katex-display { margin: 0; }
.markdown-link { color: var(--blue); text-decoration: underline; text-decoration-color: #93c5fd; text-underline-offset: 2px; }
.markdown-image { max-width: min(100%, 520px); max-height: 420px; margin: 4px 0 12px; object-fit: contain; border: 1px solid var(--border); border-radius: 10px; }
.message-markdown table { width: 100%; max-width: 100%; margin: 0 0 14px; display: block; overflow-x: auto; border-collapse: collapse; font-size: 14px; }
.message-markdown th, .message-markdown td { min-width: 100px; padding: 7px 10px; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.message-markdown th { color: #404040; background: var(--muted); font-weight: 650; }
.message-attachments, .citation-images { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.message-attachments img, .citation-images img { width: 132px; height: 96px; display: block; object-fit: cover; border: 1px solid var(--border); border-radius: 10px; background: var(--muted); }
.citation-images a { display: grid; gap: 4px; color: var(--muted-foreground); font-size: 11px; text-decoration: none; }
.citation-images span { max-width: 132px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.citation-ref { display: inline-flex; min-width: 28px; height: 26px; align-items: center; justify-content: center; margin: 0 2px; padding: 0 8px; border: 1px solid #bfdbfe; border-radius: 9px; color: var(--blue); background: #eff6ff; font-size: 13px; vertical-align: baseline; }
.citation-ref:hover, .citation-ref.active { border-color: #93c5fd; background: #dbeafe; }
.composer-wrap { padding: 8px max(22px, calc((100% - 900px) / 2)) 22px; background: linear-gradient(transparent, var(--card) 20%); }
.composer { min-height: 124px; display: grid; grid-template-rows: auto minmax(52px, auto) 44px; padding: 10px 12px 8px; border: 1px solid var(--border); border-radius: 22px; background: var(--card); box-shadow: 0 5px 20px #0000000d; }
.composer textarea { max-height: 160px; padding: 7px 6px; border: 0; box-shadow: none; font-size: 16px; line-height: 1.5; }
.composer-footer { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.composer-tools { min-width: 0; display: flex; align-items: center; gap: 5px; }
.composer-icon-button { width: 36px; height: 36px; flex: none; display: grid; place-items: center; padding: 0; border: 0; border-radius: 10px; color: #404040; background: transparent; }
.composer-icon-button:hover { background: var(--accent); }
.composer-icon-button svg { width: 18px; }
.chat-image-preview { min-width: 0; display: flex; gap: 8px; padding: 2px 4px 7px; overflow-x: auto; }
.chat-image-preview[hidden] { display: none; }
.pending-image { position: relative; width: 72px; height: 58px; flex: none; }
.pending-image img { width: 100%; height: 100%; object-fit: cover; border: 1px solid var(--border); border-radius: 9px; }
.pending-image button { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; display: grid; place-items: center; padding: 0; border: 1px solid #fff; border-radius: 50%; color: #fff; background: #262626; }
.pending-image button svg { width: 11px; }
.scope-picker { position: relative; min-width: 0; }
.scope-trigger { max-width: min(280px, 56vw); height: 36px; display: flex; align-items: center; gap: 7px; padding: 0 11px; border: 0; border-radius: 10px; color: #404040; background: var(--muted); }
.scope-trigger:hover { background: var(--accent); }
.scope-trigger svg { width: 17px; flex: none; }
.scope-trigger span { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.scope-trigger .chevron { width: 14px; }
.scope-menu { position: absolute; z-index: 35; bottom: 44px; left: 0; width: min(320px, calc(100vw - 42px)); max-height: min(380px, 55vh); padding: 7px; overflow: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--card); box-shadow: 0 18px 48px #0002; }
.scope-menu-heading { padding: 7px 9px; color: var(--muted-foreground); font-size: 12px; font-weight: 550; }
.scope-options { display: grid; gap: 2px; }
.scope-option { min-width: 0; display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: center; gap: 9px; padding: 8px 9px; border-radius: 8px; color: #404040; font-size: 13px; }
.scope-option:hover { background: var(--accent); }
.scope-option input { width: 16px; min-height: 16px; padding: 0; accent-color: #171717; }
.scope-option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.send-button { width: 38px; height: 38px; flex: none; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; color: #fff; background: #171717; }
.send-button:hover { background: #303030; }

.citation-preview { min-width: 0; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr); border-left: 1px solid var(--border); background: var(--card); }
.citation-preview.fullscreen { position: fixed; z-index: 90; inset: 0; border: 0; }
.citation-preview > :not(iframe) { display: none; }
.preview-header { min-width: 0; min-height: 60px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.preview-header > div:first-child { min-width: 0; }
.preview-header h2, .preview-header p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-header h2 { margin: 0; font-size: 14px; font-weight: 650; }
.preview-header p { margin: 4px 0 0; color: var(--muted-foreground); font-size: 11px; }
.preview-actions { flex: none; display: flex; gap: 2px; }
.preview-actions a { text-decoration: none; }
.preview-toolbar { height: 48px; display: flex; align-items: center; gap: 8px; padding: 0 14px; border-bottom: 1px solid var(--border); color: var(--muted-foreground); font-size: 13px; }
.preview-toolbar strong { color: var(--foreground); font-weight: 550; }
.preview-toolbar .icon-button { border: 1px solid var(--border); }
.citation-preview iframe { width: 100%; height: 100%; border: 0; background: #f5f5f5; }

/* Tiger 知识管理裁剪版 */
.knowledge-workspace { min-height: 0; display: block; background: var(--background); }
.business-frame { width: 100%; height: 100%; display: block; border: 0; background: var(--card); }
.knowledge-sidebar { min-width: 0; min-height: 0; padding: 14px 8px 10px; overflow: auto; border-right: 1px solid var(--border); background: var(--sidebar); }
.module-sidebar-heading { min-height: 32px; padding: 0 8px 6px; display: flex; align-items: center; }
.module-sidebar-heading h2, .knowledge-sidebar > h3 { margin: 0; color: color-mix(in srgb, var(--sidebar-foreground) 70%, transparent); font-size: 12px; font-weight: 500; }
.space-card { min-height: 54px; display: flex; align-items: center; gap: 9px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; color: var(--sidebar-foreground); background: var(--card); box-shadow: 0 5px 14px #0000000a; }
.space-card > svg { width: 17px; flex: none; color: var(--muted-foreground); }
.space-card span { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.space-card strong, .space-card small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.space-card strong { font-size: 14px; }
.space-card small { color: var(--muted-foreground); font-size: 10px; }
.create-dataset { width: 100%; margin: 12px 0; }
.knowledge-sidebar > h3 { padding: 10px 8px 5px; }
.dataset-list { display: grid; gap: 2px; }
.dataset-button { min-width: 0; min-height: 40px; display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; align-items: center; padding: 7px 9px; border: 0; border-radius: 7px; color: var(--muted-foreground); background: transparent; text-align: left; }
.dataset-button:hover, .dataset-button.active { color: var(--sidebar-foreground); background: var(--accent); }
.dataset-button > svg { width: 16px; }
.dataset-button > span { min-width: 0; display: grid; gap: 2px; }
.dataset-button strong, .dataset-button small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dataset-button strong { font-size: 13px; }
.dataset-button small { color: var(--muted-foreground); font-size: 10px; }
.knowledge-content { min-width: 0; min-height: 0; padding: 28px; overflow: auto; background: var(--background); }
.module-empty { min-height: 100%; display: grid; place-content: center; justify-items: center; color: var(--muted-foreground); text-align: center; }
.module-empty > svg { width: 42px; height: 42px; margin-bottom: 12px; stroke-width: 1.5; }
.module-empty h2 { margin: 0; color: var(--foreground); font-size: 20px; font-weight: 600; }
.module-empty p { margin: 8px 0 0; }
.module-header, .content-card-heading, .settings-page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.module-header { margin-bottom: 20px; }
.eyebrow { margin: 0 0 5px; color: var(--muted-foreground); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.module-header h1 { margin: 0; font-size: 24px; font-weight: 650; }
.module-header > div:first-child > p:last-child { max-width: 720px; margin: 6px 0 0; color: var(--muted-foreground); line-height: 1.55; }
.module-actions { flex: none; }
.upload-form { margin-bottom: 18px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.file-picker { min-width: 0; height: 42px; display: flex; align-items: center; gap: 9px; padding: 0 12px; overflow: hidden; border: 1px dashed #bdbdbd; border-radius: 8px; color: var(--muted-foreground); background: var(--card); cursor: pointer; }
.file-picker:hover { border-color: #737373; }
.file-picker svg { flex: none; }
.file-picker span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-picker input { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; opacity: 0; pointer-events: none; }
.content-card { margin-bottom: 18px; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: var(--card); }
.content-card-heading { padding: 16px 18px; border-bottom: 1px solid var(--border); }
.content-card-heading h2, .content-card-heading p { margin: 0; }
.content-card-heading h2 { font-size: 16px; font-weight: 650; }
.content-card-heading p { margin-top: 4px; color: var(--muted-foreground); font-size: 12px; }
.document-list { min-width: 0; overflow-x: auto; }
.document-table { width: 100%; min-width: 720px; border-collapse: collapse; }
.document-table th, .document-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: left; font-size: 13px; }
.document-table tr:last-child td { border-bottom: 0; }
.document-table th { color: var(--muted-foreground); background: #fafafa; font-size: 12px; font-weight: 550; }
.document-name { max-width: 360px; display: flex; align-items: center; gap: 8px; }
.document-name svg { width: 17px; flex: none; color: #dc2626; }
.document-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-message { max-width: 260px; overflow: hidden; color: var(--muted-foreground); text-overflow: ellipsis; white-space: nowrap; }
.document-actions { display: flex; gap: 6px; }
.document-actions :is(button, a) { min-height: 30px; padding: 5px 8px; font-size: 12px; text-decoration: none; }
.status { display: inline-flex; min-height: 24px; align-items: center; padding: 2px 8px; border-radius: 999px; color: #525252; background: var(--muted); font-size: 11px; white-space: nowrap; }
.status.ready { color: #166534; background: #dcfce7; }
.status.failed { color: #991b1b; background: #fee2e2; }
.status.processing, .status.queued { color: #854d0e; background: #fef9c3; }
.document-empty { padding: 48px 20px; color: var(--muted-foreground); text-align: center; }
.members-section { overflow: visible; }
.member-list { padding: 8px 18px 16px; }
.member-row { min-width: 0; display: grid; grid-template-columns: 22px minmax(0, 1fr) 140px; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.member-row:last-child { border-bottom: 0; }
.member-row input { width: 16px; min-height: 16px; padding: 0; accent-color: #171717; }
.member-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-row select { min-height: 34px; }

/* Tiger 设置菜单中的用户权限 */
.access-workspace { position: fixed; z-index: 70; inset: 0; overflow: hidden; background: var(--card); }
.fullscreen-close { position: fixed; z-index: 75; top: 18px; right: 18px; border: 1px solid var(--border); background: var(--card); }
.settings-shell { width: 100%; height: 100%; min-height: 640px; display: flex; flex-direction: column; padding: 32px; background: var(--card); }
.settings-heading { margin-bottom: 22px; }
.settings-heading h1, .settings-heading p { margin: 0; }
.settings-heading h1 { font-size: 22px; font-weight: 650; }
.settings-heading p, .settings-page-heading p { margin-top: 4px; color: #737373; font-size: 14px; line-height: 1.5; }
.settings-grid { min-height: 0; flex: 1; display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; }
.settings-nav { min-height: 0; padding: 12px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; background: #fafafa; }
.settings-nav button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 0; border-radius: 6px; color: #737373; background: transparent; font-size: 15px; font-weight: 550; text-align: left; }
.settings-nav button + button { margin-top: 4px; }
.settings-nav button:hover { color: #171717; background: var(--muted); }
.settings-nav button.active { color: #fff; background: #171717; }
.settings-nav svg { width: 20px; height: 20px; }
.settings-content { min-width: 0; min-height: 0; padding: 28px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; background: var(--card); }
.settings-page-heading { margin-bottom: 18px; }
.settings-page-heading h2 { margin: 0; font-size: 20px; font-weight: 650; }
.user-table { min-width: 0; overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
.user-table table { width: 100%; min-width: 860px; border-collapse: collapse; }
.user-table th, .user-table td { padding: 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.user-table tr:last-child td { border-bottom: 0; }
.user-table th { color: var(--muted-foreground); background: #fafafa; font-size: 12px; font-weight: 550; }
.user-table td { font-size: 13px; }
.user-table td:first-child { min-width: 200px; }
.user-table input, .user-table select { min-width: 110px; min-height: 36px; }
.user-table small { display: block; margin-top: 4px; overflow: hidden; color: var(--muted-foreground); text-overflow: ellipsis; white-space: nowrap; }
.user-table .save-user { min-height: 32px; padding-block: 5px; }
.quota-event-list { overflow: hidden; border: 1px solid var(--border); border-radius: 10px; }
.quota-event { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.quota-event:last-child { border-bottom: 0; }
.quota-event span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Tiger 浮层与提示 */
dialog { width: min(520px, calc(100% - 30px)); max-height: calc(100dvh - 30px); padding: 0; overflow: auto; border: 1px solid var(--border); border-radius: 14px; color: var(--foreground); background: var(--card); box-shadow: 0 28px 85px #0000003d; }
dialog::backdrop { background: #17171747; backdrop-filter: blur(2px); }
.dialog-card { display: grid; gap: 18px; padding: 22px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dialog-heading h2 { margin: 5px 0 0; font-size: 20px; font-weight: 650; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; }
.dialog-fields { display: grid; gap: 14px; }
.dialog-fields label { display: grid; gap: 7px; color: #404040; font-size: 14px; font-weight: 550; }
.dialog-fields textarea { min-height: 96px; resize: vertical; }
.warning { margin: 0; padding: 11px 12px; border-radius: 8px; color: #78350f; background: #fff7ed; font-size: 13px; line-height: 1.55; }
.toast { position: fixed; z-index: 100; right: 22px; bottom: 22px; max-width: min(420px, calc(100% - 44px)); padding: 12px 16px; border-radius: 10px; color: #fff; background: #262626; box-shadow: 0 14px 42px #0003; opacity: 0; pointer-events: none; transform: translateY(12px); transition: .18s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #991b1b; }
.sidebar-backdrop { position: fixed; z-index: 39; inset: 0; background: #0004; }

@media (max-width: 1080px) {
  .chat-workspace.preview-open { grid-template-columns: minmax(380px, 1fr) minmax(340px, 42vw); }
  .knowledge-workspace { grid-template-columns: 220px minmax(0, 1fr); }
  .knowledge-content { padding: 20px; }
}

@media (max-width: 820px) {
  .app-view { grid-template-columns: minmax(0, 1fr); }
  .global-sidebar { position: fixed; z-index: 40; inset: 0 auto 0 0; width: min(280px, calc(100vw - 52px)); box-shadow: 16px 0 50px #0002; transform: translateX(-105%); }
  .mobile-sidebar-open .global-sidebar { transform: translateX(0); }
  .sidebar-collapsed .app-view { --sidebar-width: 256px; }
  .sidebar-collapsed .sidebar-header { justify-content: space-between; padding: 4px 12px 4px 16px; }
  .sidebar-collapsed .tiger-brand { display: flex; }
  .sidebar-collapsed .sidebar-main-nav { padding-inline: 8px; }
  .sidebar-collapsed :is(.sidebar-nav-item, .sidebar-settings) { justify-content: flex-start; padding-inline: 10px; }
  .sidebar-collapsed :is(.sidebar-nav-item span, .sidebar-settings span, .sidebar-settings .chevrons, .recent-section) { display: flex; }
  .sidebar-collapsed .recent-section { display: block; }
  .sidebar-collapsed .settings-menu { width: auto; right: 8px; bottom: 54px; left: 8px; }
  .chat-header { padding-left: 58px; }
  .mobile-sidebar-button { position: fixed; z-index: 30; top: 11px; left: 12px; display: grid; border: 1px solid var(--border); background: var(--card); }
  .chat-workspace.preview-open { grid-template-columns: minmax(0, 1fr); }
  .chat-workspace.preview-open .chat-shell { display: none; }
  .citation-preview { border-left: 0; }
  .knowledge-workspace { grid-template-columns: minmax(0, 1fr); }
  .knowledge-sidebar { display: none; }
  .knowledge-content { padding: 64px 14px 18px; }
  .settings-shell { padding: 24px 16px; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-nav { display: flex; min-height: auto; overflow-x: auto; }
  .settings-nav button { width: auto; flex: none; padding: 10px 12px; }
  .settings-content { padding: 20px 14px; }
}

@media (max-width: 560px) {
  .login-card { padding: 26px 22px; border-radius: 20px; }
  .chat-header-actions .header-button span { display: none; }
  .quota-pill { display: none; }
  .message-list { padding: 20px 14px; }
  .message-body { font-size: 15px; }
  .message.user .message-body { max-width: 88%; }
  .composer-wrap { padding: 8px 10px 12px; }
  .composer { min-height: 116px; border-radius: 18px; }
  .module-header, .content-card-heading, .settings-page-heading { flex-direction: column; }
  .upload-form { grid-template-columns: 1fr; }
  .member-row { grid-template-columns: 22px minmax(0, 1fr); }
  .member-row select { grid-column: 2; }
  .settings-heading { padding-right: 44px; }
  .settings-shell { min-height: 100%; }
  .settings-nav button { font-size: 13px; }
  .settings-nav svg { width: 17px; }
}
