* { box-sizing: border-box; }
/* hidden 属性必须能压过 .modal-mask{display:flex} 等布局规则，否则弹窗关不掉/乱弹 */
[hidden] { display: none !important; }
:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --border: #e3e8ef;
  --text: #1f2733;
  --muted: #8a94a6;
  --primary: #2f6bff;
  --primary-d: #1f54d6;
  --danger: #e5484d;
  --ok: #12a150;
  --shadow: 0 1px 3px rgba(16,24,40,.08), 0 1px 2px rgba(16,24,40,.06);
  --bg-soft: #f6f8fb;
}
html, body { margin: 0; height: 100%; }
body {
  font-family: "Microsoft YaHei UI", "PingFang SC", system-ui, -apple-system, sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
}
.muted { color: var(--muted); font-size: 12px; }
.bucket-list .owner { font-style: normal; color: var(--muted); font-size: 11px; margin-left: 6px; }
.err { color: var(--danger); font-size: 12px; margin: 8px 0 0; }

.topbar { height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; background: var(--panel); border-bottom: 1px solid var(--border); }
.brand { font-weight: 700; font-size: 16px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.tag { background: #e7f0ff; color: var(--primary); padding: 3px 8px; border-radius: 6px; font-size: 12px; }

.layout { display: flex; height: calc(100vh - 52px); }
.sidebar { width: 220px; background: var(--panel); border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; font-weight: 600; border-bottom: 1px solid var(--border); }
.bucket-list { list-style: none; margin: 0; padding: 6px; overflow: auto; }
.bucket-list li { padding: 8px 10px; border-radius: 8px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.bucket-list li:hover { background: #f0f4ff; }
.bucket-list li.active { background: #e7f0ff; color: var(--primary); font-weight: 600; }
.bucket-list .cnt { font-size: 12px; color: var(--muted); }
.bucket-list li.active .cnt { color: var(--primary); }
.bkt-row { display: flex; align-items: center; gap: 8px; width: 100%; }
.bkt-name-line { width: 100%; min-width: 0; }
.bkt-name { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.bkt-name em { font-style: normal; font-size: 11px; opacity: .8; font-weight: 400; }
.bkt-id { font-size: 11px; font-weight: 400; opacity: .65; }
.bkt-acts { display: inline-flex; gap: 2px; flex-shrink: 0; }
.bkt-act { font-size: 12px; padding: 1px 6px; border-radius: 6px; cursor: pointer; border: 1px solid var(--border); background: #fff; color: #555; line-height: 1.6; }
.bkt-act:hover { border-color: var(--primary); color: var(--primary); }
.bkt-act.del { color: #e5484d; border-color: #f3c2c5; }
.bkt-act.del:hover { background: #fdeaea; }
.bkt-act.del.disabled { opacity: .4; cursor: not-allowed; }
.bkt-act.del.disabled:hover { border-color: #f3c2c5; color: #e5484d; background: #fff; }
.bkt-act.lock.locked { color: #b45309; border-color: #f0d9a8; background: #fffaf0; }
.bkt-act.lock { color: #2e7d32; border-color: #cfe6d0; background: #f6fcf6; }
/* 三行布局：①名称+操作 ②容量文字 ③进度条 */
.cap-line { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cap-line .cap-pct { color: var(--primary); margin-left: 4px; }
.cap-line .cap-pct.over { color: #e5484d; }
.cap-bar { width: 100%; height: 5px; background: #eef1f6; border-radius: 3px; overflow: hidden; }
.cap-fill { height: 100%; background: var(--primary); border-radius: 3px; transition: width .2s; }
.cap-fill.over { background: #e5484d; }
.cap-fill.unlimit { background: repeating-linear-gradient(45deg, #d7dee8 0 6px, #eef1f6 6px 12px); }
/* 空间升级审批 */
.qr-list { display: flex; flex-direction: column; gap: 6px; }
.qr-item { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.qr-bkt { font-weight: 600; }
.qr-user { color: var(--muted); }
.qr-size b { color: var(--primary); }
.qr-time { color: var(--muted); font-size: 12px; }
.qr-item button.mini { padding: 3px 10px; font-size: 12px; }
button.mini { padding: 3px 10px; font-size: 12px; }
/* 桶空间升级弹窗：仅可选 1G / 2G / 3G */
.upg-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.4); display: flex; align-items: center; justify-content: center; z-index: 200; }
.upg-modal { background: #fff; border-radius: 12px; padding: 18px 20px; width: 320px; max-width: 92vw; box-shadow: 0 12px 40px rgba(0,0,0,.18); }
.upg-opts { display: flex; gap: 10px; margin: 4px 0 12px; }
.upg-opts button { flex: 1; padding: 10px 0; font-size: 15px; font-weight: 600; border: 1px solid var(--border); background: #fff; color: #333; border-radius: 8px; }
.upg-opts button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); background: #f5f8ff; }
.upg-opts button:disabled { opacity: .35; cursor: not-allowed; }
.upg-cancel { border: 1px solid var(--border); background: #fff; color: #555; }
.upg-cancel:hover { border-color: #999; }
.nb-input { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; outline: none; font-size: 14px; }
.nb-input:focus { border-color: var(--primary); }

.main { flex: 1; display: flex; flex-direction: column; padding: 16px; overflow: hidden; }
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.cur-bucket { font-weight: 600; min-width: 140px; }
.search { flex: 1; max-width: 360px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; outline: none; }
.search:focus { border-color: var(--primary); }

.subbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 12px; }
.breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; font-size: 13px; }
.breadcrumb .crumb { color: var(--primary); cursor: pointer; padding: 2px 4px; border-radius: 5px; }
.breadcrumb .crumb:hover { background: #eef4ff; }
.breadcrumb .sep { color: var(--muted); margin: 0 2px; }
.breadcrumb .root { font-weight: 600; }
.subbar-actions { display: flex; gap: 8px; }

button { cursor: pointer; border: none; border-radius: 8px; font-size: 14px; padding: 8px 14px; }
.primary { background: var(--primary); color: #fff; }
.primary:hover { background: var(--primary-d); }
.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.ghost:hover { background: #f0f4ff; }
.mini { background: #eef2f8; padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.mini:hover { background: #e0e8f5; }

.dropzone { border: 1.5px dashed var(--border); border-radius: 12px; padding: 16px; text-align: center; background: var(--panel); margin-bottom: 12px; transition: .15s; }
.dropzone.drag { border-color: var(--primary); background: #f5f8ff; }
.dropzone p { margin: 0 0 4px; font-weight: 600; }

.upload-panel { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px; padding: 12px 14px; }
.up-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; margin-bottom: 8px; }
.upload-list { display: flex; flex-direction: column; gap: 8px; max-height: 220px; overflow: auto; }
.up-item { display: flex; flex-direction: column; gap: 4px; }
.up-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.up-name { font-size: 13px; word-break: break-all; flex: 1; }
.up-state { font-size: 12px; color: var(--muted); white-space: nowrap; }
.up-bar { height: 6px; background: #eef2f8; border-radius: 4px; overflow: hidden; }
.up-bar > i { display: block; height: 100%; background: var(--primary); width: 0%; transition: width .2s; }
.up-bar.done > i { background: var(--ok); }
.up-bar.err > i { background: var(--danger); }
.up-actions button { padding: 3px 9px; font-size: 12px; margin-left: 6px; }

.table-wrap { flex: 1; overflow: auto; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; }
.obj-table { width: 100%; border-collapse: collapse; }
.obj-table th, .obj-table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.obj-table th { position: sticky; top: 0; background: #fafbfc; font-size: 12px; color: var(--muted); z-index: 1; }
.obj-table tr:hover td { background: #f8faff; }
.obj-table .name { font-weight: 500; word-break: break-all; }
.obj-table .folder .name { color: var(--primary); cursor: pointer; }
.obj-table .actions { white-space: nowrap; }
.obj-table .actions button { padding: 4px 9px; font-size: 12px; margin-right: 6px; }
.link-btn { color: var(--primary); background: transparent; border: 1px solid var(--border); }
.link-btn:hover { background: #eef4ff; }
.del-btn { color: var(--danger); background: transparent; border: 1px solid #f3c9ca; }
.del-btn:hover { background: #fdeced; }
.ver-badge { background: #eef2f8; color: var(--muted); border-radius: 5px; padding: 1px 6px; font-size: 11px; }
.empty { text-align: center; color: var(--muted); padding: 30px; }

.pager { display: flex; align-items: center; gap: 10px; justify-content: flex-end; padding: 12px 4px 0; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }

.modal-mask { position: fixed; inset: 0; background: rgba(16,24,40,.45); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal { background: var(--panel); border-radius: 14px; padding: 22px; width: 420px; box-shadow: var(--shadow); }
.modal h2 { margin: 0 0 6px; }
.modal input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; margin: 10px 0; outline: none; }
.modal input:focus { border-color: var(--primary); }
/* 仅直接子按钮全宽（登录/保存类主按钮）；嵌套在列表行里的按钮必须自适应，否则会撑满整行把旁边的输入框/文本挤成窄条 */
.modal > button { width: 100%; margin-top: 6px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; }

.preview-modal { width: 80vw; max-width: 920px; max-height: 86vh; display: flex; flex-direction: column; }
.preview-body { margin-top: 12px; overflow: auto; flex: 1; text-align: center; }
.preview-body img, .preview-body video { max-width: 100%; max-height: 64vh; }
.preview-body pre { text-align: left; background: #0f172a; color: #e2e8f0; padding: 14px; border-radius: 8px; overflow: auto; max-height: 64vh; font-size: 12px; }

.share-opt { display: flex; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.share-opt button { width: auto; margin: 0; padding: 6px 12px; }
.share-opt button.sel { background: var(--primary); color: #fff; }
.share-result { background: #f6f8fc; border: 1px solid var(--border); border-radius: 8px; padding: 10px; margin-top: 10px; word-break: break-all; font-size: 13px; }
.share-list { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.share-list .row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 12px; }
.share-list .row .meta { color: var(--muted); }

.ver-body { max-height: 60vh; overflow: auto; }
.ver-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.ver-row .meta { color: var(--muted); font-size: 12px; }
.ver-row .vact button { padding: 3px 9px; font-size: 12px; margin-left: 6px; width: auto; flex: 0 0 auto; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #1f2733; color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 60; box-shadow: var(--shadow); font-size: 13px; }

/* 设置面板 */
.modal.wide { width: 640px; max-width: 94vw; max-height: 92vh; display: flex; flex-direction: column; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; border-bottom: 1px solid var(--border); }
.tabs button { border: 0; background: none; padding: 9px 14px; cursor: pointer; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.sel { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.set-body { min-height: 220px; }
/* 设置弹窗内容超高时内部滚动，避免统计/用户列表把弹窗顶出屏幕 */
.modal.wide .set-body { flex: 1; min-height: 0; overflow-y: auto; }
.set-body .row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.set-body .row input { flex: 1; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.set-body .row span { flex: 1; min-width: 0; font-size: 13px; word-break: break-all; }
.set-body .row button { flex: 0 0 auto; width: auto; margin-top: 0; white-space: nowrap; }
.code { background: #0f172a; color: #cbd5e1; padding: 12px 14px; border-radius: 10px; font-size: 12px; overflow: auto; white-space: pre-wrap; }
.share-pw { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.share-pw label { font-size: 13px; color: var(--muted); white-space: nowrap; }
.share-pw input { flex: 1; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.hook-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.hook-form input { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.hook-events { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 13px; }
.hook-events label { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.exp-badge { color: var(--danger); font-size: 12px; white-space: nowrap; }
.login-modal { width: 360px; text-align: left; }
.login-modal h2 { margin: 0 0 4px; text-align: center; }
.login-modal .muted { text-align: center; margin: 0 0 14px; }
.login-modal input, .login-modal select { width: 100%; padding: 11px 12px; margin-bottom: 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; }
.login-modal button { width: 100%; padding: 11px; }
.login-extra { text-align: center; margin-top: 12px; font-size: 12px; }
.login-extra a { color: var(--primary); text-decoration: none; }
.modal input, .modal select { width: 100%; padding: 10px 12px; margin-bottom: 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; }
.user-form { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.user-form input { flex: 1; min-width: 120px; margin-bottom: 0; }
.user-form select { width: 110px; margin-bottom: 0; }
.set-body .row .u-ops { display: flex; gap: 6px; align-items: center; flex: 0 0 auto; }
.set-body .row .u-ops select { width: 90px; padding: 4px 6px; margin: 0; }

/* 团队管理：左侧团队列表 + 右侧详情 */
.team-layout { display: flex; gap: 16px; align-items: flex-start; }
.team-side { width: 210px; flex: 0 0 auto; display: flex; flex-direction: column; gap: 6px; }
.team-item { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; background: var(--panel); }
.team-item:hover { background: #f0f4ff; }
.team-item.sel { border-color: var(--primary); background: #e7f0ff; }
.team-item span { display: block; font-size: 11px; margin-top: 2px; }
.team-main { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; background: var(--panel); }
.team-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.team-main h4 { margin: 14px 0 8px; font-size: 13px; color: var(--text); }
.team-main .row:last-child { border-bottom: none; }

/* ---------- 防盗链 ---------- */
.guard-tips { margin: 8px 0 14px; padding-left: 18px; line-height: 1.9; }
.guard-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.guard-form textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-family: inherit; resize: vertical; }
.guard-switch { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.guard-switch input { width: 16px; height: 16px; cursor: pointer; }

/* ---------- 访问统计 ---------- */
.set-body h4 { margin: 18px 0 8px; font-size: 14px; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-bottom: 6px; }
.stat-card { background: var(--bg-soft, #f6f8fb); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; text-align: center; }
.stat-card .stat-num { font-size: 22px; font-weight: 700; color: var(--primary); }
.stat-card .stat-label { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat-card.danger .stat-num { color: var(--danger); }
.stat-trend { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding: 8px 4px; border: 1px solid var(--border); border-radius: 10px; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.trend-bar { width: 70%; max-width: 34px; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 2px; opacity: .85; }
.trend-col:hover .trend-bar { opacity: 1; }
.trend-day { font-size: 11px; color: var(--muted); margin-top: 4px; }
.stat-table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.stat-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.stat-table th, .stat-table td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.stat-table th { background: var(--bg-soft, #f6f8fb); color: var(--muted); font-weight: 600; }
.stat-table tr:last-child td { border-bottom: 0; }
.stat-table .mono { font-family: ui-monospace, Consolas, monospace; font-size: 11px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }

/* 最近访问：独立滚动区 + 粘性表头，避免把整个设置弹窗撑得过长 */
.stat-recent { max-height: 300px; overflow-y: auto; }
.stat-recent .stat-table th { position: sticky; top: 0; z-index: 1; background: var(--bg-soft); }

/* ---------- 文档在线预览（docx / xlsx / pptx / pdf / csv / md） ---------- */
/* 文档类容器左对齐白底，压过 .preview-body 的居中文本 */
.doc-view { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 24px 30px; margin: 0 auto; max-width: 860px; text-align: left; font-size: 14px; line-height: 1.8; word-break: break-word; }
.doc-view h1, .doc-view h2, .doc-view h3, .doc-view h4 { margin: 14px 0 8px; line-height: 1.4; }
.doc-view h1 { font-size: 22px; } .doc-view h2 { font-size: 19px; } .doc-view h3 { font-size: 16px; }
.doc-view p { margin: 8px 0; }
.doc-view img { max-width: 100%; height: auto; }
.doc-view table { border-collapse: collapse; margin: 10px 0; }
.doc-view th, .doc-view td { border: 1px solid var(--border); padding: 6px 10px; font-size: 13px; }
.doc-view th { background: var(--bg-soft); }
.doc-view blockquote { margin: 8px 0; padding: 4px 14px; border-left: 3px solid var(--primary); background: var(--bg-soft); }
.md-view pre { background: #0f172a; color: #e2e8f0; padding: 12px 14px; border-radius: 8px; overflow: auto; font-size: 12px; }
.md-view code { font-family: ui-monospace, Consolas, monospace; }
.md-view p code, .md-view li code { background: var(--bg-soft); padding: 1px 5px; border-radius: 4px; font-size: 13px; }

.pdf-frame { width: 100%; height: 66vh; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }

.sheet-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.sheet-tabs button.sel { background: var(--primary); color: #fff; }
.sheet-wrap { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; overflow: auto; max-height: 62vh; text-align: left; }
.sheet-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.sheet-table td { border: 1px solid var(--border); padding: 6px 10px; white-space: pre-wrap; word-break: break-all; }
.sheet-table tr:first-child td { font-weight: 600; background: var(--bg-soft); position: sticky; top: 0; z-index: 1; }

.pptx-view { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.pptx-view .slide-preview, .pptx-view > div { max-width: 100%; }
.pptx-view canvas, .pptx-view img { max-width: 100%; height: auto; box-shadow: 0 2px 10px rgba(16,24,40,.18); border-radius: 4px; }

.doc-unsupported { max-width: 520px; margin: 40px auto; text-align: center; line-height: 1.9; }
.doc-unsupported .primary { display: inline-block; margin-top: 10px; text-decoration: none; }

/* 预览加载友好提示：转圈 + 文案，超 3s 自动升级为"文件有点大，努力加载中…请稍等！" */
.preview-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 240px; padding: 40px 0; }
.pl-spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: pl-spin .8s linear infinite; }
.pl-text { color: var(--muted); font-size: 14px; }
@keyframes pl-spin { to { transform: rotate(360deg); } }

/* 移动端"更多操作"触发器：桌面隐藏，手机显示 */
.more-trigger { display: none; }

/* 底部操作菜单（移动端对象操作） */
.sheet-mask { align-items: flex-end; background: rgba(16,24,40,.35); }
.action-sheet { width: 100%; max-width: 560px; background: var(--panel); border-radius: 16px 16px 0 0; padding: 6px 0 calc(8px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 24px rgba(16,24,40,.2); animation: sheet-up .22s ease; }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.action-sheet .as-title { padding: 14px 18px 10px; font-weight: 600; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--border); word-break: break-all; }
.action-sheet .as-actions { display: flex; flex-direction: column; }
.action-sheet .as-act { border: none; background: none; text-align: center; padding: 16px; font-size: 16px; color: var(--text); border-bottom: 1px solid var(--border); }
.action-sheet .as-act:active { background: #f0f4ff; }
.action-sheet .as-act.danger { color: var(--danger); font-weight: 600; }
.action-sheet .as-cancel { text-align: center; padding: 16px; font-size: 16px; font-weight: 600; color: var(--muted); }

/* ===================== 移动端适配 ===================== */
#menuBtn { display: none; }
.topbar { position: relative; z-index: 46; }

@media (max-width: 768px) {
  /* 顶栏：显示汉堡菜单，压缩间距 */
  #menuBtn { display: inline-flex; margin-right: 4px; padding: 7px 11px; font-size: 18px; line-height: 1; }
  .topbar { padding: 0 12px; }
  .brand { font-size: 15px; flex: 0 0 auto; white-space: nowrap; }
  .top-actions { gap: 6px; flex: 1 1 auto; justify-content: flex-end; min-width: 0; }
  .top-actions button { padding: 7px 10px; font-size: 13px; white-space: nowrap; }
  #userChip { flex: 0 1 auto; min-width: 0; max-width: 34vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }

  /* 侧栏变离屏抽屉 */
  .layout { display: block; height: auto; }
  .sidebar { position: fixed; top: 52px; left: 0; bottom: 0; width: 82%; max-width: 320px; background: var(--panel); transform: translateX(-100%); transition: transform .22s ease; z-index: 45; box-shadow: 2px 0 16px rgba(16,24,40,.18); }
  .sidebar.open { transform: translateX(0); }
  .overlay { position: fixed; inset: 0; background: rgba(16,24,40,.42); z-index: 44; }

  /* 主区：自然滚动，紧凑内边距 */
  .main { padding: 12px; height: auto; overflow: visible; }
  .toolbar { flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
  .toolbar .cur-bucket { flex: 1 1 100%; min-width: 0; font-size: 15px; }
  .toolbar .search { flex: 1 1 auto; max-width: none; min-width: 0; }
  .subbar { flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
  .subbar-actions { width: 100%; display: flex; gap: 8px; }
  .subbar-actions button { flex: 1; }
  .table-wrap { max-height: none; overflow: visible; border-radius: 12px; }

  /* 对象列表：表格转卡片 */
  .obj-table thead { display: none; }
  .obj-table, .obj-table tbody { display: block; }
  .obj-table tr { display: block; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; padding: 12px 14px; }
  .obj-table td { display: flex; justify-content: space-between; align-items: center; gap: 10px; border: none; padding: 4px 0; font-size: 13px; }
  .obj-table td.name { font-size: 15px; font-weight: 600; }
  .obj-table td.name::before { content: none; }
  .obj-table td:not(.name)::before { content: attr(data-label); color: var(--muted); font-size: 12px; flex: 0 0 auto; }
  .obj-table td.actions { display: none; } /* 移动端操作走底部菜单 */
  .more-trigger { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin-left: 8px; border-radius: 8px; background: #eef2f8; color: var(--muted); cursor: pointer; font-size: 20px; flex: 0 0 auto; }
  .more-trigger:active { background: #e0e8f5; }
  .inline-act { display: none !important; }

  /* 弹窗：移动端近全屏 */
  .modal { width: 92vw; padding: 18px; }
  .modal.wide { width: 96vw; max-height: 94vh; }
  .tabs { flex-wrap: wrap; }
  .preview-modal { width: 94vw; max-width: none; max-height: 92vh; }
  .preview-body img, .preview-body video { max-height: 72vh; }
  .doc-view { padding: 14px 16px; }

  /* 团队布局堆叠 */
  .team-layout { flex-direction: column; }
  .team-side { width: 100%; }
  .team-main { padding: 12px; }

  /* 触控友好：输入框 ≥16px 防止 iOS 聚焦缩放 */
  input, select, textarea { font-size: 16px; }
  .dropzone { padding: 16px 12px; }
}

/* 超窄屏进一步压缩 */
@media (max-width: 380px) {
  .brand { font-size: 14px; }
  #userChip { max-width: 30vw; }
}
