:root {
  --bg: #f3f1ec;
  --paper: #fff;
  --paper-soft: #faf9f6;
  --ink: #202522;
  --muted: #6c746f;
  --line: #dddeda;
  --line-strong: #c9ccc7;
  --accent: #c75c35;
  --accent-dark: #914022;
  --green: #2f7458;
  --amber: #9e681c;
  --red: #a43e35;
  --shadow: 0 22px 60px rgba(32, 37, 34, .15);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { min-height: 100vh; background: var(--bg); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid rgba(199,92,53,.25); outline-offset: 2px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); line-height: 1.6; }
.eyebrow { margin: 0 0 8px; color: var(--accent-dark); font-size: 10px; font-weight: 800; letter-spacing: .17em; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(29px, 4vw, 42px); line-height: 1.1; letter-spacing: -.045em; }
.lead { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.brand-mark { width: 52px; height: 52px; display: grid; place-items: center; color: white; background: var(--accent); font-weight: 850; letter-spacing: -.04em; }
.brand-mark.small { width: 35px; height: 35px; flex: 0 0 35px; font-size: 12px; }
.primary, .secondary, .text-button, .icon-button { border: 0; cursor: pointer; }
.primary { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 0 17px; background: var(--accent); color: white; text-decoration: none; font-weight: 750; }
.primary:hover { background: var(--accent-dark); }
.secondary { min-height: 38px; padding: 0 13px; border: 1px solid var(--line-strong); background: white; font-weight: 700; }
.secondary:hover { background: var(--paper-soft); }
.text-button { padding: 8px; background: transparent; color: var(--muted); }
.text-button:hover { color: var(--accent-dark); }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; background: transparent; color: var(--muted); font-size: 19px; }
.icon-button:hover { background: var(--paper-soft); color: var(--ink); }
.full { width: 100%; }

.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; background-color: #ebe8e1; background-image: linear-gradient(rgba(255,255,255,.55) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.55) 1px,transparent 1px); background-size: 32px 32px; }
.login-card { width: min(430px,100%); padding: 42px; border: 1px solid var(--line); background: var(--paper); box-shadow: var(--shadow); }
.login-card .eyebrow { margin-top: 23px; }
.login-card form { display: grid; gap: 16px; margin-top: 28px; }
label { display: grid; gap: 7px; color: #4e5551; font-size: 11px; font-weight: 750; }
input, select, textarea { border: 1px solid var(--line-strong); background: white; color: var(--ink); }
input, select { min-height: 42px; padding: 0 12px; }
textarea { min-height: 98px; resize: vertical; padding: 11px 12px; line-height: 1.55; }
.form-error { min-height: 18px; margin: -3px 0 0; color: var(--red); font-size: 12px; }
.demo-hint { margin: 16px 0 0; padding: 10px 12px; border: 1px solid #ead5b0; background: #fff7e9; color: #795018; font-size: 12px; }

.topbar { height: 66px; display: grid; grid-template-columns: 210px minmax(420px, 1fr) auto; align-items: center; gap: 20px; padding: 0 24px; position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand > span:last-child { display: grid; }
.brand strong { font-size: 14px; }
.brand small { color: var(--muted); font-size: 10px; }
.main-nav { height: 100%; display: flex; justify-content: center; }
.main-nav button { min-width: 100px; padding: 0 16px; position: relative; border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 720; cursor: pointer; }
.main-nav button:hover { color: var(--ink); }
.main-nav button.active { color: var(--ink); }
.main-nav button.active::after { content: ""; height: 3px; position: absolute; left: 16px; right: 16px; bottom: 0; background: var(--accent); }
.nav-badge { min-width: 18px; height: 18px; display: inline-grid; place-items: center; margin-left: 3px; border-radius: 9px; background: var(--accent); color: white; font-size: 9px; }
.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.connection { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.connection i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(47,116,88,.12); }
.connection.offline i { background: var(--red); box-shadow: 0 0 0 4px rgba(164,62,53,.12); }
.user-pill { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border: 0; background: var(--paper-soft); text-align: left; cursor: pointer; }
.user-pill > span:first-child { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: white; font-size: 10px; font-weight: 800; }
.user-pill > span:last-child { display: grid; }
.user-pill strong { font-size: 10px; }
.user-pill small { color: var(--muted); font-size: 9px; }
.nav-toggle { display: none; }

.page { width: min(1440px,100%); margin: auto; padding: 42px clamp(20px,4vw,60px) 70px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.metric-grid { display: grid; grid-template-columns: repeat(5,minmax(120px,1fr)); gap: 10px; margin: 26px 0 22px; }
.metric { min-height: 92px; padding: 16px 17px; border: 1px solid var(--line); background: var(--paper); }
.metric span { color: var(--muted); font-size: 10px; }
.metric strong { display: block; margin-top: 5px; font-size: 27px; letter-spacing: -.04em; }
.metric small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.metric.attention { border-top: 3px solid var(--amber); }
.filter-bar { display: grid; grid-template-columns: minmax(280px,1.8fr) repeat(3,minmax(145px,.8fr)) auto; align-items: end; gap: 10px; padding: 15px; border: 1px solid var(--line); background: var(--paper); }
.filter-bar label span { color: var(--muted); }
.clear-filter { min-height: 42px; }
.result-meta { min-height: 45px; display: flex; justify-content: space-between; align-items: center; gap: 20px; color: var(--muted); font-size: 10px; }

.query-list { border: 1px solid var(--line); background: var(--paper); }
.query-card { padding: 18px 20px; display: grid; grid-template-columns: minmax(250px,1.5fr) minmax(180px,.75fr) minmax(230px,1fr) auto; align-items: center; gap: 18px; border-bottom: 1px solid #e9e9e5; cursor: pointer; }
.query-card:last-child { border-bottom: 0; }
.query-card:hover { background: #fbfaf7; box-shadow: inset 3px 0 var(--accent); }
.query-card.return-highlight { animation: query-return-highlight 2s ease-out; box-shadow: inset 4px 0 var(--accent); }
@keyframes query-return-highlight {
  0%, 35% { background: #fff1c9; }
  100% { background: var(--paper); }
}
@media (prefers-reduced-motion: reduce) {
  .query-card.return-highlight { animation: none; background: #fff8e5; }
}
.query-title { min-width: 0; }
.query-title h2 { margin: 6px 0; font-size: 14px; line-height: 1.4; }
.query-title p { display: -webkit-box; margin: 0; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.query-index { color: var(--muted); font: 10px ui-monospace,Consolas,monospace; }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { display: inline-flex; align-items: center; min-height: 22px; padding: 2px 7px; border: 1px solid var(--line); background: var(--paper-soft); color: #4d5450; font-size: 9px; font-weight: 700; }
.tag.good { border-color: #c4dacd; background: #f0f8f3; color: var(--green); }
.tag.warn { border-color: #e7d3af; background: #fff7e9; color: #80551b; }
.tag.bad { border-color: #e3c4c0; background: #fff1ef; color: var(--red); }
.query-fields { min-width: 0; display: grid; gap: 7px; }
.query-fields div { display: grid; grid-template-columns: 58px minmax(0,1fr); gap: 7px; font-size: 10px; }
.query-fields dt { color: var(--muted); }
.query-fields dd { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.path-link, .file-link { padding: 0; border: 0; background: transparent; color: var(--accent-dark); text-align: left; text-decoration: underline; text-decoration-color: rgba(145,64,34,.25); text-underline-offset: 2px; cursor: pointer; }
.query-action { display: grid; justify-items: end; gap: 8px; }
.comment-count { color: var(--muted); font-size: 10px; }
.comment-count.unread { color: var(--accent-dark); font-weight: 800; }
.open-mark { color: var(--accent-dark); font-size: 12px; font-weight: 750; }

.overview-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.panel { padding: 21px; border: 1px solid var(--line); background: var(--paper); }
.panel-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 19px; }
.panel-title h2 { margin: 0; font-size: 15px; }
.panel-title span { color: var(--muted); font-size: 9px; }
.bar-chart { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(90px,1fr) minmax(100px,2fr) 34px; align-items: center; gap: 10px; font-size: 10px; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { width: 100%; height: 7px; border: 0; appearance: none; background: #eeece7; }
.bar-track::-webkit-progress-bar { background: #eeece7; }
.bar-track::-webkit-progress-value { background: var(--accent); }
.bar-track::-moz-progress-bar { background: var(--accent); }
.bar-value { text-align: right; font-weight: 750; }
.exception-panel { margin-top: 14px; }
.exception-item { display: grid; grid-template-columns: 120px 1fr; gap: 15px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 11px; }
.exception-item strong { color: var(--amber); }
.exception-item p { margin: 0; color: var(--muted); line-height: 1.55; }

.comment-tabs { display: flex; gap: 5px; margin: 27px 0 14px; }
.comment-tabs button { min-height: 36px; padding: 0 14px; border: 1px solid var(--line); background: var(--paper); color: var(--muted); cursor: pointer; }
.comment-tabs button.active { border-color: var(--ink); color: var(--ink); font-weight: 750; }
.comment-feed { display: grid; gap: 9px; }
.feed-item { display: grid; grid-template-columns: 170px minmax(0,1fr) auto; gap: 18px; align-items: start; padding: 17px 19px; border: 1px solid var(--line); background: var(--paper); cursor: pointer; }
.feed-item:hover { border-color: var(--line-strong); }
.feed-query strong, .feed-query small { display: block; }
.feed-query strong { margin-bottom: 5px; font-size: 11px; }
.feed-query small { color: var(--muted); font-size: 9px; }
.feed-body p { margin: 5px 0 0; color: #3d4540; font-size: 12px; line-height: 1.6; }
.author { color: var(--muted); font-size: 10px; }
.author b { color: var(--ink); }
.feed-state { display: grid; justify-items: end; gap: 5px; color: var(--muted); font-size: 9px; }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.empty-state { min-height: 260px; display: grid; place-content: center; justify-items: center; padding: 30px; color: var(--muted); text-align: center; }
.empty-state p { margin: 6px; font-size: 11px; }

.files-view { min-height: calc(100vh - 66px); display: grid; grid-template-columns: 250px minmax(0,1fr); }
.file-sidebar { padding: 22px 14px; overflow: auto; border-right: 1px solid var(--line); background: #ebe9e3; }
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 9px 10px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .13em; }
.root-link, .tree-row { width: 100%; display: flex; align-items: center; gap: 8px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.root-link { min-height: 40px; padding: 8px; font-weight: 750; }
.root-link.active, .tree-row.current { background: white; box-shadow: inset 3px 0 var(--accent); }
.tree { margin-top: 8px; }
.tree-row { min-height: 33px; padding: 4px 6px; font-size: 11px; }
.tree-row:hover { background: rgba(255,255,255,.75); }
.tree-caret { width: 18px; flex: 0 0 18px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.tree-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-children { padding-left: 14px; }
.permission-note { margin: 26px 8px 0; padding-top: 16px; border-top: 1px solid var(--line-strong); color: var(--green); font-size: 11px; }
.permission-note p { color: var(--muted); line-height: 1.55; }
.file-content { min-width: 0; padding: 25px clamp(16px,3vw,40px) 50px; }
.file-toolbar { display: grid; grid-template-columns: minmax(220px,1fr) minmax(260px,440px) auto; align-items: center; gap: 12px; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumbs button { padding: 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 700; }
.breadcrumbs button:last-child { color: var(--ink); }
.breadcrumbs span { color: #aaa; }
.file-search { display: flex; }
.file-search input { min-width: 0; flex: 1; }
.file-summary { display: flex; gap: 28px; margin: 19px 0 12px; padding: 13px 16px; border: 1px solid var(--line); background: var(--paper); color: var(--muted); font-size: 10px; }
.file-summary strong { margin-left: 4px; color: var(--ink); font-size: 14px; }
.file-panel { min-height: 430px; border: 1px solid var(--line); background: var(--paper); }
.file-table-head, .file-row { display: grid; grid-template-columns: minmax(260px,1fr) 90px 145px 60px; align-items: center; gap: 12px; }
.file-table-head { min-height: 40px; padding: 0 16px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.file-row { width: 100%; min-height: 58px; padding: 7px 16px; border: 0; border-bottom: 1px solid #ebebe7; background: white; text-align: left; cursor: pointer; }
.file-row:hover { background: var(--paper-soft); }
.file-name { min-width: 0; display: flex; align-items: center; gap: 10px; }
.file-icon { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; background: #f0eee8; color: var(--accent-dark); font-size: 9px; font-weight: 850; }
.file-icon.folder { background: #fff2dc; color: var(--amber); }
.file-name-text { min-width: 0; display: grid; gap: 3px; }
.file-name-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.file-name-text small, .file-size, .file-date, .row-action { color: var(--muted); font-size: 10px; }
.row-action { color: var(--accent-dark); font-weight: 750; }
.loading-state { min-height: 280px; display: grid; place-content: center; justify-items: center; color: var(--muted); font-size: 10px; }
.loading-state i { width: 23px; height: 23px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.mobile-only { display: none; }

.drawer, .preview-drawer, .modal { position: fixed; inset: 0; z-index: 50; }
.drawer-backdrop, .modal-backdrop { position: absolute; inset: 0; background: rgba(32,37,34,.4); backdrop-filter: blur(3px); }
.drawer-card, .preview-card { width: min(720px,94vw); height: 100%; position: absolute; top: 0; right: 0; background: var(--paper); box-shadow: var(--shadow); }
.drawer-header { min-height: 75px; display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; padding: 20px 23px 15px; border-bottom: 1px solid var(--line); }
.drawer-header .eyebrow { margin-bottom: 5px; }
.drawer-header h2 { margin: 0; font-size: 19px; line-height: 1.35; }
.drawer-scroll { height: calc(100% - 75px); overflow: auto; }
.query-detail { padding: 22px 23px; border-bottom: 1px solid var(--line); }
.detail-status { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 19px; }
.detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.detail-grid div { min-width: 0; }
.detail-grid dt { margin-bottom: 5px; color: var(--muted); font-size: 9px; }
.detail-grid dd { margin: 0; font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; }
.detail-grid .wide { grid-column: 1/-1; }
.query-copy { padding: 13px; border-left: 3px solid var(--accent); background: var(--paper-soft); white-space: pre-wrap; }
.link-list { display: flex; flex-wrap: wrap; gap: 7px; }
.link-list button { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.discussion { padding: 22px 23px 35px; }
.discussion-title { display: flex; justify-content: space-between; align-items: center; }
.discussion-title h3 { margin: 0; font-size: 15px; }
.discussion-title span { color: var(--muted); font-size: 10px; }
.thread { margin-top: 14px; padding: 14px; border: 1px solid var(--line); }
.thread.reply { margin: 7px 0 0 34px; background: var(--paper-soft); }
.thread-top { display: flex; justify-content: space-between; gap: 12px; }
.thread .author { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.thread p { margin: 9px 0; color: #343b37; font-size: 12px; line-height: 1.62; white-space: pre-wrap; }
.thread-actions { display: flex; gap: 9px; }
.thread-actions button { padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 9px; cursor: pointer; }
.thread-actions button:hover { color: var(--accent-dark); }
#commentForm { display: grid; gap: 8px; margin-top: 19px; }
#commentForm > div:last-child { display: flex; align-items: center; justify-content: space-between; }
#commentForm small { color: var(--muted); }
.replying { padding: 8px 10px; border: 1px solid #ead5b0; background: #fff7e9; color: #795018; font-size: 10px; }
.preview-card {
  inset: 18px;
  width: auto;
  height: auto;
  display: grid;
  grid-template-rows: auto auto minmax(0,1fr);
  overflow: hidden;
  background: #f7f7f5;
}
.preview-header { min-width: 0; min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 17px; border-bottom: 1px solid var(--line); background: white; }
.preview-title { min-width: 0; display: flex; align-items: center; gap: 12px; }
.preview-title > div { min-width: 0; }
.preview-title h2 { margin: 0 0 3px; overflow: hidden; color: var(--ink); font-size: 16px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.preview-path { margin: 0; overflow: hidden; color: var(--muted); font-size: 9px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.preview-header-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.preview-header-actions .secondary { display: inline-flex; align-items: center; justify-content: center; color: var(--ink); text-decoration: none; }
.preview-meta { min-height: 34px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 20px; padding: 7px 18px; border-bottom: 1px solid var(--line); background: #f4f3ef; color: var(--muted); font-size: 9px; }
.file-badge { flex: 0 0 auto; display: inline-flex; min-width: 42px; height: 42px; align-items: center; justify-content: center; padding: 3px 7px; border: 1px solid #d8ddd9; background: #eef2ef; color: var(--accent-dark); font-size: 9px; font-weight: 850; }
.preview-body { min-width: 0; min-height: 0; overflow: auto; background: #e4e5e3; }
.preview-body > .loading-state { min-height: 100%; display: grid; place-items: center; align-content: center; }
.preview-note { position: sticky; left: 0; bottom: 0; z-index: 8; width: max-content; max-width: calc(100% - 24px); margin: 0 12px 12px auto; padding: 6px 9px; border: 1px solid #e4d2af; background: #fff7e7; color: #795a26; box-shadow: 0 2px 8px rgba(45,48,45,.08); font-size: 9px; }
.text-preview { width: min(1100px,calc(100% - 36px)); min-height: calc(100% - 36px); margin: 18px auto; padding: 24px; border: 1px solid #d6d7d3; background: white; box-shadow: 0 3px 14px rgba(32,37,34,.12); white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.72 ui-monospace,Consolas,monospace; }
.image-preview { display: block; max-width: calc(100% - 36px); max-height: calc(100vh - 150px); margin: 18px auto; object-fit: contain; box-shadow: 0 3px 14px rgba(32,37,34,.12); }
.pdf-preview { display: block; width: 100%; height: 100%; min-height: calc(100vh - 150px); border: 0; background: white; }
.message-preview { width: min(680px,calc(100% - 36px)); margin: 30px auto; padding: 20px; border: 1px solid var(--line); background: white; color: var(--muted); box-shadow: 0 3px 14px rgba(32,37,34,.08); font-size: 11px; line-height: 1.7; }

.document-preview { min-height: 100%; padding: 30px 22px 60px; background: #e4e5e3; }
.word-page { box-sizing: border-box; width: min(816px,100%); min-height: 1056px; margin: 0 auto 25px; padding: 72px 76px; background: white; color: #202020; box-shadow: 0 3px 17px rgba(32,37,34,.16); font-family: Calibri,"Microsoft YaHei",Arial,sans-serif; }
.word-page > :first-child { margin-top: 0; }
.word-page p { margin: 0 0 10px; font-size: 14px; line-height: 1.8; white-space: pre-wrap; }
.word-page h1,.word-page h2,.word-page h3,.word-page h4,.word-page h5,.word-page h6 { margin: 20px 0 10px; color: #191919; line-height: 1.4; }
.word-page h1 { font-size: 25px; }.word-page h2 { font-size: 21px; }.word-page h3 { font-size: 18px; }.word-page h4 { font-size: 16px; }.word-page h5,.word-page h6 { font-size: 14px; }
.word-align-center { text-align: center; }.word-align-right { text-align: right; }.word-align-justify { text-align: justify; }
.word-bold { font-weight: 700; }.word-italic { font-style: italic; }
.word-list { position: relative; padding-left: 20px; }
.word-list::before { content: "•"; position: absolute; left: 4px; }
.word-table { width: 100%; margin: 14px 0 18px; border-collapse: collapse; table-layout: fixed; font-size: 12px; }
.word-table td { padding: 7px 8px; border: 1px solid #707070; line-height: 1.5; vertical-align: top; white-space: pre-wrap; overflow-wrap: anywhere; }
.word-page-break { margin: 32px -76px; border-top: 2px dashed #d2d3cf; color: #969994; font-size: 9px; text-align: center; }
.word-page-break span { position: relative; top: -7px; padding: 0 8px; background: white; }

.ppt-shell { height: 100%; min-height: 0; display: grid; grid-template-columns: 198px minmax(0,1fr); overflow: hidden; background: #dfe1e2; }
.ppt-thumbnails { min-height: 0; overflow: auto; padding: 14px 12px 30px; border-right: 1px solid #c8cac9; background: #f3f3f1; }
.ppt-thumb { width: 100%; display: grid; grid-template-columns: 20px minmax(0,1fr); align-items: start; gap: 5px; margin: 0 0 11px; padding: 4px; border: 2px solid transparent; background: transparent; color: var(--muted); cursor: pointer; }
.ppt-thumb:hover { background: #e9eae6; }
.ppt-thumb.active { border-color: #cb673e; background: white; }
.ppt-thumb-number { padding-top: 2px; font-size: 9px; text-align: center; }
.ppt-thumb .ppt-canvas { width: 100%; box-shadow: 0 1px 5px rgba(32,37,34,.16); }
.ppt-stage { min-width: 0; min-height: 0; display: grid; place-items: center; overflow: auto; padding: 28px; }
.ppt-stage-inner { width: min(1100px,100%); }
.ppt-canvas { display: block; width: 100%; height: auto; background: white; box-shadow: 0 5px 24px rgba(32,37,34,.22); }
.ppt-shape { box-sizing: border-box; width: 100%; height: 100%; overflow: hidden; color: #252525; font: 2.25px/1.25 Calibri,"Microsoft YaHei",Arial,sans-serif; white-space: pre-wrap; overflow-wrap: anywhere; }
.ppt-shape.title { font-size: 4.2px; font-weight: 650; line-height: 1.18; }
.ppt-shape.table { border: .15px solid #777; font-size: 1.9px; }
.ppt-empty { display: grid; place-items: center; width: 100%; height: 100%; color: #8e918e; font-size: 3px; }

.excel-shell { height: 100%; min-height: 0; display: grid; grid-template-rows: 34px minmax(0,1fr) 38px; background: white; }
.excel-formula-bar { display: grid; grid-template-columns: 150px 36px minmax(0,1fr); align-items: center; border-bottom: 1px solid #cfd2cf; background: #f6f7f5; color: #5e625f; font-size: 10px; }
.excel-name-box,.excel-fx,.excel-formula-text { height: 100%; display: flex; align-items: center; padding: 0 10px; border-right: 1px solid #d8dad7; }
.excel-fx { justify-content: center; padding: 0; font-family: Georgia,serif; font-size: 14px; font-style: italic; }
.excel-formula-text { overflow: hidden; border-right: 0; text-overflow: ellipsis; white-space: nowrap; }
.sheet-wrap { min-width: 0; min-height: 0; overflow: auto; background: white; }
.sheet-preview { min-width: 100%; border-collapse: separate; border-spacing: 0; color: #222; font: 11px/1.25 Calibri,"Microsoft YaHei",Arial,sans-serif; table-layout: fixed; }
.sheet-preview th,.sheet-preview td { box-sizing: border-box; height: 25px; border-right: 1px solid #d8dbd8; border-bottom: 1px solid #d8dbd8; }
.sheet-preview thead th { position: sticky; top: 0; z-index: 4; min-width: 96px; padding: 4px 7px; background: #f1f2f0; color: #4e524f; font-weight: 500; text-align: center; }
.sheet-preview td { min-width: 96px; max-width: 210px; padding: 4px 7px; overflow: hidden; background: white; text-overflow: ellipsis; white-space: nowrap; }
.sheet-preview td:hover { outline: 2px solid #18734b; outline-offset: -2px; }
.sheet-preview .row-heading { position: sticky; left: 0; z-index: 3; width: 48px; min-width: 48px; padding: 4px 6px; border-right-color: #c7cac7; background: #f1f2f0; color: #666a67; font-weight: 400; text-align: center; }
.sheet-preview thead .row-heading { top: 0; z-index: 6; }
.formula-cell { color: #234f78; }
.sheet-tabs { min-width: 0; display: flex; align-items: stretch; gap: 1px; overflow-x: auto; padding: 0 10px; border-top: 1px solid #c8ccc9; background: #f3f4f2; }
.sheet-tab { min-width: 90px; padding: 0 14px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: #474c48; font: 10px "Microsoft YaHei",sans-serif; white-space: nowrap; cursor: pointer; }
.sheet-tab:hover { background: #e7e9e6; }
.sheet-tab.active { border-bottom-color: #1b7f54; background: white; color: #155d40; font-weight: 700; }
.sheet-tab.hidden-sheet { color: #999; font-style: italic; }
.modal-card { width: min(760px,94vw); max-height: min(760px,92vh); overflow: auto; position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); background: var(--paper); box-shadow: var(--shadow); padding-bottom: 24px; }
.modal-card > :not(.drawer-header) { margin-left: 23px; margin-right: 23px; }
.member-form { display: grid; grid-template-columns: 1fr 1fr 1.2fr 140px auto; gap: 7px; margin-top: 16px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.member-row { display: grid; grid-template-columns: 1fr 110px 90px auto; align-items: center; gap: 10px; min-height: 55px; border-bottom: 1px solid var(--line); font-size: 11px; }
.member-row small { display: block; color: var(--muted); }
.member-actions { display: flex; justify-content: flex-end; gap: 6px; }
.member-actions button { padding: 5px 7px; border: 1px solid var(--line); background: white; color: var(--muted); font-size: 9px; cursor: pointer; }
.search-overlay { position: fixed; inset: 66px 0 0; z-index: 45; display: grid; place-items: start center; padding: 30px 15px; background: rgba(32,37,34,.4); }
.search-overlay > section { width: min(820px,100%); max-height: calc(100vh - 120px); overflow: auto; background: white; box-shadow: var(--shadow); padding-bottom: 20px; }
.search-overlay > section > :not(.drawer-header) { margin-left: 23px; margin-right: 23px; }
.search-result { width: 100%; min-height: 56px; display: grid; grid-template-columns: 36px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 8px; border: 0; border-top: 1px solid var(--line); background: white; text-align: left; cursor: pointer; }
.search-result strong, .search-result small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result small { color: var(--muted); font-size: 9px; }
.toast { max-width: min(380px,calc(100vw - 30px)); position: fixed; right: 18px; bottom: 18px; z-index: 80; padding: 12px 15px; background: #2c332f; color: white; box-shadow: var(--shadow); font-size: 11px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1050px) {
  .topbar { grid-template-columns: 190px minmax(390px,1fr) auto; padding: 0 15px; gap: 10px; }
  .main-nav button { min-width: 86px; padding: 0 10px; }
  .metric-grid { grid-template-columns: repeat(3,1fr); }
  .filter-bar { grid-template-columns: repeat(3,1fr); }
  .filter-bar .search-field { grid-column: 1/-1; }
  .query-card { grid-template-columns: minmax(250px,1.4fr) minmax(200px,1fr) auto; }
  .query-fields.secondary-fields { display: none; }
  .member-form { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 780px) {
  .topbar { grid-template-columns: 40px 1fr auto; }
  .brand { grid-column: 2; }
  .nav-toggle { display: grid; grid-column: 1; grid-row: 1; }
  .main-nav { height: auto; display: none; position: absolute; top: 66px; left: 0; right: 0; padding: 8px; border-bottom: 1px solid var(--line); background: white; box-shadow: var(--shadow); }
  .main-nav.open { display: grid; grid-template-columns: repeat(2,1fr); }
  .main-nav button { min-height: 43px; }
  .main-nav button.active::after { left: 10px; right: 10px; }
  .connection, .top-actions > .text-button, .user-pill > span:last-child { display: none; }
  .page { padding: 27px 14px 50px; }
  .page-heading { align-items: flex-start; }
  .metric-grid { grid-template-columns: repeat(2,1fr); }
  .filter-bar { grid-template-columns: 1fr; }
  .filter-bar .search-field { grid-column: auto; }
  .result-meta { align-items: flex-start; flex-direction: column; justify-content: center; gap: 3px; }
  .query-card { grid-template-columns: minmax(0,1fr) auto; padding: 16px; }
  .query-fields { grid-column: 1/-1; }
  .query-action { grid-column: 2; grid-row: 1; }
  .overview-grid { grid-template-columns: 1fr; }
  .feed-item { grid-template-columns: 1fr auto; }
  .feed-body { grid-column: 1/-1; }
  .files-view { grid-template-columns: 1fr; }
  .file-sidebar { width: min(290px,88vw); position: fixed; top: 66px; bottom: 0; left: 0; z-index: 40; transform: translateX(-105%); transition: .2s; box-shadow: var(--shadow); }
  .file-sidebar.open { transform: translateX(0); }
  .mobile-only { display: grid; }
  .file-content { padding: 18px 13px 40px; }
  .file-toolbar { grid-template-columns: 36px 1fr auto; }
  .file-search { grid-column: 1/-1; grid-row: 2; }
  .file-table-head { display: none; }
  .file-row { grid-template-columns: minmax(0,1fr) auto; }
  .file-size { display: none; }
  .file-date { grid-column: 1; padding-left: 44px; }
  .row-action { grid-column: 2; grid-row: 1/3; }
  .member-row { grid-template-columns: 1fr auto; }
  .member-row > span:nth-child(2), .member-row > span:nth-child(3) { display: none; }
  .preview-card { inset: 0; }
  .preview-header { min-height: 61px; padding: 9px 11px; gap: 8px; }
  .preview-title { gap: 8px; }
  .preview-title h2 { font-size: 13px; }
  .file-badge { min-width: 36px; height: 36px; }
  .preview-meta { padding: 6px 12px; }
  .preview-meta span:last-child { display: none; }
  .document-preview { padding: 13px 8px 35px; }
  .word-page { min-height: calc(100vh - 130px); padding: 38px 25px; }
  .word-page-break { margin-left: -25px; margin-right: -25px; }
  .ppt-shell { grid-template-columns: 1fr; grid-template-rows: 104px minmax(0,1fr); }
  .ppt-thumbnails { display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden; padding: 7px 9px; border-right: 0; border-bottom: 1px solid #c8cac9; }
  .ppt-thumb { flex: 0 0 142px; grid-template-columns: 17px minmax(0,1fr); margin: 0; }
  .ppt-stage { padding: 10px; }
  .excel-formula-bar { grid-template-columns: 90px 32px minmax(0,1fr); }
}
@media (max-width: 520px) {
  .brand small { display: none; }
  .page-heading { display: grid; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 7px; }
  .metric { min-height: 82px; padding: 13px; }
  .metric strong { font-size: 23px; }
  .query-card { display: grid; gap: 12px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-grid .wide { grid-column: auto; }
  .thread.reply { margin-left: 15px; }
  .bar-row { grid-template-columns: minmax(80px,1fr) 1.5fr 28px; gap: 7px; }
  .exception-item { grid-template-columns: 1fr; gap: 4px; }
  .file-summary { gap: 12px; overflow-x: auto; }
  .file-row { grid-template-columns: minmax(0,1fr); }
  .file-date { padding-left: 44px; }
  .row-action { display: none; }
  .member-form { grid-template-columns: 1fr; }
  .preview-header-actions .secondary { padding-left: 8px; padding-right: 8px; font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation-duration:.01ms!important; transition-duration:.01ms!important; } }
