/* ========================================
   网页阅读器 - 全局样式
   ======================================== */

/* ── 主题变量 ── */
:root {
  --bg: #f4f2ee;
  --surface: #ffffff;
  --surface-hover: #f8f7f4;
  --text: #2c2c2c;
  --text-secondary: #787774;
  --border: #e3e0dc;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --reader-font: Georgia, "Noto Serif SC", serif;
  --reader-bg: #faf9f7;
  --reader-text: #2c2c2c;
  --reader-font-size: 18px;
  --reader-line-height: 2;
  --card-min-width: 130px;
  --card-max-width: 1fr;
}

/* ── 全局重置 ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}
#app { height: 100vh; display: flex; flex-direction: column; }

/* ── 顶部栏 ── */
#top-bar {
  position: relative;
  height: calc(56px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 20px 0;
  display: flex; align-items: center;
  background: var(--surface); border-bottom: 1px solid var(--border);
  flex-shrink: 0; -webkit-user-select: none; user-select: none;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  z-index: 10;
}
#app-title { font-size: 18px; font-weight: 600; margin-left: 8px; letter-spacing: 0.3px; }
.top-bar-left { display: flex; align-items: center; }
.top-bar-right { margin-left: auto; position: relative; display: flex; align-items: center; }

/* ── 书架操作下拉菜单 ── */
.bookshelf-actions-dropdown {
  position: absolute; top: calc(100% + 4px); right: 0; z-index: 50;
  min-width: 140px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  overflow: hidden; font-size: 14px;
}
.bookshelf-actions-dropdown[hidden] { display: none; }

/* ── 菜单下拉 ── */
.menu-dropdown {
  position: absolute; top: calc(56px + env(safe-area-inset-top)); left: 8px; z-index: 50;
  min-width: 160px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  overflow: hidden; font-size: 14px;
}
.menu-dropdown[hidden] { display: none; }
.menu-item {
  padding: 12px 18px; cursor: pointer; transition: background 0.15s;
}
.menu-item:hover { background: var(--surface-hover); }
.menu-item.disabled { color: var(--text-secondary); cursor: default; }
.menu-item.disabled:hover { background: transparent; }

/* ── 弹窗遮罩 ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-overlay[hidden] { display: none; }
.modal-box {
  background: var(--surface); border-radius: var(--radius);
  width: 100%; max-width: 400px; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,0.2);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-body { padding: 20px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; }
.form-input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 14px; font-family: var(--font);
  background: var(--surface); color: var(--text); outline: none;
  transition: border-color 0.15s;
}
.form-input:focus { border-color: var(--primary); }
.form-input::placeholder { color: #bbb; }
.modal-actions { display: flex; gap: 8px; margin-top: 6px; }
.sync-section { margin-top: 12px; }
.sync-section hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.sync-info { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-secondary); }
.sync-btn { width: 100%; margin-top: 12px; justify-content: center; }

/* ── 章节导航 ── */
.chapters-box { max-width: 480px; }
.chapters-list { max-height: 60vh; overflow-y: auto; padding: 8px 0; }
.chapter-item {
  display: flex; align-items: baseline; gap: 8px;
  padding: 10px 20px; cursor: pointer;
  transition: background 0.15s; border-left: 3px solid transparent;
}
.chapter-item:hover { background: var(--surface-hover); }
.chapter-item.active { border-left-color: var(--primary); }
.chapter-item.level-2 { padding-left: 40px; }
.chapter-item.level-2 .ch-title-text { font-size: 13px; color: var(--text-secondary); }
.chapter-item .ch-title-text { font-size: 14px; color: var(--text); line-height: 1.4; }
.chapter-item .ch-page {
  margin-left: auto; font-size: 12px; color: var(--text-secondary); white-space: nowrap;
}

/* ── 按钮 ── */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border: none; border-radius: var(--radius);
  background: transparent; color: var(--text); cursor: pointer; transition: background 0.15s;
}
.icon-btn:hover { background: rgba(0,0,0,0.06); }
.icon-btn:active { background: rgba(0,0,0,0.1); }

.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px;
  border: none; border-radius: var(--radius); font-size: 15px; font-weight: 500;
  cursor: pointer; transition: all 0.15s; font-family: var(--font);
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

/* ── 主内容区 ── */
#main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.view { display: none; }
.view.active { display: flex; flex-direction: column; flex: 1; min-height: 0; }

#bookshelf-view.active { overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }

/* ── 书架页：木纹书架背景 ── */
#bookshelf-view {
  background:
    /* 横向木纹纹理 */
    repeating-linear-gradient(90deg,
      transparent 0px, transparent 45px,
      rgba(0,0,0,0.04) 45px, rgba(0,0,0,0.04) 47px
    ),
    /* 纵向纹理起伏 */
    repeating-linear-gradient(0deg,
      transparent 0px, transparent 160px,
      rgba(0,0,0,0.03) 160px, rgba(0,0,0,0.03) 161px,
      transparent 161px, transparent 220px
    ),
    /* 木质底色 */
    linear-gradient(180deg, #C68B5A 0%, #A8764E 30%, #8B5E3C 60%, #7A4E30 100%);
}

/* ── 书架网格（响应式） ── */
.bookshelf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--card-min-width), 1fr));
  gap: 34px 18px;
  padding: 6px 24px 40px;
  flex: 1;
  align-content: start;
  clip-path: inset(0 12px);
}
@media (max-width: 600px) {
  .bookshelf-grid { grid-template-columns: repeat(3, 1fr); gap: 24px 10px; padding: 4px 12px 24px; }
}
@media (min-width: 600px) { .bookshelf-grid { --card-min-width: 150px; } }
@media (min-width: 900px) { .bookshelf-grid { --card-min-width: 160px; gap: 38px 20px; } }
@media (min-width: 1200px) { .bookshelf-grid { --card-min-width: 170px; gap: 40px 24px; } }

/* ── 书籍卡片（直角仿真 + 乳白搁板 + 投影） ── */
.book-card {
  background: transparent; border-radius: 0;
  cursor: pointer;
  transition: box-shadow 0.2s ease; position: relative;
}
.book-card:hover { }
.book-card:active { }
.book-card:hover .book-cover { transform: translateY(-3px); }
.book-card:active .book-cover { transform: translateY(-1px); }
/* 乳白色搁板（从屏幕左侧到书籍右侧连续贯通） */
.book-card::before {
  content: ''; position: absolute;
  bottom: -20px; left: -9999px; right: -9999px;
  height: 16px;
  background: linear-gradient(180deg,
    #F5F0E8 0%,
    #EDE4D4 3px,
    #E0D5C2 8px,
    #D0C4AE 100%);
  border-top: 2px solid rgba(255,255,255,0.7);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  pointer-events: none; z-index: 1;
}
/* 书籍在搁板上投射的阴影 */
.book-card::after {
  content: ''; position: absolute;
  bottom: -5px; left: 5%; right: 5%;
  height: 14px; background: rgba(0,0,0,0.08);
  filter: blur(4px); pointer-events: none; z-index: 2;
}

/* 仿真书籍比例 2:3（宽:高），左侧光面反光效果 */
.book-cover {
  aspect-ratio: 2 / 3;
  background: linear-gradient(145deg, #e8e6e1, #f5f3ef);
  display: flex; align-items: center; justify-content: center; position: relative;
  transition: transform 0.2s ease;
}
/* 左侧真实书脊弯曲阴影 + 封面反光 */
.book-cover::before {
  content: ''; position: absolute; inset: 0;
  background:
    /* 书脊弯曲阴影 — 弧形渐变模拟真实书籍的弯曲书脊 */
    radial-gradient(ellipse 180% 60% at -30% 50%,
      rgba(0,0,0,0.22) 0%,
      rgba(0,0,0,0.07) 20%,
      rgba(0,0,0,0.03) 40%,
      transparent 55%
    ),
    /* 封面表面光泽反光 */
    linear-gradient(to right,
      rgba(255,255,255,0.1) 0%,
      rgba(255,255,255,0.04) 3%,
      transparent 7%
    );
  pointer-events: none; z-index: 1;
}
/* 底部极细边线模拟书脊厚度 */
.book-cover::after {
  content: ''; position: absolute; bottom: -1px; left: 0; right: 0;
  height: 2px; background: rgba(0,0,0,0.05);
  pointer-events: none; z-index: 1;
}
.book-cover-format {
  font-size: 13px; font-weight: 700; color: #a09e99;
  letter-spacing: 2px; padding: 4px 10px;
  border: 2px solid #d1cec8; border-radius: 0;
}
.book-cover-img { width: 100%; height: 100%; object-fit: cover; display: block; }

.book-info { padding: 12px 14px 14px; }
.book-title {
  font-size: 14px; font-weight: 600; line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.book-author {
  font-size: 12px; color: var(--text-secondary); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.book-meta { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

.book-progress { position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: var(--border); }
.book-progress-bar { height: 100%; background: var(--primary); border-radius: 0 2px 2px 0; transition: width 0.3s ease; }

/* ── 书籍卡片三点菜单 ── */
.book-menu { position: absolute; top: 6px; right: 6px; z-index: 5; }
.book-menu-btn {
  width: clamp(22px, 7vw, 30px); height: clamp(22px, 7vw, 30px);
  border: none; border-radius: 50%;
  background: rgba(0,0,0,0.45); color: #fff;
  font-size: clamp(13px, 4vw, 17px); line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s;
}
.book-card:hover .book-menu-btn { opacity: 1; }
.book-menu-btn:hover { background: var(--primary); }

.book-menu-dropdown {
  position: absolute; top: 100%; right: 0; margin-top: 4px;
  min-width: clamp(90px, 30vw, 130px);
  max-width: min(calc((100vw - 44px) / 3), 170px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  overflow: hidden; font-size: clamp(11px, 3.2vw, 14px);
}
.book-menu-dropdown[hidden] { display: none; }
.book-menu-item {
  padding: clamp(7px, 2.5vw, 12px) clamp(10px, 3.5vw, 16px);
  cursor: pointer; transition: background 0.15s;
  white-space: nowrap; color: var(--text); text-align: center;
}
.book-menu-item:hover { background: var(--surface-hover); }
.book-menu-item.danger { color: #dc2626; }
.book-menu-item.danger:hover { background: #fef2f2; }

.book-uncached-badge {
  position: absolute; top: 8px; left: 8px;
  font-size: 10px; color: #fff; background: rgba(245,158,11,0.85);
  padding: 2px 8px; border-radius: 4px; font-weight: 500;
  line-height: 1.5; pointer-events: none;
}

/* ── 书籍信息弹窗 ── */
.info-row {
  display: flex; padding: 8px 0; border-bottom: 1px solid var(--border);
  gap: 12px;
}
.info-row:last-of-type { border-bottom: none; }
.info-label {
  font-size: 13px; color: var(--text-secondary); min-width: 56px;
  flex-shrink: 0; padding-top: 1px;
}
.info-value { font-size: 14px; color: var(--text); word-break: break-word; }
.info-row-desc { align-items: flex-start; }
.info-value-desc { line-height: 1.7; }
.info-divider { height: 1px; background: var(--border); margin: 8px 0; }

/* ── 空状态 ── */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 60px 24px; flex: 1; color: var(--text-secondary);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.empty-icon {
  width: 120px; height: 120px; display: flex; align-items: center; justify-content: center;
  background: var(--surface); border-radius: 50%; margin-bottom: 24px; color: #d1d0cc;
}
.empty-state h2 { font-size: 20px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.empty-state p { font-size: 14px; max-width: 280px; line-height: 1.6; }

/* ════════════════════════════════════════
   阅读器
   ════════════════════════════════════════ */

/* ── 阅读器视图（作为绝对定位参考） ── */
#reader-view.view.active { position: relative; overflow: hidden; }

/* ── 阅读器顶部栏（覆盖在阅读区上方） ── */
.reader-topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 10;
  height: calc(56px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 12px 0;
  display: flex; align-items: center;
  background: var(--surface); border-bottom: 1px solid var(--border);
  -webkit-user-select: none; user-select: none; gap: 4px;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.reader-topbar.hide {
  transform: translateY(calc(-100% - env(safe-area-inset-top)));
  opacity: 0;
  pointer-events: none;
}
.reader-title-text {
  flex: 1; font-size: 16px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0 4px;
}
.reader-topbar-right { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.reader-font-btn { width: 36px; height: 36px; }
.reader-font-size-label {
  width: 24px; text-align: center; font-size: 11px; color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.reader-separator {
  width: 1px; height: 24px; background: var(--border); margin: 0 4px;
}

/* ── 阅读分页容器 ── */
.reader-scroll {
  flex: 1; overflow: hidden; position: relative;
  background: var(--reader-bg);
  cursor: pointer;
}
.page-wrap {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  height: 100%; overflow: hidden;
}

/* 水平分页容器 */
.page-horiz {
  display: flex;
  height: 100%;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
.page-col {
  width: 100%;
  height: 100%;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}
.page-viewport {
  overflow: hidden;
}
.page-col-inner {
  cursor: default;
  font-size: var(--reader-font-size, 18px);
  line-height: var(--reader-line-height, 2);
  color: var(--reader-text);
  font-family: var(--reader-font);
}

/* 单页模式（兼容） */
.page-inner {
  cursor: default;
  padding: var(--margin-v, 100px) var(--margin-h, 32px);
  font-size: var(--reader-font-size, 18px);
  line-height: var(--reader-line-height, 2);
  color: var(--reader-text);
}

/* ── 阅读内容文字 ── */
.reader-content {
  max-width: 680px; margin: 0 auto; padding: 24px 28px 60px;
  line-height: 2; font-size: 17px; width: 100%;
  font-family: var(--reader-font); color: var(--reader-text);
  cursor: default; /* 内容区域恢复默认指针 */
}

/* ── 章节标题 ── */
.ch-title {
  font-size: 22px; font-weight: 700; text-align: center;
  margin: 32px 0 28px; line-height: 1.5; letter-spacing: 1px;
}

/* ── 章节正文（EPUB 内容） ── */
.ch-body { font-size: inherit; line-height: inherit; }
.ch-body p { margin: 0; text-indent: 2em; }
.ch-body h1, .ch-body h2, .ch-body h3, .ch-body h4 {
  margin: 1.2em 0 0.6em; font-weight: 600; line-height: 1.4;
}
.ch-body img {
  max-width: 100%; height: auto; display: block; margin: 1em auto;
}
.ch-body blockquote {
  margin: 1em 0; padding: 8px 16px; border-left: 3px solid var(--border);
  color: var(--text-secondary); font-style: italic;
}
.ch-body a { color: var(--primary); text-decoration: none; }
.ch-body ul, .ch-body ol { margin: 0.5em 0 0.5em 2em; }
.ch-body li { margin: 0.3em 0; }
.ch-body em, .ch-body i { font-style: italic; }
.ch-body strong, .ch-body b { font-weight: 700; }
.ch-body hr { border: none; border-top: 1px solid var(--border); margin: 1.5em 0; }
/* 防御：防止 EPUB 内联样式改变行高/字号破坏分页对齐 */
.ch-body, .ch-body [style] { line-height: inherit !important; }
.ch-body [style*="line-height"] { line-height: inherit !important; }
.ch-body [style*="font-size"] { font-size: inherit !important; }

/* ── 阅读起始页 ── */
.reader-start { text-align: center; padding: 60px 0; cursor: default; }
.reader-start h2 { font-size: 24px; font-weight: 700; line-height: 1.4; margin-bottom: 8px; }
.reader-start-author { color: var(--text-secondary); font-size: 15px; margin-bottom: 32px; }
.reader-start hr { border: none; border-top: 1px solid var(--border); margin: 0 40px 32px; }
.reader-start-hint { color: var(--text-secondary); font-size: 14px; }

/* ── 阅读器底部状态栏（覆盖在阅读区上方） ── */
.reader-status {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
  height: calc(44px + env(safe-area-inset-bottom));
  display: flex; align-items: center;
  justify-content: space-between; padding: 0 12px;
  padding-bottom: env(safe-area-inset-bottom);
  background: transparent;
  font-size: 11px; color: var(--text-secondary);
  text-shadow: 0 0 4px rgba(0,0,0,0.3);
}
.reader-status-left {
  display: flex; align-items: center; gap: 8px; min-width: 0;
}
.reader-status-left #reader-remaining {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.reader-status-btn {
  width: 30px; height: 30px; flex-shrink: 0;
}
.reader-status-progress {
  flex-shrink: 0;
}

/* ── 设置 ── */
.settings-placeholder { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--text-secondary); font-size: 15px; }

/* ── 阅读器设置面板（下拉菜单） ── */
.settings-panel {
  position: absolute; top: 56px; right: 8px; z-index: 20;
  width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  font-size: 14px;
  overflow: hidden;
}
.settings-panel[hidden] { display: none; }
.settings-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; cursor: pointer; transition: background 0.15s;
}
.settings-item:hover { background: var(--surface-hover); }
.settings-item.disabled { color: var(--text-secondary); cursor: default; }
.settings-item.disabled:hover { background: transparent; }
.settings-arrow { color: var(--text-secondary); font-size: 16px; }
.settings-badge { font-size: 11px; color: var(--text-secondary); }
.settings-sub { padding: 8px 0; }
.settings-back {
  padding: 10px 16px; cursor: pointer; font-weight: 500;
  border-bottom: 1px solid var(--border); margin-bottom: 8px;
  transition: background 0.15s;
}
.settings-back:hover { background: var(--surface-hover); }
.settings-slider {
  padding: 8px 16px;
}
.settings-slider label {
  display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 4px;
}
.slider-row {
  display: flex; align-items: center; gap: 12px;
}
.slider-row input[type="range"] {
  flex: 1; -webkit-appearance: none; appearance: none; height: 4px;
  background: var(--border); border-radius: 2px; outline: none;
}
.slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--primary); cursor: pointer;
  border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.slider-val {
  min-width: 40px; text-align: right; font-size: 13px;
  color: var(--text-secondary); font-variant-numeric: tabular-nums;
}

/* ── 文件夹同步 ── */
.folder-sync-section { margin-top: 12px; }
.folder-sync-header { font-size: 14px; font-weight: 600; margin: 12px 0 6px; }
.folder-sync-desc { font-size: 12px; color: var(--text-secondary); margin-bottom: 10px; line-height: 1.5; }
.folder-sync-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.folder-sync-checkbox { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 14px; }
.folder-sync-checkbox input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }
.folder-path-text { font-size: 12px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── 存储容量提示 ── */
.storage-info {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 24px 16px; flex-shrink: 0;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-top: 1px solid rgba(0,0,0,0.06);
}
.storage-bar {
  flex: 1; height: 3px; background: var(--border);
  border-radius: 2px; overflow: hidden;
}
.storage-bar-fill { height: 100%; background: var(--primary); border-radius: 2px; transition: width 0.4s ease; }
.storage-text { font-size: 11px; color: var(--text-secondary); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ── 拖拽覆盖层 ── */
.drop-overlay {
  position: fixed; inset: 0;
  background: rgba(59, 130, 246, 0.08); backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 3px dashed var(--primary);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; animation: fadeIn 0.2s ease;
}
.drop-overlay[hidden] { display: none !important; }
.drop-overlay-content { display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--primary); font-size: 18px; font-weight: 500; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Toast 提示 ── */
.toast {
  position: fixed; bottom: calc(24px + env(safe-area-inset-bottom)); left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #323232; color: #fff; padding: 12px 24px;
  border-radius: var(--radius); font-size: 14px; z-index: 2000;
  opacity: 0; transition: all 0.3s ease;
  pointer-events: none; white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.toast-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-error { background: #dc2626; }

/* ── 滚动条 ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d0cc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #b0afab; }
