/* ==========================================================================
   nbblog 管理后台样式（对齐 finally-blog 后台视觉）
   侧边栏 + 顶栏 + 卡片式内容区
   ========================================================================== */

:root {
    --brand: #3366ff;
    --brand-hover: #1a53ff;
    --brand-active: #0f45ff;
    --brand-soft: #f2f5ff;
    --brand-line: #dbe4ff;

    --bg: #f7f8f9;
    --surface: #ffffff;
    --surface-2: #fbfcfd;

    --text: #303742;
    --text-2: #3b4351;
    --muted: #66758c;
    --faint: #97a3b6;
    --line: #eef0f3;
    --line-2: #e3e7ec;

    --ok: #32b643;
    --warn: #ffb700;
    --danger: #e85600;

    --r-xs: 6px;
    --r-sm: 8px;
    --r-md: 8px;
    --r-lg: 12px;
    --r-pill: 999px;

    --shadow-card: 0 0 0 0.5px rgba(188, 195, 206, .12), 0 2px 10px rgba(48, 55, 66, .06);
    --shadow-hover: 0 0 0 0.5px rgba(188, 195, 206, .16), 0 6px 20px rgba(48, 55, 66, .1);
    --shadow-pop: 0 10px 32px rgba(48, 55, 66, .14);
    --shadow-brand: 0 4px 12px rgba(51, 102, 255, .32);

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    --mono: "SF Mono", "Segoe UI Mono", Menlo, Consolas, monospace;
}

html[data-theme="dark"] {
    --bg: #1b1f27;
    --surface: #232831;
    --surface-2: #262c36;
    --text: #e6eaf2;
    --text-2: #cbd3e0;
    --muted: #8b97ab;
    --faint: #6b7788;
    --line: #2c333e;
    --line-2: #353d4a;
    --brand-soft: #1f2a45;
    --brand-line: #2c3d66;
    --shadow-card: 0 0 0 0.5px rgba(0, 0, 0, .3), 0 2px 10px rgba(0, 0, 0, .25);
    --shadow-hover: 0 0 0 0.5px rgba(0, 0, 0, .35), 0 6px 20px rgba(0, 0, 0, .35);
    --shadow-pop: 0 10px 32px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text-2);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }

h1, h2, h3, h4 { margin: 0; color: var(--text); font-weight: 600; }
p { margin: 0; }
img { max-width: 100%; }
button { font-family: inherit; cursor: pointer; }

code {
    font-family: var(--mono);
    font-size: .9em;
    padding: 1px 5px;
    border-radius: var(--r-xs);
    background: var(--surface-2);
    color: var(--text-2);
}

/* 图标 */
.icon {
    width: 18px;
    height: 18px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }

/* 工具类 */
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.bold { font-weight: 600; }
.center { text-align: center; }
.hide { display: none; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.divider { height: 1px; background: var(--line); }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }

/* ============================================================ 卡片与按钮 */
.card {
    background: var(--surface);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-card);
}

.panel-card {
    background: var(--surface);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-card);
    margin-bottom: 16px;
    overflow: hidden;
}
.panel-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 18px;
    border-bottom: 1px solid var(--line);
}
.panel-card__head h3 { font-size: 14px; }
.panel-card__body { padding: 18px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    background: var(--surface-2);
    color: var(--text-2);
    font-size: 13.5px;
    font-weight: 500;
    transition: .18s;
    white-space: nowrap;
    cursor: pointer;
}
.btn:hover { background: var(--line); color: var(--text); text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-brand); }
.btn-primary:hover { background: var(--brand-hover); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); background: transparent; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 12.5px; }
.btn-lg { height: 42px; padding: 0 22px; font-size: 14.5px; }
.btn-block { width: 100%; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #cf4a00; color: #fff; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.icon-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--r-pill);
    background: var(--surface);
    color: var(--muted);
    box-shadow: var(--shadow-card);
    transition: .2s;
}
.icon-btn:hover { color: var(--brand); transform: translateY(-1px); }

.link-btn {
    border: none;
    background: none;
    padding: 4px 6px;
    border-radius: var(--r-xs);
    color: var(--brand);
    font-size: 12.5px;
    cursor: pointer;
}
.link-btn:hover { background: var(--brand-soft); }
.link-btn.is-danger { color: var(--danger); }
.link-btn.is-danger:hover { background: #fdeee6; }

/* ============================================================ 布局 */
.admin {
    display: grid;
    grid-template-columns: 224px minmax(0, 1fr);
    min-height: 100vh;
}

.admin-side {
    background: var(--surface);
    border-right: 1px solid var(--line);
    padding: 18px 12px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    z-index: 40;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 10px 16px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}
.admin-brand__logo {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: var(--brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    box-shadow: var(--shadow-brand);
}
.admin-brand small {
    display: block;
    font-size: 11px;
    color: var(--faint);
    font-weight: 400;
    letter-spacing: .04em;
}

.menu-label {
    padding: 14px 12px 6px;
    font-size: 11px;
    color: var(--faint);
    letter-spacing: .08em;
    text-transform: uppercase;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 36px;
    padding: 0 12px;
    border-radius: var(--r-sm);
    color: var(--text-2);
    font-size: 13.5px;
    transition: .16s;
}
.menu-link .icon { color: var(--faint); }
.menu-link:hover { background: var(--surface-2); color: var(--brand); text-decoration: none; }
.menu-link:hover .icon { color: var(--brand); }
.menu-link.active { background: var(--brand-soft); color: var(--brand); font-weight: 500; }
.menu-link.active .icon { color: var(--brand); }

.menu-badge {
    margin-left: auto;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--r-pill);
    background: var(--brand);
    color: #fff;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.admin-side__foot {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.admin-top {
    position: sticky;
    top: 0;
    z-index: 30;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 22px;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.crumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--faint); }
.crumb b { font-size: 15px; color: var(--text); font-weight: 600; }
.admin-top__right { display: flex; align-items: center; gap: 10px; }
.admin-user { display: flex; align-items: center; gap: 8px; padding-left: 6px; color: inherit; }
.admin-user:hover { text-decoration: none; }
.admin-user .avatar { width: 30px; height: 30px; font-size: 12px; }

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex: none;
    background: linear-gradient(135deg, #cfdcff, #8fb0ff);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.admin-body { padding: 20px 22px 40px; }

.menu-toggle { display: none; }

/* ============================================================ 页面头 */
.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}
.page-head h2 { font-size: 18px; }
.page-head p { margin-top: 5px; font-size: 12.5px; color: var(--muted); }

/* ============================================================ 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat-card { padding: 16px 18px; }
.stat-card__top { display: flex; align-items: center; justify-content: space-between; }
.stat-card__label { font-size: 12.5px; color: var(--muted); }
.stat-card__icon {
    width: 30px; height: 30px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    background: var(--brand-soft); color: var(--brand);
}
.stat-card__num {
    margin-top: 8px;
    font-size: 24px; font-weight: 600; color: var(--text);
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
}
.stat-card__foot { margin-top: 6px; font-size: 12px; color: var(--faint); }

/* ============================================================ 表格 */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table thead th {
    text-align: left;
    font-weight: 500;
    color: var(--muted);
    font-size: 12.5px;
    padding: 10px 14px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    color: var(--text-2);
    vertical-align: middle;
}
.table tbody tr:hover td { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: none; }
.table .num { text-align: right; width: 76px; font-variant-numeric: tabular-nums; }
.table .actions { white-space: nowrap; text-align: right; }
.row-actions { display: flex; align-items: center; gap: 2px; justify-content: flex-end; }
.inline-form { display: inline; }

.cell-title { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); }
.cell-sub { font-size: 11.5px; color: var(--faint); margin-top: 2px; }

/* 状态徽章 */
.badge {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 9px;
    border-radius: var(--r-xs);
    font-size: 12px;
    background: var(--surface-2);
    color: var(--muted);
    white-space: nowrap;
}
.badge-ok { background: #e9f8ec; color: #2a8f45; }
.badge-warn { background: #fff6e5; color: #a66a00; }
.badge-info { background: var(--brand-soft); color: var(--brand); }
.badge-danger { background: #fdeee6; color: var(--danger); }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 24px;
    padding: 0 10px;
    border-radius: var(--r-pill);
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 12.5px;
    white-space: nowrap;
}

/* ============================================================ 筛选栏 */
.filterbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
}
.filterbar form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.pill-tabs {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    max-width: 100%;
    padding: 4px;
    border: 1px solid var(--line-2);
    border-radius: 14px;
    background: linear-gradient(180deg, var(--surface-2), var(--bg));
    box-shadow: inset 0 1px 2px rgba(28, 34, 46, .04);
    overflow-x: auto;
    scrollbar-width: none;
}
.pill-tabs::-webkit-scrollbar { display: none; }
.pill-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 34px;
    padding: 0 15px;
    border-radius: 10px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: color .16s ease, background-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.pill-tab:hover {
    color: var(--brand);
    background: var(--brand-soft);
    text-decoration: none;
}
.pill-tab:focus-visible {
    outline: 2px solid var(--brand-line);
    outline-offset: 2px;
}
.pill-tab.active {
    background: linear-gradient(135deg, var(--brand), var(--brand-hover));
    color: #fff;
    font-weight: 600;
    box-shadow: var(--shadow-brand);
}
.pill-tab .count {
    margin-left: 2px;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(28, 34, 46, .06);
    color: var(--faint);
    font-size: 11px;
    font-weight: 500;
}
.pill-tab.active .count { background: rgba(255, 255, 255, .22); color: #fff; }

/* ============================================================ 表单 */
.input, .select, .textarea {
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--line-2);
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: .16s;
    max-width: 100%;
}
.input:focus, .select:focus, .textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.textarea { height: auto; padding: 10px; line-height: 1.7; resize: vertical; }
.select {
    padding-right: 26px;
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--faint) 50%),
        linear-gradient(135deg, var(--faint) 50%, transparent 50%);
    background-position: calc(100% - 14px) 14px, calc(100% - 9px) 14px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}
.input-block { width: 100%; }

.form-row { margin-bottom: 16px; }
.form-label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.form-label i { color: var(--danger); font-style: normal; }
.form-control { width: 100%; }
.form-hint { margin-top: 5px; font-size: 11.5px; color: var(--faint); }

.checkbox-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
    cursor: pointer;
}
.checkbox-line input { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }

.switch {
    width: 38px;
    height: 21px;
    border-radius: var(--r-pill);
    background: var(--line-2);
    position: relative;
    display: inline-block;
    transition: .2s;
    flex: none;
}
.switch::after {
    content: "";
    position: absolute;
    top: 2px; left: 2px;
    width: 17px; height: 17px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
    transition: .2s;
}
.switch.on { background: var(--brand); }
.switch.on::after { left: 19px; }

.toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
    flex-wrap: wrap;
}

/* ============================================================ 编辑器 */
.edit-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 14px;
    align-items: start;
}
.edit-title {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 22px;
    font-weight: 600;
    color: var(--text);
    padding: 4px 0 12px;
}
.edit-title::placeholder { color: var(--faint); }
.edit-area {
    width: 100%;
    min-height: 420px;
    border: none;
    outline: none;
    resize: vertical;
    padding: 18px;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.9;
    color: var(--text-2);
    background: transparent;
}
.edit-area.code { font-family: var(--mono); font-size: 13.5px; }
.edit-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-top: 1px solid var(--line);
}
.side-panel { padding: 16px 18px; }
.side-panel h4 { font-size: 13px; color: var(--muted); margin-bottom: 12px; font-weight: 600; }

/* ============================================================ 其他 */
.alert {
    padding: 10px 14px;
    border-radius: var(--r-sm);
    font-size: 13px;
    line-height: 1.7;
    background: var(--brand-soft);
    color: var(--brand);
}
.alert-ok { background: #e9f8ec; color: #2a8f45; }
  .alert-error { background: #fdeee6; color: var(--danger); }
  .alert-warn { background: #fff6e5; color: #a66a00; }

  /* 内容编辑页保存后：提示条吸顶，滚到页面底部也能看到「已保存」 */
  .alert--sticky {
    position: sticky;
    top: calc(var(--header-h) + 10px);
    z-index: 30;
    box-shadow: 0 8px 22px -12px rgba(16, 24, 40, .35);
    animation: alert-in .22s ease;
  }

  @keyframes alert-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: none; }
  }

  /* ---------------------------------------------------------------- 右上角加载指示器 */
  .nb-loading {
    position: fixed;
    top: 72px;
    right: 20px;
    z-index: 9999;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    max-width: 240px;
    padding: 9px 16px;
    border-radius: 999px;
    background: rgba(17, 24, 39, .93);
    color: #fff;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.4;
    box-shadow: 0 14px 32px -16px rgba(0, 0, 0, .7);
    animation: nb-loading-in .18s ease;
    pointer-events: none;
  }

  .nb-loading[hidden] { display: none; }

  .nb-loading__text { white-space: nowrap; }

  .nb-spinner {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, .3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: nb-spin .68s linear infinite;
  }

  @keyframes nb-spin {
    to { transform: rotate(360deg); }
  }

  @keyframes nb-loading-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: none; }
  }

  @media (max-width: 640px) {
    .nb-loading { top: 64px; right: 12px; max-width: 60vw; }
  }

  /* ---------------------------------------------------------------- 升级实时日志 */
  .update-log {
    margin-bottom: 16px;
    border: 1px solid #dbe3ff;
    border-radius: 10px;
    background: #fbfcff;
    overflow: hidden;
  }

  .update-log.is-done { border-color: #b7e4c7; background: #f6fdf8; }
  .update-log.is-fail { border-color: #f5c2c0; background: #fff8f7; }

  .update-log__head {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 14px;
    border-bottom: 1px solid rgba(16, 24, 40, .06);
    font-size: 13px;
    font-weight: 600;
    color: var(--text, #1f2937);
  }

  .update-log__head .nb-spinner {
    border-color: rgba(51, 102, 255, .25);
    border-top-color: #3366ff;
  }

  .update-log__title { white-space: nowrap; }

  .update-log__tip {
    margin-left: auto;
    font-size: 12px;
    font-weight: 400;
    color: var(--muted, #6b7280);
  }

  .update-log__list {
    margin: 0;
    padding: 10px 14px 12px 30px;
    max-height: 260px;
    overflow-y: auto;
    font-size: 12.5px;
    line-height: 1.85;
    color: var(--text-2, #4a5261);
  }

  .update-log__list li::marker { color: #9aa3b2; }
  .update-log__list li.is-ok { color: #15803d; font-weight: 600; }
  .update-log__list li.is-fail { color: #d64545; font-weight: 600; }

.empty { padding: 48px 20px; text-align: center; color: var(--faint); font-size: 13.5px; }
.empty .icon { display: block; width: 30px; height: 30px; margin: 0 auto 12px; opacity: .6; }

.kv-list { display: grid; grid-template-columns: 92px 1fr; gap: 8px 12px; margin: 0; font-size: 13px; }
.kv-list dt { color: var(--faint); }
.kv-list dd { margin: 0; color: var(--text-2); }

.split-2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 14px;
    align-items: start;
}

/* ============================================================ 用户详情 */
.user-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
}
.user-profile__avatar { width: 56px; height: 56px; font-size: 20px; }
.user-profile__main { min-width: 0; }
.user-profile__name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.user-profile__name h3 { font-size: 16px; }
.user-profile__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--faint);
}
.user-profile__meta span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.user-profile__meta .icon { width: 14px; height: 14px; }

.user-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 14px;
    align-items: start;
}
.user-detail-side > .panel-card:last-child { margin-bottom: 0; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 16px;
}
.form-grid .form-row.is-full { grid-column: 1 / -1; }
.form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.user-side-card { position: sticky; top: 76px; }

.oauth-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}
.oauth-item:last-child { border-bottom: none; padding-bottom: 0; }
.oauth-item__info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.oauth-item__info strong { font-size: 13px; color: var(--text); }

.pager { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 16px 0 6px; }
.pager a, .pager span.pager__link {
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--muted);
    font-size: 13px;
    box-shadow: var(--shadow-card);
}
.pager a:hover { color: var(--brand); text-decoration: none; }
.pager .is-active { background: var(--brand); color: #fff; box-shadow: var(--shadow-brand); }
.pager .is-disabled { opacity: .45; cursor: not-allowed; }
.pager .pager__gap { color: var(--faint); }

/* ============================================================ 登录页 */
.alogin-body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    padding: 32px 18px;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    background:
        radial-gradient(880px 480px at 10% -10%, rgba(47, 139, 253, .12), transparent 62%),
        radial-gradient(760px 460px at 92% 108%, rgba(162, 75, 255, .12), transparent 64%),
        var(--bg);
}

.alogin { position: relative; width: 100%; max-width: 412px; margin: auto; }

.alogin__glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(48px);
    opacity: .5;
    pointer-events: none;
}
.alogin__glow--a { width: 180px; height: 180px; left: -58px; top: -34px; background: rgba(47, 139, 253, .38); }
.alogin__glow--b { width: 190px; height: 190px; right: -64px; bottom: -46px; background: rgba(162, 75, 255, .34); }

.alogin__card {
    position: relative;
    background: var(--surface);
    border-radius: 18px;
    padding: 28px 26px 20px;
    box-shadow: 0 26px 60px -30px rgba(31, 45, 90, .42), 0 0 0 1px var(--line);
}

.alogin__brand { display: flex; align-items: center; gap: 9px; margin-bottom: 22px; }
.alogin__logo {
    width: 30px; height: 30px; border-radius: 9px; flex: none;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 14px; font-weight: 700;
    background-image: linear-gradient(135deg, #2f8bfd, #a24bff);
}
.alogin__site { font-size: 14px; font-weight: 600; color: var(--text); letter-spacing: .2px; }
.alogin__badge {
    margin-left: auto;
    padding: 2px 8px;
    border-radius: var(--r-pill);
    font-size: 11px;
    color: var(--brand);
    background: var(--brand-soft);
    border: 1px solid var(--brand-line);
}

.alogin__title { margin: 0 0 8px; font-size: 26px; font-weight: 700; letter-spacing: .5px; }
.alogin__sub { margin: 0 0 20px; font-size: 13px; color: var(--faint); }

.alogin__error {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin-bottom: 16px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(232, 86, 0, .08);
    color: var(--danger);
    font-size: 13px;
    line-height: 1.55;
}
.alogin__error .icon { margin-top: 2px; }

.alogin__form { display: flex; flex-direction: column; }

.alogin__eye {
    flex: none;
    width: 28px; height: 28px;
    margin-right: -6px;
    display: flex; align-items: center; justify-content: center;
    border: 0; border-radius: 7px;
    background: transparent;
    color: var(--faint);
    transition: color .16s, background-color .16s;
}
.alogin__eye:hover { color: var(--brand); background: var(--surface); }
.alogin__eye.is-on { color: var(--brand); }

.alogin__dashed { margin: 22px 0 4px; }
.alogin__hint { margin: 0; text-align: center; font-size: 12px; line-height: 1.7; color: var(--faint); }

.auth-field {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 46px;
    padding: 0 14px;
    margin-bottom: 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--bg);
    transition: background-color .16s, border-color .16s, box-shadow .16s;
}
.auth-field .icon { color: var(--faint); transition: color .16s; }
.auth-field input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
}
.auth-field input::placeholder { color: var(--faint); }
.auth-field:focus-within { background: var(--surface); border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.auth-field:focus-within .icon { color: var(--brand); }

.auth-row { display: flex; align-items: center; justify-content: space-between; margin: 4px 2px 18px; }
.auth-check { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); cursor: pointer; user-select: none; }
.auth-check input { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; margin: 0; }
.auth-link { font-size: 13px; color: var(--muted); }
.auth-link:hover { color: var(--brand); }

.auth-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 46px;
    border: 0;
    border-radius: 10px;
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .5px;
    cursor: pointer;
    background-image: linear-gradient(90deg, #2f8bfd 0%, #6a5cff 52%, #a24bff 100%);
    box-shadow: 0 10px 22px -10px rgba(94, 92, 255, .9);
    transition: filter .16s, transform .12s, box-shadow .16s;
}
.auth-submit:hover { filter: brightness(1.05); box-shadow: 0 12px 26px -10px rgba(94, 92, 255, 1); }
.auth-submit:active { transform: translateY(1px); }
.auth-submit .icon { color: #fff; }

.auth-dashed { position: relative; margin: 24px 0 18px; text-align: center; }
.auth-dashed::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 50%;
    border-top: 1px dashed var(--line-2);
}
.auth-dashed span {
    position: relative;
    padding: 0 10px;
    background: var(--surface);
    font-size: 12px;
    color: var(--faint);
}

/* ============================================================ 媒体库 */
.upload-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 26px;
    border: 1px dashed var(--line-2);
    border-radius: var(--r-md);
    background: var(--surface-2);
    color: var(--muted);
    text-align: center;
    cursor: pointer;
    transition: .16s;
}
.upload-drop:hover,
.upload-drop.is-drag {
    border-color: var(--brand);
    background: var(--brand-soft);
    color: var(--brand);
}
.upload-drop strong { font-size: 14px; color: var(--text); }
.upload-drop .icon-lg { color: var(--brand); }

.upload-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 14px;
    padding: 16px 18px;
}
.media-card {
    margin: 0;
    background: var(--surface-2);
    border-radius: var(--r-md);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
}
.media-thumb {
    aspect-ratio: 4 / 3;
    background: var(--bg);
    display: grid;
    place-items: center;
    overflow: hidden;
}
.media-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-meta { padding: 8px 10px 0; }
.media-name {
    font-size: 12.5px;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.media-actions { display: flex; justify-content: space-between; padding: 6px 4px 8px; }

/* ============================================================ 主题 */
.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}
.theme-card {
    background: var(--surface);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    border: 1px solid transparent;
    display: flex;
    flex-direction: column;
}
.theme-card.is-active { border-color: var(--brand-line); box-shadow: var(--shadow-hover); }

.theme-shot {
    position: relative;
    aspect-ratio: 16 / 10;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #eef3ff, #e6ecff 45%, #f5f0ff);
    overflow: hidden;
}
html[data-theme="dark"] .theme-shot { background: linear-gradient(135deg, #1f2740, #232a3d); }
.theme-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.theme-shot__letter {
    font-size: 56px;
    font-weight: 700;
    color: var(--brand);
    opacity: .55;
    letter-spacing: -.03em;
}
.theme-shot__tag {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 2px 10px;
    border-radius: var(--r-pill);
    background: var(--brand);
    color: #fff;
    font-size: 11.5px;
}

.theme-actions form { margin: 0; }
.theme-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; }
.theme-body h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.theme-body p { margin: 0; }
.theme-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; }

/* ============================================================ 对话框 */
.ui-dialog-mask {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(20, 26, 38, .42);
    display: grid;
    place-items: center;
    padding: 20px;
    animation: ui-fade .12s ease;
}
.ui-dialog {
    width: 100%;
    max-width: 380px;
    background: var(--surface);
    border-radius: 14px;
    box-shadow: var(--shadow-pop);
    padding: 22px;
    animation: ui-pop .14s ease;
}
.ui-dialog__title { font-size: 16px; margin-bottom: 8px; }
.ui-dialog__text {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 13.5px;
    white-space: pre-line;
    word-break: break-word;
}
.ui-dialog__actions { display: flex; justify-content: flex-end; gap: 10px; }

@keyframes ui-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ui-pop { from { transform: translateY(6px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }

/* ============================================================ 响应式 */
@media (max-width: 1180px) {
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
    .admin { grid-template-columns: minmax(0, 1fr); }
    .admin-side {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        width: 232px;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform .22s ease;
        box-shadow: var(--shadow-pop);
    }
    body.side-open .admin-side { transform: none; }
    .menu-toggle { display: inline-flex; }
    .split-2, .edit-grid, .user-detail-grid { grid-template-columns: minmax(0, 1fr); }
    .user-side-card { position: static; }
    .admin-body { padding: 16px; }
    .admin-top { padding: 0 16px; }
}

@media (max-width: 640px) {
    .stat-grid { grid-template-columns: minmax(0, 1fr); }
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .page-head { flex-direction: column; }
    .admin-user .small { display: none; }
}

/* 依赖字段隐藏（如夜间时间仅在按时间段配色时出现） */
.form-row[hidden] { display: none !important; }
/* ============================================================ 设置页：Tab + 自动保存 */
.settings-tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  margin-bottom: 16px;
  max-width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.settings-tabs::-webkit-scrollbar { display: none; }

.settings-tabs .pill-tab {
  flex: 0 0 auto;
  padding: 7px 15px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .16s ease, color .16s ease, box-shadow .16s ease;
}
.settings-tabs .pill-tab:hover { color: var(--text); }
.settings-tabs .pill-tab.active {
  background: var(--surface);
  color: var(--brand);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(28, 34, 46, .1), 0 0 0 1px rgba(28, 34, 46, .04);
}

.settings-panel[hidden] { display: none; }

.autosave-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--muted);
  transition: color .16s;
}
.autosave-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-2);
  flex: 0 0 auto;
  transition: background-color .16s;
}
.autosave-status.is-dirty .autosave-dot { background: #f0a020; }
.autosave-status.is-saving .autosave-dot { background: #3366ff; animation: nb-pulse 1s ease-in-out infinite; }
.autosave-status.is-saved { color: #16a34a; }
.autosave-status.is-saved .autosave-dot { background: #16a34a; }
.autosave-status.is-error { color: #dc2626; }
.autosave-status.is-error .autosave-dot { background: #dc2626; }

@keyframes nb-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .3; }
}

.settings-savebar,
.autosave-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 6px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
}
.settings-savebar {
  position: sticky;
  bottom: 14px;
  z-index: 5;
}

.mail-test {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-2);
}
/* ============================================================ 顺序列表（侧边栏模块） */
.order-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 440px;
}
.order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
}
.order-row .checkbox-line { margin: 0; }
.order-actions { display: flex; gap: 4px; flex: 0 0 auto; }
.order-btn {
  width: 24px;
  height: 24px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  transition: color .16s, border-color .16s;
}
.order-btn:hover { color: var(--brand); border-color: var(--brand); }
/* ============================================================ 复选框组（侧边栏模块） */
.checks-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  max-width: 720px;
}
.checks-row .checkbox-line {
  margin: 0;
}
/* 面板标题不被右侧说明挤压换行 */
.panel-card__head { flex-wrap: wrap; row-gap: 4px; }
.panel-card__head h3 { flex: 0 0 auto; white-space: nowrap; }
.panel-card__head > .faint { flex: 1 1 320px; min-width: 0; }
.settings-savebar[hidden] { display: none !important; }
/* ============================================================ 数据备份：导入区 */
.backup-warn {
  margin: 12px 0 14px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: rgba(240, 160, 32, .12);
  border: 1px solid rgba(240, 160, 32, .35);
  color: #b56a00;
  font-size: 12.5px;
  line-height: 1.7;
}

.file-picker.is-drag {
  border-color: var(--brand);
  background: var(--brand-soft);
}
/* ============================================================ 文件选择区（备份导入） */
.file-picker {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 128px;
  padding: 20px 16px;
  border: 1.5px dashed var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  text-align: center;
  cursor: pointer;
  transition: border-color .18s, background-color .18s;
}
.file-picker:hover,
.file-picker.is-drag {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.file-picker .icon {
  width: 26px;
  height: 26px;
  color: var(--brand);
}
.file-picker__label {
  font-size: 13.5px;
  color: var(--text);
  word-break: break-all;
}
.file-picker__hint {
  font-style: normal;
  font-size: 11.5px;
  color: var(--faint);
  line-height: 1.6;
}
.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
/* 列表内联下拉（分类 / 状态直接切换） */
.select-sm {
  height: 30px;
  padding: 0 26px 0 8px;
  font-size: 12.5px;
  border-radius: 7px;
  max-width: 150px;
  cursor: pointer;
}
.select-sm:disabled { opacity: .6; cursor: default; }
/* ============================================================ 封面选择 */
.cover-picker { max-width: 380px; }
.cover-picker__preview {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 168px;
  padding: 12px;
  border: 1.5px dashed var(--line-2);
  border-radius: var(--r-md);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color .16s, background-color .16s;
  overflow: hidden;
}
.cover-picker__preview:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.cover-picker__preview img {
  max-width: 100%;
  max-height: 220px;
  border-radius: var(--r-sm);
  display: block;
  object-fit: cover;
}
.cover-picker__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--faint);
  font-size: 13px;
  text-align: center;
}
.cover-picker__empty[hidden] { display: none; }
.cover-picker__empty .icon {
  width: 26px;
  height: 26px;
  color: var(--muted);
}
.cover-picker__empty em {
  font-style: normal;
  font-size: 11.5px;
  color: var(--faint);
}
.cover-picker img[hidden] { display: none; }
/* 表格里的开关按钮（独立页面：导航显示） */
button.switch {
  border: 0;
  padding: 0;
  cursor: pointer;
  vertical-align: middle;
}
button.switch:disabled { opacity: .55; cursor: default; }
button.switch.on { background: var(--brand); }
button.switch.on::after { left: 19px; }
/* ============================================================ Markdown 编辑器（写文章） */
.md-editor { overflow: hidden; }

.md-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 12px 8px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.md-bar__label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
}

.md-tools { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }

.md-tool {
  min-width: 28px;
  height: 26px;
  padding: 0 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color .15s, color .15s;
}
.md-tool:hover { background: var(--brand-soft); color: var(--brand); }
.md-tool .icon { width: 15px; height: 15px; }

.md-sep {
  width: 1px;
  height: 16px;
  margin: 0 4px;
  background: var(--line-2);
}

.md-count {
  margin-left: auto;
  padding-right: 6px;
  font-size: 12px;
  color: var(--faint);
  white-space: nowrap;
}
.md-count b { font-weight: 600; color: var(--muted); }

.md-area {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 460px;
  padding: 18px 20px;
  border: 0;
  outline: none;
  resize: vertical;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.9;
  tab-size: 2;
}
.md-area::placeholder { color: var(--faint); }

.md-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px 10px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

/* 预览弹层 */
.md-preview {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
}
.md-preview[hidden] { display: none; }

.md-preview__mask {
  position: absolute;
  inset: 0;
  background: rgba(20, 26, 38, .45);
}

.md-preview__body {
  position: relative;
  width: min(860px, 100%);
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}

.md-preview__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  font-weight: 600;
}

.md-preview__content {
  padding: 20px 24px 28px;
  overflow-y: auto;
  font-size: 14.5px;
  line-height: 1.9;
}

.md-preview__content h1,
.md-preview__content h2,
.md-preview__content h3 { margin: 1.1em 0 .5em; line-height: 1.4; }
.md-preview__content h1:first-child,
.md-preview__content h2:first-child { margin-top: 0; }
.md-preview__content p { margin: 0 0 .8em; }
.md-preview__content ul,
.md-preview__content ol { margin: 0 0 .8em; padding-left: 22px; }
.md-preview__content img { max-width: 100%; border-radius: 8px; }
.md-preview__content blockquote {
  margin: 0 0 .8em;
  padding: 2px 14px;
  border-left: 3px solid var(--brand-line);
  color: var(--muted);
}
.md-preview__content code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface-2);
  font-size: 12.5px;
}
.md-preview__content pre {
  margin: 0 0 .8em;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--surface-2);
  overflow-x: auto;
}
.md-preview__content pre code { background: none; padding: 0; }
.md-preview__content table { border-collapse: collapse; margin-bottom: .8em; }
.md-preview__content th,
.md-preview__content td { border: 1px solid var(--line); padding: 6px 10px; }
/* 页面头部：上传安装包 */
.upload-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.file-picker--mini {
  flex-direction: row;
  min-height: 0;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  gap: 8px;
  min-width: 240px;
}
.file-picker--mini .icon { width: 16px; height: 16px; }
.file-picker--mini .file-picker__label { font-size: 12.5px; }
/* 上传进度条（替代安装按钮） */
.upload-progress {
  position: relative;
  width: 180px;
  height: 30px;
  border-radius: var(--r-pill);
  background: var(--brand-soft);
  overflow: hidden;
}
.upload-progress[hidden] { display: none; }

.upload-progress__bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: var(--brand);
  opacity: .28;
  transition: width .18s ease;
}

.upload-progress__text {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  letter-spacing: .02em;
}

/* ============================================================ 应用商店 */
.store-head-actions { display: flex; align-items: center; gap: 10px; }
.store-head-actions form { margin: 0; }

.store-online {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
}
.store-online i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line-2);
}
.store-online.is-on {
  background: rgba(22, 163, 74, .1);
  color: #15803d;
}
.store-online.is-on i { background: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, .15); }

.store-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
}
.store-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}
.store-filter .input { max-width: 240px; }
.store-filter .select { max-width: 130px; }
.store-toolbar__count {
  font-size: 12.5px;
  color: var(--faint);
  white-space: nowrap;
}

.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.store-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 15px 16px 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color .16s, box-shadow .16s, transform .16s;
}
.store-card:hover {
  border-color: var(--brand-line);
  box-shadow: 0 14px 30px -22px rgba(20, 30, 60, .5);
  transform: translateY(-1px);
}

.store-card__top { display: flex; align-items: flex-start; gap: 11px; }

.store-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, #e6ecff, #d3ddff);
  color: #3b55c9;
  font-weight: 700;
  font-size: 16px;
}
.store-icon img { width: 100%; height: 100%; object-fit: cover; }

.store-card__head { min-width: 0; flex: 1; }
.store-card__name {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.store-card__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
}
.store-type {
  padding: 0 7px;
  border-radius: 5px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11px;
  line-height: 1.7;
}
.store-dot { color: var(--line-2); }
.store-rating { color: #d99b2a; }

.store-card__desc {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}

.store-card__tags { display: flex; flex-wrap: wrap; gap: 5px; }
.store-tag {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--faint);
  font-size: 11px;
  line-height: 1.7;
}

.store-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}
.store-card__actions { display: flex; align-items: center; gap: 6px; }

.store-state {
  font-size: 11.5px;
  color: var(--faint);
  white-space: nowrap;
}
.store-state.is-installed { color: #15803d; }
.store-state.is-update { color: #b45309; }

.store-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 4px 0 16px;
}

.store-hint {
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--faint);
  font-size: 12px;
  line-height: 1.8;
}

/* 正文插图：上传状态提示 */
.md-upload-tip {
  font-size: 12px;
  line-height: 1.7;
  white-space: nowrap;
}
.md-upload-tip[hidden] { display: none; }

/* 速查弹窗保留换行 */
.ui-dialog__text { white-space: pre-line; }

/* ---------------------------------------------------------------- Markdown 编辑器增强 */
.md-tool[data-md-insert="h1"],
.md-tool[data-md-insert="h2"],
.md-tool[data-md-insert="h3"] {
  width: 30px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.md-tool.is-active {
  background: var(--brand-soft, #eef2ff);
  color: var(--brand, #3366ff);
}

/* 草稿提示条 */
.md-draft-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding: 9px 12px;
  border: 1px solid #f3e3c3;
  border-radius: 10px;
  background: #fdf8ec;
  color: #8a5a00;
  font-size: 12.5px;
}
.md-draft-bar .btn { height: 26px; padding: 0 10px; font-size: 12px; }

/* 专注模式：编辑器铺满视口 */
body.md-focus-on { overflow: hidden; }

.md-editor.is-focus {
  position: fixed;
  inset: 16px;
  z-index: 90;
  margin: 0;
  display: flex;
  flex-direction: column;
  box-shadow: 0 40px 90px -40px rgba(16, 24, 40, .55);
}

.md-editor.is-focus .md-area {
  flex: 1;
  height: auto;
  min-height: 0;
  resize: none;
  font-size: 14.5px;
  line-height: 1.9;
}

.md-editor.is-focus .md-foot { flex: 0 0 auto; }

@media (max-width: 720px) {
  .md-editor.is-focus { inset: 6px; }
}

/* 输入框 + 右侧按钮（站点域名自动识别） */
.input-with-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 460px;
}
.input-with-btn .input { flex: 1; min-width: 0; }
.input-with-btn .btn { flex: 0 0 auto; white-space: nowrap; }


/* ---------------------------------------------------------------- 内容管理：批量操作 */
.batch-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin: 0 0 12px;
  border: 1px solid #dbe3ff;
  border-radius: 10px;
  background: #f5f8ff;
}

.batch-bar[hidden] { display: none; }

.batch-bar__count {
  font-size: 12.5px;
  font-weight: 600;
  color: #3366ff;
  white-space: nowrap;
}

.batch-bar .select { min-width: 150px; }
.batch-bar .select[hidden] { display: none; }

/* 勾选列 */
.table th.check,
.table td.check {
  width: 40px;
  padding-left: 14px;
  padding-right: 4px;
  text-align: center;
}

.table th.check input,
.table td.check input {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: #3366ff;
  vertical-align: middle;
}

/* 选中行高亮 */
.table tbody tr.is-checked td { background: #f6f9ff; }

  /* ---------------------------------------------------------------- 应用商店：安装 / 启用状态 */
  .btn.is-done,
  .btn.is-done:hover {
    background: #e9f8ec;
    border-color: #b7e4c7;
    color: #2a8f45;
    cursor: default;
    opacity: 1;
  }

  /* 按钮内的小转圈（颜色跟随按钮文字） */
  .btn-spinner {
    display: inline-block;
    width: 11px;
    height: 11px;
    margin-right: 5px;
    border: 1.5px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    vertical-align: -1px;
    animation: nb-spin .68s linear infinite;
  }

  .store-state.is-active { color: #15803d; }

  /* ---------------------------------------------------------------- 应用商店：分区 + 主题缩略图 */
  .store-section { margin-bottom: 26px; }
  .store-section:last-of-type { margin-bottom: 8px; }

  .store-section__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 2px 12px;
  }

  .store-section__head h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
  }

  .store-section__head h3 span { margin-left: 5px; font-weight: 400; }

  /* 主题区：宽卡，3 列左右 */
  .store-grid--theme {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
  }

  /* 插件区：保持小图标卡，4-5 列 */
  .store-grid--plugin {
    grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
    gap: 16px;
  }

  /* -------------------------------------------------- 带缩略图的大卡 */
  .store-card--thumb {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .store-card--thumb .store-card__cover {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #eef2f0;
    border-bottom: 1px solid var(--line);
  }

  .store-card--thumb .store-card__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    transition: transform .32s ease;
  }

  .store-card--thumb:hover .store-card__cover img { transform: scale(1.03); }

  .store-card--thumb .store-card__body {
    display: flex;
    flex-direction: column;
    gap: 9px;
    flex: 1;
    padding: 13px 15px 14px;
  }

  .store-card--thumb .store-card__desc { -webkit-line-clamp: 2; }

  @media (max-width: 900px) {
    .store-grid--theme { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
    .store-grid--plugin { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 13px; }
  }

  @media (max-width: 600px) {
    .store-grid--theme { grid-template-columns: 1fr; }
    .store-card--thumb .store-card__desc { display: none; }
  }

  /* ---------------------------------------------------------------- 插件页：运行中标记 */
  .store-tag.is-on {
    background: #e9f8ec;
    color: #2a8f45;
    font-weight: 500;
  }

  .store-card.is-running {
    border-color: #cdebdd;
  }

  .store-card.is-running .store-icon {
    background: #e9f8ec;
    color: #2a8f45;
  }

  /* 插件页底部按钮较多（启用/停用 + 设置 + 删除），允许折行 */
  .store-card__foot {
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .store-card__actions {
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
  }

  /* 插件页卡片稍微放宽 */
  .store-grid--plugin {
    grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  }

  /* -------------------------------------------------- 插件管理页：状态单独占一行 */
  /* 状态文字（含版本号）和按钮分两行，避免「已启用 v1.0.0」和按钮挤在一起 */
  .store-grid--manage .store-card__foot {
    flex-direction: column;
    align-items: stretch;
    gap: 9px;
    padding-top: 11px;
  }

  .store-grid--manage .store-card__foot .store-state {
    display: block;
    font-size: 11.5px;
    line-height: 1.5;
  }

  .store-grid--manage .store-card__actions {
    justify-content: flex-start;
    gap: 7px;
    width: 100%;
  }

  .store-grid--manage .store-card__actions .btn { flex: 0 0 auto; }

  @media (max-width: 900px) {
    .store-grid--plugin { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  }

  /* ---------------------------------------------------------------- 登录验证码（失败 3 次后出现） */
  .auth-field--captcha .auth-captcha__q {
    flex: 0 0 auto;
    padding: 0 10px 0 2px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .5px;
    color: var(--text, #1f2937);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
  }

  .auth-field--captcha input {
    letter-spacing: 2px;
  }

/* 付费应用未授权：状态行标黄 */
.store-state.is-paid{color:#b45309;font-weight:600}
/* 付费未安装：显示价格 + 去商城购买 */
.store-price{font-size:12.5px;font-weight:600;color:#b45309;white-space:nowrap}
.store-card:has(.store-state.is-paid){border-color:#f3d9a4}

/* ============================================================ 商城授权 */
.license-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid #d9f0de;
  border-radius: var(--r-lg);
  background: #f4fbf6;
  margin-bottom: 16px;
}
.license-hero.is-warn { border-color: #fde8b8; background: #fffaf0; }
.license-hero.is-danger { border-color: #fbd9c9; background: #fff5f1; }
.license-hero__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #e9f8ec;
  color: #2a8f45;
}
.license-hero.is-warn .license-hero__icon { background: #fff1d6; color: #a66a00; }
.license-hero.is-danger .license-hero__icon { background: #fdeee6; color: var(--danger); }
.license-hero__icon svg { width: 22px; height: 22px; }
.license-hero__body { flex: 1; min-width: 0; }
.license-hero__title { color: var(--text); font-size: 14px; font-weight: 600; }
.license-hero__desc { margin-top: 3px; color: var(--muted); font-size: 12.5px; line-height: 1.65; }
.license-hero__desc strong { color: var(--text); font-weight: 600; }
.license-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.license-stat { padding: 12px 14px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-card); }
.license-stat__label { color: var(--muted); font-size: 12px; }
.license-stat__value { margin-top: 4px; color: var(--text); font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.license-stat__value.is-ok { color: #2a8f45; }
.license-stat__value.is-warn { color: #a66a00; }
.license-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 20px; }
.license-meta__item { min-width: 0; }
.license-meta__label { display: block; margin-bottom: 4px; color: var(--faint); font-size: 12px; }
.license-meta__value { color: var(--text-2); font-size: 13.5px; word-break: break-all; }
.license-meta__value code {
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  font-size: 12px;
}
.license-type {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11.5px;
}
.license-type.is-plugin { background: #f4f0ff; color: #7c5cff; }
.license-app { display: flex; align-items: center; gap: 10px; min-width: 0; }
.license-app__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #f2f5ff;
  color: var(--brand);
  font-size: 14px;
  font-weight: 600;
}
.license-app__icon.is-plugin { background: #f4f0ff; color: #7c5cff; }
.license-app__name { color: var(--text); font-size: 13px; font-weight: 600; }
.license-app__meta { margin-top: 2px; color: var(--faint); font-size: 11.5px; }
.license-empty {
  padding: 26px 16px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r-md);
  background: var(--surface-2);
  text-align: center;
}
.license-empty strong { display: block; margin-bottom: 4px; color: var(--text); font-size: 13.5px; }
.license-empty span { color: var(--muted); font-size: 12px; line-height: 1.7; }
.license-hint {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--brand-soft);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
.license-hint svg { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 2px; color: var(--brand); }
.license-hint code { padding: 1px 5px; border-radius: 4px; background: rgba(51, 102, 255, .08); color: var(--brand); font-size: 11.5px; }
@media (max-width: 720px) {
  .license-hero { align-items: flex-start; flex-wrap: wrap; }
  .license-stats { grid-template-columns: 1fr; }
  .license-meta { grid-template-columns: 1fr; }
}

/* 主题设置：图片字段 / 分类多选 */
.image-field { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; max-width: 640px; }
.image-field .input { flex: 1 1 260px; }
.image-field__actions { display: flex; gap: 6px; }
.image-field__preview { flex: 0 0 100%; }
.image-field__preview img { max-width: 220px; max-height: 120px; border-radius: 8px; border: 1px solid var(--border, #e5e7eb); object-fit: cover; }
.category-checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.category-checks .checkbox-line { margin: 0; }

/* ============================================================ 分类页美化 */
.cat-name { gap: 10px; }

.cat-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 12px;
    font-weight: 600;
}

.slug-code {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 6px;
    background: var(--surface-2);
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11.5px;
}

.cat-count {
    display: inline-flex;
    justify-content: center;
    min-width: 26px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 11.5px;
}

#category-form { scroll-margin-top: 80px; }

/* ============================================================ 导航菜单卡片 */
.nav-manager { scroll-margin-top: 80px; }

.nav-manager__head {
    align-items: flex-start;
    padding: 16px 18px;
}

.nav-manager__heading {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}

.nav-manager__logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: var(--brand-soft);
    color: var(--brand);
}

.nav-manager__heading h3 { margin: 0; font-size: 15px; }
.nav-manager__heading p { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }

.nav-manager__stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.nav-stat {
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.nav-stat b { color: var(--text); font-weight: 600; }
.nav-stat.is-warn { background: #fff6e5; color: #a66a00; }
.nav-stat.is-warn b { color: #a66a00; }

.nav-manager__body { padding: 18px; }

.nav-manager__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 16px;
    align-items: start;
}

.nav-list-panel {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
}

.nav-list-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
    font-size: 12.5px;
    font-weight: 600;
}

.nav-table { font-size: 13px; }
.nav-table thead th { padding: 10px 14px; }
.nav-table tbody td { padding: 10px 14px; vertical-align: middle; }

.nav-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.nav-cell__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--brand-soft);
    color: var(--brand);
}

.nav-cell__main { min-width: 0; }

.nav-cell__title {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.nav-cell__title a { font-weight: 600; color: var(--text); }
.nav-cell__title a:hover { color: var(--brand); }

.nav-cell__url {
    max-width: 300px;
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--faint);
    font-size: 11.5px;
}

.nav-row--child .nav-cell { padding-left: 20px; }
.nav-row--child .nav-cell::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--line);
}

.nav-row--child .nav-cell { position: relative; }
.nav-tree-mark { color: var(--faint); font-family: monospace; }

.nav-row.is-muted .nav-cell__icon,
.nav-row.is-muted .nav-cell__title a,
.nav-row.is-muted .nav-cell__url,
.nav-row.is-muted .nav-type { opacity: .55; }

.nav-type {
    display: inline-flex;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.nav-type--category { background: #eef6ff; color: #2f6fb3; }
.nav-type--page { background: #f2f0ff; color: #6749b8; }
.nav-type--custom { background: #fff4e8; color: #a66a00; }

.nav-act { color: var(--muted); font-size: 13px; }

.nav-form-card {
    position: sticky;
    top: 16px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
}

.nav-form-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, var(--surface-2), var(--surface));
}

.nav-form-card__eyebrow {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--brand);
}

.nav-form-card__head h3 { margin-top: 3px; font-size: 15px; }
.nav-form-card__body { padding: 16px; }
.nav-form-card .form-row { margin-bottom: 13px; }

.nav-form-section {
    margin: 2px 0 12px;
    color: var(--faint);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.nav-form-section:not(:first-child) {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px dashed var(--line);
}

.nav-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 12px;
}

.nav-form-submit { margin-top: 6px; }

@media (max-width: 1200px) {
    .nav-manager__grid { grid-template-columns: minmax(0, 1fr) 330px; }
}

@media (max-width: 1023px) {
    .nav-manager__head { flex-direction: column; }
    .nav-manager__stats { justify-content: flex-start; }
    .nav-manager__grid { grid-template-columns: 1fr; }
    .nav-form-card { position: static; }
    .nav-cell__url { max-width: 100%; }
}

@media (max-width: 600px) {
    .nav-manager__body { padding: 14px; }
    .nav-form-grid { grid-template-columns: 1fr; }
    .nav-table thead th:nth-child(2),
    .nav-table tbody td:nth-child(2) { display: none; }
}

/* 分类页：双列独立堆叠，导航菜单填入分类列表下方空白 */
.cat-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 16px;
    align-items: start;
}

.cat-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.nav-manager__head { flex-wrap: wrap; gap: 10px; }

.nav-list-panel__tools {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-manager .nav-table { margin: 0; }

.nav-form-card { position: static; }

@media (max-width: 1023px) {
    .cat-layout { grid-template-columns: 1fr; }
}

/* ============================================================ 页面级 Tab */
.page-tabs { display: flex; width: max-content; margin-bottom: 16px; }

.page-tabs .pill-tab {
    height: 36px;
    padding: 0 16px;
    font-size: 13px;
}

.page-tabs .pill-tab .count {
    padding: 1px 7px;
    font-size: 11.5px;
}

.tab-panel[hidden] { display: none !important; }

/* 设置页 Tab 统一细节 */
.settings-tabs {
    gap: 3px;
    padding: 4px;
    border-radius: 14px;
}

.settings-tabs .pill-tab {
    height: 34px;
    padding: 0 15px;
    border-radius: 10px;
    font-size: 13px;
}

.settings-tabs .pill-tab:hover {
    background: var(--brand-soft);
    color: var(--brand);
}

.settings-tabs .pill-tab.active {
    background: linear-gradient(135deg, var(--brand), var(--brand-hover));
    color: #fff;
    font-weight: 600;
    box-shadow: var(--shadow-brand);
}

/* 导航表单：按类型只显示对应字段 */
.nav-form-card [data-nav-ref-field][hidden],
.nav-form-card [data-nav-custom-field][hidden] { display: none !important; }

/* 分类列表：二级分类 */
.cat-row--child .cat-name {
    position: relative;
    padding-left: 24px;
}

.cat-row--child .cat-name::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--line);
}

.cat-tree-mark {
    color: var(--faint);
    font-family: monospace;
}

/* 导航：分类二级自动项 */
.nav-row--auto {
    background: rgba(69, 182, 247, .04);
}

.nav-row--auto .nav-cell__title {
    color: var(--text-soft, #64748b);
}

.nav-auto-status {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(69, 182, 247, .12);
    color: #2b8fc4;
    font-size: 12px;
    white-space: nowrap;
}

.nav-auto-status.is-off {
    background: rgba(148, 163, 184, .16);
    color: var(--faint);
}

.badge-warning {
    background: rgba(245, 158, 11, .14);
    color: #b45309;
}
