
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    :root {
    --primary: #1A73E8;
    --primary-light: #E8F0FE;
    --primary-dark: #1557B0;
    --surface: #FFFFFF;
    --background: #F8F9FA;
    --on-surface: #202124;
    --on-surface-variant: #5F6368;
    --outline: #DADCE0;
    --error: #D93025;
    --success: #1E8E3E;
    --warning: #F29900;
    --shadow-1: 0 1px 2px rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
    --shadow-2: 0 1px 3px rgba(60,64,67,.3), 0 4px 8px 3px rgba(60,64,67,.15);
    --shadow-3: 0 4px 8px 3px rgba(60,64,67,.15), 0 1px 3px rgba(60,64,67,.3);
    /* 交互态统一走变量：原先大量硬编码 rgba(60,64,67,…) 在深色模式下几乎不可见 */
    --hover: rgba(60,64,67,.08);
    --hover-strong: rgba(60,64,67,.12);
    --hover-weak: rgba(60,64,67,.06);
    --surface-tint: rgba(60,64,67,.04);
    --focus-ring: rgba(26,115,232,.45);
    --radius-s: 4px;
    --radius-m: 8px;
    --radius-l: 16px;
    --radius-xl: 28px;
    --font-display: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    --font-body: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  }

  /* ── Dark Mode ── */
  [data-theme="dark"] {
    --primary: #8AB4F8;
    --primary-light: #1A2332;
    --primary-dark: #C6DAFC;
    --surface: #1E1E1E;
    --background: #121212;
    --on-surface: #E8EAED;
    --on-surface-variant: #9AA0A6;
    --outline: #3C4043;
    --error: #F28B82;
    --success: #81C995;
    --warning: #FDD663;
    --shadow-1: 0 1px 2px rgba(0,0,0,.3), 0 1px 3px 1px rgba(0,0,0,.15);
    --shadow-2: 0 1px 3px rgba(0,0,0,.3), 0 4px 8px 3px rgba(0,0,0,.15);
    --shadow-3: 0 4px 8px 3px rgba(0,0,0,.15), 0 1px 3px rgba(0,0,0,.3);
    /* 深色模式下的交互态：浅色底纹，否则 hover 完全无反馈 */
    --hover: rgba(232,234,237,.08);
    --hover-strong: rgba(232,234,237,.14);
    --hover-weak: rgba(232,234,237,.05);
    --surface-tint: rgba(232,234,237,.05);
    --focus-ring: rgba(138,180,248,.55);
  }
  [data-theme="dark"] .snackbar { background: #3C4043; color: #E8EAED; }
  [data-theme="dark"] .snackbar-action { color: #8AB4F8; }
  [data-theme="dark"] .selection-bar { background: #1A2332; color: #8AB4F8; }
  [data-theme="dark"] .selection-bar .icon-btn { color: #8AB4F8; }
  [data-theme="dark"] .login-card { background: #1E1E1E; }
  [data-theme="dark"] .file-card-icon[style*="FFF8E1"] { background: #3C2E00 !important; }

  html, body { height: 100vh; overflow: hidden; }
  body {
    font-family: var(--font-body);
    background: var(--background);
    color: var(--on-surface);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
  }

  /* ── Top App Bar ── */
  .app-bar {
    z-index: 100;
    height: 64px;
    background: var(--surface);
    border-bottom: 1px solid var(--outline);
    display: flex; align-items: center;
    padding: 0 24px; gap: 16px;
    box-shadow: var(--shadow-1);
  }
  .app-bar-logo {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; color: inherit;
  }
  .logo-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, #FFB74D 0%, #FB8C00 100%);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 20px;
    overflow: hidden; flex-shrink: 0;
  }
  /* Material Icons Round：jsDelivr CDN 提供 @font-face 和基础样式，此处增强对齐和尺寸稳定性 */
  .material-icons-round {
    font-family: "Material Icons Round";
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    flex-shrink: 0;
    vertical-align: middle;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "liga";
  }
  .logo-icon .material-icons-round { font-size: inherit; }
  .logo-icon-custom { background: transparent; }
  .logo-icon-custom img {
    width: 100%; height: 100%;
    display: block; object-fit: cover;
  }
  .app-bar-title {
    font-family: var(--font-display);
    font-size: 22px; font-weight: 400;
    color: var(--on-surface);
  }
  .app-bar-spacer { flex: 1; }
  .app-bar-actions { display: flex; align-items: center; gap: 8px; }

  /* ── Icon Button ── */
  .icon-btn {
    width: 40px; height: 40px;
    border: none; background: transparent; cursor: pointer;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--on-surface-variant);
    transition: background .2s;
    position: relative;
  }
  .icon-btn:hover { background: var(--hover); }
  .icon-btn:active { background: var(--hover-strong); }
  .icon-btn .material-icons-round { font-size: 20px; }

  .theme-ripple {
    position: fixed; left: 0; top: 0; z-index: 10000;
    width: 1px; height: 1px; border-radius: 50%;
    pointer-events: none; transform: translate(-50%, -50%) scale(0);
    transition: transform .55s cubic-bezier(.4, 0, .2, 1);
    will-change: transform;
  }
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
  }

  /* ── Layout ── */
  .layout { display: flex; flex: 1; min-height: 0; }

  /* ── Sidebar ── */
  .sidebar {
    width: 256px; flex-shrink: 0;
    background: var(--surface);
    padding: 8px 0;
    border-right: 1px solid var(--outline);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .sidebar-section { padding: 8px 0; }
  .sidebar-label {
    font-family: var(--font-display);
    font-size: 11px; font-weight: 500;
    color: var(--on-surface-variant);
    letter-spacing: .8px; text-transform: uppercase;
    padding: 8px 16px 4px;
  }
  .sidebar-item {
    display: flex; align-items: center; gap: 12px;
    padding: 0 16px; height: 40px; cursor: pointer;
    border-radius: var(--radius-xl); margin: 2px 8px;
    border: none; background: transparent;
    color: var(--on-surface-variant);
    transition: background .15s;
    text-decoration: none; font-size: 14px;
    font-family: var(--font-body); font-weight: 500;
    width: calc(100% - 16px); text-align: left;
  }
  .sidebar-item:hover { background: var(--hover); }
  .sidebar-item.active {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 700;
  }
  .sidebar-item.active .material-icons-round { color: var(--primary); }
  .sidebar-item .material-icons-round { font-size: 20px; }
  .sidebar-divider { height: 1px; background: var(--outline); margin: 8px 16px; }

  /* ── Main Content ── */
  .main { flex: 1; padding: 24px 32px; overflow-x: hidden; overflow-y: auto; min-height: 0; }

  /* ── Breadcrumb ── */
  .breadcrumb {
    display: flex; align-items: center; gap: 4px;
    margin-bottom: 20px; flex-wrap: wrap;
  }
  .breadcrumb-item {
    display: flex; align-items: center; gap: 4px;
    font-family: var(--font-display); font-size: 14px;
  }
  .breadcrumb-link {
    color: var(--on-surface-variant); text-decoration: none;
    padding: 4px 8px; border-radius: var(--radius-s);
    transition: background .15s;
  }
  .breadcrumb-link:hover { background: var(--hover); color: var(--on-surface); }
  .breadcrumb-current { color: var(--on-surface); font-weight: 500; padding: 4px 8px; }
  .breadcrumb-sep { color: var(--on-surface-variant); font-size: 18px; }

  /* ── Toolbar ── */
  .toolbar {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 16px; flex-wrap: wrap;
  }
  .toolbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

  /* ── FAB ── */
  .fab {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--primary); color: white;
    border: none; border-radius: var(--radius-xl);
    padding: 0 24px; height: 48px; cursor: pointer;
    font-family: var(--font-display); font-size: 14px; font-weight: 500;
    box-shadow: var(--shadow-2); transition: box-shadow .2s, background .2s;
    letter-spacing: .25px;
  }
  .fab:hover { background: var(--primary-dark); box-shadow: var(--shadow-3); }
  .fab .material-icons-round { font-size: 18px; }

  /* ── Outlined Button ── */
  .btn-outlined {
    display: inline-flex; align-items: center; gap: 8px;
    background: transparent; color: var(--primary);
    border: 1px solid var(--outline); border-radius: var(--radius-xl);
    padding: 0 20px; height: 40px; cursor: pointer;
    font-family: var(--font-display); font-size: 14px; font-weight: 500;
    transition: background .15s, border-color .15s;
  }
  .btn-outlined:hover { background: var(--primary-light); border-color: var(--primary); }
  .btn-outlined .material-icons-round { font-size: 18px; }

  /* ── Disabled states ── */
  /* 说明：.fab / .btn-outlined / .icon-btn 原先没有禁用样式，
     导致 #shareCreateBtn、#orphanDeleteBtn 等禁用后仍显示为可点击，用户会反复点击无效按钮 */
  .fab:disabled,
  .btn-outlined:disabled,
  .icon-btn:disabled,
  .action-btn:disabled,
  .chip:disabled,
  .login-btn:disabled {
    opacity: .45; cursor: not-allowed; pointer-events: none; box-shadow: none;
  }
  .fab:disabled { background: var(--outline); color: var(--on-surface-variant); }

  /* ── Focus ring（键盘可达性）── */
  .fab:focus-visible,
  .btn-outlined:focus-visible,
  .icon-btn:focus-visible,
  .action-btn:focus-visible,
  .chip:focus-visible,
  .sidebar-item:focus-visible,
  .view-toggle-btn:focus-visible,
  .text-field:focus-visible,
  .search-field:focus-visible,
  .file-card:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
  }
  /* 表单控件在深色模式下需要可见的占位符与光标 */
  .text-field::placeholder, .search-field::placeholder { color: var(--on-surface-variant); opacity: .75; }

  /* ── File Grid ── */
  .file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    margin-bottom: 32px;
  }
  .file-card {
    background: var(--surface);
    border: 1px solid var(--outline);
    border-radius: var(--radius-m);
    padding: 12px;
    cursor: pointer;
    transition: box-shadow .15s, border-color .15s;
    display: flex; flex-direction: column; gap: 8px;
    position: relative; user-select: none;
  }
  .file-card:hover { box-shadow: var(--shadow-2); border-color: transparent; }
  .file-card.selected { border-color: var(--primary); background: var(--primary-light); }
  .file-card-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius-s);
    display: flex; align-items: center; justify-content: center;
    font-size: 28px;
  }
  .file-card-name {
    font-size: 13px; font-weight: 500;
    color: var(--on-surface);
    overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    line-height: 1.4;
  }
  .file-card-meta {
    font-size: 11px; color: var(--on-surface-variant);
    display: flex; flex-direction: column; gap: 2px;
  }
  .file-card-actions {
    position: absolute; top: 8px; right: 8px;
    opacity: 0; transition: opacity .15s;
  }
  .file-card:hover .file-card-actions { opacity: 1; }

  /* ── File List (Table) ── */
  .file-list { width: 100%; border-collapse: collapse; }
  .file-list th {
    text-align: left; padding: 8px 12px;
    font-size: 12px; font-weight: 500;
    color: var(--on-surface-variant);
    border-bottom: 1px solid var(--outline);
    white-space: nowrap; cursor: pointer; user-select: none;
  }
  .file-list th:hover { color: var(--on-surface); }
  .file-list th .th-inner { display: flex; align-items: center; gap: 4px; }
  .file-list td { padding: 6px 12px; border-bottom: 1px solid var(--outline); }
  .file-list tr:hover td { background: var(--surface-tint); }
  .file-list tr.selected td { background: var(--primary-light); }
  .file-row-icon { display: flex; align-items: center; gap: 12px; }
  .file-row-name {
    font-size: 14px; color: var(--on-surface); cursor: pointer;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 400px;
  }
  .file-row-name:hover { color: var(--primary); text-decoration: underline; }
  .file-row-meta { font-size: 13px; color: var(--on-surface-variant); white-space: nowrap; }
  .file-row-actions { opacity: 0; display: flex; gap: 4px; }
  tr:hover .file-row-actions { opacity: 1; }

  /* ── Empty State ── */
  .empty-state {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 80px 0; gap: 16px;
    color: var(--on-surface-variant);
  }
  .empty-state > .material-icons-round { font-size: 80px; opacity: .4; color: var(--primary); }
  .empty-state h3 { font-family: var(--font-display); font-size: 20px; font-weight: 400; }
  .empty-state p { font-size: 14px; text-align: center; max-width: 300px; }

  /* ── Modal ── */
  .modal-overlay {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(0,0,0,.6);
    display: flex; align-items: center; justify-content: center;
    padding: 24px; opacity: 0; pointer-events: none;
    transition: opacity .2s;
  }
  .modal-overlay.open { opacity: 1; pointer-events: all; }
  .modal {
    background: var(--surface); border-radius: var(--radius-l);
    width: 100%; max-width: 480px;
    box-shadow: var(--shadow-3);
    transform: translateY(20px) scale(.97);
    transition: transform .2s;
    overflow: hidden;
    /* 原先无 max-height：内容较多的弹窗（存储节点/API Token/重复检测）会超出视口，
       而 overflow:hidden 会把底部按钮裁掉且无法滚动，导致操作入口不可达 */
    display: flex; flex-direction: column;
    max-height: min(88vh, 100%);
  }
  .modal-overlay.open .modal { transform: none; }
  .modal-header {
    padding: 24px 24px 16px;
    display: flex; align-items: center; gap: 12px;
    flex-shrink: 0;
  }
  .modal-title { font-family: var(--font-display); font-size: 20px; font-weight: 400; }
  .modal-body { padding: 0 24px 16px; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
  .modal-footer {
    padding: 8px 16px 16px;
    display: flex; justify-content: flex-end; gap: 8px;
    flex-shrink: 0; flex-wrap: wrap;
  }
  .share-summary {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; margin-bottom: 16px;
    border: 1px solid var(--outline); border-radius: var(--radius-m);
    background: var(--surface-tint);
  }
  .share-summary .material-icons-round { color: var(--primary); }
  .share-summary-main { min-width: 0; flex: 1; }
  .share-summary-label { font-size: 12px; color: var(--on-surface-variant); margin-bottom: 2px; }
  .share-summary-path { font-size: 14px; color: var(--on-surface); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .share-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .share-form-grid .full { grid-column: 1 / -1; }
  .share-hint { font-size: 12px; color: var(--on-surface-variant); margin-top: 6px; line-height: 1.45; }
  .share-result {
    display: none; margin-top: 16px; padding: 12px;
    border: 1px solid var(--outline); border-radius: var(--radius-m);
    background: var(--primary-light);
  }
  .share-result.open { display: block; }
  .share-link-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
  .share-link-row .text-field { flex: 1; min-width: 0; }
  .share-records {
    margin-top: 18px; border-top: 1px solid var(--outline);
    padding-top: 14px; display: flex; flex-direction: column; gap: 8px;
    max-height: 260px; overflow-y: auto;
  }
  .share-record-row {
    border: 1px solid var(--outline); border-radius: var(--radius-m);
    padding: 10px 12px; background: var(--surface);
  }
  .share-record-row.editing { border-color: var(--primary); background: var(--primary-light); }
  .share-record-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
  .share-record-url {
    flex: 1; min-width: 0; font-size: 13px; color: var(--primary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .share-record-meta { font-size: 12px; color: var(--on-surface-variant); line-height: 1.5; }
  .share-record-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
  .share-record-actions .btn-outlined { height: 32px; padding: 0 10px; font-size: 12px; }
  .share-record-empty {
    padding: 14px; border: 1px dashed var(--outline); border-radius: var(--radius-m);
    color: var(--on-surface-variant); font-size: 13px; text-align: center;
  }
  @media (max-width: 640px) {
    .share-form-grid { grid-template-columns: 1fr; }
    .share-link-row { flex-direction: column; align-items: stretch; }
  }

  /* ── Upload Zone ── */
  .upload-zone {
    border: 2px dashed var(--outline); border-radius: var(--radius-m);
    padding: 40px 24px; text-align: center;
    cursor: pointer; transition: border-color .15s, background .15s;
    margin-bottom: 16px;
  }
  .upload-zone:hover, .upload-zone.drag-over {
    border-color: var(--primary); background: var(--primary-light);
  }
  .upload-zone .material-icons-round { font-size: 48px; color: var(--primary); margin-bottom: 12px; }
  .upload-zone h4 { font-family: var(--font-display); font-size: 16px; margin-bottom: 4px; }
  .upload-zone p { font-size: 13px; color: var(--on-surface-variant); }

  /* ── Preview Modal ── */
  .preview-overlay {
    position: fixed; inset: 0; z-index: 220;
    background: rgba(0,0,0,.7);
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
    opacity: 0; pointer-events: none;
    transition: opacity .2s;
  }
  .preview-overlay.open { opacity: 1; pointer-events: all; }
  .preview-modal {
    background: var(--surface); border-radius: var(--radius-l);
    width: 100%; max-width: 92vw;
    height: 88vh;
    box-shadow: var(--shadow-3);
    display: flex; flex-direction: column;
    overflow: hidden;
  }
  .preview-header {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--outline);
    flex-shrink: 0;
  }
  .preview-title {
    font-family: var(--font-display);
    font-size: 16px; font-weight: 500;
    flex: 1; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
  }
  .preview-header-actions {
    display: flex; align-items: center; gap: 4px;
  }
  .preview-body {
    flex: 1; min-height: 0;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    background: var(--background);
  }
  .preview-body img {
    max-width: 100%; max-height: 100%;
    object-fit: contain;
    padding: 8px;
  }
  .preview-body video {
    max-width: 100%; max-height: 100%;
    width: 100%; padding: 8px;
  }
  .preview-body audio {
    width: 80%; padding: 0 24px;
  }
  .preview-body iframe,
  .preview-body embed {
    width: 100%; height: 100%;
    border: none;
  }
  .preview-body .preview-text-wrap {
    width: 100%; height: 100%;
    overflow: auto;
    padding: 16px 24px;
  }
  .preview-body .preview-text-wrap pre {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
    color: var(--on-surface);
    margin: 0;
  }
  .preview-loading {
    display: flex; flex-direction: column;
    align-items: center; gap: 12px;
    color: var(--on-surface-variant);
  }
  .preview-unavailable {
    display: flex; flex-direction: column;
    align-items: center; gap: 12px;
    color: var(--on-surface-variant);
    padding: 24px; text-align: center;
  }
  .preview-unavailable .material-icons-round { font-size: 64px; opacity: .4; }
  .preview-unavailable h3 { font-family: var(--font-display); font-size: 18px; font-weight: 400; margin: 0; }
  .preview-unavailable p { font-size: 14px; margin: 0; max-width: 360px; }

  /* ── Progress ── */
  .progress-list { display: flex; flex-direction: column; gap: 10px; max-height: 280px; overflow-y: auto; }
  .progress-item { display: flex; flex-direction: column; gap: 4px; }
  .progress-item-name { font-size: 13px; display: flex; justify-content: space-between; gap: 12px; }
  .progress-item-name > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .progress-item-status { color: var(--on-surface-variant); white-space: nowrap; flex-shrink: 0; }
  .progress-item-status.ok { color: var(--success); font-weight: 500; }
  .progress-item-status.error { color: var(--error); font-weight: 500; }
  .progress-item-sub { font-size: 11px; color: var(--on-surface-variant); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .progress-bar { height: 4px; background: var(--outline); border-radius: 2px; overflow: hidden; }
  .progress-fill { height: 100%; background: var(--primary); border-radius: 2px; transition: width .3s; }
  .progress-fill.done { background: var(--success); }
  .progress-fill.error { background: var(--error); }

  /* ── Upload Summary (multi-file batch progress) ── */
  .upload-summary { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
  .upload-summary-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; font-weight: 500; }
  .upload-summary-bar { height: 6px; border-radius: 3px; }
  .upload-clear-btn {
    border: none; background: transparent; color: var(--primary);
    font-size: 12px; font-family: var(--font-body); cursor: pointer;
    padding: 4px 10px; border-radius: var(--radius-s); transition: background .15s;
    white-space: nowrap; flex-shrink: 0;
  }
  .upload-clear-btn:hover { background: var(--hover); }
  .upload-clear-btn:disabled { opacity: .38; cursor: default; pointer-events: none; }

  /* ── Upload Mini Indicator (background uploads) ── */
  .upload-mini {
    position: fixed; right: 24px; bottom: 24px; z-index: 180;
    display: none; align-items: center; gap: 10px;
    background: var(--surface); color: var(--on-surface);
    border: 1px solid var(--outline); border-radius: var(--radius-l);
    box-shadow: var(--shadow-3); padding: 12px 16px;
    cursor: pointer; min-width: 230px; max-width: 320px;
  }
  .upload-mini.show { display: flex; }
  .upload-mini .material-icons-round { color: var(--primary); font-size: 22px; }
  .upload-mini-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
  .upload-mini-text { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .upload-mini .progress-bar { height: 6px; border-radius: 3px; }
  @media (max-width: 768px) {
    .upload-mini { right: 16px; bottom: 72px; min-width: 180px; }
  }

  /* ── Full-page Drop Overlay ── */
  .drop-overlay {
    position: fixed; inset: 0; z-index: 400;
    display: none; align-items: center; justify-content: center;
    background: rgba(26,115,232,.14);
    pointer-events: none;
  }
  .drop-overlay.show { display: flex; }
  .drop-overlay-inner {
    border: 3px dashed var(--primary);
    border-radius: var(--radius-l);
    background: var(--surface);
    box-shadow: var(--shadow-3);
    padding: 40px 56px; text-align: center;
    color: var(--on-surface);
    max-width: 90vw;
  }
  .drop-overlay-inner .material-icons-round { font-size: 64px; color: var(--primary); margin-bottom: 12px; }
  .drop-overlay-inner h3 { font-family: var(--font-display); font-size: 22px; font-weight: 500; margin-bottom: 6px; }
  .drop-overlay-inner p { font-size: 13px; color: var(--on-surface-variant); line-height: 1.6; }

  /* ── Search ── */
  .search-field {
    flex: 1; max-width: 420px; min-width: 120px;
    height: 40px; padding: 0 16px;
    border: 1px solid var(--outline); border-radius: var(--radius-xl);
    background: var(--background); color: var(--on-surface);
    font-family: var(--font-body); font-size: 14px; outline: none;
    transition: border-color .15s, background .15s;
  }
  .search-field:focus { border-color: var(--primary); background: var(--surface); }
  .search-results {
    position: fixed; top: 68px; left: 50%; transform: translateX(-50%);
    width: min(560px, calc(100vw - 32px));
    max-height: 60vh; overflow-y: auto;
    background: var(--surface); border: 1px solid var(--outline);
    border-radius: var(--radius-m); box-shadow: var(--shadow-3);
    z-index: 350; display: none; flex-direction: column;
  }
  .search-results.open { display: flex; }
  .search-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; cursor: pointer; }
  .search-row:hover { background: var(--hover); }
  .search-row > .material-icons-round { font-size: 22px; flex-shrink: 0; }
  .search-row-main { flex: 1; min-width: 0; }
  .search-row-name { font-size: 14px; color: var(--on-surface); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .search-row-dir { font-size: 12px; color: var(--on-surface-variant); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .search-row-size { font-size: 12px; color: var(--on-surface-variant); flex-shrink: 0; }
  .search-empty { padding: 24px; text-align: center; color: var(--on-surface-variant); font-size: 13px; }

  /* ── Thumbnails ── */
  .file-card-icon.with-thumb { width: 100%; height: 132px; background: var(--background); overflow: hidden; }
  .file-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }

  /* ── QR ── */
  .share-qr { display: none; margin-top: 12px; padding: 12px; background: #fff; border-radius: var(--radius-m); width: fit-content; }
  .share-qr.open { display: block; }
  .share-qr svg { width: 168px; height: 168px; display: block; }

  /* ── Markdown preview ── */
  .preview-md { font-size: 14px; line-height: 1.7; color: var(--on-surface); }
  .preview-md h1, .preview-md h2, .preview-md h3, .preview-md h4 { margin: 16px 0 8px; line-height: 1.3; }
  .preview-md h1 { font-size: 24px; } .preview-md h2 { font-size: 20px; } .preview-md h3 { font-size: 17px; }
  .preview-md p { margin: 8px 0; }
  .preview-md pre { background: var(--background); padding: 12px; border-radius: var(--radius-s); overflow-x: auto; }
  .preview-md code { font-family: 'Consolas','Monaco',monospace; font-size: 13px; background: var(--background); padding: 2px 5px; border-radius: 4px; }
  .preview-md pre code { background: none; padding: 0; }
  .preview-md a { color: var(--primary); }
  .preview-md ul, .preview-md ol { padding-left: 22px; margin: 8px 0; }
  .preview-md blockquote { border-left: 3px solid var(--outline); margin: 8px 0; padding: 2px 12px; color: var(--on-surface-variant); }
  .preview-md hr { border: none; border-top: 1px solid var(--outline); margin: 16px 0; }

  /* ── Preview editing ── */
  .preview-edit-area {
    width: 100%; height: 100%; min-height: 300px;
    font-family: 'Consolas','Monaco',monospace; font-size: 13px; line-height: 1.6;
    color: var(--on-surface); background: var(--surface);
    border: none; outline: none; resize: none; padding: 16px 24px;
  }
  .preview-text-wrap { display: flex; flex-direction: column; }
  .preview-text-wrap .preview-edit-area { flex: 1; }
  .preview-edit-bar { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 24px; border-top: 1px solid var(--outline); }

  /* ── Upload cancel / pause ── */
  .progress-cancel {
    border: none; background: none; color: var(--on-surface-variant);
    cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px;
    flex-shrink: 0; border-radius: var(--radius-s); font-family: var(--font-body);
  }
  .progress-cancel:hover { color: var(--error); }
  .progress-item-status.cancelled { color: var(--on-surface-variant); }

  /* ── WebDAV accounts ── */
  .dav-account-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .dav-account-date { font-size: 11px; color: var(--on-surface-variant); }
  .dav-badge { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 10px; flex-shrink: 0; }
  .dav-badge.rw { background: rgba(52,168,83,.15); color: var(--success); }
  .dav-badge.ro { background: rgba(242,153,0,.15); color: var(--warning); }
  .dav-field-row { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
  .dav-field-label { font-size: 11px; color: var(--on-surface-variant); width: 36px; flex-shrink: 0; }
  .dav-field {
    flex: 1; min-width: 0; padding: 6px 10px;
    font-size: 12px; font-family: 'Consolas','Monaco',monospace;
    border: 1px solid var(--outline); border-radius: var(--radius-s);
    background: var(--background); color: var(--on-surface); outline: none;
  }
  .dav-copy-btn { height: 30px; padding: 0 10px; font-size: 12px; flex-shrink: 0; }
  .list-sentinel { height: 1px; }

  /* ── Drag & Drop Move ── */
  .file-card.dragging { opacity: .45; }
  .file-card.drop-target { border-color: var(--primary); background: var(--primary-light); box-shadow: var(--shadow-2); }
  .file-list tr.drop-target td { background: var(--primary-light) !important; }
  .breadcrumb-link.drop-target, .sidebar-item.drop-target {
    background: var(--primary-light) !important; color: var(--primary-dark);
  }

  /* ── Input ── */
  .text-field {
    width: 100%; padding: 12px 16px;
    border: 1px solid var(--outline); border-radius: var(--radius-s);
    font-family: var(--font-body); font-size: 14px; color: var(--on-surface);
    background: var(--surface); outline: none; transition: border-color .15s;
  }
  .text-field:focus { border-color: var(--primary); border-width: 2px; }
  .field-label {
    display: block; font-size: 12px; font-weight: 500;
    color: var(--on-surface-variant); margin-bottom: 6px;
  }

  /* ── Chip ── */
  .chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 0 12px; height: 32px; border-radius: 16px;
    border: 1px solid var(--outline); background: transparent;
    font-size: 13px; cursor: pointer; font-family: var(--font-body);
    color: var(--on-surface); transition: background .15s;
  }
  .chip:hover { background: var(--hover); }
  .chip.active { background: var(--primary-light); border-color: var(--primary); color: var(--primary-dark); }
  .chip .material-icons-round { font-size: 16px; }

  /* ── Snackbar ── */
  .snackbar {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
    background: #323232; color: white; border-radius: var(--radius-s);
    padding: 12px 24px; font-size: 14px; z-index: 300;
    display: flex; align-items: center; gap: 16px;
    box-shadow: var(--shadow-3); transition: transform .3s cubic-bezier(.4,0,.2,1);
    /* 原先为 nowrap：长文案（如含文件名的失败提示）会溢出手机屏幕且无法阅读 */
    max-width: min(560px, calc(100vw - 32px));
    white-space: normal; word-break: break-word; text-align: left;
  }
  .snackbar.show { transform: translateX(-50%) translateY(0); }
  .snackbar-action { color: #BB86FC; font-weight: 500; cursor: pointer; background: none; border: none; font-size: 14px; flex-shrink: 0; }

  /* ── Login ── */
  .login-wrap {
    flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center;
    background: #F1F3F4;
    position: relative; overflow: hidden; padding: 24px;
  }
  [data-theme="dark"] .login-wrap { background: var(--background); }
  .login-bg-image {
    position: absolute; inset: 0; z-index: 0;
    width: 100%; height: 100%; object-fit: cover;
  }
  .login-theme-toggle {
    position: fixed; top: 24px; right: 24px; z-index: 2;
    background: var(--surface); box-shadow: var(--shadow-1);
  }
  .login-card {
    background: var(--surface); border-radius: var(--radius-l);
    padding: 48px 40px; width: 400px; max-width: 100%;
    box-shadow: var(--shadow-2); text-align: center;
    position: relative; z-index: 1;
  }
  .login-logo { margin-bottom: 32px; }
  .login-logo .logo-icon { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 20px; font-size: 32px; }
  .login-title { font-family: var(--font-display); font-size: 28px; font-weight: 400; margin-bottom: 8px; }
  .login-sub { color: var(--on-surface-variant); font-size: 14px; margin-bottom: 32px; }
  .login-btn {
    width: 100%; height: 48px; background: var(--primary); color: white;
    border: none; border-radius: var(--radius-xl); cursor: pointer;
    font-family: var(--font-display); font-size: 16px; font-weight: 500;
    margin-top: 16px; transition: background .15s; box-shadow: var(--shadow-1);
  }
  .login-btn:hover { background: var(--primary-dark); }
  .login-error { color: var(--error); font-size: 13px; margin-top: 8px; min-height: 20px; }

  /* ── View Toggle ── */
  .view-toggle { display: flex; border: 1px solid var(--outline); border-radius: var(--radius-m); overflow: hidden; }
  .view-toggle-btn {
    width: 40px; height: 36px; border: none; background: transparent;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--on-surface-variant); transition: background .15s;
  }
  .view-toggle-btn:hover { background: var(--hover); }
  .view-toggle-btn.active { background: var(--primary-light); color: var(--primary); }
  .view-toggle-btn .material-icons-round { font-size: 20px; }

  /* ── Responsive ── */
  @media (max-width: 768px) {
    .sidebar { display: none; }
    .main { padding: 16px; }
    .file-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .app-bar-title { font-size: 18px; }
    .login-theme-toggle { top: 16px; right: 16px; }
  }

  /* ── 触屏设备：hover 不可达的控件必须常显 ──
     原先 .file-card-actions / .file-row-actions 依赖 :hover，
     触摸屏上永远不显示，用户只能靠长按，操作入口几乎不可发现 */
  @media (hover: none), (pointer: coarse) {
    .file-card-actions,
    .file-row-actions { opacity: 1; }
    .file-card:active { box-shadow: var(--shadow-2); }
    /* 触屏点击目标不小于 40px，避免误触 */
    .icon-btn { min-width: 40px; min-height: 40px; }
  }
  /* 键盘/鼠标用户：hover 不可用时也保证可发现性 */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: .001ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: .001ms !important;
    }
  }

  /* ── Context Menu ── */
  .context-menu {
    position: fixed; z-index: 250;
    background: var(--surface); border-radius: var(--radius-m);
    box-shadow: var(--shadow-3); padding: 4px 0; min-width: 180px;
    display: none;
  }
  .context-menu.open { display: block; }
  .context-menu-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px; cursor: pointer; font-size: 14px;
    color: var(--on-surface); transition: background .1s;
  }
  .context-menu-item:hover { background: var(--hover); }
  .context-menu-item.danger { color: var(--error); }
  .context-menu-item .material-icons-round { font-size: 18px; color: var(--on-surface-variant); }
  .context-menu-item.danger .material-icons-round { color: var(--error); }
  .context-menu-divider { height: 1px; background: var(--outline); margin: 4px 0; }

  /* ── Storage Bar ── */
  .storage-info { padding: 16px; margin-top: auto; border: none; background: transparent; text-align: left; width: 100%; cursor: pointer; }
  .storage-info:hover { background: var(--hover); }
  .storage-bar { height: 4px; background: var(--outline); border-radius: 2px; overflow: hidden; margin: 6px 0; }
  .storage-fill { height: 100%; background: var(--primary); border-radius: 2px; }
  .storage-text { font-size: 12px; color: var(--on-surface-variant); }
  .storage-details { display: none; margin-top: 12px; gap: 10px; flex-direction: column; }
  .storage-info.expanded .storage-details { display: flex; }
  .storage-node-name { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--on-surface); }
  .storage-node-meta { font-size: 11px; color: var(--on-surface-variant); margin-top: 2px; }

  /* ── Selection Bar ── */
  .selection-bar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 150;
    background: var(--primary); color: white; height: 56px;
    display: flex; align-items: center; padding: 0 24px; gap: 16px;
    transform: translateY(100%); transition: transform .25s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 -2px 8px rgba(0,0,0,.2);
  }
  .selection-bar.open { transform: none; }
  .selection-bar-count { font-family: var(--font-display); font-size: 16px; font-weight: 500; flex: 1; }
    .selection-bar .icon-btn { color: white; }
  .selection-bar .icon-btn:hover { background: rgba(255,255,255,.15); }

  /* ── Action Bar (Horizontal) ── */
  .action-bar {
    display: flex; align-items: center; gap: 4px;
    background: var(--surface);
    border: 1px solid var(--outline);
    border-radius: var(--radius-m);
    padding: 4px 8px;
    margin-bottom: 16px;
    min-height: 48px;
    flex-wrap: wrap;
    box-shadow: var(--shadow-1);
    transition: opacity .2s;
  }
  .action-bar:empty { display: none; }
  .action-bar-count {
    font-size: 13px; font-weight: 500;
    color: var(--on-surface-variant);
    padding: 0 8px; white-space: nowrap;
  }
  .action-bar-divider {
    width: 1px; height: 28px;
    background: var(--outline); margin: 0 4px;
  }
  .action-btn {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 6px 12px;
    border: none; background: transparent;
    border-radius: var(--radius-s);
    cursor: pointer;
    font-family: var(--font-body); font-size: 13px; font-weight: 500;
    color: var(--on-surface-variant);
    transition: background .15s, color .15s;
    white-space: nowrap;
  }
  .action-btn:hover { background: var(--hover); color: var(--on-surface); }
  .action-btn:active { background: var(--hover-strong); }
  .action-btn .material-icons-round { font-size: 18px; }
  .action-btn.danger:hover { color: var(--error); background: rgba(217,48,37,.08); }
  .action-btn:disabled {
    opacity: .38; cursor: default; pointer-events: none;
  }
  /* 深色模式 hover 已由 --hover 变量统一处理，无需重复覆盖 */
  [data-theme="dark"] .action-btn.danger:hover { background: rgba(242,139,130,.08); }
  .action-bar.download-only { display: none; }
  .action-bar.download-only.has-download { display: flex; }
  .download-progress {
    display: none; align-items: center; gap: 10px;
    margin-left: auto; min-width: 260px; max-width: 560px;
    flex: 1 1 360px; padding: 2px 4px;
  }
  .download-progress.open { display: flex; }
  .download-progress .material-icons-round {
    font-size: 18px; color: var(--primary); flex: 0 0 auto;
  }
  .download-progress-main {
    display: flex; flex-direction: column; gap: 5px;
    min-width: 0; flex: 1;
  }
  .download-progress-top {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; min-width: 0; font-size: 12px;
  }
  .download-progress-name {
    min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--on-surface); font-weight: 500;
  }
  .download-progress-stats {
    color: var(--on-surface-variant); white-space: nowrap; flex: 0 0 auto;
  }
  .download-progress-bar {
    height: 6px; border-radius: 999px; overflow: hidden;
    background: var(--outline);
  }
  .download-progress-fill {
    width: 0%; height: 100%; border-radius: inherit;
    background: var(--primary); transition: width .15s linear, background .15s;
  }
  .download-progress.done .download-progress-fill { background: var(--success); }
  .download-progress.error .download-progress-fill { background: var(--error); }
  @media (max-width: 720px) {
    .download-progress { min-width: 100%; margin-left: 0; }
  }

  .node-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
  .node-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border: 1px solid var(--outline);
    border-radius: var(--radius-m); background: var(--background);
  }
  .node-row-main { flex: 1; min-width: 0; }
  .node-row-title { font-size: 14px; font-weight: 500; color: var(--on-surface); }
  .node-row-sub { font-size: 12px; color: var(--on-surface-variant); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .node-row-bar { height: 4px; background: var(--outline); border-radius: 2px; overflow: hidden; margin-top: 8px; }
  .node-row-fill { height: 100%; background: var(--primary); border-radius: 2px; }
  .node-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .node-form-grid .full { grid-column: 1 / -1; }
  @media (max-width: 560px) {
    .node-form-grid { grid-template-columns: 1fr; }
  }

  /* ── R2 File Viewer (in storage node modal) ── */
  .r2file-view { display: none; flex-direction: column; gap: 0; }
  .r2file-view.open { display: flex; }
  .r2file-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
  .r2file-toolbar .node-row-title { flex: 1; }
  .r2file-list { display: flex; flex-direction: column; gap: 4px; max-height: 360px; overflow-y: auto; margin-bottom: 12px; }
  .r2file-row {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; border-radius: var(--radius-s);
    border: 1px solid transparent;
    font-size: 13px; font-family: 'Consolas','Monaco',monospace;
    color: var(--on-surface);
  }
  .r2file-row:hover { background: var(--hover-weak); }
  .r2file-key {
    flex: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .r2file-size { font-size: 12px; color: var(--on-surface-variant); white-space: nowrap; flex-shrink: 0; }
  .r2file-stats { font-size: 12px; color: var(--on-surface-variant); margin-bottom: 8px; }
  .r2file-load-more { text-align: center; margin-top: 4px; }
  .r2file-load-more button {
    padding: 6px 20px; border: 1px solid var(--outline);
    border-radius: var(--radius-xl); background: transparent;
    cursor: pointer; font-size: 13px; color: var(--primary);
    transition: background .15s;
  }
  .r2file-load-more button:hover { background: var(--hover); }
  .r2file-load-more button:disabled { opacity: .38; cursor: default; }
  .node-view-toggle { display: none; }
  .node-view-toggle.open { display: flex; }

  /* ── Orphan Cleanup ── */
  .orphan-list { display: flex; flex-direction: column; gap: 4px; max-height: 360px; overflow-y: auto; margin-bottom: 12px; }
  .orphan-row {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; border-radius: var(--radius-s);
    cursor: pointer; transition: background .1s;
    border: 1px solid transparent;
  }
  .orphan-row:hover { background: var(--hover-weak); }
  .orphan-row:has(input:checked) { background: var(--primary-light); border-color: var(--primary); }
  .orphan-check { width: 18px; height: 18px; flex-shrink: 0; cursor: pointer; accent-color: var(--primary); }
  .orphan-key {
    flex: 1; min-width: 0; font-size: 13px; font-family: 'Consolas','Monaco',monospace;
    color: var(--on-surface); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .orphan-size { font-size: 12px; color: var(--on-surface-variant); white-space: nowrap; flex-shrink: 0; }
  .orphan-select-all { display: flex; align-items: center; gap: 8px; padding: 4px 12px; margin-bottom: 4px; font-size: 13px; color: var(--on-surface-variant); cursor: pointer; }
  .orphan-stats { font-size: 12px; color: var(--on-surface-variant); padding: 0 12px; margin-bottom: 8px; }
  @keyframes spin { to { transform: rotate(360deg); } }

    /* ── Dark Mode Toggle ── */
  /* Icon is handled by JS toggleDarkMode() */

  /* ── Foot Bar ── */
  .foot-bar {
    background: var(--surface);
    border-top: 1px solid var(--outline);
    padding: 12px 24px;
    font-size: 12px;
    color: var(--on-surface-variant);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    text-align: center;
    line-height: 1.6;
  }
  .foot-bar a {
    color: var(--primary);
    text-decoration: none;
  }
  .foot-bar a:hover {
    text-decoration: underline;
  }
  .foot-bar-sep {
    color: var(--outline);
    user-select: none;
  }
  @media (max-width: 768px) {
    .foot-bar {
      padding: 10px 16px;
      flex-direction: column;
      gap: 6px;
    }
    .foot-bar-sep {
      display: none;
    }
  }

  /* ── Version Update Badge ── */
  .version-info {
    display: inline-flex; align-items: center; gap: 6px;
    cursor: pointer; position: relative;
    text-decoration: none; color: inherit;
    transition: color .15s;
    /* Expand hover area upward so the mouse doesn't lose hover when bridging to tooltip */
    padding-top: 6px; margin-top: -6px;
  }
  .version-info:hover { color: var(--primary); }
  .version-badge {
    display: none;
    font-size: 10px; font-weight: 700;
    background: var(--error); color: #fff;
    border-radius: 10px; padding: 1px 7px;
    line-height: 1.6; white-space: nowrap;
    animation: versionPulse 2s ease-in-out infinite;
  }
  .version-badge.show { display: inline; }
  @keyframes versionPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .65; }
  }
  /* Transparent hover bridge — keeps :hover active while cursor crosses the gap */
  .version-info::before {
    content: ''; position: absolute;
    bottom: 100%; left: 0; right: 0;
    height: 22px;
    background: transparent;
  }
  .version-tooltip {
    opacity: 0; visibility: hidden;
    pointer-events: none;
    position: absolute; bottom: calc(100% + 4px); left: 50%;
    transform: translateX(-50%) translateY(6px);
    background: var(--surface);
    border: 1px solid var(--outline); border-radius: var(--radius-m);
    box-shadow: var(--shadow-3); padding: 14px 18px; min-width: 260px;
    z-index: 500; text-align: left; cursor: default;
    transition: opacity .2s ease, visibility .2s ease, transform .2s cubic-bezier(.4,0,.2,1);
    transition-delay: .3s; /* delay hiding — gives time to reach the link */
  }
  .version-info:hover .version-tooltip {
    opacity: 1; visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
    transition-delay: 0s; /* show instantly */
  }
  .version-tooltip-title {
    font-size: 14px; font-weight: 600; color: var(--on-surface); margin-bottom: 6px;
  }
  .version-tooltip-body { font-size: 12px; color: var(--on-surface-variant); line-height: 1.6; margin-bottom: 10px; }
  .version-tooltip-link {
    font-size: 12px; color: var(--primary); text-decoration: none; font-weight: 500;
  }
  .version-tooltip-link:hover { text-decoration: underline; }

  /* ── 客户端加密文件锁标记 ── */
  .file-lock-badge {
    position: absolute; right: 6px; bottom: 6px;
    width: 20px; height: 20px; border-radius: 50%;
    background: var(--primary); color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,.3);
  }
  .file-lock-badge .material-icons-round { font-size: 13px; }
  .file-card-icon { position: relative; }

  /* ── 文本 diff 对比 ── */
  .diff-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: none; align-items: center; justify-content: center; z-index: 1200; }
  .diff-overlay.open { display: flex; }
  .diff-modal { background: var(--surface); border-radius: 12px; width: min(1100px, 94vw); max-height: 88vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 12px 40px rgba(0,0,0,.35); }
  .diff-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--outline); }
  .diff-head .material-icons-round { color: var(--primary); }
  .diff-head .diff-title { flex: 1; font-weight: 600; }
  .diff-body { overflow: auto; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.6; padding: 8px 0; }
  .diff-line { display: flex; white-space: pre-wrap; word-break: break-all; }
  .diff-line .diff-gutter { flex: 0 0 64px; text-align: right; padding: 0 8px; color: var(--on-surface-variant); user-select: none; }
  .diff-line.add { background: rgba(76,175,80,.16); }
  .diff-line.del { background: rgba(244,67,54,.16); }
  .diff-line.add .diff-gutter { color: #2e7d32; }
  .diff-line.del .diff-gutter { color: #c62828; }
  .diff-line .diff-text { flex: 1; padding-right: 12px; }
  .diff-legend { display: flex; gap: 14px; padding: 6px 16px; font-size: 12px; color: var(--on-surface-variant); border-top: 1px solid var(--outline); }
  .diff-legend .chip { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
