/* ===========================================================
   TGHub — 自定义样式（配合 Bootstrap 5.3）
   控制台外壳 + 官网落地页 + 通用组件
   =========================================================== */

:root {
    --tg-brand: #2aabee;
    --tg-brand-dark: #1e90ca;
    --tg-brand-soft: rgba(42, 171, 238, .12);
    --tg-bg: #f4f6fa;
    --tg-surface: #ffffff;
    --tg-text: #1f2937;
    --tg-muted: #6b7280;
    --tg-border: #e6e9ef;
    --tg-sidebar: #111c2e;
    --tg-sidebar-2: #16233a;
    --tg-sidebar-text: #9fb0c7;
    --tg-radius: 12px;
    --tg-sidebar-w: 238px;
    --tg-topbar-h: 60px;
    --tg-shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
    --tg-shadow: 0 6px 24px rgba(16, 24, 40, .07);
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background: var(--tg-bg);
    color: var(--tg-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

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

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: #111827;
}

/* ---------------- 侧边栏 ---------------- */

.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--tg-sidebar-w);
    background: var(--tg-sidebar);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 1035;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    height: var(--tg-topbar-h);
    padding: 0 18px;
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: .3px;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    flex: 0 0 auto;
}

.app-brand:hover {
    color: #fff;
}

.app-brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--tg-brand), #1d6fd0);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    flex: 0 0 auto;
}

.app-brand-text small {
    display: block;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 1px;
    color: var(--tg-sidebar-text);
    text-transform: uppercase;
}

.app-nav {
    padding: 14px 12px 26px;
    flex: 1 1 auto;
}

.app-nav-title {
    padding: 14px 10px 7px;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 600;
}

.app-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    margin-bottom: 2px;
    border-radius: 9px;
    color: var(--tg-sidebar-text);
    font-size: 14px;
    transition: background-color .15s ease, color .15s ease;
}

.app-nav-link:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
}

.app-nav-link.active {
    background: var(--tg-sidebar-2);
    color: #fff;
    box-shadow: inset 3px 0 0 var(--tg-brand);
}

.app-nav-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    opacity: .9;
}

.app-nav-link.active .app-nav-icon {
    opacity: 1;
    color: var(--tg-brand);
}

.app-sidebar-foot {
    flex: 0 0 auto;
    padding: 12px 18px 16px;
    font-size: 11px;
    color: #52627a;
    border-top: 1px solid rgba(255, 255, 255, .06);
}

/* 移动端 offcanvas 复用侧边栏视觉 */
.offcanvas.app-offcanvas {
    width: var(--tg-sidebar-w);
    background: var(--tg-sidebar);
    color: #fff;
    border-right: 0;
}

.offcanvas.app-offcanvas .app-nav {
    padding-top: 4px;
}

/* ---------------- 主区域 ---------------- */

.app-main {
    margin-left: var(--tg-sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* 布局外层是 .d-flex（行向 flex），.app-main 是 flex item：
       不显式声明 flex:1 + min-width:0 时，它的 min-width:auto 会取
       min-content（约 460px）而无法收缩，375 宽度下整页横向溢出。 */
    flex: 1 1 auto;
    min-width: 0;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    height: var(--tg-topbar-h);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--tg-border);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
}

.app-topbar-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.balance-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--tg-brand-soft);
    color: var(--tg-brand-dark);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.balance-chip small {
    font-size: 11px;
    font-weight: 400;
    color: var(--tg-muted);
}

.app-user-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border: 0;
    background: transparent;
    border-radius: 9px;
    color: var(--tg-text);
    font-size: 13px;
}

.app-user-toggle:hover,
.app-user-toggle:focus {
    background: #f1f5f9;
}

.app-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #38bdf8, #2563eb);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    flex: 0 0 auto;
}

.app-content {
    padding: 20px;
    flex: 1 1 auto;
    max-width: 1440px;
    width: 100%;
    min-width: 0;
}

.app-footer-note {
    padding: 0 20px 22px;
    font-size: 12px;
    color: #94a3b8;
}

@media (max-width: 991.98px) {
    .app-main {
        margin-left: 0;
    }
    .app-content {
        padding: 16px 14px;
    }
    .app-topbar {
        padding: 0 14px;
    }
    .app-topbar-title {
        font-size: 15px;
    }
}

/* ---------------- 卡片 / 统计 ---------------- */

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

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--tg-border);
    font-weight: 600;
    padding: 13px 18px;
}

.card-body {
    padding: 18px;
}

.stat-card {
    display: flex;
    /* Bootstrap 的 .card 声明了 flex-direction: column，必须显式覆盖，
       否则图标会被压到文字上方（v2 修复项）。 */
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 14px;
    height: 100%;
}

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    background: var(--tg-brand-soft);
    color: var(--tg-brand-dark);
}

.stat-icon svg {
    width: 20px;
    height: 20px;
}

.stat-icon.is-green {
    background: rgba(16, 185, 129, .12);
    color: #059669;
}

.stat-icon.is-amber {
    background: rgba(245, 158, 11, .14);
    color: #b45309;
}

.stat-icon.is-violet {
    background: rgba(124, 58, 237, .12);
    color: #6d28d9;
}

.stat-body {
    min-width: 0;
}

.stat-label {
    font-size: 12px;
    color: var(--tg-muted);
    margin-bottom: 2px;
    white-space: nowrap;
}

.stat-value {
    font-size: 23px;
    font-weight: 700;
    line-height: 1.25;
    color: #0f172a;
    word-break: break-all;
}

.stat-hint {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 3px;
}

/* ---------------- 表格 ---------------- */

.tg-table {
    margin-bottom: 0;
}

.tg-table > thead > tr > th {
    font-size: 12px;
    font-weight: 600;
    color: var(--tg-muted);
    text-transform: none;
    letter-spacing: .2px;
    background: #fafbfd;
    border-bottom: 1px solid var(--tg-border);
    white-space: nowrap;
    padding: 10px 14px;
}

.tg-table > tbody > tr > td {
    padding: 11px 14px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f3f7;
    font-size: 13px;
}

.tg-table > tbody > tr:last-child > td {
    border-bottom: 0;
}

.tg-table .cell-strong {
    font-weight: 600;
    color: #111827;
}

.tg-table .cell-muted {
    color: var(--tg-muted);
}

.tg-table-wrap {
    overflow-x: auto;
    border-radius: 0 0 var(--tg-radius) var(--tg-radius);
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
    font-size: 12px;
}

.cell-clip {
    max-width: 420px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------------- 徽章 ---------------- */

.badge {
    font-weight: 500;
    letter-spacing: .2px;
}

.badge-soft {
    background: #eef2f7;
    color: #475569;
}

.badge-soft-success {
    background: rgba(16, 185, 129, .13);
    color: #047857;
}

.badge-soft-danger {
    background: rgba(239, 68, 68, .12);
    color: #b91c1c;
}

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

.badge-soft-info {
    background: rgba(42, 171, 238, .14);
    color: #0369a1;
}

.badge-soft-secondary {
    background: #eef2f7;
    color: #64748b;
}

/* ---------------- 空状态 ---------------- */

.empty-state {
    padding: 48px 20px;
    text-align: center;
    color: var(--tg-muted);
}

.empty-state-icon {
    width: 54px;
    height: 54px;
    margin: 0 auto 14px;
    border-radius: 16px;
    background: #f1f5f9;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state-icon svg {
    width: 26px;
    height: 26px;
}

.empty-state-title {
    font-size: 15px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 4px;
}

.empty-state-text {
    font-size: 13px;
    margin-bottom: 14px;
}

/* ---------------- 分页 ---------------- */

.pagination {
    margin-bottom: 0;
    gap: 4px;
}

.pagination .page-link {
    border-radius: 8px;
    border-color: var(--tg-border);
    color: #475569;
    font-size: 13px;
    padding: 5px 11px;
    min-width: 34px;
    text-align: center;
}

.pagination .page-item.active .page-link {
    background: var(--tg-brand);
    border-color: var(--tg-brand);
    color: #fff;
}

.pagination .page-item.disabled .page-link {
    color: #cbd5e1;
}

/* ---------------- 表单 ---------------- */

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 5px;
}

.form-control,
.form-select {
    border-radius: 9px;
    border-color: #dde2ea;
    font-size: 14px;
    padding: 8px 12px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--tg-brand);
    box-shadow: 0 0 0 3px var(--tg-brand-soft);
}

.form-text {
    font-size: 12px;
    color: #94a3b8;
}

.form-check-input:checked {
    background-color: var(--tg-brand);
    border-color: var(--tg-brand);
}

.btn {
    border-radius: 9px;
    font-size: 14px;
    font-weight: 500;
    padding: 7px 15px;
}

.btn-sm {
    padding: 4px 11px;
    font-size: 13px;
    border-radius: 8px;
}

.btn-primary {
    --bs-btn-bg: var(--tg-brand);
    --bs-btn-border-color: var(--tg-brand);
    --bs-btn-hover-bg: var(--tg-brand-dark);
    --bs-btn-hover-border-color: var(--tg-brand-dark);
    --bs-btn-active-bg: var(--tg-brand-dark);
    --bs-btn-active-border-color: var(--tg-brand-dark);
}

.btn-outline-primary {
    --bs-btn-color: var(--tg-brand-dark);
    --bs-btn-border-color: #b9dff3;
    --bs-btn-hover-bg: var(--tg-brand);
    --bs-btn-hover-border-color: var(--tg-brand);
}

.fieldset-title {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: .2px;
    margin: 0 0 14px;
    padding-bottom: 9px;
    border-bottom: 1px dashed var(--tg-border);
}

/* ---------------- 提示条 ---------------- */

.alert {
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 13.5px;
    padding: 11px 15px;
}

.alert-success {
    background: rgba(16, 185, 129, .1);
    border-color: rgba(16, 185, 129, .22);
    color: #047857;
}

.alert-danger {
    background: rgba(239, 68, 68, .09);
    border-color: rgba(239, 68, 68, .2);
    color: #b91c1c;
}

.alert-warning {
    background: rgba(245, 158, 11, .12);
    border-color: rgba(245, 158, 11, .24);
    color: #92400e;
}

.alert-info {
    background: rgba(42, 171, 238, .1);
    border-color: rgba(42, 171, 238, .22);
    color: #0369a1;
}

/* ---------------- 插件卡片 ---------------- */

.plugin-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: box-shadow .18s ease, transform .18s ease;
}

.plugin-card:hover {
    box-shadow: var(--tg-shadow);
    transform: translateY(-1px);
}

.plugin-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.plugin-icon {
    width: 46px;
    height: 46px;
    border-radius: 11px;
    background: #f1f5f9;
    object-fit: cover;
    flex: 0 0 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-weight: 700;
    font-size: 17px;
    overflow: hidden;
}

.plugin-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.plugin-name {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
    line-height: 1.3;
}

.plugin-meta {
    font-size: 12px;
    color: #94a3b8;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.plugin-desc {
    font-size: 13px;
    color: var(--tg-muted);
    margin: 12px 0 14px;
    min-height: 42px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.plugin-foot {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid #f1f3f7;
}

.plugin-price {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}

.plugin-price.is-free {
    color: #059669;
}

.score-star {
    color: #f59e0b;
}

/* ---------------- 认证页 ---------------- */

.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 16px;
    background: radial-gradient(1000px 480px at 50% -10%, #e3f4fd 0%, var(--tg-bg) 62%);
}

.auth-card {
    width: 100%;
    max-width: 430px;
    background: var(--tg-surface);
    border: 1px solid var(--tg-border);
    border-radius: 16px;
    box-shadow: var(--tg-shadow);
    padding: 30px 28px 26px;
}

.auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 22px;
}

.auth-title {
    font-size: 19px;
    font-weight: 700;
    margin: 14px 0 4px;
}

.auth-sub {
    font-size: 13px;
    color: var(--tg-muted);
    margin: 0;
}

.auth-foot {
    margin-top: 18px;
    text-align: center;
    font-size: 13px;
    color: var(--tg-muted);
}

.auth-legal {
    font-size: 12px;
    color: #94a3b8;
    text-align: center;
    margin-top: 20px;
}

.verify-code {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 18px 0 6px;
}

.verify-code span {
    width: 44px;
    height: 54px;
    border-radius: 10px;
    background: #f1f5f9;
    border: 1px solid var(--tg-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    font-family: ui-monospace, Menlo, Consolas, monospace;
}

/* ---------------- 极简页（错误页） ---------------- */

.basic-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 16px;
    background: var(--tg-bg);
}

.basic-card {
    width: 100%;
    max-width: 460px;
    background: #fff;
    border: 1px solid var(--tg-border);
    border-radius: 16px;
    box-shadow: var(--tg-shadow);
    padding: 34px 30px;
    text-align: center;
}

.basic-code {
    font-size: 44px;
    font-weight: 800;
    letter-spacing: 2px;
    line-height: 1;
    color: #cbd5e1;
    margin-bottom: 14px;
}

.basic-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.basic-text {
    font-size: 13.5px;
    color: var(--tg-muted);
    margin-bottom: 22px;
}

/* ---------------- 官网落地页 ---------------- */

.site-body {
    background: #fff;
}

.site-nav {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--tg-border);
}

.site-nav-inner {
    height: 64px;
    display: flex;
    align-items: center;
    gap: 18px;
}

.site-nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
}

.site-nav-links {
    display: none;
    gap: 22px;
    margin-left: 14px;
}

.site-nav-links a {
    font-size: 14px;
    color: #475569;
}

.site-nav-links a:hover {
    color: var(--tg-brand-dark);
}

.site-nav-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-hero {
    padding: 74px 0 58px;
    background:
        radial-gradient(760px 380px at 82% 8%, #dff2fd 0%, rgba(223, 242, 253, 0) 68%),
        radial-gradient(680px 340px at 8% 0%, #e8ecff 0%, rgba(232, 236, 255, 0) 62%),
        #fff;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--tg-brand-soft);
    color: var(--tg-brand-dark);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 18px;
}

.hero-title {
    font-size: 40px;
    line-height: 1.24;
    font-weight: 800;
    letter-spacing: -.5px;
    color: #0b1220;
    margin-bottom: 16px;
}

.hero-title em {
    font-style: normal;
    color: var(--tg-brand-dark);
}

.hero-lead {
    font-size: 15.5px;
    color: #4b5563;
    max-width: 560px;
    margin-bottom: 26px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.hero-note {
    font-size: 12.5px;
    color: #9ca3af;
}

.hero-panel {
    background: #fff;
    border: 1px solid var(--tg-border);
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(16, 24, 40, .1);
    padding: 18px;
}

.hero-panel-head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
}

.hero-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #e2e8f0;
}

.hero-stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px dashed #eef2f7;
    font-size: 13px;
}

.hero-stat-row:last-child {
    border-bottom: 0;
}

.hero-stat-row strong {
    font-size: 14px;
    color: #0f172a;
}

.site-section {
    padding: 62px 0;
}

.site-section.alt {
    background: #f8fafc;
    border-top: 1px solid var(--tg-border);
    border-bottom: 1px solid var(--tg-border);
}

.section-head {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 40px;
}

.section-title {
    font-size: 27px;
    font-weight: 700;
    color: #0b1220;
    margin-bottom: 10px;
    letter-spacing: -.3px;
}

.section-sub {
    font-size: 14.5px;
    color: var(--tg-muted);
    margin: 0;
}

.feature-card {
    height: 100%;
    padding: 24px 22px;
    border: 1px solid var(--tg-border);
    border-radius: var(--tg-radius);
    background: #fff;
}

.feature-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: var(--tg-brand-soft);
    color: var(--tg-brand-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.feature-icon svg {
    width: 21px;
    height: 21px;
}

.feature-title {
    font-size: 15.5px;
    font-weight: 600;
    margin-bottom: 7px;
    color: #0f172a;
}

.feature-text {
    font-size: 13.5px;
    color: var(--tg-muted);
    margin: 0;
}

.site-footer {
    padding: 34px 0;
    border-top: 1px solid var(--tg-border);
    background: #fff;
}

.site-footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #94a3b8;
}

.site-footer-links {
    margin-left: auto;
    display: flex;
    gap: 18px;
}

.site-footer-links a {
    color: #64748b;
}

@media (min-width: 992px) {
    .site-nav-links {
        display: flex;
    }
    .hero-title {
        font-size: 46px;
    }
}

@media (max-width: 575.98px) {
    .hero-title {
        font-size: 30px;
    }
    .site-hero {
        padding: 44px 0 38px;
    }
    .site-section {
        padding: 42px 0;
    }
    .section-title {
        font-size: 22px;
    }
    .auth-card {
        padding: 24px 20px;
    }
    .verify-code span {
        width: 38px;
        height: 48px;
        font-size: 20px;
    }
}

/* ---------------- 杂项 ---------------- */

.text-mono-muted {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 12px;
    color: #94a3b8;
}

.code-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid var(--tg-border);
    border-radius: 8px;
    padding: 7px 10px;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 12px;
    color: #334155;
    overflow-wrap: anywhere;
}

.code-chip code {
    flex: 1 1 auto;
    color: #334155;
    overflow-wrap: anywhere;
}

.divider-dashed {
    border: 0;
    border-top: 1px dashed var(--tg-border);
    margin: 16px 0;
}

.hover-underline:hover {
    text-decoration: underline;
}

.list-plain {
    list-style: none;
    padding: 0;
    margin: 0;
}

.list-plain li {
    padding: 8px 0;
    border-bottom: 1px dashed #f1f3f7;
    font-size: 13px;
    display: flex;
    gap: 10px;
}

.list-plain li:last-child {
    border-bottom: 0;
}

.list-plain .k {
    color: #94a3b8;
    flex: 0 0 96px;
}

.list-plain .v {
    color: #334155;
    min-width: 0;
    overflow-wrap: anywhere;
}

/* ===========================================================
   用户面板：页面级通用组件（panel-dev）
   =========================================================== */

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.page-head-main {
    min-width: 0;
}

.page-head-sub {
    margin: 0;
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.7;
}

.page-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.stat-grid {
    display: grid;
    /* min(190px, 100%)：窄屏（<220px 内容宽度）时列宽不再撑破容器 */
    grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.filter-bar .form-control,
.filter-bar .form-select {
    width: auto;
    min-width: 148px;
}

.filter-spacer {
    flex: 1 1 auto;
}

.min-w-0 {
    min-width: 0;
}

.text-nowrap {
    white-space: nowrap;
}

.cell-pre {
    max-width: 420px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 12px;
    background: #f1f5f9;
    color: #475569;
    white-space: nowrap;
}

.chip .chip-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.status-dot.is-active {
    background: #22c55e;
}

.status-dot.is-stopped {
    background: #94a3b8;
}

.status-dot.is-error {
    background: #ef4444;
}

.msg-text {
    max-width: 460px;
    color: #334155;
    overflow-wrap: anywhere;
}

.msg-text.is-empty {
    color: #cbd5e1;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px dashed #eef1f6;
}

.plugin-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.code-block {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    line-height: 1.7;
    background: #f8fafc;
    border: 1px solid #eef2f7;
    border-radius: 8px;
    padding: 10px 12px;
    color: #475569;
    overflow-wrap: anywhere;
    margin: 0;
}

.reply-box {
    margin-top: 10px;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.75;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #eef2f7;
    border-left: 3px solid #6366f1;
    border-radius: 8px;
}

.request-item + .request-item {
    margin-top: 14px;
}

.request-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 6px;
}

.request-body {
    font-size: 13px;
    line-height: 1.8;
    color: #475569;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    margin: 0;
}

.status-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.status-tabs a {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 13px;
    color: #475569;
    background: #f1f5f9;
    text-decoration: none;
    border: 1px solid transparent;
}

.status-tabs a:hover {
    background: #e9eef5;
}

.status-tabs a.active {
    background: #1e293b;
    color: #fff;
}

.sort-link {
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
}

.sort-link:hover {
    color: #4f46e5;
}

.sort-link.is-active {
    color: #4f46e5;
    font-weight: 600;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #475569;
}

.danger-zone {
    border-color: #fecaca;
}

.danger-zone .card-header {
    background: #fef2f2;
    color: #b91c1c;
    border-bottom-color: #fecaca;
}

@media (max-width: 575.98px) {
    .page-head {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-bar .form-control,
    .filter-bar .form-select {
        width: 100%;
    }

    /* 手机端统计卡：图标保持在文字左侧，同时压缩内边距防止溢出 */
    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .stat-card {
        padding: 12px;
        gap: 10px;
    }

    .stat-icon {
        width: 34px;
        height: 34px;
        border-radius: 9px;
    }

    .stat-icon svg {
        width: 16px;
        height: 16px;
    }

    .stat-value {
        font-size: 19px;
    }

    .stat-label,
    .stat-hint {
        font-size: 11px;
    }

    .stat-hint {
        line-height: 1.45;
    }
}

/* ---------------- 充值 / 账单（v2） ---------------- */

.hint-inline {
    font-size: 12px;
    font-weight: 400;
    color: #94a3b8;
}

.amount-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.amount-chip {
    border: 1px solid var(--tg-border);
    background: #fff;
    color: #0f172a;
    border-radius: 9px;
    padding: 7px 14px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    transition: border-color .12s ease, background .12s ease, color .12s ease;
}

.amount-chip:hover:not(:disabled) {
    border-color: var(--tg-brand);
    color: var(--tg-brand-dark);
}

.amount-chip.is-active {
    border-color: var(--tg-brand);
    background: var(--tg-brand-soft);
    color: var(--tg-brand-dark);
}

.amount-chip:disabled {
    opacity: .55;
    cursor: not-allowed;
}

@media (max-width: 575.98px) {
    .amount-chip {
        flex: 1 1 calc(33.333% - 8px);
        text-align: center;
    }
}
