/* Atree Docs · 样式（参考飞书 Lark Design；手机优先，≥ 900px 切电脑布局） */
:root {
  --primary: #3370FF; --primary-hover: #4E83FD; --primary-press: #245BDB;
  --primary-bg: #E1EAFF; --primary-bg-soft: #F0F4FF;
  --text-1: #1F2329; --text-2: #646A73; --text-3: #8F959E; --text-4: #BBBFC4;
  --line: #DEE0E3; --line-soft: #EFF0F1;
  --bg: #FFFFFF; --bg-gray: #F5F6F7; --bg-hover: #F2F3F5; --bg-press: #EBECED;
  --green: #34C724; --green-text: #2EA121; --green-bg: #E4FAE1;
  --orange: #FF8800; --orange-text: #DE7802; --orange-bg: #FEEAD2;
  --red: #F54A45; --red-text: #D83931; --red-bg: #FDE2E2;
  --purple: #7F3BF5;
  --shadow-2: 0 6px 24px rgba(31,35,41,.08), 0 2px 6px rgba(31,35,41,.04);
  --shadow-3: 0 12px 40px rgba(31,35,41,.14);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--text-1); background: var(--bg); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select { font: inherit; color: inherit; }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); }
.muted { color: var(--text-3); }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.only-d { display: none !important; }

/* ---------- 骨架 ---------- */
.shell { min-height: 100vh; min-height: 100dvh; }
.sidebar { display: none; }
.main { padding-bottom: calc(64px + var(--safe-b)); min-width: 0; }
.bare { min-height: 100vh; min-height: 100dvh; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; background: rgba(255,255,255,.94); backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px); border-top: .5px solid var(--line); padding: 6px 0 calc(4px + var(--safe-b)); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; color: var(--text-3); padding: 2px 0; }
.tabbar svg.i { width: 24px; height: 24px; stroke-width: 1.5; }
.tabbar a.on { color: var(--primary); }
.tabbar a.on svg.i { stroke-width: 1.9; }

/* 页头 */
.ph { display: flex; align-items: center; gap: 6px; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 8px 20px; position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.94); backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px); }
.ph-title { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.01em; flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.ph-sub { font-size: 13px; font-weight: 400; color: var(--text-3); letter-spacing: 0; }
.ph-actions { display: flex; align-items: center; gap: 6px; }
.ph.has-back { padding: calc(6px + env(safe-area-inset-top, 0px)) 8px 6px; border-bottom: .5px solid var(--line-soft); }
.ph.has-back .ph-title { font-size: 17px; font-weight: 600; justify-content: center; text-align: center; overflow: hidden; }
.ph.has-back .ph-title .nm, .ph.has-back .ph-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-back { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--text-1); flex: none; }
.ph-back svg.i { width: 24px; height: 24px; }
.ph.has-back .ph-actions { min-width: 36px; justify-content: flex-end; }
.doc-head .ph-actions .btn { display: none; }
.icon-btn { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--text-1); flex: none; }
.icon-btn svg.i { width: 22px; height: 22px; }
.icon-btn:hover { background: var(--bg-hover); }
.icon-btn.sm { width: 28px; height: 28px; font-size: 15px; }
.icon-btn.sm svg.i { width: 16px; height: 16px; }
.icon-btn:disabled { opacity: .3; cursor: default; }
.icon-btn.danger { color: var(--red-text); }

/* ---------- 按钮 / 输入 ---------- */
.btn { height: 36px; padding: 0 16px; border-radius: 6px; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--text-1); font-weight: 500; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn svg.i { width: 16px; height: 16px; }
.btn:hover { background: var(--bg-hover); }
.btn:active { background: var(--bg-press); }
.btn.pri { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.pri:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.pri:active { background: var(--primary-press); }
.btn.lg { height: 48px; border-radius: 8px; font-size: 17px; width: 100%; }
.btn.sm { height: 30px; padding: 0 12px; font-size: 13px; }
.btn.wide { width: 100%; height: 44px; margin-top: 10px; }
.btn.danger { color: var(--red-text); }
.btn.text { border: 0; background: none; color: var(--primary); padding: 0 6px; }
.btn.text:hover { background: var(--primary-bg-soft); }
.btn.danger-text { border: 0; background: none; color: var(--red-text); padding: 0 6px; }
.btn.danger-text:hover { background: var(--red-bg); }
.link-btn { color: var(--primary); display: inline-flex; align-items: center; gap: 2px; font-size: 13px; }
.link-btn svg.i { width: 14px; height: 14px; }
.inp { height: 48px; width: 100%; border-radius: 8px; border: 1px solid var(--line); padding: 0 14px; font-size: 16px; background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
.inp:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(51,112,255,.12); }
.inp::placeholder { color: var(--text-4); }
.inp.slim { height: 36px; font-size: 15px; border-radius: 6px; }
select.inp { appearance: none; -webkit-appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238F959E' stroke-width='2.4'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; padding-right: 32px; height: 40px; font-size: 15px; }
.form-err { color: var(--red-text); font-size: 14px; }
.hint { font-size: 13px; color: var(--text-3); line-height: 1.6; margin: 10px 0; }
.hint a { color: var(--primary); }
.hint.warn { background: var(--orange-bg); color: var(--text-1); border-radius: 8px; padding: 10px 12px; }
.center { text-align: center; justify-content: center; }
.form { display: flex; flex-direction: column; gap: 10px; }
.fl { font-size: 14px; color: var(--text-2); margin-top: 6px; display: flex; gap: 8px; align-items: baseline; }
.fl span { font-size: 12.5px; color: var(--text-3); }
.row-gap { display: flex; gap: 8px; align-items: center; }

/* 开关（checkbox 外观） */
input.sw { appearance: none; -webkit-appearance: none; width: 44px; height: 26px; border-radius: 13px; background: var(--line); position: relative; flex: none; cursor: pointer; transition: background .2s; margin: 0; }
input.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: left .2s; }
input.sw:checked { background: var(--primary); }
input.sw:checked::after { left: 20px; }
input.ck { appearance: none; -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--text-4); margin: 0; flex: none; cursor: pointer; position: relative; }
input.ck:checked { background: var(--primary); border-color: var(--primary); }
input.ck:checked::after { content: ""; position: absolute; left: 6px; top: 2.5px; width: 6px; height: 11px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
input.ck:disabled { cursor: default; }
.switch-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; font-size: 16px; cursor: pointer; }
.switch-row .sub { display: block; font-size: 13px; color: var(--text-3); }

/* 分段选择（radio） */
.seg { display: flex; background: var(--bg-gray); border-radius: 8px; padding: 2px; }
.seg label { flex: 1; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; font-size: 14px; height: 34px; line-height: 34px; border-radius: 6px; color: var(--text-2); }
.seg input:checked + span { background: #fff; color: var(--text-1); font-weight: 500; box-shadow: 0 1px 3px rgba(31,35,41,.12); }
.pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pick-item input { position: absolute; opacity: 0; pointer-events: none; }
.pick-item span { display: inline-flex; height: 34px; padding: 0 14px; align-items: center; border-radius: 17px; background: var(--bg-gray); cursor: pointer; border: 1px solid transparent; }
.pick-item input:checked + span { background: var(--primary-bg); border-color: var(--primary); }

/* ---------- 徽标 / 标签 / 头像 / 图标 ---------- */
.bdg { font-size: 11.5px; line-height: 20px; padding: 0 6px; border-radius: 4px; font-weight: 500; white-space: nowrap; flex: none; display: inline-block; }
.bdg.blue { background: var(--primary-bg); color: var(--primary); }
.bdg.green { background: var(--green-bg); color: var(--green-text); }
.bdg.orange { background: var(--orange-bg); color: var(--orange-text); }
.bdg.gray { background: var(--bg-hover); color: var(--text-2); }
.bdg.red { background: var(--red-bg); color: var(--red-text); }
.tagc { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.tagc i { width: 7px; height: 7px; border-radius: 2px; display: block; flex: none; }
.av { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: #fff; flex: none; }
.av.xs { width: 24px; height: 24px; font-size: 11px; }
.av.xs svg.i { width: 13px; height: 13px; stroke-width: 2; }
.av.lg { width: 56px; height: 56px; font-size: 22px; }
.logo { display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #4E83FD, #3370FF); flex: none; }
.logo svg { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ficon { width: 36px; height: 36px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; flex: none; position: relative; }
.ficon svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; }
.ficon.doc { background: var(--primary); }
.ficon.html { background: var(--orange); }
.ficon.lock { background: var(--text-2); }
.ficon .lk { position: absolute; right: -3px; bottom: -3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 1px var(--line); }
.ficon .lk svg { width: 10px; height: 10px; stroke: var(--text-2); stroke-width: 2.4; }
.ficon.sm { width: 28px; height: 28px; border-radius: 6px; }
.ficon.sm svg { width: 16px; height: 16px; }
.dot-new { width: 8px; height: 8px; border-radius: 50%; background: var(--red); flex: none; }
.big-ic { width: 72px; height: 72px; border-radius: 20px; display: flex; align-items: center; justify-content: center; background: var(--bg-gray); color: var(--text-2); margin: 0 auto; }
.big-ic svg.i { width: 34px; height: 34px; }
.big-ic.blue { background: var(--primary-bg); color: var(--primary); }

/* ---------- 搜索 / 标签条 ---------- */
.search { margin: 4px 16px 12px; height: 38px; border-radius: 8px; background: var(--bg-gray); display: flex; align-items: center; gap: 8px; padding: 0 12px; color: var(--text-3); }
.search svg.i { width: 16px; height: 16px; }
.search input { flex: 1; border: 0; background: none; outline: none; font-size: 16px; color: var(--text-1); min-width: 0; height: 100%; }
.search input::placeholder { color: var(--text-3); }
.chips { display: flex; gap: 8px; padding: 0 16px 6px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 32px; padding: 0 14px; border-radius: 16px; background: var(--bg-gray); font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.chip i { width: 7px; height: 7px; border-radius: 2px; display: block; }
.chip.on { background: var(--primary-bg); color: var(--primary); font-weight: 500; }

/* ---------- 文档列表（手机：两行；电脑：表格） ---------- */
.dlist { padding-bottom: 12px; }
.dhead { display: none; }
.dgroup { padding: 16px 20px 6px; font-size: 13px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.dgroup .tagc { color: var(--text-2); }
.dgroup .cnt { margin-left: auto; }
.drow { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; grid-template-areas: "icon main time"; gap: 12px; padding: 12px 20px; align-items: start; position: relative; }
.drow + .drow::before { content: ""; position: absolute; top: 0; left: 68px; right: 0; border-top: .5px solid var(--line-soft); }
.drow:active { background: var(--bg-hover); }
.c-icon { grid-area: icon; }
.c-main { grid-area: main; min-width: 0; display: flex; flex-direction: column; }
.c-title { font-size: 16px; font-weight: 500; display: flex; align-items: center; gap: 6px; line-height: 22px; }
.c-title .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-sub { font-size: 13px; color: var(--text-3); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; }
.c-sub .sep { margin: 0 6px; color: var(--text-4); }
.c-sub .tagc { color: var(--text-2); }
.c-tag, .c-ver, .c-seen { display: none; }
.c-time { grid-area: time; font-size: 12px; color: var(--text-3); white-space: nowrap; padding-top: 3px; }
.c-time .t-long { display: none; }
/* 管理员在手机上：时间下面显示谁看过 */
.dlist.with-seen .drow { grid-template-areas: "icon main time" "icon main seen"; row-gap: 4px; }
.dlist.with-seen .c-seen { display: block; grid-area: seen; justify-self: end; }
.dlist.with-seen .c-seen .av-wrap { margin-right: 2px; }
.dlist.with-seen .c-seen .av { width: 18px; height: 18px; font-size: 9px; }
.dlist.with-seen .c-seen .st { width: 7px; height: 7px; }
.dlist.with-seen .c-seen .lbl { display: none; }
.avs { display: inline-flex; align-items: center; }
.av-wrap { position: relative; margin-right: 4px; display: inline-flex; }
.av-wrap .av { box-shadow: 0 0 0 2px #fff; }
.av-wrap .st { position: absolute; right: -2px; bottom: -2px; width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 1.5px #fff; }
.avs .lbl { margin-left: 6px; font-size: 12.5px; color: var(--text-2); }
.notice { margin: 0 16px 8px; padding: 10px 12px; border-radius: 8px; background: var(--bg-gray); font-size: 13.5px; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.notice.danger { background: var(--red-bg); color: var(--red-text); }
.notice svg.i:last-child { margin-left: auto; width: 14px; height: 14px; }

/* 空状态 */
.empty { text-align: center; padding: 72px 32px; }
.empty-t { font-size: 17px; font-weight: 600; margin: 18px 0 6px; }
.empty-s { font-size: 14px; color: var(--text-2); line-height: 1.6; max-width: 320px; margin: 0 auto 18px; }

/* ---------- 登录等单页 ---------- */
.auth { max-width: 400px; margin: 0 auto; padding: calc(80px + env(safe-area-inset-top, 0px)) 28px 40px; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.auth > .logo { margin-bottom: 22px; }
.auth h1 { font-size: 26px; margin: 0 0 6px; font-weight: 700; }
.auth .big-ic { margin: 30px 0 22px; }
.auth-sub { font-size: 15px; color: var(--text-2); margin: 0 0 32px; line-height: 1.6; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form .btn.lg { margin-top: 12px; }
.auth > form:last-child .btn.text { margin-top: 18px; color: var(--text-2); }
.auth-foot { margin-top: auto; padding-top: 40px; text-align: center; font-size: 13px; color: var(--text-3); }
.brandline { display: flex; align-items: center; justify-content: center; gap: 6px; }
.auth .btn.wide { margin-top: 0; }

/* ---------- 文档页 ---------- */
.doc-split { display: block; }
.doc-col { padding: 4px 16px 24px; }
.m-actions { display: flex; gap: 8px; padding: 10px 16px 0; }
.m-actions .btn { flex: 1; height: 36px; font-size: 13.5px; padding: 0 8px; }
.ver-strip { margin-top: 8px; background: var(--bg-gray); border-radius: 8px; padding: 9px 12px; font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.ver-strip .v { font-family: var(--mono); font-weight: 600; color: var(--primary); font-size: 12.5px; background: var(--primary-bg); border-radius: 4px; padding: 1px 6px; }
.change-note { margin-top: 8px; padding: 10px 12px; border-radius: 8px; background: var(--primary-bg-soft); font-size: 13.5px; line-height: 1.6; border-left: 3px solid var(--primary); }
.change-note b { color: var(--primary); font-weight: 500; margin-right: 6px; }
.old-bar { margin-top: 8px; background: var(--orange-bg); border-radius: 8px; padding: 10px 12px; font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.old-bar a { color: var(--primary); font-weight: 500; white-space: nowrap; }
.doc-frame { display: block; width: 100%; border: 0; min-height: 300px; margin-top: 16px; background: #fff; }
.unlock { text-align: center; padding: 56px 8px 24px; max-width: 360px; margin: 0 auto; }
.unlock .auth-form { margin-top: 24px; }
.unlock .big-ic.gray { background: var(--bg-gray); }
.panel { display: none; }
.restore { margin: 4px 0 8px; }
.guest-head { padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; border-bottom: .5px solid var(--line-soft); }
.guest-head .ph-title { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.guest-foot { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 24px 0 calc(28px + var(--safe-b)); font-size: 12.5px; color: var(--text-3); }

/* 版本时间线 */
.tl { padding: 4px 4px 0; }
.tl-item { display: flex; gap: 14px; position: relative; padding: 8px 10px 14px; border-radius: 8px; }
.tl-item::before { content: ""; position: absolute; left: 15px; top: 24px; bottom: -8px; width: 1.5px; background: var(--line-soft); }
.tl-item:last-child::before { display: none; }
.tl-item:hover { background: var(--bg-hover); }
.tl-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line); background: #fff; margin-top: 5px; flex: none; z-index: 1; }
.tl-item.cur .tl-dot { border-color: var(--primary); background: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }
.tl-item.viewing { background: var(--bg-gray); }
.tl-item .grow { display: flex; flex-direction: column; }
.vh { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 500; }
.vh .mono { font-size: 14px; }
.vn { font-size: 14px; color: var(--text-2); margin-top: 2px; }
.vt { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* ---------- 弹层（手机底部弹出，电脑居中） ---------- */
dialog.sheet { border: 0; padding: 0; margin: auto 0 0; width: 100%; max-width: 100%; max-height: 88vh; max-height: 88dvh; border-radius: 16px 16px 0 0; background: #fff; color: var(--text-1); overflow: hidden; display: none; flex-direction: column; }
dialog.sheet[open] { display: flex; animation: up .22s cubic-bezier(.2,.8,.2,1); }
dialog.sheet::backdrop { background: rgba(31,35,41,.4); }
@keyframes up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.sheet-h { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; padding: 10px 8px 6px; flex: none; }
.sheet-h::before { content: ""; position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 36px; height: 4px; border-radius: 2px; background: var(--line); }
.sheet-h b { text-align: center; font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-h .icon-btn { justify-self: end; color: var(--text-3); }
.sheet-b { padding: 4px 16px calc(24px + var(--safe-b)); overflow-y: auto; }
.sheet-b .cell { padding: 0 4px; }

/* ---------- 分组单元格（我的 / 权限） ---------- */
.gray-page { background: var(--bg-gray); min-height: calc(100vh - 120px); padding: 8px 0 24px; }
.cell-group { background: #fff; border-radius: 10px; margin: 0 16px 12px; overflow: hidden; display: block; }
.cell-group.bordered { border: 1px solid var(--line); margin: 16px 0; }
.cell-group.dim { opacity: .45; }
.cell { display: flex; align-items: center; gap: 12px; padding: 0 16px; min-height: 54px; font-size: 16px; position: relative; width: 100%; text-align: left; }
.cell + .cell, .cell-group > form + form .cell, .cell-group > .cell + form .cell { border-top: .5px solid var(--line); }
.cell .grow { display: flex; flex-direction: column; padding: 8px 0; }
.cell .sub { font-size: 13px; color: var(--text-3); margin-top: 2px; }
.cell .val { color: var(--text-3); font-size: 15px; }
.cell svg.chev { color: var(--text-4); width: 16px; height: 16px; }
.cell.big { min-height: 84px; }
.big-name { font-size: 18px; font-weight: 600; }
.cell.center { justify-content: center; }
.cell.danger { color: var(--red-text); }
a.cell:active, button.cell:active, label.cell:active { background: var(--bg-hover); }
label.cell { cursor: pointer; }
.cell-ic { width: 28px; height: 28px; border-radius: 7px; display: flex; align-items: center; justify-content: center; color: #fff; flex: none; }
.cell-ic svg.i { width: 16px; height: 16px; stroke-width: 2; }
.group-cap { padding: 14px 32px 8px; font-size: 13px; color: var(--text-3); }
.pad { padding: 8px 16px 24px; }
.narrow { max-width: 480px; }
.invite { background: var(--bg-gray); border-radius: 8px; padding: 14px; margin: 4px 0 14px; }
.invite pre { margin: 0; white-space: pre-wrap; word-break: break-all; font-size: 14px; line-height: 1.8; }
.tag-edit { gap: 8px; padding: 8px 12px; }
.cell form.row-gap { flex-direction: row; padding: 0; }
.color-pick { appearance: none; -webkit-appearance: none; width: 24px; height: 24px; border-radius: 6px; border: 0; color: transparent; cursor: pointer; flex: none; }

/* 链接行 */
.link-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: 10px; margin-top: 8px; flex-wrap: wrap; background: #fff; }
.lr-ic { width: 32px; height: 32px; border-radius: 8px; background: var(--primary-bg-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; flex: none; }
.link-row > .grow { display: flex; flex-direction: column; }
.lr-t { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 500; flex-wrap: wrap; }
.link-row .sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.link-row .sub a { color: var(--text-2); text-decoration: underline; text-decoration-color: var(--line); }
.lr-acts { display: flex; align-items: center; gap: 2px; margin-left: auto; width: 100%; justify-content: flex-end; border-top: .5px solid var(--line-soft); padding-top: 8px; }
.lr-acts form { display: contents; }

/* 访问记录 */
.loglist { display: flex; flex-direction: column; }
.logrow { display: flex; align-items: center; gap: 10px; padding: 10px 2px; font-size: 14px; border-bottom: .5px solid var(--line-soft); }
.logrow b { font-weight: 500; }
.logrow a { color: var(--primary); }
.logrow .t { font-size: 12px; color: var(--text-3); white-space: nowrap; }

/* 提示 */
.toast { position: fixed; left: 50%; top: calc(16px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); background: #fff; border-radius: 8px; box-shadow: var(--shadow-2), 0 0 0 1px var(--line-soft); padding: 10px 16px; font-size: 14px; display: flex; align-items: center; gap: 8px; z-index: 100; max-width: calc(100vw - 32px); animation: fadein .2s; }
.toast::before { content: ""; width: 16px; height: 16px; border-radius: 50%; background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round'%3E%3Cpath d='m6 12 4 4 8-9'/%3E%3C/svg%3E") center/11px no-repeat; flex: none; }
@keyframes fadein { from { opacity: 0; transform: translate(-50%, -6px); } }

/* =================== 电脑布局 =================== */
@media (min-width: 900px) {
  .only-m { display: none !important; }
  .only-d { display: revert !important; }
  .tabbar { display: none; }
  body { font-size: 14px; }
  .shell { display: flex; height: 100vh; }
  .main { flex: 1; overflow-y: auto; padding-bottom: 40px; }

  .sidebar { display: flex; flex-direction: column; width: 240px; flex: none; background: var(--bg-gray); border-right: 1px solid var(--line-soft); padding: 14px 10px; overflow-y: auto; }
  .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; font-size: 16px; font-weight: 600; }
  .side-item { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 6px; font-size: 14px; flex: none; }
  .side-item svg.i { color: var(--text-2); }
  .side-item:hover { background: var(--bg-press); }
  .side-item.on { background: var(--primary-bg); color: var(--primary); font-weight: 500; }
  .side-item.on svg.i { color: var(--primary); }
  .side-item .cnt { margin-left: auto; font-size: 12px; color: var(--text-3); font-weight: 400; }
  .side-item .tdot { width: 8px; height: 8px; border-radius: 2px; display: block; margin: 0 5px; flex: none; }
  .side-item span:not(.cnt) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side-cap { font-size: 12px; color: var(--text-3); padding: 18px 10px 6px; display: flex; justify-content: space-between; align-items: center; }
  .side-cap a { color: var(--text-3); display: flex; border-radius: 4px; }
  .side-cap a:hover { color: var(--primary); }
  .side-cap svg.i { width: 15px; height: 15px; }
  .side-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 12px 6px 2px; display: flex; align-items: center; gap: 10px; font-size: 14px; flex: none; }
  .side-foot .grow { display: flex; flex-direction: column; }
  .side-foot .sub { font-size: 12px; color: var(--text-3); }
  .side-foot svg.i { color: var(--text-3); }
  .side-foot:hover .grow { color: var(--primary); }

  .ph, .ph.has-back { position: static; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 20px 32px 12px; border-bottom: 0; }
  .ph-title, .ph.has-back .ph-title { font-size: 20px; font-weight: 600; justify-content: flex-start; text-align: left; }
  .ph-back { width: 32px; height: 32px; margin-right: 2px; }
  .ph-back:hover { background: var(--bg-hover); }
  .ph-back svg.i { width: 20px; height: 20px; }
  .doc-head .ph-actions .btn { display: inline-flex; }

  .search { margin: 0 32px 12px; max-width: 360px; height: 34px; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
  .search input { font-size: 14px; }
  .chips { padding: 0 32px 4px; flex-wrap: wrap; }
  .chip { height: 30px; font-size: 13.5px; }
  .chip:hover:not(.on) { background: var(--bg-press); }
  .notice { margin: 0 32px 12px; }

  .dlist { padding: 0 22px; }
  .dhead, .drow { grid-template-columns: 28px minmax(0, 1fr) 120px 64px 130px; grid-template-areas: none; gap: 14px; align-items: center; padding: 0 10px; }
  .dlist.with-seen .dhead, .dlist.with-seen .drow { grid-template-columns: 28px minmax(0, 1fr) 120px 64px 130px 170px; }
  .dhead { display: grid; height: 40px; font-size: 12.5px; color: var(--text-3); border-bottom: 1px solid var(--line); }
  .drow { height: 56px; border-radius: 6px; border-bottom: 1px solid var(--line-soft); }
  .drow + .drow::before { display: none; }
  .drow:hover { background: var(--bg-hover); border-bottom-color: transparent; }
  .drow > * { grid-area: auto; }
  .c-icon { display: flex; }
  .c-icon .ficon { width: 28px; height: 28px; border-radius: 6px; }
  .c-icon .ficon svg { width: 16px; height: 16px; }
  .c-title { font-size: 14px; }
  .c-sub { font-size: 12px; margin-top: 1px; }
  .c-sub .tagc, .c-sub .sep { display: none; }
  .c-tag, .c-ver, .c-seen { display: block; }
  .dlist.with-seen .drow { grid-template-areas: none; row-gap: 0; }
  .dlist.with-seen .c-seen { justify-self: start; grid-area: auto; }
  .dlist.with-seen .c-seen .av { width: 24px; height: 24px; font-size: 11px; }
  .dlist.with-seen .c-seen .st { width: 9px; height: 9px; }
  .dlist.with-seen .c-seen .lbl { display: inline; }
  .c-tag { font-size: 13px; color: var(--text-2); }
  .c-ver { font-family: var(--mono); font-size: 13px; color: var(--text-2); }
  .c-time { font-size: 13px; color: var(--text-2); padding: 0; }
  .c-time .t-long { display: inline; }
  .c-time .t-short { display: none; }
  .dgroup { padding: 18px 10px 6px; }
  /* 「文档 / 标签」页按标签分组，没有「标签」列 */
  .dlist.no-tag .dhead, .dlist.no-tag .drow { grid-template-columns: 28px minmax(0, 1fr) 64px 150px; }
  .dlist.no-tag.with-seen .dhead, .dlist.no-tag.with-seen .drow { grid-template-columns: 28px minmax(0, 1fr) 64px 150px 170px; }
  .empty { padding: 96px 32px; }

  .pad { padding: 8px 32px 32px; }
  .gray-page { background: none; padding: 4px 16px 24px; min-height: 0; max-width: 720px; }
  .cell-group { border: 1px solid var(--line-soft); }
  .cell { font-size: 15px; min-height: 52px; }
  a.cell:hover, button.cell:hover, label.cell:hover { background: var(--bg-hover); }
  .group-cap { padding: 14px 32px 8px; }

  /* 文档页：正文 + 右侧面板 */
  .doc-page { display: flex; flex-direction: column; height: 100vh; }
  .doc-head { border-bottom: 1px solid var(--line-soft) !important; padding: 12px 20px 12px 16px !important; flex: none; }
  .doc-head .ph-title { font-size: 15px !important; font-weight: 500 !important; align-items: center; }
  .crumb { display: inline-flex !important; align-items: center; gap: 6px; color: var(--text-2); font-weight: 400; flex: none; }
  .crumb svg.i { width: 14px; height: 14px; color: var(--text-4); }
  .doc-split { flex: 1; display: flex; min-height: 0; }
  .doc-center { flex: 1; overflow-y: auto; min-width: 0; }
  .doc-col { max-width: 800px; margin: 0 auto; padding: 24px 40px 60px; }
  .doc-frame { margin-top: 20px; }
  .panel { display: flex !important; flex-direction: column; width: 320px; flex: none; border-left: 1px solid var(--line-soft); overflow: hidden; }
  .ptabs { display: flex; gap: 22px; padding: 0 20px; border-bottom: 1px solid var(--line-soft); height: 46px; flex: none; }
  .ptabs button { font-size: 14px; color: var(--text-2); position: relative; }
  .ptabs button.on { color: var(--text-1); font-weight: 500; }
  .ptabs button.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--primary); border-radius: 1px; }
  .psec { padding: 12px 14px; overflow-y: auto; flex: 1; }
  .psec .logrow { font-size: 13px; }
  .link-row { flex-wrap: nowrap; }
  .lr-acts { width: auto; border-top: 0; padding-top: 0; }

  .guest .doc-col { padding-top: 32px; }
  .guest-head { padding: 14px 32px; position: sticky; top: 0; background: rgba(255,255,255,.94); z-index: 5; display: flex; gap: 10px; }

  dialog.sheet { margin: auto; width: 520px; max-height: 80vh; border-radius: 12px; box-shadow: var(--shadow-3); }
  dialog.sheet.small { width: 420px; }
  dialog.sheet[open] { animation: pop .18s ease-out; }
  @keyframes pop { from { transform: scale(.97); opacity: 0; } }
  dialog.sheet::backdrop { background: rgba(31,35,41,.32); }
  .sheet-h { padding: 16px 12px 4px 24px; grid-template-columns: 0 1fr 44px; }
  .sheet-h::before { display: none; }
  .sheet-h b { text-align: left; }
  .sheet-b { padding: 4px 24px 24px; }
  .btn.lg { height: 40px; font-size: 15px; border-radius: 6px; }
  .inp { height: 40px; font-size: 14px; border-radius: 6px; }
  .seg span { height: 30px; line-height: 30px; font-size: 13.5px; }
  .switch-row { font-size: 14px; }
  .auth .btn.lg { height: 48px; font-size: 16px; }
  .auth .inp { height: 46px; font-size: 15px; }
  .toast { top: 20px; }
}
