
  *, *::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);
    --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);
  }
  [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：本地 icons/round.css 提供 @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: rgba(60,64,67,.08); }
  .icon-btn:active { background: rgba(60,64,67,.12); }
  .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: rgba(60,64,67,.08); }
  .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: rgba(60,64,67,.08); 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; }

  /* ── 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: rgba(60,64,67,.04); }
  .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;
  }
  .modal-overlay.open .modal { transform: none; }
  .modal-header {
    padding: 24px 24px 16px;
    display: flex; align-items: center; gap: 12px;
  }
  .modal-title { font-family: var(--font-display); font-size: 20px; font-weight: 400; }
  .modal-body { padding: 0 24px 16px; }
  .modal-footer {
    padding: 8px 16px 16px;
    display: flex; justify-content: flex-end; gap: 8px;
  }
  .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: rgba(60,64,67,.04);
  }
  .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: 8px; max-height: 200px; overflow-y: auto; }
  .progress-item { display: flex; flex-direction: column; gap: 4px; }
  .progress-item-name { font-size: 13px; display: flex; justify-content: space-between; }
  .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); }

  /* ── 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: rgba(60,64,67,.08); }
  .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);
    white-space: nowrap;
  }
  .snackbar.show { transform: translateX(-50%) translateY(0); }
  .snackbar-action { color: #BB86FC; font-weight: 500; cursor: pointer; background: none; border: none; font-size: 14px; }

  /* ── 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: rgba(60,64,67,.08); }
  .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; }
  }

  /* ── 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: rgba(60,64,67,.08); }
  .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: rgba(60,64,67,.08); }
  .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: rgba(60,64,67,.08); color: var(--on-surface); }
  .action-btn:active { background: rgba(60,64,67,.12); }
  .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;
  }
  [data-theme="dark"] .action-btn:hover { background: rgba(232,234,237,.08); color: var(--on-surface); }
  [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: rgba(60,64,67,.06); }
  .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: rgba(60,64,67,.08); }
  .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: rgba(60,64,67,.06); }
  .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; }
