/* ============================================================================
   BN log — 视觉规范对齐 DSH Web GUI
   ----------------------------------------------------------------------------
   直接采用 DSH 的设计令牌（--dsw-*）取值：
     · 表面：白 #fff / 模块灰 #f5f6f7 / 浮层 #e9ecf2
     · 文字：#0f1115 / #61666b / #81858c / #adb2b8
     · 描边：4% / 10% / 12% / 16% 黑
     · 圆角：4 / 8 / 12 / 16
     · 阴影：lv1 0 2px 4px 5% / lv2 4px 12px / lv3 12px 32px
     · 主色：deepseek-500 #4176e6，hover #5686fe
     · 正文 Inter / 系统字体栈，数字 tabular-nums
   浅色 + 深色两套，跟随系统。
   ============================================================================ */

:root {
  /* 表面：画布 / 面板 / 卡片 三层 */
  --bg-app: #e9ecf0;
  --bg-base: #ffffff;
  --bg-module: #f6f7f9;
  --bg-module-2: #eceef2;
  --bg-overlay: #e2e6ec;
  --bg-hover: rgba(15, 17, 21, .045);
  --bg-active: rgba(15, 17, 21, .07);

  /* 文字 */
  --label-1: #0f1115;
  --label-2: #61666b;
  --label-3: #81858c;
  --label-4: #adb2b8;
  --label-invert: #ffffff;

  /* 描边 */
  --border-1: rgba(0, 0, 0, .04);
  --border-2: rgba(0, 0, 0, .10);
  --border-3: rgba(0, 0, 0, .12);
  --border-4: rgba(0, 0, 0, .16);

  /* 主色 */
  --accent: #4176e6;
  --accent-hover: #5686fe;
  --accent-weak: rgba(65, 118, 230, .10);
  --accent-ring: rgba(65, 118, 230, .28);
  --danger: #d92d20;
  --danger-weak: rgba(217, 45, 32, .10);
  --success: #12b76a;

  /* 圆角 / 阴影 */
  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-pill: 999px;
  --shadow-1: 0 1px 2px 0 rgba(16, 18, 21, .06);
  --shadow-2: 0 2px 6px -1px rgba(16, 18, 21, .08), 0 10px 24px -6px rgba(16, 18, 21, .10);
  --shadow-3: 0 0 0 1px rgba(16, 18, 21, .05), 0 18px 48px -12px rgba(16, 18, 21, .18);
  --ring: rgba(65, 118, 230, .30);
  --ease: cubic-bezier(.2, .7, .3, 1);

  /* 字体：统一到一套系统无衬线，避免混用等宽导致的"忽大忽小" */
  --f-text: "Segoe UI Variable Text", "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei",
            "PingFang SC", "HarmonyOS Sans SC", system-ui, -apple-system, sans-serif;
  --f-mono: var(--f-text);

  /* 尺寸 */
  --sidebar-w: 288px;
  --header-h: 60px;
  --col-w: 344px;
  --card-h: 196px;
  --cover-h: 104px;      /* 104 / 196 ≈ 53%，封面占卡片一半以上 */
  --bg-blur: 12px;
  /* 背景图之上压的一层底色，越高越不抢戏（设置里的 Dim 滑杆改的就是它） */
  --bg-dim: 62%;
  /* 有背景图时，列 / 侧栏的玻璃不透明度（浅色需要更实一点，不然发蓝） */
  --glass-col: 74%;
  --glass-side: 84%;

  /* 兼容旧变量名 */
  --primary: #4176e6;
  --text-main: #0f1115;
  --text-sub: #61666b;
  --glass-bg: #ffffff;
  --glass-border: rgba(0, 0, 0, .10);
  --radius: 12px;
  --transition: all .16s ease;

  /* 难度色 */
  --diff-easy: #2f9e44;
  --diff-normal: #1c7ed6;
  --diff-hard: #f08c00;
  --diff-insane: #e64980;
  --diff-expert: #7048e8;
  --diff-expert-plus: #343a40;
  --bn-shared-bg: #7048e8;
  --bn-accent: #7048e8;
  /* osu! 品牌粉：浅色下压深一点，深色下提亮，两个主题都是扁平单色 */
  color-scheme: light;
}

:root[data-theme="dark"] {
    --bg-app: #0f1012;
    --bg-base: #1f2023;
    --bg-module: #18191c;
    --bg-module-2: #2a2c31;
    --bg-overlay: #2f3136;
    --bg-hover: rgba(255, 255, 255, .055);
    --bg-active: rgba(255, 255, 255, .09);

    --label-1: #f3f4f6;
    --label-2: #c5c9cf;
    --label-3: #8d939b;
    --label-4: #6b7078;
    --label-invert: #0f1012;

    --border-1: rgba(255, 255, 255, .06);
    --border-2: rgba(255, 255, 255, .10);
    --border-3: rgba(255, 255, 255, .14);
    --border-4: rgba(255, 255, 255, .20);

    --accent: #5686fe;
    --accent-hover: #7aaaff;
    --accent-weak: rgba(86, 134, 254, .16);
    --accent-ring: rgba(122, 170, 255, .34);
    --danger: #f97066;
    --danger-weak: rgba(249, 112, 102, .14);

    --shadow-1: 0 1px 2px 0 rgba(0, 0, 0, .50);
    --shadow-2: 0 2px 8px -2px rgba(0, 0, 0, .50), 0 12px 28px -10px rgba(0, 0, 0, .55);
    --shadow-3: 0 0 0 1px rgba(255, 255, 255, .06), 0 24px 60px -16px rgba(0, 0, 0, .75);
    --ring: rgba(122, 170, 255, .34);
    --glass-col: 62%;
    --glass-side: 72%;
    --bg-dim: 55%;

    --text-main: #f3f4f6;
    --text-sub: #c5c9cf;
    --glass-bg: #1f2023;
    --glass-border: rgba(255, 255, 255, .10);
  --diff-expert-plus: #e9ecef;
  --bn-accent: #b9a6ff;
  color-scheme: dark;
}

/* ==== 强调色（标题栏配色）====
   html[data-accent="…"] 由 localStorage 驱动；只重定义 --accent 系列，
   其余令牌继续跟着明暗主题走。默认 blue 完全沿用上面的原始取值。 */
:root[data-accent="violet"] { --accent: #7c5cf0; --accent-hover: #8f74f5; }
:root[data-accent="teal"]   { --accent: #0d9488; --accent-hover: #14b8a6; }
:root[data-accent="green"]  { --accent: #16a34a; --accent-hover: #22c55e; }
:root[data-accent="amber"]  { --accent: #d97706; --accent-hover: #f59e0b; }
:root[data-accent="rose"]   { --accent: #e11d48; --accent-hover: #f43f5e; }

:root[data-theme="dark"][data-accent="violet"] { --accent: #9a80ff; --accent-hover: #b4a0ff; }
:root[data-theme="dark"][data-accent="teal"]   { --accent: #2dd4bf; --accent-hover: #5eead4; }
:root[data-theme="dark"][data-accent="green"]  { --accent: #34d399; --accent-hover: #6ee7b7; }
:root[data-theme="dark"][data-accent="amber"]  { --accent: #f5a524; --accent-hover: #fbbf24; }
:root[data-theme="dark"][data-accent="rose"]   { --accent: #fb7185; --accent-hover: #fda4af; }

:root[data-accent]:not([data-accent="blue"]) {
  --accent-weak: color-mix(in srgb, var(--accent) 10%, transparent);
  --accent-ring: color-mix(in srgb, var(--accent) 28%, transparent);
  --ring: color-mix(in srgb, var(--accent) 30%, transparent);
  --primary: var(--accent);
}
:root[data-theme="dark"][data-accent]:not([data-accent="blue"]) {
  --accent-weak: color-mix(in srgb, var(--accent) 16%, transparent);
  --accent-ring: color-mix(in srgb, var(--accent) 34%, transparent);
  --ring: color-mix(in srgb, var(--accent) 34%, transparent);
  --primary: var(--accent);
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--f-text);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--label-1);
  background: var(--bg-app);
  display: flex;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
}

/* 背景图遮罩：图片铺在 body 上，这一层负责「压暗 + 模糊」，
   前景表面（列、侧栏）在 body.has-bg 时改为半透明玻璃，图片才透得出来 */
.bg-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: color-mix(in srgb, var(--bg-app) var(--bg-dim), transparent);
  -webkit-backdrop-filter: blur(var(--bg-blur)) saturate(1.08);
  backdrop-filter: blur(var(--bg-blur)) saturate(1.08);
}

/* 没有设置背景图时，一切照旧（画布是不透明的纯色） */
body.has-bg .app-container,
body.has-bg .main-content,
body.has-bg .board-scroll { background: transparent; }

body.has-bg .sidebar {
  background: color-mix(in srgb, var(--bg-module) var(--glass-side), transparent);
  -webkit-backdrop-filter: blur(22px) saturate(1.1);
  backdrop-filter: blur(22px) saturate(1.1);
}
body.has-bg .column {
  background: color-mix(in srgb, var(--bg-module) var(--glass-col), transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.12);
  backdrop-filter: blur(18px) saturate(1.12);
}
body.has-bg header { background: color-mix(in srgb, var(--bg-app) 78%, transparent); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-3);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: var(--r-pill);
}
::-webkit-scrollbar-thumb:hover { background: var(--border-4); background-clip: content-box; }

::selection { background: rgba(65, 118, 230, .28); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(4px) scale(.99); } to { opacity: 1; transform: none; } }

/* ==== 权限 ==== */
body.view-only .admin-only,
body.view-only .card-actions,
body.view-only .btn-primary { display: none !important; }
body.view-only .column-header span,
body.view-only .card-footer-actions { pointer-events: none; }
body.view-only .card { cursor: pointer; pointer-events: auto; }
/* viewer 的搜索框（同一控件，只做过滤不做添加） */
body.view-only input#urlInput { padding-right: 12px; }

/* ==== 布局 ==== */
.app-container {
  display: flex;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
  background: var(--bg-app);
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
  background: var(--bg-app);
}

/* ==== 侧边栏 ==== */
.sidebar {
  position: relative;
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--bg-module);
  border-right: 1px solid var(--border-2);
  z-index: 50;
  transition: width .18s ease, flex-basis .18s ease;
  overflow: visible;
}
.sidebar.collapsed { width: 0; flex-basis: 0; border-right-color: transparent; }
.sidebar-inner {
  width: var(--sidebar-w);
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 1;
  transition: opacity .12s;
}
.sidebar.collapsed .sidebar-inner { opacity: 0; pointer-events: none; }

/* 侧栏收起按钮：内嵌在侧栏最右侧那条窄缝里（滚动条右侧到窗口边缘之间），
   11px 宽的“波峰”形 —— 靠边一侧平齐、朝内容一侧大圆角，hover 才显出淡淡底 */
.sidebar-toggle-btn {
  position: absolute;
  top: 50%;
  right: 2px;
  transform: translateY(-50%);
  width: 10px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  background: transparent;
  border: none;
  border-radius: 999px 0 0 999px;
  color: var(--label-2);
  opacity: .85;
  cursor: pointer;
  z-index: 120;
  transition: background .16s, color .16s, opacity .16s;
}
.sidebar-toggle-btn:hover {
  background: color-mix(in srgb, var(--label-1) 12%, transparent);
  color: var(--label-1);
  opacity: 1;
}
/* 收起后侧栏宽度为 0，按钮必须留在可视区内才能再点开 */
.sidebar.collapsed .sidebar-toggle-btn {
  right: auto;
  left: 3px;
  width: 15px;
  border-radius: 0 8px 8px 0;
  background: color-mix(in srgb, var(--label-1) 8%, var(--bg-module));
  color: var(--label-3);
}
.sidebar-toggle-btn .ico { width: 10px; height: 10px; }


.sidebar-header { padding: 20px 18px 14px; }
.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--label-1);
}
/* 左上角图标：默认是 osu! 的扁平圆环（透明镂空，跟主题一起变亮变暗），也可以换成自定义图片 */
.logo-mark {
  width: 24px; height: 24px;
  flex: 0 0 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  overflow: hidden;
  color: var(--label-1);
}
.logo-mark .logo-default { width: 24px; height: 24px; display: block; }
.logo-mark .logo-custom {
  width: 100%; height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 6px;
}
.logo-mark .logo-custom[hidden] { display: none; }
.logo-mark.has-image { color: inherit; }
.logo-mark.has-image .logo-default { display: none; }
.logo em { font-style: normal; color: var(--accent); }
.sidebar-sub {
  margin-top: 6px;
  font-size: 11px;
  color: var(--label-3);
}
.user-badge {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  height: 20px;
  border-radius: var(--r-pill);
  background: var(--accent-weak);
  color: var(--accent);
  font-size: 11px;
  font-weight: 500;
}

/* 徽章可点：访客点它登录、管理员点它退出（访客看不到 Global Settings） */
.user-badge.user-badge-clickable {
  cursor: pointer;
  user-select: none;
  transition: background .12s, color .12s, box-shadow .12s;
}
.user-badge.user-badge-clickable:hover {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}
.user-badge.user-badge-clickable:active { transform: translateY(.5px); }

.inbox-container {
  flex: 1;
  /* 右侧留出 15px：滚动条占 10px，剩下的窄缝给「收起侧栏」按钮，互不遮挡 */
  padding: 2px 15px 12px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.inbox-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 4px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--label-3);
}
.inbox-title .inbox-count {
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
  background: var(--bg-base);
  border: 1px solid var(--border-2);
  color: var(--label-2);
  font-size: 11px;
  font-weight: 500;
}
#col-Inbox { padding: 0; min-height: 120px; display: flex; flex-direction: column; gap: 8px; }

.settings-area { padding: 10px 12px 12px; border-top: 1px solid var(--border-1); }
.btn-settings {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--label-2);
  font-family: var(--f-text);
  font-size: 12px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: .14s;
  white-space: nowrap;
}
.btn-settings:hover { background: var(--bg-base); border-color: var(--border-2); color: var(--label-1); }
.btn-settings .gear { color: var(--label-3); font-size: 12px; }
.side-stamp { display: none; }

/* ==== 顶栏 ==== */
header {
  display: flex;
  gap: 8px;
  align-items: center;
  height: var(--header-h);
  padding: 0 16px;
  background: color-mix(in srgb, var(--bg-app) 86%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  backdrop-filter: blur(14px) saturate(1.15);
  border-bottom: 1px solid var(--border-1);
  position: relative;
  z-index: 20;
  flex: 0 0 var(--header-h);
}
.hdr-rule { display: none; }

input#urlInput {
  flex: 1;
  max-width: 520px;
  height: 36px;
  padding: 0 12px 0 34px;
  background-color: var(--bg-module);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%238d939b' stroke-width='1.9' stroke-linecap='round'><circle cx='10.8' cy='10.8' r='6.4'/><path d='M15.6 15.6L20 20'/></svg>");
  background-repeat: no-repeat;
  background-position: 11px center;
  background-size: 15px 15px;
  border: 1px solid var(--border-1);
  border-radius: 9px;
  color: var(--label-1);
  font-family: var(--f-text);
  font-size: 12.5px;
  outline: none;
  transition: background-color .14s, border-color .14s, box-shadow .14s;
}
input#urlInput::placeholder { color: var(--label-4); }
input#urlInput:hover { background-color: var(--bg-module-2); }
input#urlInput:focus {
  background-color: var(--bg-base);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.btn-primary {
  height: 38px;
  padding: 0 16px;
  background: var(--accent);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: #fff;
  font-family: var(--f-text);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: .14s;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: translateY(.5px); }
.btn-primary:disabled { background: var(--bg-module-2); color: var(--label-4); cursor: not-allowed; }

.btn-icon {
  width: 38px; height: 38px;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--label-2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: .14s;
}
.btn-icon:hover { background: var(--bg-module); color: var(--label-1); }
.btn-icon:active { background: var(--bg-module-2); }
.btn-icon:disabled { opacity: .4; cursor: progress; }
.btn-icon.danger:hover { background: var(--danger-weak); color: var(--danger); }
.btn-icon.active, #selectModeBtn.active { background: var(--accent-weak); color: var(--accent); }
.sync-label { display: none; }

.loader {
  display: none;
  width: 14px; height: 14px;
  border: 2px solid var(--border-3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.view-toggles { margin-left: auto; display: flex; gap: 2px; }
.btn-icon-toggle {
  width: 34px; height: 34px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--r-sm);
  color: var(--label-3);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: .14s;
}
.btn-icon-toggle:hover { background: var(--bg-module); color: var(--label-1); }
.btn-icon-toggle.active { background: var(--bg-module-2); color: var(--label-1); }
#selectModeBtn {
  width: 32px; height: 32px;
  background: transparent;
  border: none;
  border-radius: var(--r-sm);
  color: var(--label-3);
  font-size: 12px;
  cursor: pointer;
  transition: .14s;
}
#selectModeBtn:hover { background: var(--bg-module); color: var(--label-1); }
#selectModeBtn.active { background: var(--accent-weak); color: var(--accent); }

/* ==== 看板 ==== */
.board-scroll {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  display: flex;
  padding: 16px;
  gap: 14px;
  align-items: stretch;
  min-height: 0;
  background: var(--bg-app);
}

.column {
  flex: 0 0 var(--col-w);
  width: var(--col-w);
  background: var(--bg-base);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  max-height: 100%;
  min-height: 0;
  position: relative;
  box-shadow: var(--shadow-1);
  transition: border-color .16s, box-shadow .16s;
}
.column:hover { border-color: var(--border-3); }
.column.collapsed { flex: 0 0 var(--col-w); height: auto; max-height: none; align-self: flex-start; }

.column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  height: 48px;
  padding: 0 10px 0 14px;
  border-bottom: 1px solid var(--border-1);
  cursor: pointer;
  user-select: none;
  flex: 0 0 auto;
  border-radius: var(--r-md) var(--r-md) 0 0;
  transition: background .14s;
}
.column:hover .column-header { background: var(--bg-module); }
.column-header::before { content: none; }
.column-header .header-left { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; }
.column-header .toggle-icon { display: flex; color: var(--label-4); transition: transform .16s; }
.column-header .toggle-icon svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.column.collapsed .toggle-icon { transform: rotate(-90deg); }

.column-header span:nth-child(2) {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--label-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}
.column-header span.no-edit { cursor: default; }
.col-count {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
  background: var(--bg-module);
  border: 1px solid var(--border-1);
  color: var(--label-3);
  font-size: 10.5px;
  font-weight: 500;
  flex: 0 0 auto;
}
.col-actions { display: flex; gap: 4px; margin-left: 4px; opacity: 0; transition: opacity .14s; }
.column:hover .col-actions { opacity: 1; }
.col-actions .col-act {
  width: 26px; height: 26px;
  margin: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--bg-base) 90%, transparent);
  border: 1px solid var(--border-2);
  border-radius: var(--r-xs);
  color: var(--label-2);
  cursor: pointer;
  transition: .14s;
}
.col-actions .col-act:hover {
  background: var(--bg-base);
  border-color: var(--border-3);
  color: var(--label-1);
  box-shadow: var(--shadow-1);
}
.col-actions .col-act.danger:hover {
  background: var(--danger-weak);
  border-color: var(--danger);
  color: var(--danger);
}

.column-content {
  flex: 1;
  min-height: 64px;
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: transparent;
}
.column-content.drag-over {
  background: var(--accent-weak);
  outline: 1.5px dashed var(--accent);
  outline-offset: -4px;
  border-radius: 0 0 var(--r-md) var(--r-md);
}
.column.collapsed .column-content { display: none !important; }
.column-content:empty::after {
  content: "No entries";
  margin: auto;
  font-size: 11px;
  color: var(--label-4);
}
/* 搜索中清空的列，文案改成「没匹配到」 */
body.searching .column-content:empty::after { content: "No matches"; }

/* 折叠后的缩略图 */
.column-preview {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 6px;
  padding: 10px;
}
.column.collapsed .column-preview { display: grid; animation: fadeIn .14s ease; }
.preview-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  background-color: var(--bg-module-2);
  background-size: cover;
  background-position: center;
  border-radius: var(--r-xs);
  border: 1px solid var(--border-1);
  transition: .14s;
}
.preview-thumb:hover { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-ring); }
.preview-empty { grid-column: 1 / -1; height: 24px; }
.preview-more-overlay {
  position: absolute;
  right: 2px; bottom: 2px;
  padding: 0 4px;
  border-radius: var(--r-xs);
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 9px;
}

.new-column-btn {
  gap: 6px;
  flex: 0 0 160px;
  min-width: 160px;
  height: 48px;
  align-self: flex-start;
  border: 1px dashed var(--border-3);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--label-3);
  font-size: 12px;
  cursor: pointer;
  transition: .14s;
}
.new-column-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-weak);
}

/* ==== 卡片 ==== */
.card {
  position: relative;
  width: 100%;
  height: var(--card-h);
  flex: 0 0 auto;
  background: var(--bg-base);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  display: flex;
  flex-direction: column;
  overflow: visible;
  cursor: grab;
  transition: box-shadow .14s, border-color .14s, transform .14s;
}
.card:hover {
  border-color: var(--border-3);
  box-shadow: var(--shadow-2);
  transform: translateY(-1px);
  z-index: 100;
}
.card.dragging { opacity: .5; border-style: dashed; transform: none; box-shadow: none; }
.card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-ring); }

.card-bg-layer {
  height: var(--cover-h);
  flex: 0 0 var(--cover-h);
  background-size: cover;
  background-position: center;
  background-color: var(--bg-module-2);
  border-bottom: 1px solid var(--border-1);
  border-radius: calc(var(--r-sm) - 1px) calc(var(--r-sm) - 1px) 0 0;
  transition: filter .2s;
}
.card-bg-layer::after { content: none; }

.card-content {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  padding: 9px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.card-title {
  flex: 0 0 auto;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--label-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-host {
  flex: 0 0 auto;
  font-size: 12px;
  line-height: 1.3;
  color: var(--label-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 难度条：贴在缩略图底部的分段色条，从低星到高星左→右排列 */
.diff-bar-container {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--cover-h) - 6px);
  height: 6px;
  display: flex;
  gap: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
}
.diff-square {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  border-radius: 0;
  opacity: 1;
  /* 每段向右多抹 1px 同色，盖掉亚像素舍入产生的细缝（后面的段会覆盖它） */
  box-shadow: 1px 0 0 0 currentColor;
  transition: opacity .12s;
}
.diff-bar-container:hover .diff-square { opacity: 1; }

.card-footer-actions {
  flex: 0 0 auto;
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  --pill-gap: 6px;          /* 胶囊行的唯一间距来源：改这一个值，整行（含 ⋮）一起变 */
  gap: var(--pill-gap);
  z-index: 5;
  pointer-events: none;
}
.bn-pill {
  height: 21px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: var(--r-pill);
  background: var(--bg-module);
  border: 1px solid transparent;
  color: var(--label-2);
  font-size: 11.5px;
  white-space: nowrap;
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bn-pill.second-bn { pointer-events: auto; cursor: default; text-decoration: none; }
.bn-pill.second-bn:hover { background: var(--bg-module-2); color: var(--label-1); }
.bn-pill.second-bn.bn-empty { color: var(--label-4); background: transparent; border-style: dashed; border-color: var(--border-2); }
/* 空位胶囊对管理员是可点的：点一下就能输入第二 BN 名字 */
body:not(.view-only) .card .bn-pill.second-bn.bn-empty { cursor: pointer; }
body:not(.view-only) .card .bn-pill.second-bn.bn-empty:hover { color: var(--label-1); border-color: var(--border-3); }
body:not(.view-only) .card .bn-pill.second-bn.bn-filled .bn-pill-label { cursor: pointer; }
body:not(.view-only) .card .bn-pill.second-bn.bn-filled .bn-pill-label:hover { color: var(--label-1); }
.bn-pill.second-bn.bn-filled {
  color: var(--label-3);
  background: color-mix(in srgb, var(--bn-accent) 12%, var(--bg-base));
  border-color: transparent;
  font-weight: 500;
}
/* 只有 BN 名字是链接：2nd 前缀不跟着点击 */
.bn-pill-label { color: var(--label-4); }
.bn-pill.second-bn.bn-filled .bn-pill-label { color: var(--label-3); }
.bn-pill-link {
  color: var(--bn-accent);
  text-decoration: none;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 3px;
}
.bn-pill.second-bn.bn-filled:hover { background: color-mix(in srgb, var(--bn-accent) 18%, var(--bg-base)); }
.bn-pill.second-bn.bn-filled:hover .bn-pill-link { text-decoration: underline; text-underline-offset: 2px; }

.bn-pill.status-tag {
  pointer-events: auto;
  color: var(--tag, var(--accent));
  background: color-mix(in srgb, var(--tag, var(--accent)) 12%, var(--bg-base));
  font-weight: 500;
  padding-left: 6px;
}
.bn-pill.status-tag::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--tag, var(--accent));
  flex: 0 0 5px;
}
.bn-pill.status-tag:hover { filter: brightness(.97); }

/* 卡片操作区：⋮ 就是胶囊行的最后一项，网格/列表、普通列/Inbox 共用同一套间距
   默认只隐藏不脱流（visibility），否则悬停冒出来时会把左边两颗胶囊挤得左右跳 */
.card-actions {
  display: flex;
  align-items: center;
  visibility: hidden;
  opacity: 0;
  /* 按钮盒 13px，三点墨迹只有 1.84px，左右各空 5.58px；减掉它，视觉间距才等于 --pill-gap。
     这是常数，和 --pill-gap 无关（胶囊间距变小到 5.6 以下时按钮盒会开始压到胶囊的 padding 上） */
  margin-left: -5.6px;
  transition: opacity .12s;
  pointer-events: none;
}
.card:hover .card-actions,
.card-actions.force { visibility: visible; opacity: 1; pointer-events: auto; }

.card-act {
  width: 13px; height: 20px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: var(--r-pill);
  color: var(--label-3);
  cursor: pointer;
  transition: color .14s;
}
.card-act:hover { color: var(--label-1); }
.card-act.active { color: var(--label-1); }

.card-ctx-menu {
  position: absolute;
  top: 36px; right: 6px;
  min-width: 132px;
  display: none;
  flex-direction: column;
  padding: 4px;
  background: var(--bg-base);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-3);
  z-index: 300;
}
.card-ctx-menu.show { display: flex; animation: popIn .12s ease; }
.ctx-item {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 8px;
  border-radius: var(--r-xs);
  color: var(--label-1);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.ctx-item:hover { background: var(--bg-module); }
.ctx-item.danger { color: var(--danger); }
.ctx-item.danger:hover { background: var(--danger-weak); }
.ctx-icon { display: flex; color: var(--label-3); }
.ctx-item:hover .ctx-icon { color: inherit; }
.ctx-icon svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.card-ctx-menu .divider { height: 1px; margin: 4px 0; background: var(--border-1); }

/* 悬停展开的难度面板 */
.card-details-overlay {
  position: absolute;
  top: calc(var(--cover-h) + 4px); left: 0; right: 0;
  margin-top: 0;
  display: flex;
  flex-direction: column;
  max-height: 180px;
  overflow-y: auto;
  padding: 4px;
  background: var(--bg-base);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-3px);
  transition: .12s ease;
  pointer-events: none;
  z-index: 120;
}
/* 列表视图里整行悬停即可展开；网格视图改用 body 级的 .diff-peek（见下） */
.view-list .card:hover .card-details-overlay { opacity: 1; visibility: visible; transform: none; pointer-events: auto; }
.detail-row {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
  height: 26px;
  padding: 0 6px;
  border-radius: var(--r-xs);
}
.detail-row:hover { background: var(--bg-module); }
.detail-dot { width: 3px; height: 10px; border-radius: 1.5px; flex: 0 0 3px; }
.detail-star { font-size: 11px; color: var(--label-3); width: 38px; flex: 0 0 38px; }
.detail-ver { font-size: 12px; color: var(--label-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 网格视图：鼠标停在缩略图上时，难度列表从卡片「下方」弹出。
   挂到 body 上 + position:fixed，所以既不会被列的滚动区裁掉，
   也不会在自己的卡片里盖住 2nd / 状态胶囊；pointer-events:none 保证点得到下层。 */
.diff-peek {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 380px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 5px;
  background: var(--bg-base);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  box-shadow: var(--shadow-3);
  opacity: 0;
  visibility: hidden;
  transition: opacity .1s ease, visibility .1s;
  pointer-events: none;
}
.diff-peek.visible { opacity: 1; visibility: visible; }
.diff-peek-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 7px 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--label-4);
}
.diff-peek-num { color: var(--label-3); font-weight: 600; }

.card * { pointer-events: none; }
.card .card-actions, .card .card-act, .card .card-ctx-menu, .card .ctx-item,
.card .bn-pill, .card .bn-pill *, .card .card-footer-actions, .card .card-bg-layer,
.card .card-details-overlay, .card .card-details-overlay * { pointer-events: auto; }
.card .bn-pill-link { cursor: pointer; }

/* ==== 列表视图 ==== */
.board-scroll.view-list {
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  gap: 10px;
  padding-bottom: 32px;
}
.view-list .column { width: 100%; flex: 0 0 auto; height: auto; max-height: none; }
.view-list .column-content { padding: 8px 10px 10px; overflow: visible; max-height: none; display: flex; flex-direction: column; gap: 6px; }
.view-list .new-column-btn { flex: 0 0 auto; width: 100%; min-width: 0; height: 40px; align-self: stretch; }
.view-list .column.collapsed { height: auto; }

.view-list .card {
  height: auto;
  min-height: 68px;
  flex-direction: row;
  align-items: center;
  gap: 0;
  cursor: pointer;
  border-radius: var(--r-sm);
}
.view-list .card:hover { transform: none; }
.view-list .card-bg-layer {
  height: 66px;
  flex: 0 0 96px;
  width: 96px;
  align-self: stretch;
  border-bottom: none;
  border-right: 1px solid var(--border-1);
  border-radius: var(--r-sm) 0 0 var(--r-sm);
}
.view-list .card-content {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "title pills"
    "host  pills";
  align-items: center;
  gap: 3px 14px;
  padding: 10px 14px;
}
.view-list .card-title { grid-area: title; }
.view-list .card-host { grid-area: host; }
.view-list .diff-bar-container { grid-area: diffs; margin-top: 0; justify-content: flex-end; }
/* 胶囊跨两行、垂直居中 —— 跟右侧的 ⋮ 对齐在同一条中线上（margin-top:auto 会把它顶到格子底部，这里要清掉）
   padding-right 让出 ⋮ 的位置，使「2nd / 状态 / ⋮」三者间距完全一致 */
.view-list .card-footer-actions { grid-area: pills; align-self: center; justify-self: end; padding-right: 0; margin-top: 0; }

/* 列表视图：难度条改成缩略图左侧的竖条 */
.view-list .diff-bar-container {
  top: 0;
  bottom: 0;
  left: 0;
  right: auto;
  width: 6px;
  height: auto;
  flex-direction: column;
  gap: 0;
  border-radius: var(--r-sm) 0 0 var(--r-sm);
  overflow: hidden;
}
.view-list .diff-square { width: 100%; height: auto; flex: 1 1 0; box-shadow: 0 1px 0 0 currentColor; }
.view-list .card-details-overlay { top: 100%; left: -1px; right: -1px; margin-top: 4px; max-height: 240px; }
.view-list .card.show-details .card-details-overlay { opacity: 1; visibility: visible; transform: none; }
.view-list .column-preview { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }

/* ==== 弹窗 ==== */
.modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .32);
  z-index: 2000;
  padding: 24px;
}
.modal {
  width: 100%;
  max-width: 520px;
  max-height: 86vh;
  overflow-y: auto;
  background: var(--bg-base);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-3);
  padding: 0 0 16px;
  animation: popIn .16s ease;
}
.modal::before { content: none; }
.modal h2 {
  margin: 0;
  padding: 18px 20px 10px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--label-1);
}
.modal h2::before { content: none; }

.form-group { margin: 12px 20px; }
.form-row { display: flex; gap: 12px; }
.form-col { flex: 1; min-width: 0; }
.form-group label,
.form-col label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--label-2);
}
.form-control {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  background: var(--bg-module);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--label-1);
  font-family: var(--f-text);
  font-size: 13px;
  outline: none;
  transition: .14s;
}
.form-control:hover { background: var(--bg-module-2); }
.form-control:focus {
  background: var(--bg-base);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
select.form-control {
  appearance: none;
  padding-right: 26px;
  background-image: linear-gradient(45deg, transparent 50%, var(--label-3) 50%),
                    linear-gradient(135deg, var(--label-3) 50%, transparent 50%);
  background-position: right 13px center, right 8px center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.range-control {
  -webkit-appearance: none;
  width: 100%;
  height: 20px;
  background: transparent;
  outline: none;
}
.range-control::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--bg-module-2); }
.range-control::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--bg-base);
  border: 1px solid var(--border-3);
  box-shadow: var(--shadow-1);
  cursor: pointer;
}
.modal hr, .modal .divider-line { border: 0; border-top: 1px solid var(--border-1); margin: 14px 20px; }

.settings-group { margin: 0 20px; border: 1px solid var(--border-2); border-radius: var(--r-md); overflow: hidden; }
.settings-group > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 38px;
  padding: 0 12px;
  background: var(--bg-module);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--label-1);
  cursor: pointer;
}
.settings-group > summary::-webkit-details-marker { display: none; }
.settings-group[open] > summary { border-bottom: 1px solid var(--border-1); }
.summary-arrow { font-size: 9px; color: var(--label-3); transition: transform .14s; }
.settings-group[open] .summary-arrow { transform: rotate(180deg); }
.settings-content { padding: 12px; }
.settings-content p { margin: 0 0 10px; font-size: 12px; color: var(--label-3); line-height: 1.6; }

.modal-actions { margin: 16px 20px 0; display: flex; justify-content: flex-end; gap: 8px; }
.btn-text {
  height: 34px;
  padding: 0 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--label-2);
  font-family: var(--f-text);
  font-size: 13px;
  cursor: pointer;
  transition: .14s;
}
.btn-text:hover { background: var(--bg-module); color: var(--label-1); }
.btn-dashed {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 10px 20px 0;
  width: calc(100% - 40px);
  height: 34px;
  background: transparent;
  border: 1px dashed var(--border-3);
  border-radius: var(--r-sm);
  color: var(--label-2);
  font-size: 12.5px;
  cursor: pointer;
  transition: .14s;
}
.btn-dashed:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-weak); }

.tag-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.tag-row .edit-color { width: 30px; height: 30px; padding: 0; border: 1px solid var(--border-2); border-radius: var(--r-sm); background: none; cursor: pointer; }
.tag-row .edit-name { flex: 1; height: 32px; padding: 0 10px; border: 1px solid var(--border-2); border-radius: var(--r-sm); font-size: 13px; font-family: var(--f-text); background: var(--bg-base); color: var(--label-1); }
.btn-remove { width: 28px; height: 28px; padding: 0; background: transparent; border: 1px solid var(--border-2); border-radius: var(--r-sm); color: var(--label-3); cursor: pointer; font-size: 13px; line-height: 1; transition: .14s; }
.btn-remove:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-weak); }

.import-log-box {
  margin-top: 10px;
  padding: 10px;
  background: var(--bg-module);
  border-radius: var(--r-sm);
  color: var(--label-2);
  font-family: var(--f-mono);
  font-size: 11px;
  line-height: 1.7;
  max-height: 150px;
  overflow-y: auto;
}

.auth-section { margin-bottom: 10px; }
#authBtnGroup { display: block; }
.auth-user {
  display: none;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
}
.auth-avatar { color: var(--accent); font-size: 12px; }
.auth-name { flex: 1; font-size: 12.5px; font-weight: 500; color: var(--label-1); }
.auth-unlink { font-size: 11.5px; color: var(--accent); cursor: pointer; }
.auth-unlink:hover { color: var(--accent-hover); text-decoration: underline; }
.btn-osu { background: var(--bg-module); color: var(--label-1); border-color: transparent; }
.btn-osu:hover { background: var(--bg-module-2); }
.btn-block { display: flex; width: 100%; margin: 0; justify-content: center; }
.tag-list { margin: 8px 20px 0; max-height: 280px; overflow-y: auto; }

/* 主题切换（设置面板里） */
.theme-switch {
  display: flex;
  gap: 4px;
  padding: 3px;
  background: var(--bg-module);
  border-radius: var(--r-sm);
}
.theme-switch button {
  flex: 1;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-xs);
  color: var(--label-3);
  font-family: var(--f-text);
  font-size: 12.5px;
  cursor: pointer;
  transition: .14s;
}
.theme-switch button:hover { color: var(--label-1); }
.theme-switch button.active {
  background: var(--bg-base);
  border-color: var(--border-2);
  color: var(--label-1);
  box-shadow: var(--shadow-1);
}

/* ==== 详情 ==== */
.detail-modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .36);
  z-index: 2100;
  padding: 24px;
}
.detail-card {
  width: min(980px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg-base);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-3);
  position: relative;
  animation: popIn .16s ease;
}
.detail-header {
  position: relative;
  min-height: 152px;
  padding: 20px 22px;
  background-color: var(--bg-module-2);
  background-size: cover;
  background-position: center;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  color: #fff;
  overflow: hidden;
}
.detail-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(15, 17, 21, .90) 0%, rgba(15, 17, 21, .62) 55%, rgba(15, 17, 21, .28) 100%);
}
.detail-header-content { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 10px; }
.detail-title-group { padding-left: 0; border-left: none; }
.detail-title {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.01em;
  max-width: 620px;
}
.detail-subtitle { margin-top: 4px; font-size: 12px; color: rgba(255, 255, 255, .62); }
.host-highlight { color: #fff; font-weight: 500; }

.detail-meta-row { display: flex; flex-wrap: wrap; gap: 6px; }
.meta-tag {
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .88);
  font-size: 11px;
}
.detail-stats-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.stat-group { display: flex; align-items: center; gap: 6px; }
.stat-label { font-size: 10.5px; color: rgba(255, 255, 255, .55); }
.stat-bar-bg { width: 54px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .22); overflow: hidden; }
.stat-bar-fill { height: 100%; border-radius: 2px; background: #fff; width: 0; transition: width .18s ease; }
.stat-value { width: 20px; font-size: 10.5px; color: #fff; }
.selected-diff-name {
  margin-left: auto;
  height: 24px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
}

.btn-close-detail {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 5;
  width: 28px; height: 28px;
  padding: 0;
  background: rgba(255, 255, 255, .16);
  border: none;
  border-radius: var(--r-sm);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: .14s;
}
.btn-close-detail:hover { background: rgba(255, 255, 255, .28); }

.detail-body { display: flex; }
.detail-left { flex: 1; min-width: 0; padding: 16px 18px; border-right: 1px solid var(--border-1); }
.detail-right { width: 340px; flex: 0 0 340px; padding: 18px 20px; display: flex; flex-direction: column; background: var(--bg-module); border-radius: 0 0 var(--r-lg) 0; }

.detail-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--label-3);
}
.spacing-top { margin-top: 18px; }

.detail-diff-list { display: flex; flex-direction: column; gap: 2px; max-height: 240px; overflow-y: auto; }
.detail-diff-row {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 32px;
  padding: 0 8px;
  border-radius: var(--r-xs);
  cursor: pointer;
  transition: background .12s;
}
.detail-diff-row:hover { background: var(--bg-module); }
.detail-diff-row.active { background: var(--accent-weak); }
.d-dot { width: 3px; height: 12px; border-radius: 1.5px; flex: 0 0 3px; }
.d-star { width: 42px; flex: 0 0 42px; font-size: 11.5px; font-weight: 500; }
.d-ver { font-size: 12.5px; color: var(--label-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.detail-info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.info-item {
  padding: 8px 10px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.info-item .label { font-size: 10.5px; color: var(--label-3); }
.info-item .value { font-size: 12.5px; font-weight: 500; color: var(--label-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.info-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent) !important;
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  align-self: flex-start;
}
.info-link:hover { text-decoration: underline; }

.memo-status { margin-left: auto; font-size: 10.5px; color: var(--success); }
#detailMemoInput {
  flex: 1;
  width: 100%;
  min-height: 120px;
  padding: 10px;
  background: var(--bg-base);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  color: var(--label-1);
  font-family: var(--f-text);
  font-size: 12.5px;
  line-height: 1.65;
  resize: vertical;
  outline: none;
  margin-bottom: 10px;
  transition: .14s;
}
#detailMemoInput:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.btn-save-memo {
  width: 100%;
  height: 34px;
  background: var(--bg-base);
  border: 1px solid var(--border-3);
  border-radius: var(--r-sm);
  color: var(--label-1);
  font-family: var(--f-text);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: .14s;
}
.btn-save-memo:hover { background: var(--bg-module-2); }
.btn-save-memo:disabled { opacity: .5; cursor: progress; }

/* ==== 浮动菜单 / toast / 批量栏 ==== */
#overlay { display: none; position: fixed; inset: 0; z-index: 150; }
.popover-menu {
  display: none;
  position: fixed;
  min-width: 160px;
  padding: 4px;
  background: var(--bg-base);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-3);
  z-index: 400;
}
.menu-label { padding: 6px 8px 4px; font-size: 10.5px; color: var(--label-3); }
.menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 8px;
  border-radius: var(--r-xs);
  font-size: 12.5px;
  color: var(--label-1);
  cursor: pointer;
}
.menu-item:hover { background: var(--bg-module); }
.menu-dot { width: 6px; height: 6px; border-radius: 50%; flex: 0 0 6px; }
.menu-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 7px 8px;
  border-top: 1px solid var(--border-1);
  font-size: 11.5px;
  color: var(--label-3);
  cursor: pointer;
}
.menu-footer:hover { color: var(--label-1); }

.toast-msg {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 9999;
  padding: 9px 14px;
  background: var(--bg-base);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-3);
  color: var(--label-1);
  font-size: 12.5px;
  pointer-events: none;
  animation: popIn .14s ease;
  max-width: 70vw;
}

.bulk-bar {
  position: fixed !important;
  left: 50% !important;
  bottom: 20px !important;
  transform: translateX(-50%) !important;
  z-index: 4000 !important;
  display: none;
  align-items: center;
  gap: 6px;
  padding: 8px 10px !important;
  background: var(--bg-base) !important;
  border: 1px solid var(--border-2) !important;
  border-radius: var(--r-md) !important;
  box-shadow: var(--shadow-3) !important;
  color: var(--label-1) !important;
  font-size: 12.5px !important;
}
.bulk-bar.visible { display: flex; animation: popIn .14s ease; }
.bulk-count { min-width: 76px; font-size: 12px !important; color: var(--label-2) !important; }
.bulk-select {
  height: 30px !important;
  padding: 0 24px 0 10px !important;
  background-color: var(--bg-module) !important;
  color: var(--label-1) !important;
  border: 1px solid transparent !important;
  border-radius: var(--r-sm) !important;
  font-family: var(--f-text) !important;
  font-size: 12px !important;
  outline: none;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--label-3) 50%),
                    linear-gradient(135deg, var(--label-3) 50%, transparent 50%) !important;
  background-position: right 12px center, right 7px center !important;
  background-size: 5px 5px, 5px 5px !important;
  background-repeat: no-repeat !important;
}
.bulk-select:hover { border-color: var(--border-3) !important; }
.bulk-select:disabled { opacity: .45; }
.bulk-btn {
  height: 30px !important;
  padding: 0 10px !important;
  background: transparent !important;
  color: var(--label-2) !important;
  border: 1px solid transparent !important;
  border-radius: var(--r-sm) !important;
  font-family: var(--f-text) !important;
  font-size: 12px !important;
  cursor: pointer;
  transition: .14s;
}
.bulk-btn:hover { background: var(--bg-module) !important; color: var(--label-1) !important; }
.bulk-btn.danger { color: var(--danger) !important; }
.bulk-btn.danger:hover { background: var(--danger-weak) !important; }

body.select-mode .card { cursor: pointer; }

/* 统一图标：全部内联 SVG，1.8 描边、圆角端点 */
.ico { flex: 0 0 auto; display: inline-block; vertical-align: -2px; pointer-events: none; }

/* ============================================================================
   v2 精修 —— 画布 / 面板 / 卡片 三层、统一留白、弹窗结构、详情页重构
   ============================================================================ */

/* ---- 侧栏 ---- */
.sidebar { background: var(--bg-module); border-right: 1px solid var(--border-1); }
.sidebar-header { padding: 18px 16px 12px; }
.logo { font-size: 14.5px; gap: 8px; }
.logo-mark { border-radius: 6px; }
.sidebar-sub { margin-top: 7px; font-size: 11px; color: var(--label-4); }
.user-badge { margin-top: 9px; height: 21px; font-weight: 600; letter-spacing: .01em; }

.inbox-container { padding: 0 15px 10px 10px; }
.inbox-title {
  padding: 10px 4px 6px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--label-4);
}
.inbox-title .inbox-count {
  background: transparent;
  border-color: var(--border-2);
  color: var(--label-3);
  font-weight: 600;
}
.settings-area { padding: 8px 10px 10px; border-top: 1px solid var(--border-1); }
.btn-settings:hover { background: var(--bg-base); border-color: var(--border-2); }

/* 侧栏里的卡片更紧凑：封面 72，整卡 148 */
#col-Inbox .card { --cover-h: 72px; --card-h: 148px; }
#col-Inbox .card-content { padding: 8px 10px 9px; }
#col-Inbox .card-title { font-size: 12.5px; }
#col-Inbox .card-host { font-size: 11px; }
#col-Inbox .bn-pill { height: 19px; font-size: 10.5px; padding: 0 7px; max-width: 104px; }

#col-Inbox .card-details-overlay { top: calc(var(--cover-h) + 4px); }

/* ---- 看板 / 列 ---- */
.column {
  background: var(--bg-module);
  border: 1px solid var(--border-1);
  border-radius: 14px;
  box-shadow: none;
}
.column:hover { border-color: var(--border-2); box-shadow: var(--shadow-1); }
.column-header {
  height: 46px;
  padding: 0 8px 0 12px;
  border-bottom: 1px solid var(--border-1);
  border-radius: 14px 14px 0 0;
}
.column:hover .column-header { background: color-mix(in srgb, var(--label-1) 2.5%, transparent); }
.column-header span:nth-child(2) { font-size: 13px; font-weight: 600; letter-spacing: -.005em; }
.column-header .toggle-icon { color: var(--label-4); }
.col-count {
  background: transparent;
  border: 1px solid var(--border-2);
  color: var(--label-3);
  font-weight: 600;
}
.column:hover .col-count { color: var(--label-2); border-color: var(--border-3); }
.column-content { padding: 10px; gap: 10px; }
.column-content:empty::after {
  content: "No entries";
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 86px;
  margin: 0;
  border: 1px dashed var(--border-2);
  border-radius: 10px;
  color: var(--label-4);
  font-size: 11.5px;
}
.new-column-btn { border-color: var(--border-2); border-radius: 14px; color: var(--label-3); }
.new-column-btn:hover { border-color: var(--accent); background: var(--accent-weak); }

/* ---- 卡片 ---- */
.card {
  background: var(--bg-base);
  border: 1px solid var(--border-1);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(16, 18, 21, .04);
  transition: box-shadow .16s var(--ease), border-color .16s var(--ease),
              transform .16s var(--ease), background .16s;
}
.card:hover {
  border-color: var(--border-3);
  box-shadow: var(--shadow-2);
  transform: translateY(-1px);
}
.card-bg-layer {
  border-bottom: none;
  border-radius: 9px 9px 0 0;
  transition: filter .3s var(--ease);
}
.card:hover .card-bg-layer { filter: saturate(1.06) brightness(1.03); }
.card-content { padding: 10px 12px 11px; gap: 2px; }
.card-title { font-size: 13px; line-height: 1.34; letter-spacing: -.002em; }
.card-host { font-size: 11.5px; line-height: 1.32; color: var(--label-3); }
.bn-pill { height: 20px; padding: 0 7px; font-size: 11px; }
.bn-pill.second-bn.bn-empty { border-color: var(--border-2); }
.card-ctx-menu { border-radius: 10px; border-color: var(--border-2); }
.card-details-overlay { border-radius: 10px; border-color: var(--border-2); }

/* 网格视图：⋮ 从封面右上角挪到胶囊那一行的最右，和 2nd / 状态胶囊同一条中线 */
.card-ctx-menu { top: auto; bottom: 37px; right: 10px; }
.card-act .ico,
.view-list .card-act .ico { width: 13px; height: 13px; }

/* 难度条：9px，贴封面下沿 */
.diff-bar-container { top: calc(var(--cover-h) - 6px); height: 6px; }

/* ---- 顶栏控件 ---- */
.btn-primary {
  height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  font-size: 12.5px;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--accent) 28%, transparent);
}
.btn-primary:hover { box-shadow: 0 4px 14px -4px color-mix(in srgb, var(--accent) 55%, transparent); }
.btn-icon { width: 36px; height: 36px; border-radius: 9px; }
.view-toggles { gap: 2px; padding: 2px; background: var(--bg-module); border-radius: 10px; }
.btn-icon-toggle { width: 32px; height: 32px; border-radius: 8px; }
.btn-icon-toggle:hover { background: var(--bg-module-2); }
.btn-icon-toggle.active { background: var(--bg-base); color: var(--label-1); box-shadow: var(--shadow-1); }
#selectModeBtn { border-radius: 8px; }

/* ---- 弹窗 ---- */
.modal-overlay, .detail-modal-overlay { background: rgba(8, 9, 11, .48); }
.modal {
  padding: 0 0 16px;
  border-radius: 16px;
  border-color: var(--border-2);
  box-shadow: var(--shadow-3);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 8px;
}
.modal-head h2 { margin: 0; padding: 0; font-size: 16px; letter-spacing: -.01em; }
.modal-close {
  width: 28px; height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--label-3);
  cursor: pointer;
  transition: .14s;
}
.modal-close:hover { background: var(--bg-module-2); color: var(--label-1); }
.modal-actions {
  margin: 16px 20px 0;
  padding-top: 14px;
  border-top: 1px solid var(--border-1);
}
.form-control, .btn-text, .btn-save-memo, .btn-dashed { border-radius: 9px; }
.form-control { height: 36px; border-color: var(--border-1); }
.form-group label, .form-col label { font-size: 11.5px; font-weight: 500; color: var(--label-3); letter-spacing: .01em; }
.modal hr, .modal .divider-line { border-top-color: var(--border-1); }

.settings-group { border-radius: 12px; border-color: var(--border-1); background: var(--bg-module); }
.settings-group > summary { height: 42px; background: transparent; }
.settings-group > summary:hover { background: color-mix(in srgb, var(--label-1) 3%, transparent); }
.settings-content p { color: var(--label-3); }
.import-log-box { border-radius: 9px; }

.theme-switch {
  padding: 3px;
  gap: 2px;
  background: var(--bg-base);
  border: 1px solid var(--border-1);
  border-radius: 10px;
}
.theme-switch button { height: 32px; border-radius: 7px; font-size: 12px; }
.theme-switch button.active {
  background: var(--accent-weak);
  border-color: color-mix(in srgb, var(--accent) 38%, transparent);
  color: var(--accent);
  font-weight: 600;
  box-shadow: none;
}
.theme-switch button svg { opacity: .9; }

/* ---- 背景图选择（内置素材）---- */
.bg-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.bg-tile {
  position: relative;
  height: 62px;
  padding: 0;
  border: 1px solid var(--border-2);
  border-radius: 9px;
  background-color: var(--bg-module);
  background-size: cover;
  background-position: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .14s, box-shadow .14s, transform .14s;
}
.bg-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, .55), rgba(0, 0, 0, .05) 62%);
}
.bg-tile:hover { transform: translateY(-1px); border-color: var(--border-4); }
.bg-tile.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-ring);
}
.bg-tile-name {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 5px;
  z-index: 1;
  font-size: 10.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, .92);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bg-tile-none {
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: repeating-linear-gradient(135deg,
    color-mix(in srgb, var(--label-1) 4%, transparent) 0 6px,
    transparent 6px 12px);
}
.bg-tile-none::after { content: none; }
.bg-tile-none .bg-tile-name {
  position: static;
  color: var(--label-4);
  font-size: 11px;
  text-align: center;
}
.bg-note {
  margin-top: 7px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--label-4);
}
.bg-note svg { flex: 0 0 auto; opacity: .8; }

/* ---- 强调色色板 ---- */
.accent-swatches { display: flex; align-items: center; gap: 9px; padding: 2px 0; }
.accent-dot {
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--c);
  cursor: pointer;
  transition: transform .14s, box-shadow .14s;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18);
}
.accent-dot:hover { transform: scale(1.1); }
.accent-dot.active {
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18),
              0 0 0 2px var(--bg-base),
              0 0 0 4px var(--c);
}
.accent-name { margin-left: auto; font-size: 11.5px; color: var(--label-4); }

/* ---- 应用图标（左上角 logo 可替换） ---- */
.icon-row { display: flex; align-items: center; gap: 8px; padding: 2px 0; flex-wrap: wrap; }
.icon-preview {
  width: 34px; height: 34px;
  flex: 0 0 34px;
  border-radius: 8px;
  background: var(--bg-module);
  border: 1px solid var(--border-2);
  color: var(--label-1);
}
.icon-preview .logo-default { width: 26px; height: 26px; }
.icon-preview .logo-custom { border-radius: 7px; }
.field-hint { margin: 7px 0 0; font-size: 11px; line-height: 1.5; color: var(--label-4); }
/* osu! logo sprite（inline symbol，用 currentColor 跟主题走） */
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* 设置面板内容比较长：底部按钮吸底，不用滚到底才能保存 */
#bgModal .modal-actions {
  position: sticky;
  bottom: -16px;
  z-index: 5;
  margin: 16px 0 0;
  padding: 14px 20px 16px;
  background: var(--bg-base);
  border-top: 1px solid var(--border-1);
}

.range-control::-webkit-slider-thumb {
  width: 16px; height: 16px;
  margin-top: -6px;
  background: var(--bg-base);
  border: 1px solid var(--border-4);
}
.range-control:hover::-webkit-slider-thumb { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }

/* ---- 详情 ---- */
.detail-card { width: min(1040px, 100%); border-radius: 18px; border-color: var(--border-2); }
.detail-header { min-height: 178px; padding: 24px 24px 20px; }
.detail-header::before {
  background:
    linear-gradient(96deg, rgba(10, 11, 13, .94) 0%, rgba(10, 11, 13, .78) 42%, rgba(10, 11, 13, .34) 76%, rgba(10, 11, 13, .20) 100%),
    linear-gradient(0deg, rgba(10, 11, 13, .38), rgba(10, 11, 13, 0) 58%);
}
.detail-title { font-size: 22px; font-weight: 650; letter-spacing: -.015em; }
.detail-subtitle { font-size: 12.5px; color: rgba(255, 255, 255, .68); }
.meta-tag {
  height: 24px;
  padding: 0 9px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .10);
  color: rgba(255, 255, 255, .9);
  font-size: 11.5px;
}
.btn-close-detail {
  top: 14px; right: 14px;
  width: 30px; height: 30px;
  border-radius: 9px;
  background: rgba(10, 11, 13, .46);
  border: 1px solid rgba(255, 255, 255, .14);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.btn-close-detail:hover { background: rgba(10, 11, 13, .72); }

/* 属性条：从封面里拿出来，单独一条浅色舞台 */
.detail-statbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 11px 24px;
  background: var(--bg-module);
  border-bottom: 1px solid var(--border-1);
}
.detail-statbar .stat-group { gap: 7px; }
.detail-statbar .stat-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--label-4);
}
.detail-statbar .stat-bar-bg { width: 68px; height: 4px; background: var(--bg-module-2); }
.detail-statbar .stat-bar-fill { background: var(--accent); }
.detail-statbar .stat-value { width: 24px; font-size: 11px; font-weight: 600; color: var(--label-1); }
.detail-statbar .selected-diff-name {
  margin-left: auto;
  height: 24px;
  gap: 6px;
  background: var(--bg-base);
  border: 1px solid var(--border-2);
  color: var(--label-2);
  font-size: 11px;
  font-weight: 500;
}
.selected-diff-name .diff-pill-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex: 0 0 5px;
}

.detail-left { padding: 18px 22px 22px; border-right-color: var(--border-1); }
.detail-right { width: 360px; flex-basis: 360px; padding: 18px 20px; background: var(--bg-module); }
.detail-section-title {
  margin-bottom: 10px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--label-4);
}
.detail-diff-row { height: 34px; border-radius: 8px; }
.detail-diff-row.active { background: var(--accent-weak); box-shadow: inset 0 0 0 1px var(--accent-ring); }
.detail-diff-list { gap: 1px; }
.info-item { background: var(--bg-module); border-color: var(--border-1); border-radius: 9px; padding: 9px 11px; }
.info-item .label { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--label-4); }
.info-item .value { font-size: 12.5px; }
.info-link { font-size: 12.5px; }
#detailMemoInput { min-height: 160px; border-radius: 10px; background: var(--bg-base); border-color: var(--border-1); }
.btn-save-memo { height: 36px; background: var(--bg-base); border-color: var(--border-3); }

/* ---- 通用状态 ---- */
:where(button, a, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { border-width: 2px; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.popover-menu, .toast-msg, .bulk-bar { border-radius: 10px; }

/* ==== 响应式 ==== */
@media (max-width: 1100px) {
  :root { --sidebar-w: 228px; --col-w: 272px; }
  .detail-right { width: 268px; flex-basis: 268px; }
}

@media (max-width: 820px) {
  header { flex-wrap: wrap; height: auto; padding: 10px 12px; gap: 8px; flex: 0 0 auto; }
  input#urlInput { flex: 1 1 100%; max-width: none; order: 1; }
  .btn-primary { order: 2; flex: 1; justify-content: center; }
  #btnSyncAll { order: 2; }
  .view-toggles { order: 3; margin-left: 0; }
  .board-scroll { padding: 12px; gap: 10px; }
  .column { flex-basis: 86vw; width: 86vw; }
  .new-column-btn { flex-basis: 120px; min-width: 120px; }
  .detail-body { flex-direction: column; }
  .detail-left { border-right: none; border-bottom: 1px solid var(--border-1); }
  .detail-right { width: 100%; flex: 1 1 auto; border-radius: 0 0 var(--r-lg) var(--r-lg); }
  .detail-info-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-title { font-size: 17px; }
}

@media (max-width: 520px) {
  :root { --sidebar-w: min(84vw, 300px); }
  .sidebar {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    z-index: 800;
    box-shadow: var(--shadow-3);
    border-radius: 0 var(--r-md) var(--r-md) 0;
  }
  .sidebar.collapsed { width: 0; box-shadow: none; }
  .stat-bar-bg { width: 44px; }
  .selected-diff-name { margin-left: 0; }
  .bulk-bar { flex-wrap: wrap; width: calc(100% - 20px); justify-content: center; }

  /* 列表视图：手机上胶囊换到第二行，标题不再被挤成两个字 */
  .view-list .card { min-height: 76px; }
  .view-list .card-bg-layer { flex-basis: 76px; width: 76px; }
  .view-list .card-content {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "title" "host" "pills";
    row-gap: 5px;
    padding: 10px 12px;
  }
  .view-list .card-footer-actions { justify-content: flex-start; }
  .view-list .diff-bar-container { width: 5px; }

  .detail-header { min-height: 150px; padding: 18px 16px 16px; }
  .detail-statbar { gap: 12px; padding: 10px 16px; }
  .detail-statbar .selected-diff-name { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}