/* ============================================================
   Solo Admin UI v7 — 标准后台表格 / 表单
   ============================================================ */
:root {
    --primary: #1677ff;
    --primary-hover: #4096ff;
    --primary-bg: #e6f4ff;
    --success: #52c41a;
    --warning: #fa8c16;
    --error: #ff4d4f;
    --error-bg: #fff2f0;
    --success-bg: #f6ffed;
    --text: rgba(0, 0, 0, 0.88);
    --text-2: rgba(0, 0, 0, 0.65);
    --text-3: rgba(0, 0, 0, 0.45);
    --border: #f0f0f0;
    --border-2: #d9d9d9;
    --bg: #f0f2f5;
    --bg-white: #fff;
    --sider: #001529;
    --sider-w: 220px;
    --header-h: 48px;
    --radius: 8px;
    --space-xs: 8px;
    --space-sm: 12px;
    --space-md: 16px;
    --space-lg: 24px;
    --row-h: 54px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
            Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

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

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

code {
    font-family: var(--mono);
    font-size: 0.85em;
    padding: 2px 6px;
    background: #fafafa;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: #c41d7f;
}

.text-muted { color: var(--text-2); }
.text-strong { font-weight: 600; color: var(--text); }
.required { color: var(--error); }

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 15px;
    font-size: 14px;
    font-family: inherit;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn-default { background: #fff; border-color: var(--border-2); color: var(--text); }
.btn-default:hover { color: var(--primary); border-color: var(--primary); }
.btn-danger { background: var(--error); border-color: var(--error); color: #fff; }
.btn-link-danger { background: none; border: none; color: var(--error); padding: 0 4px; height: auto; }
.btn-link-danger:hover { color: #ff7875; }
.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    padding: 0 4px;
    height: auto;
    cursor: pointer;
    font-family: inherit;
}
.btn-link:hover { color: var(--primary-hover); }
.btn-sm { height: 24px; padding: 0 8px; font-size: 12px; }
.btn-block { width: 100%; }

/* ===== Alerts ===== */
.alert {
    padding: 10px 16px;
    border-radius: 6px;
    margin-bottom: var(--space-md);
    border: 1px solid transparent;
    line-height: 22px;
}
.alert-success { background: var(--success-bg); border-color: #b7eb8f; color: #389e0d; }
.alert-error { background: var(--error-bg); border-color: #ffccc7; color: #cf1322; }

/* ============================================================
   Login
   ============================================================ */
.login-body {
    min-height: 100vh;
    background: linear-gradient(160deg, #e6f4ff 0%, #f0f2f5 50%, #f0f2f5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-wrapper { width: 100%; max-width: 400px; padding: var(--space-lg); }
.login-box {
    background: #fff;
    border-radius: var(--radius);
    padding: 40px 36px 32px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}
.login-header { text-align: center; margin-bottom: 28px; }
.login-logo {
    display: inline-flex;
    width: 48px; height: 48px;
    align-items: center; justify-content: center;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-size: 22px; font-weight: 700;
    margin-bottom: 16px;
}
.login-header h1 { font-size: 22px; font-weight: 600; margin: 0 0 6px; line-height: 30px; }
.login-header p { font-size: 13px; color: var(--text-3); margin: 0; }
.login-form .form-field { margin-bottom: 18px; }
.login-form .input { height: 40px; }
.btn-login { height: 40px; margin-top: 4px; }
.login-copyright { text-align: center; margin-top: 16px; font-size: 12px; color: var(--text-3); }

/* ============================================================
   Layout Shell
   ============================================================ */
.pro-layout { display: flex; min-height: 100vh; }

.pro-sider {
    width: var(--sider-w);
    background: var(--sider);
    position: fixed; top: 0; left: 0; bottom: 0;
    z-index: 100;
    display: flex; flex-direction: column;
}
.pro-sider-logo {
    display: flex; align-items: center; gap: 10px;
    height: var(--header-h);
    padding: 0 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.pro-sider-logo-icon {
    width: 28px; height: 28px;
    border-radius: 6px;
    background: var(--primary);
    color: #fff;
    font-size: 14px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.pro-sider-logo-title { font-size: 15px; font-weight: 600; color: #fff; }

.pro-menu {
    list-style: none;
    padding: 8px;
    flex: 1;
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.pro-menu li { margin-bottom: 4px; }
.pro-menu a {
    display: block;
    height: 40px; line-height: 40px;
    padding: 0 16px;
    border-radius: 6px;
    color: rgba(255,255,255,0.65);
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s;
}
.pro-menu a:hover { color: #fff; background: rgba(255,255,255,0.08); }
.pro-menu li.active a { color: #fff; background: var(--primary); }
.pro-menu-section {
    margin: 12px 8px 4px;
    padding: 0 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.45);
    list-style: none;
}

.pro-main {
    flex: 1;
    margin-left: var(--sider-w);
    display: flex; flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}
.pro-header {
    display: flex; align-items: center; justify-content: space-between;
    height: var(--header-h);
    padding: 0 var(--space-lg);
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 99;
}
.pro-breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-3); line-height: 22px; }
.pro-breadcrumb .sep { color: var(--border-2); }
.pro-breadcrumb .current { color: var(--text); font-weight: 500; }
.pro-header-right { display: flex; align-items: center; gap: 16px; }
.pro-user-name { font-size: 14px; color: var(--text-2); }
.pro-logout {
    font-size: 13px; color: var(--text-2);
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    text-decoration: none;
}
.pro-logout:hover { color: var(--error); border-color: #ffccc7; background: var(--error-bg); }

.pro-content {
    flex: 1;
    padding: var(--space-lg);
    width: 100%;
}
.pro-footer {
    padding: 12px var(--space-lg);
    text-align: center;
    font-size: 12px;
    color: var(--text-3);
    background: #fff;
    border-top: 1px solid var(--border);
    line-height: 20px;
}

/* ============================================================
   Page Header
   ============================================================ */
.page-section { max-width: 1200px; }
.page-section-wide { max-width: none; }
.page-header { margin-bottom: var(--space-lg); }
.page-header-with-actions {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-md);
    flex-wrap: wrap;
}
.discover-section-enabled,
.discover-group-enabled {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 12px;
    font-size: 13px;
    font-weight: normal;
    color: var(--text-2);
}
.page-title {
    font-size: 20px;
    font-weight: 600;
    line-height: 28px;
    margin: 0 0 8px;
    color: var(--text);
}
.page-desc {
    font-size: 14px;
    color: var(--text-2);
    margin: 0;
    line-height: 22px;
}

/* ============================================================
   Panel
   ============================================================ */
.panel {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: var(--space-md);
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.panel-head {
    display: flex;
    align-items: center;
    min-height: 52px;
    padding: 12px var(--space-lg);
    border-bottom: 1px solid var(--border);
    background: #fafafa;
    gap: 12px;
}
.panel-head-between { justify-content: space-between; }
.panel-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    line-height: 24px;
}
.panel-extra { font-size: 13px; color: var(--text-2); line-height: 22px; }
.panel-body { padding: var(--space-lg); }
.panel-body-zero { padding: 0; }
.panel-body-code { padding: 0; background: #fafafa; }
.panel-highlight {
    border-color: #c7d2fe;
    box-shadow: 0 0 0 1px rgba(76, 82, 255, 0.08), 0 4px 16px rgba(76, 82, 255, 0.06);
}
.panel-highlight .panel-head {
    background: linear-gradient(180deg, #f5f6ff 0%, #fafafa 100%);
}

.manifest-section-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: var(--space-md);
}
.manifest-section-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    color: var(--text-2);
    font-size: 13px;
    text-decoration: none;
}
.manifest-section-nav a:hover {
    color: var(--primary);
    border-color: #c7d2fe;
    background: #f8f9ff;
}

.apk-upload-progress {
    margin: 0 0 16px;
}

.apk-upload-progress-track {
    height: 8px;
    border-radius: 999px;
    background: #eef2ff;
    overflow: hidden;
}

.apk-upload-progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #4c52ff 0%, #6366f1 100%);
    transition: width 0.15s ease;
}

.apk-upload-progress-text {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-2);
}

#apk-upload-form.is-submitting .apk-upload-progress {
    display: block;
}

.apk-download-url-field {
    margin-bottom: 16px;
}

.apk-download-url-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.apk-download-url-row .input {
    flex: 1 1 auto;
    min-width: 0;
}

.apk-download-url-row .btn.is-copied {
    color: #059669;
    border-color: #6ee7b7;
    background: #ecfdf5;
}

/* ============================================================
   Data Table — 标准列表表格
   ============================================================ */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    font-size: 14px;
    background: #fff;
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
    line-height: 22px;
    word-break: break-word;
}

.data-table thead th {
    background: #fafafa;
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
    white-space: nowrap;
    border-bottom: 1px solid var(--border-2);
    padding: 13px 16px;
    position: sticky;
    top: 0;
    z-index: 1;
}

.data-table tbody tr:hover td { background: #fafafa; }
.data-table tbody tr:last-child td { border-bottom: none; }

/* 带边框表格 */
.data-table-bordered {
    border: 1px solid var(--border);
    border-radius: 0;
}
.data-table-bordered th,
.data-table-bordered td {
    border-right: 1px solid var(--border);
}
.data-table-bordered th:last-child,
.data-table-bordered td:last-child {
    border-right: none;
}

/* 斑马纹 */
.data-table-striped tbody tr:nth-child(even) td {
    background: #fafafa;
}
.data-table-striped tbody tr:nth-child(even):hover td {
    background: #f5f5f5;
}

/* 列宽 */
.col-index { width: 64px; text-align: center !important; }
.col-time { width: 172px; }
.col-contact { width: 140px; }
.col-content { width: auto; min-width: 200px; }
.col-version { width: 136px; }
.col-channel { width: 96px; }
.col-device { width: 150px; }
.col-ip { width: 132px; }
.col-action { width: 88px; text-align: center !important; }

.cell-index {
    color: var(--text-3);
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.cell-muted { color: var(--text-2); }
.cell-nowrap { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-content {
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.65;
    vertical-align: top;
    padding-top: 16px;
    padding-bottom: 16px;
}

.badge {
    display: inline-block;
    padding: 0 8px;
    font-size: 12px;
    line-height: 22px;
    border-radius: 4px;
    border: 1px solid var(--border-2);
    background: #fafafa;
    color: var(--text-2);
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
.badge-blue {
    background: var(--primary-bg);
    border-color: #91caff;
    color: var(--primary);
}
.badge-green {
    background: var(--success-bg);
    border-color: #b7eb8f;
    color: #389e0d;
}
.badge-gray {
    background: #fafafa;
    border-color: var(--border-2);
    color: var(--text-3);
}
.badge-orange {
    background: #fff7e6;
    border-color: #ffd591;
    color: #d46b08;
}

.table-toolbar-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
}
.inline-form {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}
.inline-form label {
    font-size: 13px;
    color: var(--text-2);
}
.inline-form select {
    min-width: 120px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid var(--border-2);
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
}

/* 崩溃列表：压缩次要列宽，放宽异常摘要，控制行高 */
.data-table-crash-list {
    font-size: 13px;
}
.data-table-crash-list th,
.data-table-crash-list td {
    padding: 7px 8px;
    line-height: 18px;
    vertical-align: middle;
}
.data-table-crash-list thead th {
    padding: 9px 8px;
    font-size: 12px;
}
.data-table-crash-list .col-index { width: 44px; }
.data-table-crash-list .col-count { width: 52px; text-align: center !important; }
.data-table-crash-list .col-time { width: 124px; }
.data-table-crash-list .col-status { width: 64px; }
.data-table-crash-list .col-exception { width: auto; min-width: 320px; }
.data-table-crash-list .col-user { width: 64px; }
.data-table-crash-list .col-version { width: 72px; }
.data-table-crash-list .col-channel { width: 44px; }
.data-table-crash-list .col-device { width: 88px; }
.data-table-crash-list .col-ip { width: 92px; }
.data-table-crash-list .col-action {
    width: 156px;
    text-align: left !important;
}
.data-table-crash-list tbody tr:hover td { background: #fafafa; }
.data-table-crash-list tbody tr.crash-row-fixed td { background: #f6ffed; }
.data-table-crash-list tbody tr.crash-row-fixed:hover td { background: #eefadf; }
.data-table-crash-list .badge-compact {
    padding: 0 6px;
    font-size: 11px;
    line-height: 18px;
}
.cell-time-compact { font-size: 12px; }
.cell-user-compact {
    max-width: 64px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
}
.cell-version-compact { font-size: 12px; }
.cell-channel-compact {
    max-width: 44px;
    font-size: 12px;
    text-align: center;
}
.cell-meta-compact {
    max-width: 88px;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cell-exception {
    max-width: 0;
}
.cell-exception-link {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    word-break: break-all;
    line-height: 1.35;
    font-size: 13px;
    color: var(--text);
}
.cell-exception-link:hover { color: var(--primary); }
.crash-action-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 4px;
}
.cell-count { text-align: center; }
.crash-count-badge {
    min-width: 28px;
    font-variant-numeric: tabular-nums;
}
.data-table-crash-occurrences th,
.data-table-crash-occurrences td {
    padding: 6px 8px;
}
.data-table-crash-occurrences tbody tr.crash-row-current td {
    background: #e6f4ff;
}

.crash-admin-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1200;
    max-width: 360px;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(24, 24, 27, 0.92);
    color: #fff;
    font-size: 13px;
    line-height: 1.45;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    pointer-events: none;
}
.crash-admin-toast.is-error {
    background: rgba(180, 35, 24, 0.95);
}
.crash-fix-panel .crash-fix-note {
    white-space: pre-wrap;
    word-break: break-word;
}
.crash-fix-files {
    margin: 0;
    padding-left: 18px;
}
.crash-fix-files li {
    margin: 4px 0;
}
.crash-fix-form-wrap {
    border-top: 1px solid var(--border);
    background: #fafafa;
}
.form-stack .form-label {
    display: block;
    margin: 12px 0 6px;
    font-size: 13px;
    color: var(--text-2);
}
.form-stack .form-label:first-child {
    margin-top: 0;
}
.form-stack .form-control {
    width: 100%;
    box-sizing: border-box;
}
.form-stack .form-actions {
    margin-top: 12px;
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: #fff;
    gap: 12px;
    line-height: 22px;
}
.table-toolbar-left { font-size: 14px; color: var(--text-2); }
.table-toolbar-right { font-size: 13px; color: var(--text-3); }

.table-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-2);
    border-top: 1px solid var(--border);
    background: #fafafa;
    line-height: 22px;
    gap: 8px;
}

/* 可编辑表格 */
.data-table-editable td { vertical-align: top; padding: 12px 14px; }
.data-table-editable .input { margin: 0; }
.data-table-editable textarea.input { min-height: 60px; }

/* ============================================================
   Description Table — 详情 / 摘要
   ============================================================ */
.desc-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}
.desc-table th,
.desc-table td {
    padding: 15px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    line-height: 22px;
    vertical-align: middle;
    text-align: left;
}
.desc-table th {
    width: 160px;
    background: #fafafa;
    color: var(--text-2);
    font-weight: 400;
    border-right: 1px solid var(--border);
}
.desc-table tr:last-child th,
.desc-table tr:last-child td { border-bottom: none; }
.desc-table td { color: var(--text); }

/* ============================================================
   Form
   ============================================================ */
.form-field { margin-bottom: 22px; }
.form-field:last-child { margin-bottom: 0; }
.form-field-narrow { max-width: 480px; }
.form-field-check { margin-bottom: 16px; }

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text);
    line-height: 22px;
}
.form-tip {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-3);
    line-height: 20px;
}
.check-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    line-height: 22px;
    cursor: pointer;
}
.check-label input { margin: 0; width: 16px; height: 16px; }

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

.input {
    display: block;
    width: 100%;
    padding: 7px 11px;
    font-size: 14px;
    line-height: 1.5715;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border-2);
    border-radius: 6px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.1);
}
textarea.input { min-height: 88px; resize: vertical; padding: 8px 11px; line-height: 1.6; }
.input-sm { padding: 5px 8px; font-size: 13px; }
.input-mono { font-family: var(--mono); font-size: 13px; }

.form-actions {
    margin: var(--space-md) 0 var(--space-lg);
    padding: 0;
}

.panel-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.secrets-form-sticky-actions {
    position: sticky;
    bottom: 0;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 16px 0 0;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 -6px 18px rgba(15, 23, 42, 0.06);
}

.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-size: 14px; }

/* ============================================================
   Dashboard
   ============================================================ */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}
.stat-item {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px var(--space-lg);
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
a.stat-item {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
a.stat-item:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(22, 119, 255, 0.12);
}
.stat-item.is-reveal-trigger {
    cursor: pointer;
    user-select: none;
}
.stat-item::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
}
.stat-blue::before { background: var(--primary); }
.stat-green::before { background: var(--success); }
.stat-orange::before { background: var(--warning); }
.stat-purple::before { background: #722ed1; }
.stat-red::before { background: var(--danger, #ff4d4f); }
.stat-label { font-size: 14px; color: var(--text-2); margin-bottom: 10px; line-height: 22px; }
.stat-num { font-size: 30px; font-weight: 600; line-height: 38px; color: var(--text); }
.stat-num-sm { font-size: 22px; line-height: 30px; }

.link-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}
.link-item {
    display: block;
    padding: 18px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s;
    min-height: 88px;
}
.link-item:hover { border-color: var(--primary); background: var(--primary-bg); }
.link-item-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 22px;
}
.link-item-desc {
    display: block;
    font-size: 12px;
    color: var(--text-3);
    line-height: 20px;
}
.link-item:hover .link-item-title { color: var(--primary); }

/* ============================================================
   Code Preview
   ============================================================ */
.code-preview {
    margin: 0;
    padding: var(--space-md) var(--space-lg);
    background: #1e1e2e;
    color: #cdd6f4;
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 420px;
    overflow: auto;
}

/* ============================================================
   Empty State
   ============================================================ */
.empty-block {
    padding: 64px var(--space-lg);
    text-align: center;
}
.empty-icon {
    font-size: 40px;
    line-height: 1;
    margin-bottom: 12px;
    opacity: 0.35;
}
.empty-title {
    font-size: 15px;
    color: var(--text-2);
    margin: 0 0 8px;
    line-height: 24px;
}
.empty-desc {
    font-size: 13px;
    color: var(--text-3);
    margin: 0;
    line-height: 22px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 992px) {
    .stat-grid { grid-template-columns: 1fr; }
    .link-grid { grid-template-columns: 1fr; }
    .form-grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .pro-sider { width: 64px; }
    .pro-sider-logo-title { display: none; }
    .pro-sider-logo { justify-content: center; padding: 0; }
    .pro-menu a {
        font-size: 11px;
        text-align: center;
        padding: 8px 4px;
        height: auto;
        line-height: 1.4;
    }
    .pro-main { margin-left: 64px; }
    .pro-content { padding: var(--space-md); }
    .pro-user-name { display: none; }
    .data-table { table-layout: auto; min-width: 960px; }
}

/* ============================================================
   Nav tag editor (新闻 / 热榜 / 早报)
   ============================================================ */
.nav-tag-editor-wrap { margin-bottom: var(--space-md); }
.nav-tag-section {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
}
.nav-tag-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 12px;
    margin-bottom: 12px;
}
.nav-tag-section-title { font-weight: 600; color: var(--text); }
.nav-tag-section-tip { font-size: 12px; color: var(--text-3); }
.nav-tag-section-actions { margin-top: 12px; }
.nav-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 40px;
    align-items: center;
}
.nav-tag-list-active {
    min-height: 52px;
    padding: 8px;
    background: #fafafa;
    border: 1px dashed var(--border-2);
    border-radius: 6px;
}
.nav-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 999px;
    font-size: 13px;
    line-height: 1;
    transition: box-shadow 0.15s, transform 0.15s;
}
.nav-tag-pool {
    border: 1px solid var(--border-2);
    background: #fff;
    color: var(--text);
    padding: 8px 14px;
    cursor: pointer;
}
.nav-tag-pool-item {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
.nav-tag-pool-remove {
    border: none;
    background: transparent;
    color: var(--text-3);
    font-size: 15px;
    line-height: 1;
    padding: 4px 6px;
    cursor: pointer;
    border-radius: 999px;
}
.nav-tag-pool-remove:hover { color: var(--error); background: #fef2f2; }
.nav-tag-pool:hover {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(22, 119, 255, 0.12);
}
.nav-tag-preset { border-color: #91caff; background: var(--primary-bg); }
.nav-tag-custom { border-style: dashed; }
.nav-tag-active {
    border: 1px solid #91caff;
    background: #fff;
    padding: 4px 6px 4px 4px;
    cursor: grab;
    user-select: none;
}
.nav-tag-active.is-selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.15);
}
.nav-tag-active.is-dragging { opacity: 0.55; }
.nav-tag-active.is-drag-over { box-shadow: inset 0 0 0 2px var(--primary); }
.nav-tag-active.is-disabled {
    opacity: 0.55;
    border-style: dashed;
    background: #fafafa;
}
.nav-tag-enable {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-2);
    margin-left: 4px;
    cursor: pointer;
    user-select: none;
}
.nav-tag-enable-cb { margin: 0; }
.nav-tag-handle {
    color: var(--text-3);
    font-size: 14px;
    padding: 4px 2px;
    cursor: grab;
}
.nav-config-subsection-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-1);
    margin: 0 0 0.75rem;
}
.daily-hot-drag-handle {
    color: var(--text-3);
    font-size: 16px;
    cursor: grab;
    user-select: none;
    padding: 4px 6px;
}
.daily-hot-table .col-drag { width: 36px; text-align: center; }
.daily-hot-row.is-dragging { opacity: 0.45; }
.daily-hot-row.is-drag-over { box-shadow: inset 0 0 0 2px var(--primary); }
.daily-hot-fetch-bar { align-items: end; }
.daily-hot-table-wrap { max-height: 70vh; overflow: auto; }
.daily-hot-page .col-check { width: 40px; text-align: center; }

.nav-tag-label {
    border: none;
    background: transparent;
    padding: 6px 8px;
    font: inherit;
    color: var(--text);
    cursor: pointer;
}
.nav-tag-label:hover { color: var(--primary); }
.nav-tag-remove {
    border: none;
    background: transparent;
    color: var(--text-3);
    font-size: 16px;
    line-height: 1;
    padding: 4px 6px;
    cursor: pointer;
}
.nav-tag-remove:hover { color: var(--error); }
.nav-tag-empty { font-size: 13px; color: var(--text-3); }
.nav-tag-empty-active { width: 100%; text-align: center; padding: 12px 0; }
.nav-tag-editor-panel {
    min-height: 80px;
}
.nav-tag-editor-empty {
    margin: 0;
    color: var(--text-3);
    font-size: 13px;
}
.nav-tag-editor-title {
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text);
}
.nav-tag-editor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px 16px;
}
.nav-tag-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.nav-tag-field-label { font-size: 12px; color: var(--text-2); }
.nav-tag-editor-actions {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-2);
}

/* ============================================================
   Nav config unified page
   ============================================================ */
.nav-config-page { padding-bottom: 88px; }

.nav-config-overview {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}
.nav-config-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: inherit;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.nav-config-stat:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(22, 119, 255, 0.1);
    transform: translateY(-1px);
    color: inherit;
}
.nav-config-stat-icon {
    font-size: 22px;
    line-height: 1;
    flex-shrink: 0;
}
.nav-config-stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-3);
    margin-bottom: 2px;
}
.nav-config-stat-value {
    display: block;
    font-size: 14px;
    color: var(--text);
}
.nav-config-stat--news { border-left: 3px solid #1677ff; }
.nav-config-stat--hot { border-left: 3px solid #fa8c16; }
.nav-config-stat--morning { border-left: 3px solid #52c41a; }
.nav-config-stat--cache { border-left: 3px solid #722ed1; }

.nav-config-tabs {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
    margin-bottom: var(--space-md);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.nav-config-tab {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 14px;
    border-radius: 999px;
    font-size: 13px;
    color: var(--text-2);
    background: #fafafa;
    border: 1px solid transparent;
    transition: all 0.15s;
}
.nav-config-tab:hover {
    color: var(--primary);
    background: var(--primary-bg);
}
.nav-config-tab.is-active {
    color: var(--primary);
    background: var(--primary-bg);
    border-color: #91caff;
    font-weight: 600;
}

.nav-config-module {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: var(--space-lg);
    overflow: hidden;
    scroll-margin-top: 72px;
}
.nav-config-module-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #fafafa 0%, #fff 100%);
}
.nav-config-module--news .nav-config-module-head { border-top: 3px solid #1677ff; }
.nav-config-module--hot .nav-config-module-head { border-top: 3px solid #fa8c16; }
.nav-config-module--morning .nav-config-module-head { border-top: 3px solid #52c41a; }
.nav-config-module--cache .nav-config-module-head { border-top: 3px solid #722ed1; }

.nav-config-module-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: #f5f5f5;
    border-radius: 10px;
    flex-shrink: 0;
}
.nav-config-module-meta { flex: 1; min-width: 0; }
.nav-config-module-title {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}
.nav-config-module-desc {
    margin: 0;
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.5;
}
.nav-config-module-badge {
    flex-shrink: 0;
    padding: 4px 10px;
    font-size: 12px;
    color: var(--primary);
    background: var(--primary-bg);
    border-radius: 999px;
    white-space: nowrap;
}
.nav-config-module-body {
    padding: 16px 20px 20px;
}

/* type 编码对照表 */
.nav-config-type-legend {
    margin: 0 0 var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #fafafa;
}
.nav-config-type-legend-summary {
    cursor: pointer;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    list-style: none;
}
.nav-config-type-legend-summary::-webkit-details-marker { display: none; }
.nav-config-type-legend-body {
    padding: 0 16px 16px;
    border-top: 1px dashed var(--border);
}
.nav-config-type-legend-intro {
    margin: 12px 0;
}
.nav-config-type-legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}
.nav-config-type-legend-title {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}
.nav-config-type-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.nav-config-type-table th,
.nav-config-type-table td {
    padding: 6px 8px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.nav-config-type-table th {
    background: #f5f5f5;
    font-weight: 600;
}
.nav-config-type-table tr:last-child td { border-bottom: none; }
.nav-config-type-table code {
    font-size: 11px;
    white-space: nowrap;
}

.nav-tag-type-hint {
    margin: 0 0 10px;
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--primary);
    background: var(--primary-bg);
    border-radius: var(--radius-sm);
}
.nav-tag-type-hint-muted {
    color: var(--text-secondary);
    background: #f5f5f5;
}
.nav-tag-field-tip {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    line-height: 1.4;
    color: var(--text-secondary);
}

.nav-config-cache-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px dashed var(--border);
}
.nav-config-cache-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.nav-config-savebar {
    position: fixed;
    left: var(--sider-w);
    right: 0;
    bottom: 0;
    z-index: 30;
    padding: 12px var(--space-lg);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
}
.nav-config-savebar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.nav-config-savebar-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.btn-lg {
    height: 40px;
    padding: 0 24px;
    font-size: 15px;
}

.nav-tag-editor-wrap--embedded { margin-bottom: 0; }
.nav-tag-editor--embedded .nav-tag-section {
    background: #fafafa;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px;
    margin-bottom: 12px;
}
.nav-tag-editor--embedded .nav-tag-section-editor {
    background: #fff;
}
.nav-tag-editor--embedded .nav-tag-list-active {
    background: #fff;
}

@media (max-width: 992px) {
    .nav-config-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
    .nav-config-overview { grid-template-columns: 1fr; }
    .nav-config-savebar { left: 64px; padding: 10px var(--space-md); }
    .nav-config-savebar-inner { flex-direction: column; align-items: stretch; }
    .nav-config-savebar-text { display: none; }
    .nav-config-module-head { flex-wrap: wrap; }
}

/* —— 配置环境（测试 / 正式）—— */
.env-banner {
    padding: 10px 24px;
    font-size: 13px;
    line-height: 1.5;
    border-bottom: 1px solid var(--border);
}
.env-banner-staging {
    background: #fff7e6;
    color: #ad6800;
}
.env-banner-prod {
    background: #fff1f0;
    color: #cf1322;
}
.env-switch-form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 12px;
}
.env-switch-label {
    font-size: 12px;
    color: var(--text-secondary);
}
.env-switch-select {
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--border);
}
.pro-env-link {
    margin-right: 12px;
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
}
.env-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}
.env-badge-staging { background: #fff7e6; color: #ad6800; }
.env-badge-prod { background: #f6ffed; color: #389e0d; }
.env-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.env-diff-list, .env-publish-list {
    margin: 0;
    padding-left: 20px;
}
.stat-sub {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* —— 发现/导航页配置 —— */
.discover-nav-page .discover-nav-overview {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}
.discover-nav-stat {
    flex: 1;
    min-width: 160px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
}
.discover-nav-stat-label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.discover-nav-stat strong {
    font-size: 22px;
    color: var(--primary);
}
.discover-nav-stat-sub {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}
.discover-nav-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    align-items: start;
}
@media (max-width: 1100px) {
    .discover-nav-layout { grid-template-columns: 1fr; }
}
.discover-nav-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.discover-nav-tab {
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
}
.discover-nav-tab.is-active {
    border-color: var(--primary);
    color: var(--primary);
    background: #e6f4ff;
}
.discover-nav-region.is-hidden { display: none; }
.discover-nav-section {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 12px;
}
.discover-nav-section summary {
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 8px;
}
.discover-site-row {
    display: grid;
    grid-template-columns: 1fr 1.4fr 1.2fr 36px;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}
.discover-group-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 14px;
    overflow: hidden;
}
.discover-group-head {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 10px 12px;
    background: #fafafa;
    border-bottom: 1px solid var(--border);
}
.discover-group-title { flex: 1; min-width: 140px; }
.discover-group-body { padding: 12px; }
.discover-group-section { margin-bottom: 12px; }
.discover-group-section-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
}
.discover-nav-savebar {
    position: sticky;
    bottom: 0;
    background: #fff;
    border-top: 1px solid var(--border);
    padding: 14px 0;
    margin-top: 20px;
    display: flex;
    gap: 12px;
    z-index: 5;
}
.discover-phone {
    width: 300px;
    margin: 0 auto;
    background: #1f1f1f;
    border-radius: 28px;
    padding: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.discover-phone-notch {
    width: 80px;
    height: 6px;
    background: #333;
    border-radius: 3px;
    margin: 4px auto 8px;
}
.discover-phone-screen {
    background: #f5f5f5;
    border-radius: 20px;
    min-height: 480px;
    max-height: 640px;
    overflow-y: auto;
    padding: 10px;
}
.discover-preview-toolbar {
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 0 10px;
    color: #333;
}
.discover-preview-apps {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin-bottom: 10px;
    padding-bottom: 4px;
}
.discover-preview-app {
    flex: 0 0 44px;
    text-align: center;
    font-size: 8px;
    color: #666;
}
.discover-preview-strip {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    margin-bottom: 12px;
}
.discover-preview-strip-item {
    flex: 0 0 42px;
    text-align: center;
    font-size: 7px;
    color: #666;
}
.discover-preview-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin: 0 auto 2px;
    border-radius: 7px;
    background: linear-gradient(135deg, #1677ff, #69b1ff);
    color: #fff;
    font-weight: 700;
    font-size: 11px;
}
.discover-preview-icon.sm {
    width: 24px;
    height: 24px;
    font-size: 10px;
    border-radius: 6px;
}
.discover-preview-group {
    background: #fff;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 10px;
}
.discover-preview-group-title {
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #222;
}
.discover-preview-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin-bottom: 8px;
}
.discover-preview-cell {
    text-align: center;
    font-size: 7px;
    color: #666;
    word-break: break-all;
}
.discover-preview-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.discover-preview-label {
    font-size: 9px;
    padding: 3px 6px;
    background: #f0f0f0;
    border-radius: 12px;
    color: #555;
}
.discover-preview-tip { text-align: center; margin-top: 10px; }
.discover-preview-logo-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin: 0 auto 2px;
    padding: 2px 3px;
    border-radius: 6px;
    background: #eef5ff;
    color: #1677ff;
    font-size: 7px;
    line-height: 1.1;
    word-break: break-all;
    text-align: center;
    font-weight: 600;
}
.discover-preview-logo-badge.is-fallback { background: #fff7e6; color: #ad6800; }
.discover-preview-icon-wrap { width: 28px; height: 28px; margin: 0 auto 2px; }
.discover-preview-img {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    object-fit: cover;
    display: block;
}
.discover-preview-title {
    display: block;
    font-size: 7px;
    color: #666;
    word-break: break-all;
}
.discover-preview-logo-id { display: none; }

/* —— 图标输入 + 实时预览 —— */
.admin-logo-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.admin-icon-preview {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.admin-logo-cell:not(.has-icon) .admin-icon-preview {
    opacity: 0.45;
}
.admin-logo-cell.has-icon .admin-icon-preview {
    border-color: var(--border-2);
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.admin-icon-thumb {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.admin-icon-letter {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-3);
}
.discover-site-logo-cell {
    min-width: 0;
}
.discover-site-logo-cell .input {
    flex: 1;
    min-width: 0;
}
.discover-site-row {
    grid-template-columns: minmax(100px, 1fr) minmax(140px, 1.4fr) minmax(220px, 1.8fr) 36px;
}
.data-table .admin-logo-cell {
    max-width: 280px;
}
.data-table .admin-logo-cell .input-sm {
    flex: 1;
    min-width: 120px;
}
.ai-catalog-table th:nth-child(3),
.ai-catalog-table td:nth-child(3) {
    min-width: 200px;
}

.admin-ajax-dialog {
    position: fixed;
    inset: 0;
    z-index: 10000;
}
.admin-ajax-dialog[hidden] {
    display: none !important;
    pointer-events: none !important;
}
.admin-ajax-dialog-mask {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}
.admin-ajax-dialog-panel {
    position: relative;
    z-index: 1;
    width: min(420px, calc(100vw - 32px));
    margin: 20vh auto 0;
    padding: 20px 22px 16px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 16px 48px rgba(15, 23, 42, 0.18);
}
.admin-ajax-dialog-panel.is-error .admin-ajax-dialog-title {
    color: #dc2626;
}
.admin-ajax-dialog-title {
    font-size: 16px;
    font-weight: 600;
    color: #15803d;
    margin-bottom: 10px;
}
.admin-ajax-dialog-message {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-2, #475569);
    white-space: pre-wrap;
    word-break: break-word;
}
.admin-ajax-dialog-actions {
    margin-top: 18px;
    text-align: right;
}
.feedback-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}
.feedback-attachment-link {
    display: inline-block;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 6px;
    overflow: hidden;
    line-height: 0;
}
.feedback-attachment-thumb {
    width: 72px;
    height: 72px;
    object-fit: cover;
    display: block;
}

/* —— 首页壁纸管理（客户端同构） —— */
.wallpaper-admin-page .wallpaper-studio {
    padding: 16px 18px 20px;
    background: #f7f7f8;
    border: 1px solid var(--border);
}
.wallpaper-studio-head {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.wallpaper-studio-title-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: baseline;
}
.wallpaper-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.wallpaper-batch-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
}
.wallpaper-batch-count {
    font-size: 13px;
    color: var(--text-secondary);
    margin-right: 4px;
}
.wallpaper-batch-bar .form-control-sm,
.wallpaper-batch-bar select.form-control {
    min-width: 160px;
    height: 32px;
    padding: 4px 8px;
    font-size: 13px;
}
.wallpaper-tabbar-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    border-bottom: 1px solid #e5e7eb;
}
.wallpaper-tabbar {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    flex: 1;
    padding-bottom: 0;
    scrollbar-width: thin;
}
.wallpaper-tab {
    flex: 0 0 auto;
    border: none;
    background: transparent;
    padding: 10px 14px 12px;
    font-size: 14px;
    color: #8a9199;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
}
.wallpaper-tab.is-active {
    color: #1a1a1a;
    font-weight: 600;
}
.wallpaper-tab.is-active::after {
    content: '';
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 0;
    height: 2px;
    background: #1a1a1a;
    border-radius: 1px;
}
.wallpaper-tab-add {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    padding: 0;
    margin-bottom: 6px;
}
.wallpaper-grid-wrap {
    min-height: 320px;
}
.wallpaper-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
@media (min-width: 900px) {
    .wallpaper-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
    .wallpaper-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.wallpaper-card {
    background: #e8ecf9;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.wallpaper-card:hover {
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}
.wallpaper-card.is-selected {
    border-color: #1677ff;
}
.wallpaper-card-check {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    width: 22px;
    height: 22px;
    background: rgba(255,255,255,.92);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.wallpaper-card-media {
    position: relative;
    aspect-ratio: 9 / 12;
    background: #dbe2f5;
}
.wallpaper-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.wallpaper-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8a9199;
    font-size: 13px;
}
.wallpaper-card-title {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 8px 10px 10px;
    background: rgba(0,0,0,.4);
    color: #fff;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wallpaper-card-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 1;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(22, 119, 255, 0.92);
    color: #fff;
}
.wallpaper-card-badge--chrome {
    top: 34px;
    background: rgba(0,0,0,.55);
}
.wallpaper-card-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    background: #fff;
    font-size: 11px;
    color: var(--text-secondary);
}
.wallpaper-card-meta code {
    font-size: 11px;
    word-break: break-all;
}
.wallpaper-empty {
    text-align: center;
    padding: 48px 16px;
    color: var(--text-secondary);
}
.wallpaper-empty p { margin-bottom: 12px; }

.wallpaper-modal[hidden] { display: none !important; }
.wallpaper-modal {
    position: fixed;
    inset: 0;
    z-index: 9000;
}
.wallpaper-modal-mask {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}
.wallpaper-modal-panel {
    position: relative;
    z-index: 1;
    width: min(720px, calc(100vw - 32px));
    max-height: min(80vh, 720px);
    overflow: auto;
    margin: 10vh auto 0;
    background: #fff;
    border-radius: 12px;
    padding: 18px 20px 16px;
    box-shadow: 0 16px 48px rgba(15, 23, 42, 0.18);
}
.wallpaper-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.wallpaper-modal-head h3 {
    margin: 0;
    font-size: 16px;
}
.wallpaper-cat-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0;
}
.wallpaper-cat-row {
    display: grid;
    grid-template-columns: 1.1fr 1.2fr 1.2fr 36px 36px 36px;
    gap: 6px;
    align-items: center;
}
.wallpaper-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.wallpaper-edit-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}
@media (max-width: 960px) {
    .wallpaper-edit-layout { grid-template-columns: 1fr; }
}
.wallpaper-edit-preview-frame {
    position: relative;
    aspect-ratio: 9 / 16;
    border-radius: 12px;
    overflow: hidden;
    background: #e8ecf9;
}
.wallpaper-edit-preview-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.wallpaper-edit-preview-frame img.is-empty {
    opacity: 0;
}
.wallpaper-edit-preview-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px 12px;
    background: rgba(0,0,0,.45);
    color: #fff;
    font-size: 13px;
}
.wallpaper-edit-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 14px;
}
.wallpaper-edit-fields .form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}
.wallpaper-edit-fields .form-field em {
    font-style: normal;
    color: #94a3b8;
    font-size: 12px;
}
.wallpaper-edit-fields .form-field-full { grid-column: 1 / -1; }
.wallpaper-edit-fields .form-field-check {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    grid-column: 1 / -1;
}
.wallpaper-edit-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}
.wallpaper-upload-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 720px) {
    .wallpaper-upload-row { grid-template-columns: 1fr; }
    .wallpaper-edit-fields { grid-template-columns: 1fr; }
    .wallpaper-cat-row {
        grid-template-columns: 1fr 1fr;
    }
}
.wallpaper-upload-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border: 1px dashed var(--border);
    border-radius: 10px;
    background: #fafafa;
}
.wallpaper-advanced summary.page-subtitle {
    list-style: none;
}
.wallpaper-advanced summary::-webkit-details-marker { display: none; }

.feedback-thread-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 4px 0 12px;
}
.feedback-thread-card {
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    padding: 16px;
    background: #fff;
}
.feedback-thread-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 6px;
}
.feedback-thread-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.feedback-thread-submeta {
    font-size: 12px;
    margin-bottom: 14px;
}
.feedback-timeline {
    position: relative;
    padding-left: 18px;
    margin-bottom: 16px;
}
.feedback-timeline::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: #e2e8f0;
}
.feedback-timeline-item {
    position: relative;
    margin-bottom: 14px;
}
.feedback-timeline-item:last-child {
    margin-bottom: 0;
}
.feedback-timeline-dot {
    position: absolute;
    left: -15px;
    top: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #94a3b8;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #cbd5e1;
}
.feedback-timeline-item.is-official .feedback-timeline-dot {
    background: #3b82f6;
}
.feedback-timeline-body {
    background: #f8fafc;
    border-radius: 10px;
    padding: 10px 12px;
}
.feedback-timeline-item.is-official .feedback-timeline-body {
    background: #eff6ff;
}
.feedback-timeline-label {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #334155;
}
.feedback-timeline-content {
    font-size: 14px;
    line-height: 1.55;
    color: #0f172a;
    white-space: pre-wrap;
    word-break: break-word;
}
.feedback-thread-actions {
    border-top: 1px solid var(--border, #e2e8f0);
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.feedback-reply-form textarea {
    width: 100%;
    margin-top: 6px;
    margin-bottom: 8px;
}
.feedback-thread-action-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
