:root {
    --color-primary: #5b5bd6;
    --color-primary-hover: #4f46e5;
    --color-primary-soft: #eeeeff;
    --color-bg: #f7f8fa;
    --color-surface: #ffffff;
    --color-surface-muted: #f9fafb;
    --color-border: #e4e7ec;
    --color-border-strong: #d0d5dd;
    --color-text: #101828;
    --color-text-secondary: #667085;
    --color-text-tertiary: #98a2b3;
    --color-success: #067647;
    --color-success-soft: #ecfdf3;
    --color-danger: #d92d20;
    --color-danger-soft: #fef3f2;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04);
    --shadow-md: 0 8px 24px rgba(16, 24, 40, .08);
    --radius-control: 8px;
    --radius-card: 12px;
    --transition: 160ms ease;
    --color-content: #344054;
    --color-code: #f6f7f9;
    --color-hover: #fafaff;
    --color-backdrop: rgba(16, 24, 40, .55);
}

html { color-scheme: light; }
body {
    background: var(--color-bg);
    color: var(--color-text);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
    outline: 3px solid rgba(91, 91, 214, .24) !important;
    outline-offset: 2px;
}
.ui-icon { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: -3px; stroke: currentColor; }

.theme-toggle {
    width: 38px; height: 38px; padding: 0; flex: none; display: inline-grid; place-items: center;
    color: var(--color-text-secondary); background: transparent; border: 1px solid transparent;
    border-radius: var(--radius-control); cursor: pointer;
    transition: color var(--transition), background var(--transition), border-color var(--transition);
}
.theme-toggle:hover { color: var(--color-text); background: var(--color-surface-muted); border-color: var(--color-border); }
.theme-toggle .ui-icon { width: 17px; height: 17px; }
.header .theme-toggle { margin-left: auto; }
.workspace-label { display: block; margin-top: 2px; color: var(--color-text-tertiary); font: 600 9px/1.1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .13em; }

/* 顶部品牌区与导航 */
.header {
    position: relative;
    padding: 0;
    color: var(--color-text);
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid var(--color-border);
    box-shadow: none;
    backdrop-filter: blur(12px);
}
.header-inner {
    max-width: 1200px;
    height: 68px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 28px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--color-text); text-decoration: none; flex: none; }
.brand-mark {
    width: 34px; height: 34px; display: grid; place-items: center;
    color: #fff; background: var(--color-primary); border-radius: 10px;
    box-shadow: 0 3px 8px rgba(91, 91, 214, .22);
}
.brand-mark .ui-icon { width: 19px; height: 19px; }
.brand-title { font-size: 17px; font-weight: 700; letter-spacing: -.2px; }
.header h1 { font-size: inherit; }
.tabs { align-self: stretch; padding: 0; gap: 4px; background: transparent; display: flex; }
.tab-item {
    position: relative; min-height: 44px; padding: 0 14px; display: flex; align-items: center;
    color: var(--color-text-secondary); font-size: 14px; font-weight: 600;
    border: 0; transition: color var(--transition), background var(--transition); cursor: pointer;
}
.tab-item::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px; border-radius: 2px 2px 0 0; background: transparent; }
.tab-item:hover { color: var(--color-text); background: var(--color-surface-muted); }
.tab-item.active { color: var(--color-primary); }
.tab-item.active::after { background: var(--color-primary); }
.logout-link {
    position: static; min-height: 38px; padding: 8px 11px;
    display: inline-flex; align-items: center; gap: 7px; color: var(--color-text-secondary);
    border: 1px solid transparent; border-radius: var(--radius-control); text-decoration: none; font-size: 13px; font-weight: 600;
    transition: color var(--transition), background var(--transition), border-color var(--transition);
}
.logout-link:hover { color: var(--color-text); background: var(--color-surface-muted); border-color: var(--color-border); }

/* 页面布局与工具栏 */
.container { max-width: 1200px; padding: 28px 20px 48px; }
.toolbar {
    min-height: 56px; padding: 0 0 16px; margin-bottom: 8px; gap: 8px;
    background: transparent; border-radius: 0; box-shadow: none;
}
.section-heading { display: flex; align-items: center; gap: 11px; }
.section-heading-icon { width: 34px; height: 34px; display: grid; place-items: center; color: var(--color-primary); background: var(--color-primary-soft); border-radius: 9px; }
.section-heading-icon .ui-icon { width: 18px; height: 18px; }
.section-heading-title { display: block; font-size: 17px; line-height: 1.35; font-weight: 700; color: var(--color-text); }
.section-heading-desc { display: block; margin-top: 2px; color: var(--color-text-secondary); font-size: 12px; line-height: 1.4; }
.path-nav { min-width: 0; }

/* 按钮体系 */
.btn {
    min-height: 38px; padding: 8px 13px; gap: 7px; justify-content: center;
    border: 1px solid transparent; border-radius: var(--radius-control);
    color: var(--color-text-secondary); background: var(--color-surface);
    box-shadow: none; font-size: 13px; font-weight: 600; line-height: 1.2;
    transition: color var(--transition), background var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.btn:hover { color: var(--color-text); background: var(--color-surface-muted); }
.btn:active { transform: translateY(1px); }
.btn-primary { color: #fff; background: var(--color-primary); border-color: var(--color-primary); box-shadow: var(--shadow-sm); }
.btn-primary:hover { color: #fff; background: var(--color-primary-hover); border-color: var(--color-primary-hover); }
.btn-secondary, .btn-success { color: var(--color-text-secondary); background: var(--color-surface); border-color: var(--color-border-strong); }
.btn-secondary:hover, .btn-success:hover { color: var(--color-text); background: var(--color-surface-muted); border-color: #b8c0cc; }
.btn-danger { color: var(--color-danger); background: transparent; border-color: transparent; }
.btn-danger:hover { color: #b42318; background: var(--color-danger-soft); border-color: transparent; }
.btn-icon { width: 38px; padding: 0; }
.btn-ghost { color: var(--color-text-secondary); background: transparent; border-color: transparent; }
.btn-ghost:hover { color: var(--color-primary); background: var(--color-primary-soft); }

/* 文件上传与内容表面 */
.upload-area {
    min-height: 154px; padding: 28px 20px; margin-bottom: 24px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: var(--color-surface); border: 1px dashed var(--color-border-strong);
    border-radius: var(--radius-card); box-shadow: var(--shadow-sm); transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}
.upload-area:hover, .upload-area.dragover { border-color: var(--color-primary); background: var(--color-hover); box-shadow: 0 0 0 3px rgba(91,91,214,.08); }
.upload-area .icon { width: 42px; height: 42px; margin-bottom: 12px; display: grid; place-items: center; color: var(--color-primary); background: var(--color-primary-soft); border-radius: 12px; font-size: 0; }
.upload-area .icon .ui-icon { width: 21px; height: 21px; }
.upload-area p { color: var(--color-text); font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.upload-area .hint { color: var(--color-text-tertiary); font-size: 12px; font-weight: 400; }
.upload-progress, .file-list, .text-list, .markdown-card {
    background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-card); box-shadow: var(--shadow-sm);
}
.upload-progress { padding: 16px; }
.progress-bar { background: var(--color-surface-muted); }
.progress-fill { background: var(--color-primary); }
.progress-text, .empty-state { color: var(--color-text-tertiary); }
.file-list, .text-list { overflow: hidden; }
.file-header {
    grid-template-columns: minmax(0,1fr) 120px 170px 120px; padding: 12px 18px;
    color: var(--color-text-secondary); background: var(--color-surface-muted); border-bottom: 1px solid var(--color-border); font-size: 12px;
}
.file-item { grid-template-columns: minmax(0,1fr) 120px 170px 120px; min-height: 58px; padding: 10px 18px; border-bottom-color: var(--color-border); }
.file-item:hover, .text-item:hover { background: var(--color-hover); }
.file-name a { color: var(--color-text); font-size: 14px; }
.file-name a:hover { color: var(--color-primary); }
.file-icon { width: 34px; height: 34px; display: grid; place-items: center; color: var(--color-primary); background: var(--color-primary-soft); border-radius: 8px; font-size: 0; }
.file-icon .ui-icon { width: 18px; height: 18px; }
.file-size, .file-date { color: var(--color-text-secondary); font-size: 12px; }
.file-actions button, .text-item-actions button, .markdown-actions .btn { min-height: 32px; padding: 6px 9px; }
.breadcrumb { gap: 2px; }
.breadcrumb a { color: var(--color-text-secondary); padding: 7px 8px; display: inline-flex; align-items: center; gap: 6px; }
.breadcrumb a:hover { color: var(--color-primary); background: var(--color-primary-soft); }
.breadcrumb span { color: var(--color-text-tertiary); }

/* 便签与 Markdown */
.text-item { padding: 19px 20px; border-bottom-color: var(--color-border); cursor: default; }
.text-item-title { color: var(--color-text); font-size: 15px; }
.text-item-meta, .markdown-card-meta { color: var(--color-text-tertiary); }
.text-content-body { max-width: 820px; color: var(--color-content); line-height: 1.75; }
.text-content-body a, .markdown-body a { color: var(--color-primary); }
.text-item-actions, .markdown-actions { gap: 4px; padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--color-border); }
.markdown-list { gap: 16px; }
.markdown-card { padding: 22px 20px 16px; }
.markdown-card-header { display: block; margin-bottom: 16px; }
.markdown-card-title { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; color: var(--color-text); font-size: 18px; line-height: 1.4; }
.markdown-card-meta { display: block; margin-top: 5px; font-size: 12px; }
.share-badge { margin-left: 0; padding: 3px 8px; color: var(--color-success); background: var(--color-success-soft); border-radius: 999px; font-size: 11px; }
.markdown-card-content { max-width: 820px; color: var(--color-content); line-height: 1.75; }
.markdown-card-content.collapsed::after { background: linear-gradient(transparent, var(--color-surface)); }
.markdown-actions { align-items: center; }
.markdown-actions .btn-danger { margin-left: auto; }
.markdown-body h1, .markdown-body h2 { color: var(--color-text); border-bottom-color: var(--color-border); }
.markdown-body pre, .markdown-body code { background: var(--color-code); }
.markdown-body blockquote { color: var(--color-text-secondary); border-left-color: #c7c7f5; }

/* 弹窗与反馈 */
.modal { background: var(--color-backdrop); backdrop-filter: blur(3px); }
.modal.active .modal-content { animation: modal-in 180ms ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-content { border: 1px solid rgba(255,255,255,.8); border-radius: 14px; box-shadow: 0 24px 56px rgba(16,24,40,.2); }
.modal-header { color: var(--color-text); font-size: 18px; }
.modal-input, .modal-textarea, .markdown-editor-grid textarea, .markdown-preview, .share-link-row input {
    border: 1px solid var(--color-border-strong); border-radius: var(--radius-control); color: var(--color-text); background: var(--color-surface);
}
#shareModal p { color: var(--color-text-secondary) !important; }
.modal-input:focus, .modal-textarea:focus, .markdown-editor-grid textarea:focus, .share-link-row input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(91,91,214,.12); }
.modal-buttons { padding-top: 18px; margin-top: 4px; border-top: 1px solid var(--color-border); }
.toast { bottom: 24px; padding: 11px 16px; border: 1px solid rgba(255,255,255,.12); border-radius: 10px; background: #1d2939; box-shadow: var(--shadow-md); }
.toast.success { background: #067647; }
.toast.error { background: #b42318; }

/* 登录页 */
body.login-page { background: radial-gradient(circle at 50% -10%, #eeeeff 0, transparent 38%), var(--color-bg); }
.login-page::before {
    content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .26;
    background-image: linear-gradient(rgba(91,91,214,.09) 1px, transparent 1px), linear-gradient(90deg, rgba(91,91,214,.09) 1px, transparent 1px);
    background-size: 54px 54px; mask-image: linear-gradient(to bottom, #000, transparent 72%);
}
.login-theme-toggle { position: fixed; top: 18px; right: 18px; z-index: 2; }
.login-page .card { max-width: 400px; padding: 34px; border: 1px solid var(--color-border); border-radius: 16px; box-shadow: var(--shadow-md); }
.login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 24px; }
.login-page h1 { color: var(--color-text); font-size: 23px; }
.login-page .desc { color: var(--color-text-secondary); font-size: 14px; }
.login-page label { color: #344054; font-size: 13px; font-weight: 600; }
.login-page input[type=text], .login-page input[type=password] { border-color: var(--color-border-strong); }
.login-page input[type=text]:focus, .login-page input[type=password]:focus { outline: 0; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(91,91,214,.12); }
.login-page button { min-height: 44px; background: var(--color-primary); font-weight: 650; transition: background var(--transition); }
.login-page button:hover { background: var(--color-primary-hover); }

/* 公开阅读页 */
body.share-page { background: var(--color-bg); }
.share-theme-toggle { position: fixed; z-index: 20; top: 18px; right: 18px; background: var(--color-surface); border-color: var(--color-border); box-shadow: var(--shadow-sm); }
.share-page .page { max-width: 900px; margin: 32px auto; }
.share-page .article { padding: 42px 48px; border: 1px solid var(--color-border); border-radius: 16px; box-shadow: var(--shadow-sm); }
.share-page .top { border-bottom-color: var(--color-border); }
.share-page .top h1 { color: var(--color-text); font-size: 30px; }
.share-page .meta { color: var(--color-text-tertiary); }
.share-page button { min-height: 38px; color: var(--color-text-secondary); border-color: var(--color-border-strong); border-radius: var(--radius-control); font-weight: 600; transition: background var(--transition), color var(--transition); }
.share-page button:hover { color: var(--color-primary); background: var(--color-primary-soft); border-color: #c7c7f5; }
.share-page .markdown-body { max-width: 760px; color: var(--color-content); }

/* Quiet Workspace：与 Leo's Space 共用品牌气质，工作区域保持稳定和高可读性。 */
html[data-theme="dark"] {
    color-scheme: dark;
    --color-primary: #7c83ff;
    --color-primary-hover: #9297ff;
    --color-primary-soft: rgba(124, 131, 255, .13);
    --color-bg: #080b12;
    --color-surface: #0e1420;
    --color-surface-muted: #111925;
    --color-border: rgba(232, 238, 247, .09);
    --color-border-strong: rgba(232, 238, 247, .16);
    --color-text: #e8eef7;
    --color-text-secondary: #a6b0c0;
    --color-text-tertiary: #747f91;
    --color-success: #58d68d;
    --color-success-soft: rgba(88, 214, 141, .11);
    --color-danger: #f97066;
    --color-danger-soft: rgba(249, 112, 102, .11);
    --color-content: #c6cfdb;
    --color-code: #080c14;
    --color-hover: rgba(124, 131, 255, .055);
    --color-backdrop: rgba(2, 5, 10, .76);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .22);
    --shadow-md: 0 18px 50px rgba(0, 0, 0, .32);
}
html[data-theme="dark"] body {
    background-color: var(--color-bg);
    background-image: radial-gradient(circle at 50% -24%, rgba(77, 91, 183, .12), transparent 42%);
}
html[data-theme="dark"] .header { background: rgba(8, 11, 18, .88); }
html[data-theme="dark"] .brand-mark { color: #dfe3ff; background: rgba(124,131,255,.13); border: 1px solid rgba(124,131,255,.34); box-shadow: 0 0 24px rgba(124,131,255,.09); }
html[data-theme="dark"] .upload-area { background-image: linear-gradient(rgba(124,131,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(124,131,255,.035) 1px, transparent 1px); background-size: 28px 28px; }
html[data-theme="dark"] .file-icon { border: 1px solid rgba(124,131,255,.11); }
html[data-theme="dark"] .btn-secondary:hover,
html[data-theme="dark"] .btn-success:hover { border-color: rgba(232,238,247,.25); }
html[data-theme="dark"] .modal-content { background: var(--color-surface); border-color: var(--color-border-strong); box-shadow: 0 28px 80px rgba(0,0,0,.48); }
html[data-theme="dark"] .action-menu-panel { box-shadow: 0 18px 44px rgba(0,0,0,.38); }
html[data-theme="dark"] .action-menu-panel button { color: var(--color-content); }
html[data-theme="dark"] .login-page { background: radial-gradient(circle at 50% -10%, rgba(75,82,175,.18) 0, transparent 42%), var(--color-bg); }
html[data-theme="dark"] .login-page .card { background: rgba(14,20,32,.9); box-shadow: 0 30px 90px rgba(0,0,0,.4); backdrop-filter: blur(18px); }
html[data-theme="dark"] .login-page label { color: var(--color-content); }
html[data-theme="dark"] .login-page input[type=text],
html[data-theme="dark"] .login-page input[type=password] { color: var(--color-text); background: #0a101a; }
html[data-theme="dark"] .error { color: #ffb4ae; background: rgba(249,112,102,.1); border: 1px solid rgba(249,112,102,.18); }
html[data-theme="dark"] .share-page .article { background: var(--color-surface); }
html[data-theme="dark"] .share-page button { background: var(--color-surface); }
html[data-theme="dark"] .markdown-body th { background: var(--color-surface-muted); }
html[data-theme="dark"] .markdown-body th,
html[data-theme="dark"] .markdown-body td { border-color: var(--color-border-strong); }
html[data-theme="dark"] .markdown-body blockquote { background: rgba(255,255,255,.018); }
html[data-theme="dark"] .toast { background: #182131; }

@media (max-width: 768px) {
    .header-inner { height: auto; min-height: 60px; padding: 10px 14px 0; flex-wrap: wrap; gap: 0; }
    .brand { padding-bottom: 10px; }
    .brand-mark { width: 32px; height: 32px; }
    .brand-title { font-size: 16px; }
    .logout-link { min-height: 36px; padding: 7px 9px; margin-bottom: 10px; }
    .logout-text { display: none; }
    .theme-toggle { width: 36px; height: 36px; margin-bottom: 10px; }
    .share-theme-toggle { top: 10px; right: 10px; margin: 0; }
    .tabs { order: 3; width: 100%; height: 44px; overflow-x: auto; }
    .tab-item { flex: 1; justify-content: center; padding: 0 10px; white-space: nowrap; }
    .tab-item::after { left: 10px; right: 10px; }
    .container { padding: 20px 12px 36px; }
    .toolbar { min-height: 48px; padding-bottom: 12px; }
    .section-heading-desc { display: none; }
    .upload-area { min-height: 132px; margin-bottom: 18px; padding: 22px 14px; }
    .btn { min-height: 40px; }
    .btn-icon { width: 40px; }
    .file-item { padding: 12px 14px; }
    .file-actions { gap: 2px; }
    .text-item { padding: 17px 15px; }
    .text-item-header { align-items: flex-start; gap: 8px; }
    .text-item-meta { white-space: nowrap; }
    .text-item-actions, .markdown-actions { overflow-x: auto; flex-wrap: nowrap; }
    .markdown-card { padding: 19px 16px 14px; }
    .markdown-actions .btn-danger { margin-left: 0; }
    .modal { padding: 12px; }
    .modal-content { padding: 20px 17px; }
    .login-page .card { padding: 28px 23px; }
    .share-page .page { margin: 0; padding: 0; }
    .share-page .article { min-height: 100vh; padding: 26px 18px; border: 0; border-radius: 0; }
    .share-page .top { padding-right: 42px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* 第二轮：交互反馈与高频操作 */
[hidden] { display: none !important; }
.tab-item { gap: 7px; background: transparent; font-family: inherit; }
.tab-item .ui-icon { width: 16px; height: 16px; }
.btn:disabled { cursor: wait; opacity: .72; transform: none; }
.button-spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: button-spin .65s linear infinite; }
@keyframes button-spin { to { transform: rotate(360deg); } }
.btn-danger-solid { color: #fff; background: var(--color-danger); border-color: var(--color-danger); }
.btn-danger-solid:hover { color: #fff; background: #b42318; border-color: #b42318; }

/* 菜单：桌面端浮层，手机端底部操作面板 */
.action-menu { position: relative; display: inline-flex; }
.action-menu-inline { margin-left: auto; }
.action-menu-panel {
    position: absolute; z-index: 80; right: 0; top: calc(100% + 6px); width: 158px; padding: 5px;
    display: none; background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: 10px; box-shadow: 0 12px 30px rgba(16,24,40,.14);
}
.action-menu.open .action-menu-panel { display: grid; animation: menu-in 120ms ease-out; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.action-menu-panel button {
    width: 100%; min-height: 38px; padding: 8px 10px; display: flex; align-items: center; gap: 9px;
    color: #344054; background: transparent; border: 0; border-radius: 7px; text-align: left; cursor: pointer; font-size: 13px; font-weight: 550;
}
.action-menu-panel button:hover, .action-menu-panel button:focus-visible { background: var(--color-surface-muted); }
.action-menu-panel button.danger { color: var(--color-danger); }
.action-menu-panel button.danger:hover { background: var(--color-danger-soft); }
.action-menu-backdrop { display: none; }
.file-actions { align-items: center; gap: 2px; }
.file-list, .text-list { overflow: visible; }
.file-list .file-header { border-radius: var(--radius-card) var(--radius-card) 0 0; }

/* 文件缩略图 */
.file-thumbnail { position: relative; overflow: hidden; background: var(--color-primary-soft); }
.file-thumbnail img { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; object-fit: cover; }
.file-icon-fallback { display: grid; place-items: center; width: 100%; height: 100%; }

/* 通用确认弹窗 */
.confirm-modal .modal-content { position: relative; max-width: 420px; padding: 25px 24px 22px 72px; }
.confirm-icon { position: absolute; left: 23px; top: 24px; width: 36px; height: 36px; display: grid; place-items: center; color: var(--color-danger); background: var(--color-danger-soft); border-radius: 10px; }
.confirm-icon .ui-icon { width: 19px; height: 19px; }
.confirm-modal .modal-header { margin-bottom: 7px; }
.confirm-message { min-height: 40px; margin: 0; color: var(--color-text-secondary); font-size: 14px; line-height: 1.6; }

/* Toast 状态反馈 */
.toast { min-width: 230px; max-width: min(460px, calc(100vw - 28px)); display: flex; align-items: center; gap: 9px; transform: translate(-50%, 8px); }
.toast.show { transform: translate(-50%, 0); }
.toast-icon { width: 18px; height: 18px; display: grid; place-items: center; flex: none; }
.toast-icon svg { width: 18px; height: 18px; }
.toast-message { flex: 1; line-height: 1.45; }
.toast-close { width: 26px; height: 26px; margin: -4px -6px -4px 2px; color: inherit; background: transparent; border: 0; border-radius: 6px; cursor: pointer; font-size: 19px; }
.toast-close:hover { background: rgba(255,255,255,.14); }

/* 图片查看器 */
.image-preview-modal .modal-content { overflow: hidden; padding: 62px 58px 18px; }
.image-preview-title { top: 19px; right: 430px; display: flex; align-items: center; gap: 10px; }
.image-preview-counter { color: rgba(255,255,255,.58); font-size: 12px; }
.image-preview-actions { align-items: center; }
.image-preview-actions .btn-secondary { color: #fff; background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); }
.image-preview-actions .btn-secondary:hover { background: rgba(255,255,255,.18); }
.image-zoom-value { min-width: 62px; }
.image-preview-stage { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; overflow: auto; overscroll-behavior: contain; border-radius: 8px; }
.image-preview-modal .image-preview-stage img { max-width: 100%; max-height: 100%; object-fit: contain; transform-origin: center; transition: transform 120ms ease; }
.image-nav { position: absolute; z-index: 3; top: 50%; width: 42px; height: 58px; margin-top: -21px; color: #fff; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15); border-radius: 10px; cursor: pointer; font-size: 34px; line-height: 1; transition: background var(--transition); }
.image-nav:hover { background: rgba(255,255,255,.2); }
.image-nav-prev { left: 10px; }
.image-nav-next { right: 10px; }

@media (max-width: 768px) {
    body { padding-bottom: 70px; }
    .header-inner { padding-bottom: 10px; }
    .header .tabs {
        position: fixed; z-index: 500; left: 10px; right: 10px; bottom: max(8px, env(safe-area-inset-bottom));
        width: auto; height: 58px; padding: 5px; order: initial; overflow: visible;
        background: rgba(255,255,255,.96); border: 1px solid var(--color-border); border-radius: 16px;
        box-shadow: 0 10px 35px rgba(16,24,40,.18); backdrop-filter: blur(14px);
    }
    html[data-theme="dark"] .header .tabs { background: rgba(14,20,32,.96); box-shadow: 0 14px 38px rgba(0,0,0,.42); }
    .tab-item { min-width: 0; min-height: 48px; padding: 4px 5px; flex-direction: column; justify-content: center; gap: 3px; border-radius: 11px; font-size: 11px; }
    .tab-item::after { display: none; }
    .tab-item .ui-icon { width: 19px; height: 19px; }
    .tab-item.active { color: var(--color-primary); background: var(--color-primary-soft); }
    .action-menu-backdrop.active { position: fixed; z-index: 899; inset: 0; display: block; background: rgba(16,24,40,.38); backdrop-filter: blur(2px); }
    .action-menu.open .action-menu-panel {
        position: fixed; z-index: 900; left: 10px; right: 10px; top: auto; bottom: max(78px, calc(env(safe-area-inset-bottom) + 70px));
        width: auto; padding: 8px; border-radius: 15px; box-shadow: 0 18px 48px rgba(16,24,40,.24); animation: sheet-in 180ms ease-out;
    }
    @keyframes sheet-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
    .action-menu-panel button { min-height: 46px; padding: 10px 12px; font-size: 14px; }
    .file-icon { width: 40px; height: 40px; }
    .file-name { gap: 11px; }
    .confirm-modal .modal-content { padding: 68px 19px 18px; }
    .confirm-icon { left: 19px; top: 18px; }
    .confirm-modal .modal-header { position: absolute; left: 66px; right: 18px; top: 27px; }
    .confirm-modal .modal-buttons { display: grid; grid-template-columns: 1fr 1fr; }
    .toast { bottom: 84px; }
    .image-preview-modal .modal-content { width: 100vw; height: 100dvh; max-height: none; padding: 104px 10px 72px; border: 0; border-radius: 0; }
    .image-preview-title { left: 14px; right: 14px; top: 17px; justify-content: space-between; }
    .image-preview-actions { left: 10px; right: 10px; top: 52px; justify-content: center; }
    .image-preview-actions .btn-primary { margin-left: auto; }
    .image-preview-actions .image-zoom-value { min-width: 58px; }
    .image-nav { top: auto; bottom: 12px; width: 46px; height: 46px; margin: 0; border-radius: 50%; }
    .image-nav-prev { left: calc(50% - 56px); }
    .image-nav-next { right: calc(50% - 56px); }
}
