:root {
  --bg: #0c0e13;
  --bg-2: #11141b;
  --surface: #171b24;
  --surface-2: #1e2330;
  --surface-3: #262c3a;
  --border: #2a3040;
  --border-light: #384054;
  --text: #eef0f5;
  --text-2: #b7bdcc;
  --muted: #7d8598;
  --accent: #7c8cff;
  --accent-2: #a78bfa;
  --accent-glow: rgba(124, 140, 255, 0.25);
  --success: #5ddba0;
  --warning: #f5b544;
  --danger: #f0738b;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }

.ambient {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 500px at 12% -10%, rgba(124, 140, 255, 0.10), transparent 60%),
    radial-gradient(700px 400px at 88% 0%, rgba(167, 139, 250, 0.08), transparent 60%);
}

.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 32px;
  background: rgba(12, 14, 19, 0.78);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0c0e13;
  box-shadow: 0 4px 16px var(--accent-glow);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-title { font-size: 15px; font-weight: 650; letter-spacing: 0.02em; }
.brand-sub { font-size: 10px; color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; margin-top: 2px; }

.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  background: transparent; color: var(--text-2);
  border: 1px solid transparent; border-radius: 9px; cursor: pointer;
  transition: all .18s; font-size: 20px;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: 9px; font-size: 13px; font-weight: 550;
  border: 1px solid var(--border-light); background: var(--surface-2); color: var(--text);
  cursor: pointer; text-decoration: none; transition: all .18s;
}
.btn:hover { background: var(--surface-3); border-color: var(--accent); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #6a7bf0);
  color: #fff; border-color: transparent;
  box-shadow: 0 4px 16px var(--accent-glow);
}
.btn-primary:hover { background: linear-gradient(135deg, #8f9dff, #7c8cff); box-shadow: 0 6px 22px var(--accent-glow); }

.task-panel {
  position: relative; z-index: 40;
  margin: 16px 32px 0;
  background: linear-gradient(90deg, rgba(124,140,255,.10), rgba(167,139,250,.05));
  border: 1px solid rgba(124,140,255,.25); border-radius: 12px;
  overflow: hidden;
}
.task-panel.hidden { display: none; }
.task-panel-main {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px; cursor: pointer;
}
.task-spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid rgba(124,140,255,.25); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.task-info { flex: 1; min-width: 0; }
.task-info > span { font-size: 13px; color: var(--text-2); }
.task-progress { height: 3px; background: rgba(255,255,255,.08); border-radius: 3px; margin-top: 7px; overflow: hidden; }
.task-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 3px; transition: width .3s; }
.task-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

main { position: relative; z-index: 1; padding: 0 32px 60px; max-width: 1600px; margin: 0 auto; }

.hero {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 30px;
  padding: 44px 0 30px;
}
.hero-left h1 { margin: 0; font-size: 30px; font-weight: 680; letter-spacing: -0.02em; }
.hero-left h1 em { font-style: normal; background: linear-gradient(120deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-left p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.stat-cards { display: flex; gap: 10px; }
.stat-card {
  min-width: 94px; padding: 13px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  display: flex; flex-direction: column; align-items: flex-start;
}
.stat-num { font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-label { font-size: 11px; color: var(--muted); margin-top: 4px; letter-spacing: 0.05em; }

.toolbar { display: flex; gap: 10px; margin-bottom: 14px; }
.search-box {
  flex: 1; display: flex; align-items: center; gap: 10px;
  padding: 0 14px; height: 42px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 11px;
  color: var(--muted); transition: border-color .18s, box-shadow .18s;
}
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.search-box input {
  flex: 1; border: none; outline: none; background: transparent;
  color: var(--text); font-size: 14px; height: 100%;
}
.search-box input::placeholder { color: var(--muted); }
.search-box kbd {
  font: 10px/1.4 ui-monospace, monospace; padding: 2px 6px;
  border: 1px solid var(--border-light); border-radius: 5px; color: var(--muted); background: var(--surface-2);
}
.sort-select {
  padding: 0 34px 0 14px; height: 42px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%237d8598' stroke-width='2'%3E%3Cpath d='m2 4 4 4 4-4'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid var(--border); border-radius: 11px; color: var(--text-2);
  font-size: 13px; appearance: none; cursor: pointer; outline: none;
}
.sort-select:focus { border-color: var(--accent); }

.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip {
  padding: 6px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-2); font-size: 12px; cursor: pointer; transition: all .18s;
}
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; border-color: transparent; box-shadow: 0 3px 12px var(--accent-glow);
}
.chip-count { opacity: .6; margin-left: 5px; font-size: 10px; }

.result-line { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.muted { color: var(--muted); font-size: 12px; }
.view-hint { color: var(--muted); font-size: 11px; opacity: .6; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 18px; }

.card {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; cursor: pointer;
  transition: transform .22s cubic-bezier(.2,.8,.2,1), border-color .22s, box-shadow .22s;
}
.card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: 0 14px 36px rgba(0,0,0,.5), 0 0 0 1px var(--accent-glow);
}
.card-media { position: relative; aspect-ratio: 3 / 4; overflow: hidden; background: var(--surface-2); }
/* 禁止 iOS 长按封面弹出「存储图片」系统菜单 */
.card-media img, .card-media, .modal-cover { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.card-cover {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .4s cubic-bezier(.2,.8,.2,1);
}
.card:hover .card-cover { transform: scale(1.06); }
.card-placeholder {
  width: 100%; height: 100%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--surface-2), var(--surface-3));
  color: var(--muted); font-size: 11px; letter-spacing: .08em;
}
.card-badge {
  position: absolute; top: 9px; right: 9px;
  padding: 3px 8px; border-radius: 6px; font-size: 10px; font-weight: 600;
  backdrop-filter: blur(8px); background: rgba(12,14,19,.75); color: var(--text-2);
  border: 1px solid rgba(255,255,255,.1);
}
.card-badge.done { color: var(--success); border-color: rgba(93,219,160,.3); }
.card-badge.failed { color: var(--danger); border-color: rgba(240,115,139,.3); }
.card-site {
  position: absolute; bottom: 9px; left: 9px;
  padding: 3px 7px; border-radius: 5px; font-size: 10px;
  background: rgba(12,14,19,.75); color: var(--text-2); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.1);
}
.card-site.ex { color: var(--accent-2); }
.card-body { padding: 11px 12px 13px; }
.card-title {
  font-size: 12px; line-height: 1.45; height: 2.9em; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  color: var(--text);
}
.card-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 9px; gap: 8px; }
.cat-tag {
  padding: 2px 8px; border-radius: 5px; font-size: 10px;
  background: var(--surface-2); color: var(--accent); border: 1px solid var(--border);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 90px;
}
.page-count { font-size: 10px; color: var(--muted); white-space: nowrap; }

.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.skeleton-card { border-radius: var(--radius); overflow: hidden; }
.skeleton-media { aspect-ratio: 3/4; }
.skeleton-line { height: 10px; border-radius: 5px; margin: 12px; }

.empty { text-align: center; padding: 90px 20px; color: var(--muted); }
.empty-icon {
  width: 76px; height: 76px; margin: 0 auto 18px; border-radius: 20px;
  display: grid; place-items: center; color: var(--accent);
  background: var(--surface); border: 1px solid var(--border);
}
.empty h2 { color: var(--text); font-size: 18px; margin: 0 0 6px; }
.empty p { margin: 0 0 20px; font-size: 13px; }
.empty .btn { margin: 0 auto; }

.modal, .drawer { position: fixed; inset: 0; z-index: 100; }
.modal-backdrop, .drawer-backdrop { position: absolute; inset: 0; background: rgba(4,6,10,.75); backdrop-filter: blur(6px); }
.modal-card {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: min(900px, 94vw); max-height: 90vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border-light);
  border-radius: 18px; box-shadow: var(--shadow);
  animation: popIn .22s cubic-bezier(.2,.8,.2,1);
}
@keyframes popIn { from { opacity: 0; transform: translate(-50%,-48%) scale(.97); } }
.modal-close {
  position: absolute; top: 14px; right: 18px; z-index: 2;
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--muted); font-size: 20px; cursor: pointer; line-height: 1;
}
.modal-close:hover { color: var(--text); border-color: var(--accent); }
.modal-body { display: flex; gap: 28px; padding: 30px; }
.modal-cover-wrap { width: 280px; flex-shrink: 0; }
.modal-cover { width: 100%; max-height: 72vh; object-fit: contain; border-radius: 12px; background: var(--bg-2); }
.modal-cover-missing {
  width: 100%; aspect-ratio: 3/4; border-radius: 12px;
  display: grid; place-items: center; background: var(--surface-2); color: var(--muted); font-size: 12px;
}
.modal-info { flex: 1; min-width: 0; }
.modal-eyebrow { font-size: 10px; letter-spacing: .16em; color: var(--accent); font-weight: 600; margin-bottom: 8px; }
.modal-info h2 { margin: 0; font-size: 20px; line-height: 1.4; font-weight: 620; }
.modal-jpn { color: var(--muted); font-size: 12px; margin-top: 6px; }
.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 22px 0; }
.meta-item { padding: 10px 12px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 9px; }
.meta-key { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.meta-val { font-size: 13px; color: var(--text); margin-top: 3px; }
.section-label { font-size: 10px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 8px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 24px; }
.tag { padding: 3px 9px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-size: 10px; }
.tag:hover { border-color: var(--accent); color: var(--text); }
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.drawer-card {
  position: absolute; top: 0; right: 0; width: min(470px, 96vw); height: 100%;
  overflow-y: auto; padding: 20px 22px;
  background: var(--surface); border-left: 1px solid var(--border-light);
  box-shadow: var(--shadow); animation: slideIn .25s cubic-bezier(.2,.8,.2,1);
}
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } }
.drawer-head h2 { margin: 0; font-size: 18px; }
.setting-section { margin-top: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.setting-section:last-of-type { border-bottom: none; }
.section-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.section-head h3 { margin: 0; font-size: 13px; }
.section-icon { color: var(--accent); font-size: 15px; }
.setting-section label { display: block; font-size: 11px; color: var(--muted); margin: 0 0 4px; }
.setting-section input[type=text], .setting-section input[type=number], .setting-section input[type=password] {
  width: 100%; padding: 6px 9px; margin-bottom: 8px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 7px;
  color: var(--text); font-size: 12px; outline: none; transition: border-color .18s;
}
.setting-section input:focus { border-color: var(--accent); }
.hint { font-size: 10px; color: var(--muted); line-height: 1.5; margin: 2px 0 8px; }
/* Cookie 两站并排 */
.cookie-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.site-block { margin-bottom: 0; padding: 10px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; }
.site-block h4 { margin: 0 0 8px; font-size: 11px; color: var(--accent); letter-spacing: .03em; }
.site-block label { font-size: 10px; margin-bottom: 2px; }
.site-block input { padding: 5px 8px !important; margin-bottom: 6px !important; font-size: 11px !important; }
/* 同步区两列 */
.setting-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.setting-chk { display: flex; align-items: center; gap: 7px; padding: 5px 0; font-size: 11px; color: var(--text-2); cursor: pointer; }
.setting-chk input { accent-color: var(--accent); }
.setting-section details.advanced { margin-top: 8px; }
.setting-section details.advanced > summary { font-size: 11px; color: var(--accent); cursor: pointer; padding: 4px 0; }
.threshold-row { display: flex; gap: 8px; align-items: center; font-size: 11px; color: var(--muted); padding: 4px 0 6px; }
.threshold-row input { width: 56px !important; margin: 0 !important; }
/* OneDrive 精简提示 */
.od-note { font-size: 10px; color: var(--muted); padding: 6px 9px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 7px; margin-bottom: 8px; }
.od-note b { color: var(--accent-2); }
.drawer-footer { display: flex; align-items: center; gap: 14px; margin-top: 24px; }

.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 200;
  padding: 11px 20px; border-radius: 10px; font-size: 13px;
  background: var(--surface-2); border: 1px solid var(--border-light); box-shadow: var(--shadow);
  animation: toastIn .2s ease-out;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } }

@media (max-width: 900px) {
  .hero { flex-direction: column; align-items: flex-start; padding-top: 30px; }
  .stat-cards { width: 100%; }
  .stat-card { flex: 1; }
  .modal-body { flex-direction: column; }
  .modal-cover-wrap { width: 100%; max-width: 300px; margin: 0 auto; }
}
@media (max-width: 640px) {
  .topbar { padding: 11px 16px; }
  main { padding: 0 16px 40px; }
  .task-panel { margin: 12px 16px 0; }
  .brand-sub { display: none; }
  .btn span { display: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
  .search-box kbd { display: none; }
  .hero-left h1 { font-size: 24px; }
  /* 详情弹窗：手机上占满屏，关闭按钮做大并固定在右上角易点位置 */
  .modal-card { width: 100vw; height: 100dvh; max-height: none; border-radius: 0; transform: none; top: 0; left: 0; }
  @keyframes popIn { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }
  .modal-body { padding: 56px 18px 30px; }
  .modal-close {
    position: fixed; top: calc(env(safe-area-inset-top, 0px) + 12px);
    right: 16px; width: 44px; height: 44px; font-size: 28px;
    background: var(--surface-2); border-color: var(--border-light); z-index: 10;
  }
  .modal-cover-wrap { max-width: 100%; }
  .modal-cover { max-height: 46vh; }
  .modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .modal-actions .btn { width: 100%; justify-content: center; margin: 0 !important; }
  .modal-actions .btn-danger { grid-column: auto; }
}

/* OneDrive 状态条 */
.od-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 18px; padding: 13px 18px;
  background: linear-gradient(100deg, rgba(93,219,160,.08), rgba(124,140,255,.05));
  border: 1px solid var(--border); border-radius: 12px;
}
.od-banner.connected {
  background: linear-gradient(100deg, rgba(93,219,160,.12), rgba(93,219,160,.03));
  border-color: rgba(93,219,160,.28);
}
.od-banner-info { display: flex; align-items: center; gap: 12px; }
.od-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.od-banner.connected .od-dot { background: var(--success); box-shadow: 0 0 10px rgba(93,219,160,.5); }
.od-banner-title { font-size: 13px; font-weight: 600; }
.od-banner-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.od-banner-actions { display: flex; gap: 8px; }
.btn-small { padding: 6px 12px; font-size: 12px; }
.od-stat .stat-num { color: var(--success); }

/* OneDrive 卡片状态角标 */
.card-badge.od-done { color: var(--success); border-color: rgba(93,219,160,.3); background: rgba(93,219,160,.12); }
.card-badge.od-failed { color: var(--danger); border-color: rgba(240,115,139,.3); }
.card-od {
  position: absolute; bottom: 9px; right: 9px;
  padding: 3px 7px; border-radius: 5px; font-size: 10px;
  background: rgba(12,14,19,.8); color: var(--success); backdrop-filter: blur(8px);
  border: 1px solid rgba(93,219,160,.3);
}

/* 开关 */
.toggle-row { display: flex; align-items: center; justify-content: space-between; margin: 16px 0 10px; }
.toggle-label { font-size: 12px; color: var(--text-2) !important; margin: 0 !important; }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--surface-3); border: 1px solid var(--border); border-radius: 22px;
  transition: .2s;
}
.slider:before {
  content: ''; position: absolute; height: 16px; width: 16px; left: 2px; bottom: 2px;
  background: var(--muted); border-radius: 50%; transition: .2s;
}
.switch input:checked + .slider { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .slider:before { transform: translateX(18px); background: #fff; }

details.advanced { margin: 12px 0; }
details.advanced summary {
  cursor: pointer; font-size: 11px; color: var(--accent); margin-bottom: 8px;
  list-style: none; padding: 4px 0;
}
details.advanced summary::-webkit-details-marker { display: none; }
details.advanced summary:before { content: '▸ '; }
details.advanced[open] summary:before { content: '▾ '; }

/* 诊断面板 */
.diag-card { width: min(760px, 95vw); }
.diag-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 28px 16px; border-bottom: 1px solid var(--border);
}
.diag-head h2 { margin: 0; font-size: 20px; }
.diag-summary { display: flex; gap: 10px; padding: 16px 28px; }
.diag-count {
  flex: 1; padding: 12px 14px; border-radius: 10px; text-align: center;
  background: var(--bg-2); border: 1px solid var(--border);
}
.diag-count .num { font-size: 22px; font-weight: 650; line-height: 1.2; }
.diag-count .lbl { font-size: 11px; color: var(--muted); margin-top: 3px; }
.diag-count.ok .num { color: var(--success); }
.diag-count.warn .num { color: var(--warning); }
.diag-count.error .num { color: var(--danger); }
.diag-content { padding: 8px 28px 20px; max-height: 55vh; overflow-y: auto; }
.diag-section { margin-top: 18px; }
.diag-section-title {
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 8px; font-weight: 600;
}
.diag-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 10px 12px; margin-bottom: 6px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 9px;
}
.diag-icon { font-size: 14px; width: 18px; flex-shrink: 0; text-align: center; }
.diag-item.ok .diag-icon { color: var(--success); }
.diag-item.warn .diag-icon { color: var(--warning); }
.diag-item.error .diag-icon { color: var(--danger); }
.diag-item-body { flex: 1; min-width: 0; }
.diag-item-name { font-size: 13px; font-weight: 550; }
.diag-item-detail { font-size: 12px; color: var(--text-2); margin-top: 2px; word-break: break-word; }
.diag-item-hint { font-size: 11px; color: var(--warning); margin-top: 4px; }
.diag-foot { padding: 14px 28px 20px; border-top: 1px solid var(--border); }

.section-head .btn { margin-left: auto; text-decoration: none; }

/* 文件夹选择器 */
.folder-picker { display: flex; gap: 8px; align-items: center; }
.folder-picker input { flex: 1; }
.folder-browser {
  margin-top: 8px; padding: 12px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 9px;
}
.folder-browser-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.folder-list { max-height: 180px; overflow-y: auto; margin-bottom: 10px; }
.folder-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  border-radius: 6px; cursor: pointer; font-size: 12px; color: var(--text-2);
}
.folder-item:hover { background: var(--surface-2); color: var(--text); }
.folder-item.selected { background: rgba(124,140,255,.15); color: var(--accent); }
.folder-empty { padding: 12px; text-align: center; font-size: 11px; color: var(--muted); }

/* 磁盘信息 */
.disk-info {
  padding: 10px 12px; margin-bottom: 14px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 9px;
  font-size: 12px; color: var(--text-2);
}
.disk-bar { height: 4px; background: var(--surface-3); border-radius: 4px; margin-top: 7px; overflow: hidden; }
.disk-bar-fill { height: 100%; background: var(--accent); border-radius: 4px; }

.js-error {
  position: fixed; top: 0; left: 0; right: 0; z-index: 300;
  padding: 10px 20px; background: #7a1f2b; color: #fff;
  font-size: 12px; text-align: center;
}

.task-stage { color: var(--accent); font-size: 11px; font-weight: 600; white-space: nowrap; }

.text-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 11px; background: transparent; color: var(--text-2);
  border: 1px solid transparent; border-radius: 9px; cursor: pointer;
  font-size: 12px; transition: all .18s;
}
.text-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }

.eh-account { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.quota-card {
  padding: 16px; border-radius: 12px;
  background: var(--bg-2); border: 1px solid var(--border);
}
.quota-title { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.quota-num { font-size: 24px; font-weight: 650; margin-bottom: 10px; }
.quota-num span { font-size: 14px; color: var(--muted); font-weight: 400; }
.eh-note {
  margin-top: 18px; padding: 14px; border-radius: 10px;
  background: rgba(245,181,68,.07); border: 1px solid rgba(245,181,68,.2);
  font-size: 12px; line-height: 1.7; color: var(--text-2);
}
.eh-note code { color: var(--warning); }

.last-sync-info { margin-top: 8px; font-size: 11px; line-height: 1.6; }

.trigger-badge {
  display: inline-block; padding: 2px 7px; margin-left: 8px;
  border-radius: 5px; font-size: 10px; font-weight: 500;
  background: var(--surface-3); color: var(--muted);
}
.trigger-badge.trigger-auto { background: rgba(124,140,255,.15); color: var(--accent); }
.trigger-badge.trigger-scheduled { background: rgba(91,219,160,.15); color: var(--success); }
.trigger-badge.trigger-skip { background: rgba(245,181,68,.12); color: var(--warning); }

.eh-quota-bar {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 14px; padding: 7px 12px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 9px; font-size: 11px;
}
.quota-label { color: var(--muted); font-weight: 600; }
.quota-mini { width: 70px; height: 4px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.quota-mini > div { height: 100%; background: var(--success); border-radius: 4px; transition: width .3s; }
.quota-detail-btn {
  background: none; border: none; color: var(--accent);
  cursor: pointer; font-size: 11px; padding: 0;
}
.quota-detail-btn:hover { text-decoration: underline; }
.hero-actions { margin-top: 10px; }

.od-warning {
  padding: 14px; margin-bottom: 16px; border-radius: 10px;
  background: rgba(227,75,74,.08); border: 1px solid rgba(227,75,74,.25);
  font-size: 12px; line-height: 1.7; color: var(--text-2);
}
.od-warning-title { font-weight: 600; color: var(--danger); margin-bottom: 6px; }
.od-warning code, .od-setup-steps code {
  padding: 1px 5px; border-radius: 4px; background: var(--bg-2);
  font: 11px ui-monospace, monospace; color: var(--accent);
  word-break: break-all;
}
.od-mode-info { font-size: 12px; margin-bottom: 12px; padding: 8px 10px; background: var(--bg-2); border-radius: 8px; }
.od-setup-steps {
  margin-top: 14px; padding: 12px 14px; border-radius: 9px;
  background: var(--bg-2); border: 1px solid var(--border);
  font-size: 11px; line-height: 1.8; color: var(--text-2);
}
.od-setup-steps ol { margin: 8px 0 0; padding-left: 20px; }
.od-setup-steps a { color: var(--accent); }

.btn-danger {
  color: var(--danger, #f0738b);
  border-color: rgba(240,115,139,.4);
}
.btn-danger:hover { background: rgba(240,115,139,.12); }

/* 在线观看 */
.viewer { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; background: #08090d; }
.viewer.hidden { display: none; }
.viewer-bar { display: flex; align-items: center; gap: 14px; padding: 12px 18px; padding-top: calc(env(safe-area-inset-top, 0px) + 12px); border-bottom: 1px solid #1c2130; }
.viewer-title { flex: 1; font-size: 14px; color: #eef0f5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-page { font-size: 13px; }
.viewer-x { width: 44px; height: 44px; border-radius: 10px; background: #1a1e28; border: 1px solid #2b3242; color: #eef0f5; font-size: 26px; cursor: pointer; line-height: 1; }
.viewer-stage { flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 10px; }
.viewer-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer-loading { position: absolute; color: #8fb4ff; font-size: 13px; }
.viewer-controls { display: flex; justify-content: space-between; gap: 12px; padding: 14px 18px; padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 14px); border-top: 1px solid #1c2130; }
.viewer-controls .btn { flex: 1; justify-content: center; }

/* 批量选择 */
.batchbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 14px; margin: 12px 0; background: var(--surface); border: 1px solid var(--border-light); border-radius: 12px; }
.batchbar.hidden { display: none; }
.batchbar .muted { margin-right: auto; font-size: 12px; }
#btn-batch-mode.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.card.selected { outline: 2px solid var(--accent); outline-offset: 2px; cursor: pointer; }
.card.selected::after { content: "✓"; position: absolute; top: 8px; left: 8px; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; background: var(--accent); color: #fff; border-radius: 50%; font-size: 15px; z-index: 3; }
.card { position: relative; }

.viewer-tip { font-size: 11px; }
@media (max-width: 640px) { .viewer-tip { display: none; } }

.gallery-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 10px; }

.queuebar { padding: 10px 18px; border-top: 1px solid var(--border); }
.queuebar.hidden { display: none; }
.queue-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; margin-bottom: 6px; }
.queue-item { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 12px; border-top: 1px solid var(--border); }
.queue-order { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; background: var(--surface-2); border-radius: 50%; font-size: 11px; }
.queue-label { flex: 1; }
.queue-cancel { width: 24px; height: 24px; border: 1px solid var(--border); background: transparent; color: var(--muted); border-radius: 6px; cursor: pointer; font-size: 15px; }
.queue-cancel:hover { color: var(--danger, #f0738b); border-color: var(--danger, #f0738b); }

/* 任务进度详情（可展开） */
.task-detail { padding: 12px 18px; border-top: 1px solid var(--border); background: rgba(0,0,0,.12); }
.task-detail.collapsed { display: none; }
.task-detail-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 11px; margin-bottom: 8px; }
.task-detail-method { color: var(--accent); font-weight: 600; }
.task-track { display: grid; grid-template-columns: 52px 1fr auto 38px; gap: 8px; align-items: center; padding: 6px 0; font-size: 11px; border-top: 1px solid var(--border); }
.task-track-label { color: var(--muted); white-space: nowrap; }
.task-track-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.task-track-stage { color: var(--text-2); white-space: nowrap; }
.task-track-pct { text-align: right; color: var(--accent); }
.task-track-bar { grid-column: 1 / -1; height: 3px; background: rgba(255,255,255,.08); border-radius: 3px; overflow: hidden; }
.task-track-bar > div { height: 100%; background: var(--accent); border-radius: 3px; transition: width .3s; }
.card-badge.od-gone { color: var(--warning); border-color: rgba(239,159,39,.45); background: rgba(239,159,39,.16); font-weight: 600; }
.task-speed { color: var(--accent); font-weight: 600; white-space: nowrap; }
