/* ===== IPA Source · 明亮苹果克制（A-light-ios 风格） ===== */
/* 字体：SF Pro（系统）+ 苹方中文 + SF Mono 等宽数据 */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'PingFang SC', 'HarmonyOS Sans SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'SF Mono', ui-monospace, 'JetBrains Mono', Menlo, monospace;

  /* 明亮苹果配色（HEX，A-light-ios 稿风格） */
  --bg:        #f5f5f7;
  --surface:   #ffffff;
  --surface-2: #fafafa;
  --border:    #e3e3e8;
  --border-soft: #ececf0;
  --text:      #1d1d1f;
  --text-2:    #6e6e73;
  --text-3:    #707075;
  --accent:    #0066cc;
  --accent-2:  #0055b3;
  --accent-soft: #e8f1fd;
  --green:     #34c759;
  --green-text: #167c3a;
  --orange:    #ff9500;
  --orange-text: #9a5c12;
  --danger:    #d70015;
  --danger-soft: #fbe9eb;

  --surface-hover: #f8f8fb;
  --control-track: #d8d8de;
  --control-track-hover: #c4c4cc;
  --control-off: #c7c7cc;
  --selection-border: #b8d5f5;
  --upload-border: #b9bec8;
  --warning-border: #f1d5a8;
  --warning-surface: #fff8eb;
  --warning-text: #875d18;
  --scope-all-text: #25724b;
  --scope-all-surface: #e8f6ee;
  --scope-exclude-text: #9a5c12;
  --scope-exclude-surface: #fff3df;
  --overlay: rgba(0,0,0,.35);
  --overlay-soft: rgba(0,0,0,.3);
  --shadow-focus: rgba(0,0,0,.08);
  --shadow-control: rgba(0,0,0,.15);
  --shadow-toast: rgba(0,0,0,.16);
  --shadow-overlay: rgba(0,0,0,.12);

  --font-display: 26px;
  --font-display-compact: 24px;
  --font-title: 17px;
  --font-body: 14px;
  --font-supporting: 12.5px;
  --font-label: 12px;
  --font-icon-lg: 20px;
  --font-icon-xl: 24px;

  --r: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { overflow-x: hidden; }
html, body { height: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: var(--font-body); line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
button:disabled { cursor: not-allowed; opacity: .5; }
:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
input, textarea, select { font-family: inherit; font-size: inherit; }
::selection { background: var(--accent-soft); color: var(--accent); }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--control-track); border-radius: 5px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--control-track-hover); }

/* ===== 登录页 ===== */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.login-card { width: 360px; }
.login-logo { font-family: var(--font-mono); font-size: var(--font-label); letter-spacing: 0.3em; color: var(--text-3); text-align: center; padding: 0 0 28px; }
.login-card h1 { font-size: var(--font-display); font-weight: 700; text-align: center; letter-spacing: 0; margin-bottom: 6px; }
.login-sub { text-align: center; color: var(--text-3); font-size: var(--font-body); margin-bottom: 32px; }
.login-form { padding: 0 4px; }
.login-foot { text-align: center; font-family: var(--font-mono); font-size: var(--font-label); color: var(--text-3); padding: 24px 0 0; }
.login-submit { width: 100%; padding: 10px; }
.login-error { min-height: 1em; margin-top: 14px; }

/* ===== 表单原子 ===== */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field > label, .field > .lbl { font-size: var(--font-label); font-weight: 500; color: var(--text-2); }
.input, input[type=text], input[type=password], input[type=search], input[type=url],
input[type=number], textarea, select {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  padding: 9px 12px; font-size: var(--font-body); border-radius: 6px; outline: none;
  transition: border-color .12s, box-shadow .12s; width: 100%;
}
.input:focus, input:focus, textarea:focus, select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.mono { font-family: var(--font-mono); }
textarea { resize: vertical; min-height: 64px; }
.input-hint { font-size: var(--font-label); color: var(--text-3); line-height: 1.5; margin-top: 4px; }

/* ===== 按钮 ===== */
.btn {
  padding: 8px 16px; font-size: var(--font-body); border-radius: 7px; font-weight: 500;
  border: 1px solid var(--border); color: var(--text); background: var(--surface);
  transition: background .12s, border-color .12s, opacity .12s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { opacity: 0.8; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-ghost { border-color: transparent; color: var(--accent); background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger, .btn.del { color: var(--danger); }
.btn-danger:hover, .btn.del:hover { background: var(--danger-soft); border-color: var(--danger-soft); }
.btn-sm { padding: 5px 12px; font-size: var(--font-supporting); }

/* ===== 主布局 ===== */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 224px; flex-shrink: 0; background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 24px 0;
  position: sticky; top: 0; height: 100vh;
	overflow: hidden;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 8px 26px 16px; }
.brand { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-family: var(--font-mono); font-size: var(--font-label); letter-spacing: 0.2em; color: var(--text-2); white-space: nowrap; }
.brand-mark { display: inline-grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--border); border-radius: 7px; color: var(--accent); font-size: var(--font-label); letter-spacing: 0; font-weight: 700; flex: 0 0 28px; }
.brand-text { overflow: hidden; }
.sidebar-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 7px 7px; color: var(--text-3); border-radius: 7px; font-size: var(--font-label); white-space: nowrap; }
.sidebar-toggle:hover { color: var(--text); background: var(--surface-2); }
.sidebar-toggle svg, .nav-icon svg, .btn-with-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-toggle svg { flex: 0 0 18px; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-section { padding: 16px 20px 6px; font-size: var(--font-label); font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; }
.nav-item {
  min-height: 44px; display: flex; align-items: center; gap: 12px;
  padding: 10px 20px; font-size: var(--font-body); color: var(--text);
  border-left: 1px solid transparent; transition: color .12s, background .12s, border-color .12s;
}
.nav-item:hover { background: var(--surface-2); }
.nav-item.active { color: var(--accent); border-left-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.nav-icon { width: 20px; height: 20px; display: inline-grid; place-items: center; flex: 0 0 20px; color: currentColor; }
.nav-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-footer { margin-top: auto; padding: 16px 0 0; border-top: 1px solid var(--border-soft); }
.sidebar-footer .nav-item { width: 100%; color: var(--text-3); }
.sidebar-footer .nav-item:hover { color: var(--danger); background: var(--danger-soft); }
.sidebar.collapsed { width: 72px; }
.sidebar.collapsed .sidebar-head { flex-direction: column; justify-content: flex-start; gap: 10px; padding-inline: 12px; padding-bottom: 18px; }
.sidebar.collapsed .brand-text, .sidebar.collapsed .nav-label, .sidebar.collapsed .nav-section, .sidebar.collapsed .sidebar-toggle-text { display: none; }
.sidebar.collapsed .sidebar-toggle { padding-inline: 7px; }
.sidebar.collapsed .nav-item { justify-content: center; padding-inline: 0; }
.sidebar.collapsed .nav-icon { flex-basis: 22px; width: 22px; height: 22px; }
.content { flex: 1; padding: 36px clamp(24px, 4vw, 56px); min-width: 0; }

/* ===== 页面头 ===== */
.page-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 24px; }
.page-head h2 { font-size: var(--font-display); line-height: 1.25; font-weight: 700; letter-spacing: 0; }
.page-head .meta { font-size: var(--font-supporting); color: var(--text-3); margin-top: 6px; }
.btn-with-icon { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.btn-with-icon svg { width: 16px; height: 16px; }

/* ===== 维度切换（segmented） ===== */
.dim-switch { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 3px; margin-bottom: 16px; }
.dim-option { padding: 6px 16px; font-size: var(--font-body); font-weight: 500; color: var(--text-2); border-radius: 6px; cursor: pointer; transition: all .12s; white-space: nowrap; }
.dim-option.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px var(--shadow-focus); }
.dim-option:hover:not(.active) { color: var(--text); }

/* ===== 分类/渠道 tab（下划线优雅版） ===== */
.tabs { display: flex; gap: 2px; margin-bottom: 14px; flex-wrap: wrap; align-items: baseline; }
.tab { padding: 8px 16px; font-size: var(--font-body); color: var(--text-3); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; transition: color .12s, border-color .12s; }
.tab:hover { color: var(--text-2); border-bottom-color: var(--border); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.tab .cnt { font-family: var(--font-mono); font-size: var(--font-label); color: inherit; opacity: 0.6; margin-left: 5px; }
.cat-manage { margin-left: auto; font-size: var(--font-supporting); color: var(--text-3); padding: 8px 12px; align-self: center; }
.cat-manage:hover { color: var(--accent); }

/* ===== 工具栏 ===== */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.list-controls { display: grid; grid-template-columns: minmax(260px, 420px) 150px auto minmax(90px, 1fr); align-items: center; gap: 10px; margin-bottom: 14px; }
.search-box { position: relative; min-width: 0; }
.search-box input { padding: 9px 12px 9px 34px; background: var(--surface); border-radius: 8px; }
.search-box .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; font-size: var(--font-body); }
.filter-sel { width: auto; min-width: 120px; background: var(--surface); border-radius: 8px; padding: 9px 12px; padding-right: 28px; }
.list-result { grid-column: -2 / -1; justify-self: end; color: var(--text-3); font-size: var(--font-label); white-space: nowrap; }

/* ===== 表格 ===== */
.table-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.table-scroll { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table { min-width: 760px; }
.table th { font-family: var(--font-mono); font-size: var(--font-label); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 10px 16px; border-bottom: 1px solid var(--border-soft); font-size: var(--font-body); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.row { transition: background .08s; }
.table tr.row:hover { background: var(--surface-hover); }
.col-check { width: 32px; }
.col-check input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; border-radius: 4px; }
.col-icon { width: 40px; }
.col-bundle, .col-ver, .col-size { font-family: var(--font-mono); font-size: var(--font-supporting); color: var(--text-2); }
.col-size { color: var(--text-3); }
.col-status { width: 80px; }
.col-actions { width: 100px; text-align: right; }
.app-icon { width: 30px; height: 30px; border-radius: 7px; object-fit: cover; background: var(--surface-2); display: block; }
.app-name { font-weight: 600; }
.col-name { max-width: 280px; }
.col-name .app-name { display: inline-block; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.col-bundle { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-tag { font-size: var(--font-label); color: var(--text-3); margin-left: 6px; padding: 1px 7px; background: var(--surface-2); border-radius: 4px; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: var(--font-supporting); color: var(--text-2); }
.status .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-on { background: var(--green); }
.dot-off { background: var(--control-off); }
.dot-lock { background: var(--orange); }
.row-actions { display: inline-flex; gap: 4px; }
.row-actions button { padding: 5px 10px; font-size: var(--font-supporting); color: var(--accent); border-radius: 5px; font-weight: 500; white-space: nowrap; }
.row-actions button:hover { background: var(--accent-soft); }
.row-actions button.del { color: var(--text-3); }
.row-actions button.del:hover { color: var(--danger); background: var(--danger-soft); }
.row.dragging { opacity: 0.4; cursor: grabbing; }
.row[draggable=true] { cursor: grab; }
.pagination { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; min-height: 52px; padding: 8px 14px; border-top: 1px solid var(--border); color: var(--text-3); font-size: var(--font-supporting); background: var(--surface-2); }
.pagination-size, .pagination-nav { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.pagination-size .filter-sel { min-width: 72px; padding-block: 6px; background: var(--surface); }
.pagination-range { justify-self: center; color: var(--text-3); }
.pagination-nav { justify-self: end; }
.page-indicator { min-width: 58px; text-align: center; font-family: var(--font-mono); color: var(--text-2); }
.page-btn { width: 34px; height: 34px; padding: 0; font-size: var(--font-icon-lg); line-height: 1; }

/* 批量工具栏 */
.batch-bar { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 7px 10px 7px 12px; margin-bottom: 12px; background: var(--surface); border: 1px solid var(--selection-border); border-left-color: var(--accent); border-radius: var(--r); font-size: var(--font-supporting); }
.batch-bar[hidden] { display: none; }
.batch-selection { display: inline-flex; align-items: baseline; gap: 5px; padding-right: 8px; color: var(--text-2); white-space: nowrap; }
.batch-selection strong { color: var(--accent); font-family: var(--font-mono); font-size: var(--font-body); }
.batch-sel { width: auto; min-width: 128px; padding: 6px 28px 6px 10px; font-size: var(--font-supporting); }
.empty { text-align: center; padding: 80px 20px; color: var(--text-3); }
.empty-cell .empty { width: min(100%, calc(100vw - 34px)); }
.empty .big { font-size: var(--font-title); font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.empty .hint { font-size: var(--font-supporting); }

/* ===== 自定义确认对话框 ===== */
.dialog-overlay { position: fixed; inset: 0; background: var(--overlay); z-index: 50; display: flex; align-items: center; justify-content: center; animation: fadeIn .15s; padding: 20px; }
.dialog-overlay[hidden] { display: none; }
.dialog-box { background: var(--surface); border-radius: var(--r); padding: 28px 32px 24px; width: 380px; max-width: 92vw; box-shadow: 0 8px 40px var(--shadow-overlay); }
.dialog-box h3 { font-size: var(--font-title); font-weight: 700; margin-bottom: 8px; letter-spacing: 0; }
.dialog-box p { font-size: var(--font-body); color: var(--text-2); margin-bottom: 24px; line-height: 1.5; }
.dialog-box .dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
.dialog-form { max-height: min(640px, 92vh); overflow-y: auto; }
.dialog-fields { margin: 20px 0 -2px; }
.dialog-fields .field { margin-bottom: 14px; }
.dialog-intro { margin-bottom: 0 !important; }
.access-code-dialog { width: 560px; }
.access-code-dialog .lbl em { color: var(--text-3); font-size: var(--font-label); font-style: normal; font-weight: 400; }
.scope-picker { margin-top: 4px; padding-top: 18px; border-top: 1px solid var(--border-soft); }
.scope-picker > .lbl { display: block; margin-bottom: 8px; color: var(--text-2); font-size: var(--font-label); font-weight: 600; }
.scope-mode { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px; }
.scope-mode button { min-height: 34px; padding: 7px 10px; border-radius: 5px; color: var(--text-2); font-size: var(--font-label); font-weight: 600; }
.scope-mode button:hover:not(:disabled) { color: var(--text); }
.scope-mode button.active { color: var(--accent); background: var(--surface); box-shadow: 0 1px 3px var(--shadow-focus); }
.scope-mode button:disabled { color: var(--text-3); cursor: not-allowed; }
.scope-help { min-height: 18px; margin: 9px 0 10px !important; color: var(--text-3) !important; font-size: var(--font-label) !important; }
.scope-categories { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; max-height: 186px; overflow-y: auto; padding: 8px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-2); }
.scope-categories[hidden] { display: none; }
.scope-category { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 34px; padding: 7px 8px; border-radius: 5px; color: var(--text-2); cursor: pointer; font-size: var(--font-supporting); }
.scope-category:hover { background: var(--surface); }
.scope-category input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); flex: 0 0 auto; }
.scope-category span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scope-empty { grid-column: 1 / -1; padding: 8px; color: var(--text-3); font-size: var(--font-label); }
.toast { position: fixed; bottom: max(24px, env(safe-area-inset-bottom)); left: 50%; transform: translate(-50%, 0); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: var(--r); font-size: var(--font-body); font-weight: 500; z-index: 60; max-width: min(560px, calc(100vw - 32px)); white-space: pre-line; text-align: center; box-shadow: 0 8px 28px var(--shadow-toast); animation: fadeIn .2s; }
.page-error { display: grid; gap: 8px; justify-items: start; max-width: 520px; padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); color: var(--text-2); }
.page-error strong { color: var(--text); font-size: var(--font-title); }

/* ===== 上传 ===== */
.upload-zone { border: 1px dashed var(--upload-border); border-radius: var(--r); padding: 36px 24px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; background: var(--surface); }
.upload-zone:hover, .upload-zone.dragover { border-color: var(--accent); background: var(--accent-soft); }
.upload-glyph { width: 42px; height: 42px; display: grid; place-items: center; margin: 0 auto 12px; color: var(--accent); background: var(--accent-soft); border-radius: 8px; }
.upload-glyph svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.upload-title { font-size: var(--font-title); font-weight: 650; margin-bottom: 4px; letter-spacing: 0; }
.upload-title .link { color: var(--accent); }
.upload-hint { font-size: var(--font-supporting); color: var(--text-3); margin-bottom: 16px; }
.upload-review { margin-top: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.upload-review[hidden] { display: none; }
.upload-review-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.upload-review-head h3 { font-size: var(--font-body); font-weight: 700; }
.upload-review-head > div:first-child > span { display: block; margin-top: 2px; font-size: var(--font-label); color: var(--text-3); }
.upload-review-controls { display: flex; align-items: center; gap: 9px; }
.upload-review-controls label { font-size: var(--font-label); color: var(--text-3); white-space: nowrap; }
.upload-review-controls .filter-sel { min-width: 160px; }
.upload-queue { display: flex; flex-direction: column; }
.upload-item { display: grid; grid-template-columns: 44px minmax(0,1fr) minmax(120px,auto) auto 28px; align-items: center; gap: 12px; min-height: 78px; padding: 12px 16px; border-bottom: 1px solid var(--border-soft); }
.upload-item:last-child { border-bottom: 0; }
.upload-item-icon, .upload-item-icon img, .upload-app-placeholder { width: 44px; height: 44px; border-radius: 8px; }
.upload-item-icon img { display: block; object-fit: cover; }
.upload-app-placeholder { display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-3); font-family: var(--font-mono); font-size: var(--font-label); }
.upload-item-main { min-width: 0; }
.upload-item-main strong, .upload-file-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item-main strong { font-size: var(--font-body); }
.upload-file-name { color: var(--text-3); font-size: var(--font-label); margin-top: 1px; }
.upload-item-meta { display: flex; gap: 14px; margin-top: 5px; color: var(--text-2); font-family: var(--font-mono); font-size: var(--font-label); }
.upload-item-meta span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item-status { max-width: 220px; color: var(--text-3); font-size: var(--font-label); text-align: right; overflow-wrap: anywhere; }
.upload-item.is-ready .upload-item-status, .upload-item.is-done .upload-item-status { color: var(--green-text); }
.upload-item.is-overwrite .upload-item-status { color: var(--orange-text); font-weight: 600; }
.upload-item.is-error .upload-item-status { color: var(--danger); }
.upload-item.is-busy .upload-item-status { color: var(--accent); }
.upload-item-status { position: relative; }
.upload-progress { display: block; height: 2px; margin-top: 5px; border-radius: 1px; background: var(--accent); transition: width .15s ease; }
.upload-action { color: var(--accent); font-size: var(--font-label); white-space: nowrap; }
.upload-remove { width: 28px; height: 28px; border-radius: 6px; color: var(--text-3); font-size: var(--font-title); line-height: 1; }
.upload-remove:hover:not(:disabled) { color: var(--danger); background: var(--danger-soft); }
.upload-review-foot { display: flex; align-items: center; gap: 9px; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface-2); }
.upload-review-foot .spacer { flex: 1; }
.upload-result { margin-top: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.upload-result .ur-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border-soft); }
.upload-result .ur-name { font-weight: 600; }
.upload-result .ur-size { font-family: var(--font-mono); font-size: var(--font-label); color: var(--text-3); margin-left: auto; }
.upload-result .ur-bar { height: 2px; background: var(--accent); }
.upload-result .ur-meta { padding: 12px 16px; font-family: var(--font-mono); font-size: var(--font-label); color: var(--text-2); }
.upload-result .ur-meta .k { color: var(--text-3); display: inline-block; width: 80px; }
.upload-result .ur-status { padding: 10px 16px; font-size: var(--font-supporting); color: var(--green-text); display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--border-soft); }

/* ===== 编辑抽屉 ===== */
.drawer-overlay { position: fixed; inset: 0; background: var(--overlay-soft); z-index: 40; animation: fadeIn .15s; }
.drawer-overlay[hidden] { display: none; }
.drawer { position: fixed; right: 0; top: 0; bottom: 0; width: 540px; max-width: 94vw; background: var(--bg); border-left: 1px solid var(--border); z-index: 41; display: flex; flex-direction: column; overflow-y: auto; }
.drawer[hidden] { display: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 28px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg); z-index: 1; }
.drawer-head h3 { font-size: var(--font-title); font-weight: 700; }
.drawer-close { font-size: var(--font-icon-xl); color: var(--text-3); line-height: 1; padding: 4px; border-radius: 6px; }
.drawer-close:hover { color: var(--text); background: var(--surface-2); }
.drawer-body { padding: 24px 28px 28px; flex: 1; }
.drawer-icon-row { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.drawer-icon-row img { width: 52px; height: 52px; border-radius: var(--r); background: var(--surface-2); }
.drawer-icon-row .bid { font-family: var(--font-mono); font-size: var(--font-supporting); color: var(--text-3); }
.toggle-stack { margin-top: 8px; border-top: 1px solid var(--border-soft); }
.inline-field { display: flex; gap: 8px; }
.nowrap { white-space: nowrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--border-soft); font-size: var(--font-body); }
.toggle-row:last-child { border-bottom: 0; }
.toggle-row .tl .th { display: block; font-weight: 600; }
.toggle-row .tl .td { font-size: var(--font-label); color: var(--text-3); margin-top: 3px; }
.switch { position: relative; width: 42px; height: 26px; padding: 0; background: var(--control-track); border-radius: 13px; transition: background .15s; flex-shrink: 0; cursor: pointer; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 4px var(--shadow-control); transition: transform .15s; }
.switch.on { background: var(--green); }
.switch.on::after { transform: translateX(16px); }
.drawer-foot { display: flex; align-items: center; gap: 10px; padding: 16px 28px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--bg); }
.drawer-foot .spacer { flex: 1; }

/* ===== 设置 ===== */
.settings-wrap { width: min(1120px, 100%); display: grid; gap: 14px; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(340px, .88fr); gap: 14px; align-items: stretch; }
.setting-section { padding: 18px 20px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
.setting-section h3 { font-size: var(--font-body); font-weight: 700; color: var(--text); }
.setting-section .field { margin-bottom: 14px; }
.setting-section .field:last-child { margin-bottom: 0; }
.compact-grid { gap: 12px; }
.source-access-section { padding-block: 15px; }
.source-access-layout { display: grid; grid-template-columns: minmax(0,1fr) 72px; align-items: center; gap: 18px; }
.source-url-box { display: flex; align-items: center; gap: 12px; }
.source-url-box .input { flex: 1; }
.qr { width: 48px; height: 48px; border-radius: 5px; background: var(--surface); padding: 3px; flex-shrink: 0; border: 1px solid var(--border); }
.qr-lg { width: 80px; height: 80px; }
.copy-btn { white-space: nowrap; }
.json-preview { font-family: var(--font-mono); font-size: var(--font-supporting); color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 8px; padding: 18px; overflow: auto; line-height: 1.6; }
.setting-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.setting-title-row h3 { margin-bottom: 2px; }
.setting-title-row > div > span, .storage-current { font-size: var(--font-label); color: var(--text-3); }
.setting-switch { display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; color: var(--text-2); font-size: var(--font-label); }
.schedule-status { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); margin-top: 2px; border: 1px solid var(--border-soft); border-radius: 7px; overflow: hidden; }
.schedule-status > div { min-width: 0; padding: 10px 12px; background: var(--surface-2); }
.schedule-status > div:nth-child(2) { border-left: 1px solid var(--border-soft); }
.schedule-status .schedule-result { grid-column: 1 / -1; border-top: 1px solid var(--border-soft); }
.schedule-status span, .schedule-status strong { display: block; }
.schedule-status span { color: var(--text-3); font-size: var(--font-label); margin-bottom: 3px; }
.schedule-status strong { overflow-wrap: anywhere; font-size: var(--font-label); font-weight: 600; }
.schedule-actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.schedule-actions span { color: var(--text-3); font-size: var(--font-label); }
.storage-current { padding: 4px 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; white-space: nowrap; }
.storage-mode { display: inline-flex; gap: 2px; padding: 3px; margin-bottom: 18px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; }
.storage-mode button { min-width: 108px; padding: 7px 12px; border-radius: 6px; color: var(--text-2); font-size: var(--font-supporting); }
.storage-mode button.active { color: var(--text); background: var(--surface); box-shadow: 0 1px 3px var(--shadow-focus); font-weight: 600; }
.check-row { min-height: 62px; display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin-bottom: 18px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); cursor: pointer; }
.check-row input { width: 16px; height: 16px; accent-color: var(--accent); }
.check-row strong, .check-row small { display: block; }
.check-row strong { font-size: var(--font-supporting); }
.check-row small { margin-top: 2px; color: var(--text-3); font-size: var(--font-label); }
.inline-warning { padding: 10px 12px; margin-bottom: 16px; border: 1px solid var(--warning-border); border-radius: 6px; background: var(--warning-surface); color: var(--warning-text); font-size: var(--font-supporting); }
.storage-risk { margin-top: 2px; }
.storage-actions { margin-top: 16px; }
.storage-migration-slot:empty { display: none; }
.storage-migration { display: grid; gap: 9px; padding: 12px 14px; margin: 2px 0 14px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-2); }
.storage-migration-head, .storage-migration-detail { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.storage-migration-head strong { font-size: var(--font-supporting); }
.storage-migration-head span, .storage-migration-detail { color: var(--text-3); font-size: var(--font-label); }
.storage-migration.is-running .storage-migration-head strong, .storage-migration.is-pending .storage-migration-head strong { color: var(--accent); }
.storage-migration.is-failed .storage-migration-head strong { color: var(--danger); }
.storage-migration.is-completed .storage-migration-head strong { color: var(--green-text); }
.storage-migration progress { width: 100%; height: 6px; overflow: hidden; border: 0; border-radius: 4px; background: var(--border-soft); accent-color: var(--accent); }
.storage-migration progress::-webkit-progress-bar { background: var(--border-soft); }
.storage-migration progress::-webkit-progress-value { background: var(--accent); }
.storage-migration progress::-moz-progress-bar { background: var(--accent); }

@media (max-width: 1050px) {
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
	.list-controls { grid-template-columns: minmax(0,1fr) 132px; gap: 8px; }
	.list-controls .search-box { grid-column: 1 / -1; }
	.list-controls .list-result { grid-column: 1 / -1; justify-self: start; }
}

/* 分类管理 */
.cat-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.cat-row { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--border-soft); }
.cat-row:last-child { border-bottom: 0; }
.cat-name { font-weight: 600; min-width: 100px; }
.cat-actions { margin-left: auto; display: flex; gap: 6px; }

/* 授权码 & 上游 */
.unlock-mode { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); margin-bottom: 24px; font-size: var(--font-body); color: var(--text-2); }
.access-summary { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); margin-bottom: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); }
.access-summary > div { padding: 15px 18px; border-right: 1px solid var(--border-soft); }
.access-summary > div:last-child { border-right: 0; }
.access-summary span, .access-summary strong { display: block; }
.access-summary span { color: var(--text-3); font-size: var(--font-label); margin-bottom: 3px; }
.access-summary strong { font-size: var(--font-title); font-weight: 650; }
.access-summary .is-restricted { color: var(--orange-text); }
.access-summary .is-open { color: var(--green-text); }
.code-controls { display: grid; grid-template-columns: minmax(240px,380px) 140px 1fr; align-items: center; gap: 10px; margin-bottom: 12px; }
.code-table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.code-table .code-val { font-size: var(--font-supporting); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-code { cursor: pointer; padding: 2px 6px; border-radius: 4px; transition: background .12s, color .12s; }
.copy-code:hover { background: var(--accent-soft); color: var(--accent); }
.code-table { min-width: 900px; table-layout: fixed; }
.code-table th, .code-table td { padding-inline: 10px; }
.code-table th:nth-child(1) { width: 13%; }
.code-table th:nth-child(2) { width: 12%; }
.code-table th:nth-child(3) { width: 15%; }
.code-table th:nth-child(4) { width: 17%; }
.code-table th:nth-child(5) { width: 10%; }
.code-table th:nth-child(6) { width: 10%; }
.code-table th:nth-child(7) { width: 12%; }
.code-table th:nth-child(8) { width: 11%; }
.code-table .code-note { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-table .code-actions, .code-table .col-actions { width: auto; min-width: 0; }
.code-table .row-actions { justify-content: flex-end; flex-wrap: wrap; }
.scope-cell { display: flex; align-items: center; gap: 7px; min-width: 0; max-width: 100%; }
.scope-badge { display: inline-flex; align-items: center; width: fit-content; padding: 3px 7px; border-radius: 4px; font-size: var(--font-label); font-weight: 650; line-height: 1.25; white-space: nowrap; }
.scope-badge.scope-all { color: var(--scope-all-text); background: var(--scope-all-surface); }
.scope-badge.scope-exclude { color: var(--scope-exclude-text); background: var(--scope-exclude-surface); }
.scope-names { overflow: hidden; color: var(--text-2); font-size: var(--font-label); text-overflow: ellipsis; white-space: nowrap; }
.code-state, .source-actions { display: inline-flex; align-items: center; gap: 8px; }
.code-state > span { color: var(--text-2); font-size: var(--font-supporting); }
.device-binding { min-width: 190px; max-width: 260px; }
.device-udid { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--font-label); color: var(--text-2); }
.binding-empty { display: inline-flex; padding: 3px 7px; border-radius: 4px; background: var(--surface-2); color: var(--text-3); font-size: var(--font-label); white-space: nowrap; }
.usage-count, .usage-time { display: block; }
.usage-count { font-family: var(--font-mono); font-size: var(--font-supporting); }
.usage-time { color: var(--text-3); font-size: var(--font-label); margin-top: 2px; white-space: nowrap; }
.source-actions .qr { width: 34px; height: 34px; }
.code-list { display: flex; flex-direction: column; gap: 12px; }
.code-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px 20px; }
.code-card-head { display: flex; align-items: center; gap: 14px; }
.code-val { font-family: var(--font-mono); font-size: var(--font-body); font-weight: 600; }
.code-note { font-size: var(--font-body); color: var(--text-2); }
.code-card-meta { font-family: var(--font-mono); font-size: var(--font-label); color: var(--text-3); margin: 12px 0 16px; display: flex; gap: 10px; }
.code-url-row { display: flex; align-items: center; gap: 10px; }
.code-url { flex: 1; font-size: var(--font-label); }
.code-url-row .qr { width: 44px; height: 44px; }
.up-actions { display: flex; gap: 8px; margin-top: 16px; }
.up-tag { font-size: var(--font-label); color: var(--text-3); padding: 1px 7px; background: var(--surface-2); border-radius: 4px; margin-left: 6px; font-family: var(--font-mono); }

.form-actions { display: flex; align-items: center; gap: 10px; margin-top: 24px; }
.form-actions .spacer { flex: 1; }
.err-text { color: var(--danger); font-size: var(--font-supporting); margin-top: 12px; }
.muted { color: var(--text-3); }

@media (max-width: 760px) {
  body { font-size: var(--font-body); }
  .layout { display: block; }
  .sidebar, .sidebar.collapsed { width: 100%; height: auto; min-height: 0; padding: 10px 0 0; position: sticky; top: 0; z-index: 20; border-right: 0; border-bottom: 1px solid var(--border); overflow: visible; }
  .sidebar-head { padding: 0 16px 10px; }
  .sidebar-toggle { display: none; }
  .brand { padding: 0; }
  .sidebar.collapsed .brand-text { display: inline; }
	.nav { flex-direction: row; gap: 2px; overflow-x: auto; padding: 0 10px; scrollbar-width: none; }
	.nav::after { content: ''; flex: 0 0 8px; }
  .nav-item { scroll-snap-align: center; }
  .nav::-webkit-scrollbar { display: none; }
  .nav-section { display: none; }
	.nav-item, .sidebar.collapsed .nav-item { justify-content: flex-start; border-left: 0; border-bottom: 1px solid transparent; padding: 9px 12px 10px; white-space: nowrap; font-size: var(--font-supporting); }
  .sidebar.collapsed .nav-label, .sidebar.collapsed .nav-icon { display: inline-grid; }
  .sidebar.collapsed .nav-label { display: inline; }
  .nav-item.active { border-left-color: transparent; border-bottom-color: var(--accent); }
  .sidebar-footer { position: absolute; right: 8px; top: 5px; margin-top: 0; border: 0; padding: 0; }
	.sidebar-footer .nav-item { width: 40px; min-height: 40px; color: var(--text-3); border: 0; padding: 0; justify-content: center; }
	.sidebar-footer .nav-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
  .content { padding: 24px 16px 36px; }
  .page-head { align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
  .page-head h2 { font-size: var(--font-display-compact); }
  .page-head > .btn, .page-head > div:last-child { margin-left: auto; }
  .toolbar { align-items: stretch; }
  .search-box { min-width: 100%; max-width: none; }
  .filter-sel { flex: 1; min-width: 0; }
  .toolbar .spacer { display: none; }
  .pagination { flex-wrap: wrap; justify-content: flex-end; }
  .pagination { grid-template-columns: 1fr auto; gap: 8px 12px; }
  .pagination-size { grid-column: 1; }
  .pagination-range { grid-column: 1 / -1; grid-row: 2; justify-self: start; }
  .pagination-nav { grid-column: 2; grid-row: 1; }
  .batch-bar { align-items: stretch; flex-wrap: wrap; }
  .batch-divider { display: none; }
  .batch-bar .spacer { display: none; }
	.batch-bar .btn, .batch-bar .batch-sel { flex: 1; }
	.table-card { border: 0; background: transparent; overflow: visible; }
	.table-card .table-scroll { overflow: visible; }
	.table-card .table { display: block; min-width: 0; }
	.table-card .table thead { display: none; }
	.table-card .table tbody { display: grid; gap: 10px; }
	.table-card .table tbody tr.row { display: grid; grid-template-columns: 32px 40px minmax(0,1fr) auto; gap: 6px 10px; min-height: 0; padding: 12px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
	.table-card .table tbody td { min-width: 0; padding: 0; border: 0; }
	.table-card .col-check { grid-column: 1; grid-row: 1 / span 3; align-self: center; }
	.table-card .col-icon { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
	.table-card .app-icon { width: 40px; height: 40px; }
	.table-card .col-name { grid-column: 3; grid-row: 1; max-width: none; }
	.table-card .col-name .app-name { display: block; max-width: 100%; }
	.table-card .note-tag { display: inline-block; margin: 3px 0 0; }
	.table-card .col-status { grid-column: 4; grid-row: 1; width: auto; }
	.table-card .col-bundle { grid-column: 3 / 5; grid-row: 2; max-width: none; overflow: hidden; text-overflow: ellipsis; }
	.table-card .col-ver { grid-column: 3; grid-row: 3; }
	.table-card .col-ver::before { content: '版本 '; color: var(--text-3); }
	.table-card .col-size { grid-column: 4; grid-row: 3; text-align: right; }
	.table-card .col-actions { grid-column: 2 / 5; grid-row: 4; width: auto; padding-top: 7px; border-top: 1px solid var(--border-soft); text-align: left; }
	.table-card .row-actions { display: flex; justify-content: flex-end; }
	.table-card .row-actions button { min-height: 34px; padding-inline: 14px; }
	.table-card .empty-cell { display: block; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
  .upload-review-head { align-items: stretch; flex-direction: column; gap: 12px; }
  .upload-review-controls { flex-wrap: wrap; }
  .upload-review-controls .filter-sel { flex: 1; min-width: 0; }
  .upload-item { grid-template-columns: 40px minmax(0,1fr) auto 28px; gap: 10px; padding-inline: 12px; }
  .upload-item-icon, .upload-item-icon img, .upload-app-placeholder { width: 40px; height: 40px; }
  .upload-item-status { grid-column: 2; grid-row: 2; text-align: left; max-width: none; }
  .upload-action { grid-column: 3; grid-row: 1 / span 2; }
  .upload-remove { grid-column: 4; grid-row: 1 / span 2; }
  .upload-item-meta { gap: 8px; flex-wrap: wrap; }
  .upload-review-foot { flex-wrap: wrap; }
  .upload-review-foot .spacer { display: none; }
  .upload-review-foot .btn { flex: 1; }
  .access-summary > div { padding: 12px; }
  .access-summary strong { font-size: var(--font-body); }
  .access-summary { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .access-summary > div:nth-child(2) { border-right: 0; }
  .access-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--border-soft); }
  .access-summary > div:nth-child(3) { border-right: 1px solid var(--border-soft); }
  .code-controls { grid-template-columns: minmax(0,1fr) 120px; }
  .code-controls .search-box { grid-column: 1 / -1; }
  .code-controls .list-result { grid-column: 1 / -1; justify-self: start; }
  .code-table-wrap { border: 0; background: transparent; overflow: visible; }
  .code-table-wrap .table-scroll { overflow: visible; }
  .code-table { display: block; min-width: 0; }
  .code-table thead { display: none; }
  .code-table tbody { display: grid; gap: 10px; }
  .code-table tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 15px 12px; padding: 14px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
  .code-table tbody td { display: flex; min-width: 0; padding: 0; border: 0; flex-direction: column; align-items: flex-start; white-space: normal; }
  .code-table tbody td::before { content: attr(data-label); margin-bottom: 5px; color: var(--text-3); font-size: var(--font-label); font-weight: 500; }
  .code-table tbody td[data-label="授权码"], .code-table tbody td[data-label="绑定设备"], .code-table tbody .empty-cell { grid-column: 1 / -1; }
  .code-table tbody td.col-actions { width: auto; min-width: 0; }
  .code-table tbody .empty-cell::before { display: none; }
  .code-table .code-val { font-size: var(--font-body); overflow-wrap: anywhere; }
  .code-table .code-note { width: auto; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  .code-table .scope-cell { min-width: 0; max-width: none; }
  .code-table .scope-names { white-space: normal; overflow-wrap: anywhere; }
  .code-table .device-binding { width: 100%; min-width: 0; max-width: none; }
  .code-table .device-udid { overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; }
  .code-table .row-actions { justify-content: flex-start; flex-wrap: wrap; }
  .setting-title-row { flex-direction: column; gap: 8px; }
  .setting-section { padding: 16px; }
  .source-access-layout { grid-template-columns: minmax(0,1fr) 64px; gap: 12px; }
  .source-access-layout .qr-lg { width: 64px; height: 64px; }
  .schedule-title { flex-direction: row; align-items: center; }
  .schedule-actions { align-items: flex-start; flex-direction: column; }
  .storage-actions { flex-wrap: wrap; }
  .storage-actions .spacer { display: none; }
	.storage-actions .btn { flex: 1; }
	.storage-migration-head, .storage-migration-detail { align-items: flex-start; flex-direction: column; }
	.storage-migration-detail .btn { width: 100%; }
  .drawer { width: 100%; max-width: none; border-left: 0; }
  .drawer-head { padding: 18px 20px; }
  .drawer-body { padding: 20px; }
  .drawer-foot { padding: 14px 20px; }
  .grid-2 { grid-template-columns: 1fr; gap: 0; }
  .source-url-box { align-items: stretch; flex-wrap: wrap; }
  .source-url-box .input { min-width: calc(100% - 92px); }
  .source-url-box .qr-lg { order: 3; }
  .code-card { padding: 14px; }
  .code-card-head { align-items: flex-start; flex-wrap: wrap; gap: 6px 10px; }
  .code-card-head .spacer { display: none; }
  .code-note { width: 100%; overflow-wrap: anywhere; }
  .code-url-row { flex-wrap: wrap; }
  .code-url { min-width: calc(100% - 54px); }
  .code-url-row .qr { margin-left: auto; }
  .access-code-dialog { width: min(560px, 100%); padding: 22px 20px 18px; }
  .scope-categories { grid-template-columns: 1fr; max-height: 210px; }
  .cat-row { gap: 10px; padding: 13px 14px; }
  .cat-name { min-width: 0; overflow-wrap: anywhere; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes appear { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: translateY(0); } }
.stagger > * { animation: appear .3s ease-out both; }
.stagger > *:nth-child(1) { animation-delay: 0ms; }
.stagger > *:nth-child(2) { animation-delay: 20ms; }
.stagger > *:nth-child(3) { animation-delay: 40ms; }
.stagger > *:nth-child(n+4) { animation-delay: 60ms; }
