/* ============ MyCloud UI ============ */
:root {
  --bg: #f4f5fb;
  --surface: #ffffff;
  --surface-2: #f8f9fe;
  --border: #e7e9f2;
  --text: #1c2033;
  --text-2: #6b7189;
  --text-3: #9aa0b5;
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-soft: #eef0ff;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(28, 32, 51, .06), 0 6px 24px rgba(28, 32, 51, .05);
  --shadow-lg: 0 8px 40px rgba(28, 32, 51, .16);
  --sidebar-w: 232px;
  --ink: #111827;          /* 播放器等近黑元素,深色下反转 */
  --ink-hover: #1f2937;
}

/* ---------- 深色模式 ---------- */
[data-theme="dark"] {
  --bg: #0f1117;
  --surface: #181b25;
  --surface-2: #1f2330;
  --border: #2a2f40;
  --text: #e5e8f2;
  --text-2: #a3a9c0;
  --text-3: #6f7590;
  --primary: #818cf8;
  --primary-dark: #6366f1;
  --primary-soft: #26294a;
  --shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 6px 24px rgba(0, 0, 0, .3);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, .6);
  --ink: #e5e8f2;
  --ink-hover: #cbd2e4;
  color-scheme: dark;
}
[data-theme="dark"] .mcp-play, [data-theme="dark"] .audio-row.playing .audio-play-btn,
[data-theme="dark"] .audio-play-btn:hover { color: #0f1117; }
[data-theme="dark"] .mcp-seek-bar { background: #2a2f40; }
[data-theme="dark"] .mcp-seek-bar b { box-shadow: 0 0 0 3px var(--surface), 0 1px 4px rgba(0,0,0,.5); }
[data-theme="dark"] .mcp-btn:hover, [data-theme="dark"] .mcp-btn.active { background: var(--surface-2); color: var(--text); }
[data-theme="dark"] .mcp-title { color: var(--text); }
[data-theme="dark"] .player-bar { background: rgba(24, 27, 37, .95); }
[data-theme="dark"] .player-seek i { background: var(--ink); }
[data-theme="dark"] .audio-row.playing { border-color: #3a4055; background: var(--surface-2); }
[data-theme="dark"] .fd-text-preview { background: var(--surface-2); color: var(--text-2); }
[data-theme="dark"] .dash-mini:hover { background: var(--primary-soft); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
.icon { vertical-align: -0.22em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; padding: 28px 32px 90px; max-width: 1280px; margin: 0 auto; }

/* ---------- 侧边栏 ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 4px 12px 20px; font-size: 18px; font-weight: 700; }
.brand-mark { color: var(--primary); display: flex; }
.sidebar-search {
  display: flex; align-items: center; gap: 8px;
  margin: 0 2px 12px; padding: 8px 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-3);
  transition: border-color .15s;
}
.sidebar-search:focus-within { border-color: var(--primary); }
.sidebar-search input {
  border: none; background: none; outline: none; width: 100%;
  font-size: 13px; color: var(--text); font-family: inherit;
}
.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 3px; }
button.nav-item { background: none; border: none; cursor: pointer; width: 100%; font-size: inherit; text-align: left; color: inherit; }
.sidebar-foot { display: flex; flex-direction: column; gap: 3px; border-top: 1px solid var(--border); padding-top: 12px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary-dark); }

/* ---------- 移动端导航 ---------- */
.mobile-nav { display: none; }
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main { padding: 18px 16px 84px; }
  .mobile-nav {
    display: flex;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  [data-theme="dark"] .mobile-nav { background: rgba(15, 17, 23, .92); }
  .mobile-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    font-size: 11px; color: var(--text-3); padding: 4px 0;
  }
  .mobile-nav a.active { color: var(--primary); }
}

/* ---------- 通用组件 ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.page-title { font-size: 22px; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 10px; }
.page-title .icon { color: var(--primary); }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 14px; font-weight: 500; cursor: pointer;
  transition: all .15s;
}
.btn:hover { border-color: #d5d8e6; background: var(--surface-2); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: #fef2f2; border-color: #fecaca; }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-icon { padding: 8px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }

.input, textarea.input, select.input {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font-size: 14.5px; font-family: inherit; outline: none;
  transition: border-color .15s;
}
.input:focus { border-color: var(--primary); }
textarea.input { resize: vertical; min-height: 120px; line-height: 1.7; }
select.input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b7189' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 38px;
  cursor: pointer;
}
select.input:hover { border-color: #d5d8e6; }
.field { margin-bottom: 16px; }
.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }

.empty {
  text-align: center; padding: 60px 20px; color: var(--text-3);
}
.empty .icon { width: 52px; height: 52px; stroke-width: 1.2; margin-bottom: 12px; }
.empty p { margin: 4px 0; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 500; background: var(--surface-2); color: var(--text-2); }
.badge-primary { background: var(--primary-soft); color: var(--primary-dark); }
.fd-fs-ok { background: #dcfce7; color: #166534; }
.fd-fs-warn { background: #fef3c7; color: #92400e; }

/* ---------- Toast ---------- */
#toast-box { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  padding: 11px 20px; border-radius: var(--radius-sm);
  background: var(--text); color: #fff; font-size: 14px;
  box-shadow: var(--shadow-lg);
  animation: toast-in .25s ease;
}
.toast.err { background: var(--danger); }
.toast.ok { background: var(--success); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(20, 23, 38, .45);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fade-in .18s ease;
}
.modal {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 440px; max-height: 88vh; overflow: auto;
  padding: 24px;
  animation: pop-in .2s ease;
}
.modal h3 { margin: 0 0 18px; font-size: 17px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: scale(.96); } }

/* ---------- 仪表盘(旧组件,年度回顾页仍在使用) ---------- */
.dash-hero { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.dash-hero-date { font-size: 13px; color: var(--text-3); margin-top: 3px; }
.dash-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 10px; }
.dash-grid > .card { min-width: 0; padding: 18px 20px; }
@media (max-width: 720px) { .dash-grid { grid-template-columns: 1fr; } }
/* 柱状活动图(年度回顾页使用) */
.activity-chart { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; height: 120px; }
.act-col { display: flex; flex-direction: column; height: 100%; min-width: 0; }
.act-bars { flex: 1; display: flex; gap: 2px; align-items: flex-end; justify-content: center; }
.act-bars i { width: 38%; max-width: 14px; border-radius: 3px 3px 0 0; transition: height .3s; }
.act-label { text-align: center; font-size: 10px; color: var(--text-3); margin-top: 5px; white-space: nowrap; overflow: hidden; }

/* ---------- 概览 Bento Grid ----------
 * 12 列显式跨度 + 容器查询:卡片按自身可用宽度重排,与视口/侧栏无关。
 * 防竖排铁律:所有 1fr 轨道内 min-width:0,文本一律 nowrap + ellipsis。 */
.bento {
  container-type: inline-size;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}
.bento-cell {
  display: flex; flex-direction: column; min-width: 0;
  padding: 16px 18px;
  animation: pop-in .28s ease both;
}
.bento-cell:nth-child(-n+12) { animation-delay: calc(var(--i, 0) * 0s); }
@media (prefers-reduced-motion: reduce) { .bento-cell { animation: none; } }
.bento-s3 { grid-column: span 3; }
.bento-s4 { grid-column: span 4; }
.bento-s6 { grid-column: span 6; }
.bento-s8 { grid-column: span 8; }
.bento-s12 { grid-column: span 12; }
/* 平板:两列节奏 */
@container (max-width: 920px) {
  .bento-s3 { grid-column: span 6; }
  .bento-s4 { grid-column: span 6; }
  .bento-s8 { grid-column: span 12; }
}
/* 手机:整列,统计块保持 2×2 */
@container (max-width: 560px) {
  .bento-s4, .bento-s6 { grid-column: span 12; }
  .bento-s3 { grid-column: span 6; }
  .bento-cell { padding: 14px 15px; }
}
/* 旧浏览器不支持容器查询时退回媒体查询 */
@supports not (container-type: inline-size) {
  @media (max-width: 1080px) {
    .bento-s3 { grid-column: span 6; }
    .bento-s4 { grid-column: span 6; }
    .bento-s8 { grid-column: span 12; }
  }
  @media (max-width: 640px) {
    .bento-s4, .bento-s6 { grid-column: span 12; }
    .bento-s3 { grid-column: span 6; }
  }
}

/* 卡片头 */
.bento-head { display: flex; align-items: center; gap: 7px; margin-bottom: 12px; min-width: 0; }
.bento-head .icon { color: var(--primary); flex: none; }
.bento-head h3 { margin: 0; font-size: 13.5px; font-weight: 700; color: var(--text-2); white-space: nowrap; }
.bento-sub { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.bento-more { margin-left: auto; flex: none; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.bento-more:hover { color: var(--primary); }
.bento-empty { color: var(--text-3); font-size: 13px; margin: 14px 0; }

/* 统计块 */
.bento-stat { display: flex; align-items: center; gap: 12px; min-width: 0; height: 100%; }
.bento-stat .stat-icon { flex: none; width: 42px; height: 42px; border-radius: 11px; }
.bento-stat-body { min-width: 0; flex: 1; }
.bento-stat-body b { display: block; font-size: 22px; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bento-stat-body span { display: block; font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bento-delta {
  flex: none; align-self: flex-start; font-style: normal; font-size: 11px; font-weight: 700;
  color: var(--success); background: color-mix(in srgb, var(--success) 12%, transparent);
  padding: 2px 7px; border-radius: 99px; white-space: nowrap;
}
.bento-cell:has(.bento-stat) { transition: border-color .15s, transform .15s, box-shadow .15s; }
.bento-cell:has(.bento-stat:hover) { border-color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow); }
@container (max-width: 560px) {
  .bento-stat { gap: 10px; }
  .bento-stat .stat-icon { width: 36px; height: 36px; }
  .bento-stat-body b { font-size: 18px; }
  .bento-delta { display: none; }
}

/* 图表容器 */
.bento-chart { position: relative; min-height: 170px; min-width: 0; }
.bento-range { display: inline-flex; margin-left: auto; flex: none; gap: 2px; background: var(--surface-2); border-radius: 8px; padding: 2px; }
.bento-range button {
  border: 0; background: none; font-size: 11.5px; font-weight: 600; color: var(--text-3);
  padding: 3px 10px; border-radius: 6px; cursor: pointer; white-space: nowrap; transition: all .15s;
}
.bento-range button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

/* 存储环形图 */
.bento-donut-row { display: flex; align-items: center; gap: 16px; min-width: 0; }
.bento-donut { position: relative; width: 104px; height: 104px; flex: none; }
.bento-donut-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; pointer-events: none;
}
.bento-donut-center b { font-size: 17px; font-weight: 800; line-height: 1.1; }
.bento-donut-center span { font-size: 10.5px; color: var(--text-3); }
.bento-legend { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.bento-legend-row { display: flex; align-items: center; gap: 7px; font-size: 12.5px; min-width: 0; }
.bento-legend-row i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.bento-legend-row span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bento-legend-row em { font-style: normal; margin-left: auto; flex: none; font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.bento-disk { margin-top: 12px; }
.bento-disk-bar { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bento-disk-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--primary), var(--primary-dark)); }
.bento-disk > span { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 活跃热力图(GitHub 风格,color-mix 自动适配主题/深色) */
.bento-heatmap {
  display: grid; grid-template-columns: repeat(12, minmax(10px, 24px));
  gap: 5px; justify-content: center; align-content: center; padding: 6px 0;
}
.bento-hm-col { display: grid; grid-template-rows: repeat(7, 1fr); gap: 5px; min-width: 0; }
.bento-hm-col i, .bento-hm-scale i { display: block; width: 100%; aspect-ratio: 1; border-radius: 3.5px; background: var(--surface-2); }
.bento-hm-col i.future { visibility: hidden; }
.bento-hm-col i.l1, .bento-hm-scale i.l1 { background: color-mix(in srgb, var(--primary) 25%, transparent); }
.bento-hm-col i.l2, .bento-hm-scale i.l2 { background: color-mix(in srgb, var(--primary) 48%, transparent); }
.bento-hm-col i.l3, .bento-hm-scale i.l3 { background: color-mix(in srgb, var(--primary) 72%, transparent); }
.bento-hm-col i.l4, .bento-hm-scale i.l4 { background: var(--primary); }
.bento-hm-scale { margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--text-3); white-space: nowrap; }
.bento-hm-scale i { width: 10px; }
@container (max-width: 560px) {
  .bento-hm-scale { display: none; }
  .bento-heatmap { gap: 3.5px; }
  .bento-hm-col { gap: 3.5px; }
}

/* 列表行 */
.bento-row { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 7px 4px; border-radius: 9px; }
.bento-row:hover { background: var(--surface-2); }
.bento-row-ico { flex: none; }
.bento-row-thumb { height: auto !important; margin: 0 !important; flex: none; }
.bento-row-main { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bento-row-sub { flex: none; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.bento-row .badge { flex: none; }

/* 照片墙 */
.bento-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; margin-bottom: 4px; }
.bento-photo { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; cursor: zoom-in; }
.bento-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.bento-photo:hover img { transform: scale(1.06); }
.bento-photo span {
  position: absolute; left: 5px; bottom: 5px; font-size: 10px; font-weight: 700; color: #fff;
  background: rgba(0,0,0,.45); padding: 1px 6px; border-radius: 99px; backdrop-filter: blur(4px);
}

/* 快速入口 2×2 */
.bento-quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-content: start; }
.bento-quick a {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0;
  padding: 11px 13px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: all .15s;
}
.bento-quick a:hover { border-color: var(--primary); background: var(--primary-soft); }
.bento-quick .stat-icon { width: 34px; height: 34px; border-radius: 9px; margin-bottom: 2px; }
.bento-quick b { font-size: 14.5px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bento-quick span:last-child { font-size: 11.5px; color: var(--text-3); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 标签云 */
.bento-tags { display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; }
.bento-tags .tag-chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bento-tags .tag-chip b { font-weight: 600; opacity: .6; margin-left: 2px; }

/* 系统状态 */
.bento-sys { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 22px; align-content: start; }
.bento-sys > div {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0;
  padding: 7.5px 0; border-bottom: 1px dashed var(--border); font-size: 12.5px;
}
.bento-sys span { color: var(--text-3); white-space: nowrap; }
.bento-sys b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@container (max-width: 560px) { .bento-sys { grid-template-columns: 1fr; } }

/* ---------- 概览页 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-bottom: 26px; }
.stat-card { padding: 18px; display: flex; align-items: center; gap: 14px; }
.stat-icon {
  width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary);
}
.stat-icon.green { background: #ecfdf5; color: var(--success); }
.stat-icon.amber { background: #fffbeb; color: var(--warning); }
.stat-icon.rose { background: #fff1f2; color: #f43f5e; }
.stat-value { font-size: 20px; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: 12.5px; color: var(--text-3); }

.section-title { font-size: 15px; font-weight: 700; margin: 26px 0 12px; display: flex; align-items: center; gap: 8px; color: var(--text-2); }

/* ---------- 网盘 ---------- */
.breadcrumb { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 14px; color: var(--text-2); margin-bottom: 16px; }
.breadcrumb a { color: var(--text-2); padding: 3px 7px; border-radius: 6px; }
.breadcrumb a:hover { background: var(--surface-2); color: var(--text); }
.breadcrumb .cur { color: var(--text); font-weight: 600; padding: 3px 7px; }
.breadcrumb .icon { color: var(--text-3); }

.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
@media (max-width: 768px) { .file-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; } }
.file-card {
  position: relative;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 10px 12px; text-align: center; cursor: pointer;
  transition: all .15s;
}
.file-card:hover { box-shadow: var(--shadow); border-color: #d5d8e6; transform: translateY(-1px); }
.file-thumb {
  position: relative;
  height: 74px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 8px; border-radius: var(--radius-sm); overflow: hidden;
}
.file-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-sm); }
.file-thumb .icon { width: 44px; height: 44px; stroke-width: 1.3; }
.file-thumb.t-folder { color: #f59e0b; }
.file-thumb.t-image { color: #10b981; }
.file-thumb.t-audio { color: #8b5cf6; }
.file-thumb.t-video { color: #f43f5e; }
.file-thumb.t-doc { color: #3b82f6; }
.file-thumb.t-archive { color: #f97316; }
.file-thumb.t-other { color: var(--text-3); }
.file-name { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { font-size: 11.5px; color: var(--text-3); }
.file-more {
  position: absolute; top: 6px; right: 6px;
  border: none; background: transparent; color: var(--text-3);
  padding: 5px; border-radius: 7px; cursor: pointer; opacity: 0;
  transition: all .15s;
}
.file-card:hover .file-more, .file-more.open { opacity: 1; }
.file-more:hover { background: var(--surface-2); color: var(--text); }
@media (hover: none) { .file-more { opacity: 1; } }

.ctx-menu {
  position: fixed; z-index: 200; min-width: 150px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); padding: 5px;
  animation: pop-in .12s ease;
}
.ctx-menu button {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 8px 11px; border: none; background: none; text-align: left;
  font-size: 13.5px; color: var(--text); border-radius: 7px; cursor: pointer;
}
.ctx-menu button:hover { background: var(--surface-2); }
.ctx-menu button.danger { color: var(--danger); }

/* 上传进度 */
.upload-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 90;
  width: 320px; max-width: calc(100vw - 40px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  overflow: hidden;
}
@media (max-width: 768px) { .upload-panel { bottom: 76px; } }
.upload-panel-head { padding: 11px 16px; font-size: 13.5px; font-weight: 600; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.upload-panel-body { max-height: 220px; overflow: auto; padding: 8px 16px; }
.upload-item { padding: 7px 0; font-size: 13px; }
.upload-item-name { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.upload-item-name span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress { height: 4px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--primary); border-radius: 99px; transition: width .2s; }
.progress i.done { background: var(--success); }
.progress i.fail { background: var(--danger); }

.audio-fs-panel { padding: 16px 18px; margin-bottom: 16px; }
.audio-fs-badge { margin-left: 6px; vertical-align: middle; font-size: 11px; padding: 1px 7px; }
.audio-name { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.u-btn {
  border: none; background: var(--surface-2); color: var(--text-2);
  width: 22px; height: 22px; border-radius: 6px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.u-btn:hover { background: var(--border); color: var(--text); }
.u-err { color: var(--danger); font-size: 12px; margin-top: 4px; line-height: 1.5; word-break: break-all; }

.dropzone-hint {
  position: fixed; inset: 12px; z-index: 80; pointer-events: none;
  border: 2.5px dashed var(--primary); border-radius: 20px;
  background: rgba(99, 102, 241, .08);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 600; color: var(--primary-dark);
}

/* ---------- 图库 ---------- */
.masonry { columns: 4 200px; column-gap: 12px; }
.masonry-item {
  break-inside: avoid; margin-bottom: 12px;
  border-radius: var(--radius); overflow: hidden; cursor: zoom-in;
  background: var(--surface); border: 1px solid var(--border);
  position: relative;
}
.masonry-item img { width: 100%; display: block; transition: transform .3s; }
.masonry-item:hover img { transform: scale(1.03); }
.masonry-item .m-cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 20px 10px 8px; font-size: 12px; color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.55));
  opacity: 0; transition: opacity .2s;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.masonry-item:hover .m-cap { opacity: 1; }

/* 灯箱 */
.lightbox {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(12, 14, 24, .93);
  display: flex; align-items: center; justify-content: center;
  animation: fade-in .2s ease;
}
.lightbox img { max-width: 92vw; max-height: 86vh; border-radius: 6px; box-shadow: 0 10px 60px rgba(0,0,0,.5); }
.lightbox-btn {
  position: absolute; border: none; cursor: pointer;
  background: rgba(255,255,255,.1); color: #fff;
  border-radius: 50%; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.lightbox-btn:hover { background: rgba(255,255,255,.22); }
.lightbox-close { top: 18px; right: 18px; }
.lightbox-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 14px; top: 50%; transform: translateY(-50%); }
.lightbox-cap { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,.85); font-size: 13px; max-width: 80vw; text-align: center; }

/* ---------- 音频 ---------- */
.audio-list { display: flex; flex-direction: column; gap: 10px; }
.audio-row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  transition: all .15s;
}
.audio-row:hover { box-shadow: var(--shadow); }
.audio-row.playing { border-color: #d1d5db; background: var(--surface-2); }
.audio-play-btn {
  width: 42px; height: 42px; border-radius: 50%; cursor: pointer; flex: none;
  background: var(--surface); color: var(--text-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.audio-play-btn:hover { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.audio-row.playing .audio-play-btn { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.audio-info { flex: 1; min-width: 0; }
.audio-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audio-meta { font-size: 12px; color: var(--text-3); }
.audio-actions { display: flex; gap: 4px; }

/* 底部播放条 */
.player-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  padding: 10px 20px calc(10px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 14px;
  box-shadow: 0 -4px 24px rgba(28,32,51,.08);
}
@media (max-width: 768px) { .player-bar { bottom: 62px; padding-bottom: 10px; } }
.player-title { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.player-time { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.player-seek { flex: 1; height: 5px; border-radius: 99px; background: var(--border); cursor: pointer; position: relative; }
.player-seek i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink); border-radius: 99px; pointer-events: none; }

/* 录音 */
.rec-pulse { animation: pulse 1.2s ease infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.rec-timer { font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: center; margin: 14px 0; }

/* ---------- 记录 ---------- */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--border); border-radius: 2px; }
.note-card { position: relative; margin-bottom: 18px; padding: 18px 20px; }
.note-card::before {
  content: ''; position: absolute; left: -22px; top: 24px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--primary); border: 2.5px solid var(--bg);
}
.note-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 6px; }
.note-title { font-size: 16px; font-weight: 700; margin: 0; }
.note-title a:hover { color: var(--primary); }
.note-date { font-size: 12.5px; color: var(--text-3); white-space: nowrap; display: flex; align-items: center; gap: 5px; }
.note-excerpt { color: var(--text-2); font-size: 14px; margin: 4px 0 10px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; white-space: pre-line; }
.note-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.note-thumbs img { width: 84px; height: 84px; object-fit: cover; border-radius: var(--radius-sm); cursor: zoom-in; }
.note-thumbs .more-count {
  width: 84px; height: 84px; border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text-2);
  display: flex; align-items: center; justify-content: center; font-weight: 600;
}
.note-audio-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px 7px 8px; margin: 3px 6px 3px 0;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 99px;
  font-size: 13px; cursor: pointer; transition: all .15s;
}
.note-audio-chip:hover { border-color: var(--primary); color: var(--primary-dark); }
.note-audio-chip .chip-play {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; flex: none;
}

/* 记录编辑页 */
.attach-grid { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.attach-item { position: relative; width: 96px; }
.attach-item img { width: 96px; height: 96px; object-fit: cover; border-radius: var(--radius-sm); display: block; }
.attach-item .att-audio {
  width: 96px; height: 96px; border-radius: var(--radius-sm);
  background: var(--primary-soft); color: var(--primary);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 11px; padding: 4px; text-align: center;
}
.attach-item .att-audio span { max-width: 88px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.attach-remove {
  position: absolute; top: -7px; right: -7px;
  width: 22px; height: 22px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--text); color: #fff;
  display: flex; align-items: center; justify-content: center;
}

/* 记录详情 */
.note-full-content { font-size: 15.5px; line-height: 1.9; white-space: pre-wrap; word-break: break-word; }
.note-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 18px; }
.note-gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); cursor: zoom-in; }

.thumb-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(0, 0, 0, .5); color: #fff;
  display: flex; align-items: center; justify-content: center; pointer-events: none;
}
.thumb-play .icon { fill: #fff; stroke: #fff; margin-left: 2px; }

/* ---------- 相册 ---------- */
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.album-card { display: block; overflow: hidden; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
.album-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.album-cover { aspect-ratio: 4 / 3; background: var(--surface-2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.album-cover img { width: 100%; height: 100%; object-fit: cover; }
.tl-item { position: relative; }
.tl-remove {
  position: absolute; right: 6px; top: 6px; z-index: 2;
  width: 24px; height: 24px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(0, 0, 0, .55); color: #fff;
  display: none; align-items: center; justify-content: center;
}
.tl-item:hover .tl-remove { display: flex; }

/* ---------- 歌词 ---------- */
.lrc-box {
  position: relative; width: 100%; max-height: 280px; overflow-y: auto;
  text-align: center; padding: 100px 16px; margin-top: 12px;
  -webkit-mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent);
}
.lrc-box p {
  margin: 0; padding: 7px 0; color: var(--text-3); font-size: 14px;
  cursor: pointer; transition: all .25s;
}
.lrc-box p:hover { color: var(--text-2); }
.lrc-box p.on { color: var(--primary); font-size: 16px; font-weight: 600; }

/* ---------- Markdown 正文 ---------- */
.md-body { width: 100%; line-height: 1.75; font-size: 15px; word-break: break-word; }
.md-body h1, .md-body h2, .md-body h3 { margin: 1.2em 0 .5em; line-height: 1.4; }
.md-body h1 { font-size: 1.5em; } .md-body h2 { font-size: 1.3em; } .md-body h3 { font-size: 1.15em; }
.md-body p { margin: .6em 0; }
.md-body pre {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; overflow-x: auto; font-size: 13px;
}
.md-body code { background: var(--surface-2); border-radius: 5px; padding: 1.5px 6px; font-size: .9em; }
.md-body pre code { background: none; padding: 0; }
.md-body blockquote {
  margin: .8em 0; padding: 4px 14px; color: var(--text-2);
  border-left: 3px solid var(--primary); background: var(--surface-2); border-radius: 0 8px 8px 0;
}
.md-body img { max-width: 100%; border-radius: 10px; }
.md-body table { border-collapse: collapse; margin: .8em 0; }
.md-body th, .md-body td { border: 1px solid var(--border); padding: 6px 12px; font-size: 13.5px; }
.md-body a { color: var(--primary); }
.md-body ul, .md-body ol { padding-left: 1.6em; }
.md-body hr { border: none; border-top: 1px solid var(--border); margin: 1.2em 0; }

/* ---------- 文件夹选择器 ---------- */
.picker-list {
  max-height: 46vh; overflow-y: auto; border: 1px solid var(--border);
  border-radius: 10px; margin-top: 4px;
}
.picker-row {
  display: flex; align-items: center; gap: 9px; padding: 9px 12px;
  cursor: pointer; font-size: 14px; border-bottom: 1px solid var(--border);
}
.picker-row:last-child { border-bottom: none; }
.picker-row:hover { background: var(--primary-soft); }

/* ---------- 批量选择 ---------- */
.sel-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; z-index: 60;
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 99px; padding: 10px 18px; box-shadow: var(--shadow-lg);
  min-width: min(560px, calc(100vw - 32px));
}
.sel-badge {
  position: absolute; left: 10px; top: 10px; z-index: 2;
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--text-3); background: var(--surface);
  display: none; align-items: center; justify-content: center; color: transparent;
}
body.selecting .sel-badge { display: flex; }
body.selecting .file-card { user-select: none; }
.file-card.sel { outline: 2px solid var(--primary); background: var(--primary-soft); }
.tl-item.sel, .masonry-item.sel { outline: 3px solid var(--primary); outline-offset: -3px; border-radius: 10px; opacity: .82; }
.file-card.sel .sel-badge { background: var(--primary); border-color: var(--primary); color: #fff; }
.star-badge {
  position: absolute; right: 10px; top: 10px; z-index: 2; color: #f59e0b;
}
.star-badge .icon { fill: #f59e0b; stroke: #f59e0b; }
.toast-undo {
  margin-left: 10px; border: none; cursor: pointer;
  background: rgba(255, 255, 255, .18); color: #fff;
  border-radius: 7px; padding: 3px 12px; font-size: 12.5px; font-weight: 600;
}
.toast-undo:hover { background: rgba(255, 255, 255, .3); }

/* ---------- 设置中心:左侧分组标签 + 右侧单列内容 ---------- */
.settings-layout { display: flex; gap: 20px; align-items: flex-start; }
.set-tabs {
  flex: none; width: 190px; position: sticky; top: 20px;
  display: flex; flex-direction: column; gap: 3px;
}
.set-tab {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 13px; border: none; border-radius: var(--radius-sm);
  background: none; color: var(--text-2); font-size: 14px; font-weight: 500;
  cursor: pointer; text-align: left; transition: background .15s, color .15s;
}
.set-tab:hover { background: var(--surface-2); color: var(--text); }
.set-tab.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.set-panel { flex: 1; min-width: 0; max-width: 620px; }
.set-panel .set-card { margin-bottom: 16px; display: none; } /* JS 按分组显示,避免闪烁 */
.set-card { padding: 22px 24px; }
@media (max-width: 900px) {
  /* 平板/手机:标签变横向滚动条 */
  .settings-layout { flex-direction: column; gap: 14px; }
  .set-tabs {
    position: static; width: 100%; flex-direction: row; overflow-x: auto;
    padding-bottom: 4px; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .set-tabs::-webkit-scrollbar { display: none; }
  .set-tab { flex: none; white-space: nowrap; padding: 8px 13px; background: var(--surface); border: 1px solid var(--border); border-radius: 99px; }
  .set-tab.active { border-color: var(--primary); }
  .set-panel { max-width: none; width: 100%; }
}
.color-dot {
  width: 30px; height: 30px; border-radius: 50%; border: 3px solid transparent;
  cursor: pointer; padding: 0; transition: all .15s;
}
.color-dot.sel { border-color: var(--surface); box-shadow: 0 0 0 2px var(--text); }
.color-dot:hover { transform: scale(1.12); }

/* 主题皮肤选择器 */
.skin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.skin-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 8px 6px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer; transition: all .15s;
}
.skin-card:hover { border-color: var(--text-3); }
.skin-card.sel { border-color: var(--primary); background: var(--primary-soft); }
.skin-swatch {
  position: relative; width: 100%; height: 34px; border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, .08); overflow: hidden;
}
.skin-swatch i {
  position: absolute; left: 8px; bottom: 6px;
  width: 14px; height: 14px; border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.skin-name { font-size: 12px; font-weight: 600; color: var(--text-2); }
.skin-card.sel .skin-name { color: var(--primary-dark); }

/* ---------- 文件请求(收集) ---------- */
.fr-drop {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 34px 16px; margin: 8px 0 12px;
  border: 2px dashed var(--border); border-radius: var(--radius);
  color: var(--text-3); cursor: pointer; text-align: center;
  transition: all .15s;
}
.fr-drop:hover, .fr-drop.over { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.fr-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.fr-row:last-child { border-bottom: none; }
.fr-state { white-space: nowrap; font-size: 12.5px; }

/* ---------- 心情日历 ---------- */
.mood-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.mc-week { text-align: center; font-size: 12px; color: var(--text-3); padding: 4px 0; }
.mc-day {
  aspect-ratio: 1; border-radius: var(--radius-sm);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: var(--surface-2); position: relative; min-height: 52px;
}
.mc-day.has-note { cursor: pointer; background: var(--primary-soft); }
.mc-day.has-note:hover, .mc-day.sel { outline: 2px solid var(--primary); }
.mc-day.today .mc-num { background: var(--primary); color: #fff; border-radius: 99px; padding: 0 7px; }
.mc-num { font-size: 12px; color: var(--text-2); line-height: 1.5; }
.mc-mood { font-size: 17px; line-height: 1.2; min-height: 20px; }
@media (max-width: 600px) { .mc-day { min-height: 40px; } .mc-mood { font-size: 14px; } }

/* ---------- 标签 ---------- */
.tag-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 99px; font-size: 13px;
  background: var(--surface-2); border: 1px solid var(--border);
  transition: all .15s; font-weight: 500;
}
.tag-chip span { font-size: 11px; color: var(--text-3); }
.tag-chip:hover { border-color: var(--primary); color: var(--primary); }
.tag-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.tag-chip.active span { color: rgba(255, 255, 255, .8); }

/* ---------- 那年今天 ---------- */
.memory-item { position: relative; }
.memory-year {
  position: absolute; left: 6px; bottom: 6px;
  background: rgba(0, 0, 0, .55); color: #fff;
  font-size: 10.5px; padding: 1px 7px; border-radius: 99px; pointer-events: none;
}

/* ---------- 照片时间线 ---------- */
.tl-month { margin-bottom: 26px; }
.tl-month-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.tl-month-title { font-size: 17px; font-weight: 700; }
.tl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.tl-item { aspect-ratio: 1; overflow: hidden; border-radius: 10px; cursor: zoom-in; background: var(--surface-2); }
.tl-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.tl-item:hover img { transform: scale(1.05); }
@media (max-width: 600px) { .tl-grid { grid-template-columns: repeat(3, 1fr); gap: 4px; } }

/* ---------- 播放器与预览组件 ---------- */
.fd-text-preview {
  width: 100%; max-height: 60vh; overflow: auto; margin: 0;
  padding: 14px 16px; background: var(--surface-2, #f8fafc);
  border: 1px solid var(--border); border-radius: 10px;
  font: 12.5px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap; word-break: break-all; color: var(--text-2);
}
.plyr { border-radius: 10px; --plyr-color-main: #6366f1; }

/* 音频播放器(黑白灰精致风) */
.mc-player { padding: 16px 18px 12px; width: 100%; }
.mc-player.buffering .mcp-play { opacity: .55; cursor: wait; }
.mcp-main { display: flex; align-items: center; gap: 12px; }
.mcp-play {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  background: var(--ink); color: #fff; cursor: pointer;
  border: none;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, transform .15s;
  box-shadow: 0 1px 3px rgba(17, 24, 39, .25);
}
.mcp-play:hover { background: var(--ink-hover); transform: scale(1.03); }
.mcp-play:active { transform: scale(.97); }
.mcp-btn {
  border: none; background: none; color: #9ca3af; cursor: pointer; flex: none;
  min-width: 30px; height: 30px; padding: 0 6px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 600; letter-spacing: .02em;
  font-variant-numeric: tabular-nums; transition: all .15s;
}
.mcp-btn:hover { background: var(--surface-2); color: var(--text); }
.mcp-btn.active { color: var(--ink); background: var(--surface-2); }
.mcp-info { flex: 1; min-width: 0; }
.mcp-title { font-weight: 600; font-size: 13.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mcp-sub { font-size: 11.5px; color: #9ca3af; margin-top: 2px; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.mcp-seek { padding: 12px 0 4px; cursor: pointer; touch-action: none; }
.mcp-seek-bar { position: relative; height: 3px; border-radius: 99px; background: var(--border); transition: height .15s; }
.mc-player:hover .mcp-seek-bar { height: 5px; }
.mcp-seek-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--ink); width: 0; }
.mcp-seek-bar b {
  position: absolute; top: 50%; left: 0; width: 11px; height: 11px;
  border-radius: 50%; background: var(--ink);
  box-shadow: 0 0 0 3px var(--surface), 0 1px 4px rgba(0, 0, 0, .2);
  transform: translate(-50%, -50%) scale(0); transition: transform .15s;
}
.mc-player:hover .mcp-seek-bar b { transform: translate(-50%, -50%) scale(1); }
.viewer-title { color: #e2e8f0; opacity: 1; }

/* ---------- 彩色图标 / 文件夹图标选择 ---------- */
.icon-ip { vertical-align: -0.22em; flex: none; }
.icon-cell-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; max-height: 340px; overflow: auto; padding: 2px; }
.icon-cell {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 1; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; transition: all .12s; background: var(--surface);
}
.icon-cell:hover { border-color: var(--primary); background: var(--primary-soft); transform: scale(1.06); }

/* 拖动排序 / 拖入文件夹 */
.file-card.drag-ghost { opacity: .35; border-style: dashed; border-color: var(--primary); }
.file-card.drop-into {
  border-color: var(--primary); background: var(--primary-soft);
  transform: scale(1.05); box-shadow: var(--shadow);
}

/* ---------- 网盘文件选择器 ---------- */
.picker-list { max-height: 320px; overflow: auto; margin: 4px 0; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.picker-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; cursor: pointer; font-size: 13.5px;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.picker-row:last-child { border-bottom: none; }
.picker-row:hover { background: var(--surface-2); }
.picker-row.sel { background: var(--primary-soft); }
.picker-row .p-check {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  border: 1.5px solid var(--border); background: var(--surface);
  display: flex; align-items: center; justify-content: center; color: transparent;
}
.picker-row.sel .p-check { background: var(--primary); border-color: var(--primary); color: #fff; }
.picker-row .p-check .icon { color: inherit; }
.picker-row > .icon { color: #8b5cf6; }

/* ---------- 文件详情页 ---------- */
.file-detail-grid { display: grid; grid-template-columns: 5fr 6fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .file-detail-grid { grid-template-columns: 1fr; } }
.fd-preview { padding: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 240px; }
.fd-preview img { max-width: 100%; max-height: 420px; border-radius: 10px; }
.fd-media-icon {
  width: 110px; height: 110px; border-radius: 26px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2);
}
.fd-media-icon .icon { width: 56px; height: 56px; stroke-width: 1.2; }
.fd-table td { padding: 12px 10px; vertical-align: top; }
.fd-table td:first-child { white-space: nowrap; width: 84px; }
.fd-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; word-break: break-all; }
.fd-crumb { display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); font-size: 12.5px; }
.fd-crumb:hover { background: var(--primary-soft); color: var(--primary-dark); }

/* ---------- 登录 / 安装 ---------- */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, #eef0ff 0%, #f4f5fb 50%, #eefdf5 100%);
}
.auth-card { width: 100%; max-width: 400px; padding: 36px 32px; }
.auth-logo { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 24px; font-weight: 800; margin-bottom: 8px; color: var(--text); }
.auth-logo .icon { color: var(--primary); }
.auth-sub { text-align: center; color: var(--text-3); font-size: 13.5px; margin-bottom: 26px; }

/* ---------- 分享页 ---------- */
.share-hero { text-align: center; padding: 30px 0 10px; }
.share-file-icon { width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 20px; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; }
.share-file-icon .icon { width: 38px; height: 38px; stroke-width: 1.4; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; padding: 11px 14px; color: var(--text-3); font-size: 12.5px; font-weight: 600; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--border); }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: var(--surface-2); }

/* ---------- 其他 ---------- */
.muted { color: var(--text-3); font-size: 13px; }
.flex { display: flex; align-items: center; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.hidden { display: none !important; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

[data-theme="dark"] .auth-wrap { background: linear-gradient(135deg, #171a2b 0%, #0f1117 50%, #14201a 100%); }
[data-theme="dark"] .audio-row.playing { border-color: #3a4055; }
