:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --primary-deep: #1e40af;
    --ink: #0f172a;
    --bg: #f5f7fb;
    --surface: #ffffff;
    --border: #e5e7eb;
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --success: #16a34a;
    --success-bg: #f0fdf4;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --warning: #d97706;
    --warning-bg: #fffbeb;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
    --shadow-lg: 0 12px 32px rgba(16, 24, 40, .12);
    --topbar-h: 60px;
    --sidebar-w: 220px;
    --content-max: 1400px;
    /* 安全区 + 顶栏总高：与手机版口径一致，供提示定位等使用 */
    --safe-top: var(--sys-safe-top, env(safe-area-inset-top, 0px));
    --safe-right: var(--sys-safe-right, env(safe-area-inset-right, 0px));
    --topbar-total: calc(var(--topbar-h) + var(--safe-top));
}

/* ============================================================
 * Element Plus 提示（ElMessage / ElNotification）定位
 * 说明：用户端提示统一显示在「顶栏下方居中」，绝不覆盖顶栏或出现在顶栏上方，
 *   并从上到下缓慢落下。
 *   - 无论是否带 .app-toast 类，一律强制下移到顶栏下方（兜底 ElMessage 默认 20px）；
 *   - ElNotification 默认 top:0 会压住顶栏，这里同样强制下移。
 * ============================================================ */
.el-message.app-toast {
    top: calc(var(--topbar-total, 60px) + 12px) !important;
    left: 50% !important;
    right: auto !important;
    margin-left: 0 !important;
    width: auto;
    max-width: min(420px, 90vw);
    transform: translateX(-50%);
    z-index: 3000;
    animation: app-toast-in .42s cubic-bezier(.16, 1, .3, 1) both;
}

/*
 * 兜底：即使某处直接调用 ElementPlus.ElMessage（未加 .app-toast 类），
 * 也强制显示在顶栏下方，避免出现在顶部遮住头部。
 */
body > .el-message {
    top: calc(var(--topbar-total, 60px) + 12px) !important;
    z-index: 3000;
}

/* ElNotification 默认 top:0 会覆盖顶栏，统一下移到顶栏下方 */
.el-notification {
    top: calc(var(--topbar-total, 60px) + 12px) !important;
    z-index: 3000;
}
@keyframes app-toast-in {
    from { transform: translate(-50%, -14px); opacity: 0; }
    to   { transform: translate(-50%, 0);     opacity: 1; }
}
.el-message.app-toast.is-closing {
    animation: app-toast-out .34s ease-in both;
}
@keyframes app-toast-out {
    from { transform: translate(-50%, 0);     opacity: 1; }
    to   { transform: translate(-50%, -14px); opacity: 0; }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

html {
    overflow-y: auto;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 100vh;
    -webkit-overflow-scrolling: touch;
}

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

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

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input {
    font-family: inherit;
}

/* ============ 通用组件 ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: all .18s ease;
    border: 1px solid transparent;
    white-space: nowrap;
}

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

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}

.btn-ghost:hover:not(:disabled) {
    background: #f3f4f6;
    color: var(--text);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover:not(:disabled) {
    background: #b91c1c;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 13px 18px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-sm);
}

.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: 20px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, .4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.spinner-dark {
    border-color: var(--border);
    border-top-color: var(--primary);
}

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

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-muted);
    gap: 10px;
}

.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    color: var(--text-muted);
    text-align: center;
}

.empty svg {
    margin-bottom: 12px;
    opacity: .4;
}

.empty .empty-icon {
    font-size: 48px;
    color: var(--text-muted);
    opacity: .4;
    margin-bottom: 12px;
    line-height: 1;
}

.ts-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-120%);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    max-width: min(420px, 92vw);
    padding: 14px 18px 14px 14px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    /* 提示需覆盖顶栏/底部导航（.topbar/.tabbar 为 1000，m-lock 下 1200），
       故抬升到 3200，确保任何状态下提示都显示在最上方 */
    z-index: 3200;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transition: transform .38s cubic-bezier(.21, 1.02, .55, 1), opacity .38s ease;
    will-change: transform, opacity;
}

.ts-toast.ts-toast--show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.ts-toast.ts-toast--hide {
    transform: translateX(-50%) translateY(-8px);
    opacity: 0;
    transition: transform .28s ease-in, opacity .28s ease-in;
}

.ts-toast__bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 12px 0 0 12px;
}

.ts-toast__icon {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    margin-left: 4px;
}

.ts-toast__msg {
    flex: 1 1 auto;
    color: #1f2937;
    word-break: break-word;
}

.ts-toast__progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    transform-origin: left center;
    transform: scaleX(1);
    opacity: .95;
}

.ts-toast--success { background: #d1fae5; }
.ts-toast--success .ts-toast__bar { background: #10b981; }
.ts-toast--success .ts-toast__icon { background: #10b981; }
.ts-toast--success .ts-toast__progress { background: linear-gradient(90deg, #34d399 0%, #10b981 60%, #059669 100%); }

.ts-toast--error { background: #fee2e2; }
.ts-toast--error .ts-toast__bar { background: #ef4444; }
.ts-toast--error .ts-toast__icon { background: #ef4444; }
.ts-toast--error .ts-toast__progress { background: linear-gradient(90deg, #f87171 0%, #ef4444 60%, #dc2626 100%); }

.ts-toast--warning { background: #fef3c7; }
.ts-toast--warning .ts-toast__bar { background: #f59e0b; }
.ts-toast--warning .ts-toast__icon { background: #f59e0b; }
.ts-toast--warning .ts-toast__progress { background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 60%, #d97706 100%); }

.ts-toast--info { background: #dbeafe; }
.ts-toast--info .ts-toast__bar { background: #3b82f6; }
.ts-toast--info .ts-toast__icon { background: #3b82f6; }
.ts-toast--info .ts-toast__progress { background: linear-gradient(90deg, #60a5fa 0%, #3b82f6 60%, #2563eb 100%); }

@keyframes ts-toast-progress {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

/* ============ 认证页 ============ */
.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background:
        radial-gradient(1200px 600px at 50% -10%, #dbeafe 0%, #eff6ff 45%, #f5f7fb 75%, #f5f7fb 100%),
        linear-gradient(180deg, #eef4ff 0%, #f8fafc 100%);
    padding: 24px 16px;
}

.auth-wrap {
    width: 100%;
    max-width: 420px;
}

.auth-card {
    background: var(--surface);
    border-radius: 20px;
    padding: 40px 36px;
    box-shadow: 0 24px 60px rgba(37, 99, 235, .12), 0 8px 24px rgba(15, 23, 42, .08), 0 1px 3px rgba(15, 23, 42, .05);
    border: 1px solid rgba(37, 99, 235, .10);
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2563eb, #60a5fa, #1e40af);
}

.auth-logo {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo .brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auth-logo svg {
    color: var(--primary);
    margin-bottom: 10px;
}

.auth-logo h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: .5px;
}

.auth-logo p {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 6px;
}

.auth-form .form-field {
    margin-bottom: 20px;
}

.auth-links {
    text-align: center;
    margin-top: 22px;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-links a {
    font-weight: 600;
}

.auth-links a:hover {
    text-decoration: underline;
}

.auth-footer {
    text-align: center;
    margin-top: 22px;
    font-size: 12px;
    color: var(--text-muted);
    opacity: .8;
}

/* ============ 表单 ============ */
.form-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
    color: var(--text);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-field input::placeholder {
    color: var(--text-muted);
}

.input-icon-wrap {
    position: relative;
}

.input-icon-wrap input {
    padding-left: 40px;
}

.input-prefix-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    pointer-events: none;
    line-height: 0;
}

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

.input-with-action {
    position: relative;
}

.input-with-action > .input-icon-wrap input {
    padding-right: 52px;
}

.input-with-action input.has-wide-action {
    padding-right: 108px;
}

.captcha-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.captcha-row input {
    flex: 1;
    min-width: 0;
}

.captcha-row img {
    flex: 0 0 auto;
    height: 46px;
    cursor: pointer;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: #fff;
}

.captcha-row .math-question {
    flex: 0 0 auto;
    min-width: 110px;
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--primary-light, rgba(37, 99, 235, .1));
    color: var(--primary, #2563eb);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .04em;
    cursor: pointer;
    transition: background .18s ease, transform .18s ease;
}

.captcha-row .math-question:hover {
    background: var(--primary, #2563eb);
    color: #fff;
}

.captcha-row .math-question:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.input-action {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    color: var(--text-muted);
    border-radius: 6px;
    transition: color .15s, background .15s;
}

.input-action:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.input-action-wide {
    padding: 5px 10px;
    font-size: 12px;
    color: var(--primary);
    font-weight: 500;
}

.input-action-wide:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
}

.input-action-btn {
    padding: 5px 10px;
    font-size: 12px;
    color: var(--primary);
    font-weight: 500;
    border: none;
    background: transparent;
    cursor: pointer;
    white-space: nowrap;
}

.input-action-btn:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.input-action-btn:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
}

.geetest-box {
    margin-top: 10px;
    min-height: 40px;
}

/* ============ 布局（左侧目录栏 + 主内容） ============ */
.layout {
    display: flex;
    align-items: flex-start;
    width: 100%;
    padding-top: var(--topbar-h);
}

.sidebar {
    flex: 0 0 var(--sidebar-w);
    width: var(--sidebar-w);
    position: fixed;
    left: 0;
    top: var(--topbar-h);
    height: calc(100vh - var(--topbar-h));
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 12px;
    border-right: 1px solid var(--border);
    background: var(--surface);
    z-index: 90;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    transition: width .28s cubic-bezier(.4, 0, .2, 1), flex-basis .28s cubic-bezier(.4, 0, .2, 1), padding .28s cubic-bezier(.4, 0, .2, 1);
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 999px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-nav .nav-item {
    position: relative;
    width: 100%;
    justify-content: flex-start;
    padding: 11px 14px;
    font-size: 14px;
    border-radius: var(--radius-sm);
    transition: padding .28s cubic-bezier(.4, 0, .2, 1), color .15s, background .15s;
}

.sidebar-nav .nav-item > span:not(.nav-icon) {
    white-space: nowrap;
    overflow: hidden;
    opacity: 1;
    transition: opacity .2s ease;
}

.sidebar-nav .nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 3px;
    height: 20px;
    border-radius: 0 999px 999px 0;
    background: var(--primary);
    transition: transform .18s ease;
}

.sidebar-nav .nav-item.active::before {
    transform: translateY(-50%) scaleY(1);
}

.sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    margin: 0 0 0 -8px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .2s, color .2s;
}
.sidebar-toggle:hover {
    background: var(--primary-light);
    color: var(--text);
}
.sidebar-toggle .el-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    width: 16px;
    height: 16px;
}
.sidebar-toggle .el-icon svg {
    width: 16px;
    height: 16px;
}
.sidebar-toggle-text {
    display: none;
    line-height: 1;
}

/* 折叠状态：目录栏收窄为纯图标 */
html.sidebar-collapsed {
    --sidebar-w: 64px;
}
html.sidebar-collapsed .sidebar {
    padding: 16px 8px;
}
html.sidebar-collapsed .sidebar-nav .nav-item {
    justify-content: center;
    padding: 11px 0;
}
html.sidebar-collapsed .sidebar-nav .nav-item > span:not(.nav-icon) {
    opacity: 0;
    max-width: 0;
    pointer-events: none;
}
html.sidebar-collapsed .sidebar-nav .nav-item::before {
    left: 0;
}

/* ============ 顶栏 ============ */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    height: var(--topbar-h);
}

.topbar-inner {
    max-width: none;
    margin: 0;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 16px;
    color: var(--text);
}

.brand svg {
    color: var(--primary);
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
}

.topbar-nav::-webkit-scrollbar {
    display: none;
}

.nav-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-secondary);
    transition: all .15s;
    white-space: nowrap;
}

.nav-item .nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    font-size: 16px;
    line-height: 1;
}

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

.nav-item:hover {
    background: var(--primary-light);
    color: var(--text);
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-shrink: 0;
}

.user-balance {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-light);
    padding: 4px 10px;
    border-radius: 20px;
}

.btn-refresh-balance {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg-soft);
    color: var(--text-secondary);
    cursor: pointer;
    transition: color .2s, border-color .2s, transform .2s;
}

.btn-refresh-balance:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-refresh-balance.spinning svg {
    animation: spin 0.8s linear infinite;
}

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

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--primary-light);
    border: 1px solid var(--border);
}

.username {
    font-size: 14px;
    font-weight: 500;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 6px;
}

.menu-toggle span {
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all .2s;
}

/* ============ 顶栏扩展（.tb- 前缀） ============ */
.tb-inner {
    gap: 16px;
}

.tb-brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tb-brand-name {
    white-space: nowrap;
}

.tb-nav-item {
    cursor: pointer;
}

.tb-balance {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.tb-balance-icon {
    font-size: 13px;
}

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

.tb-refresh {
    cursor: pointer;
}

/* 深色模式切换按钮 */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    color: var(--text-secondary);
    transition: background .2s, color .2s;
    flex-shrink: 0;
}

.lang-select-wrap {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.lang-select {
    appearance: none;
    -webkit-appearance: none;
    height: 34px;
    padding: 0 28px 0 12px;
    font-size: 13px;
    color: var(--text-secondary);
    background-color: transparent;
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
    outline: none;
    transition: background .2s, color .2s, border-color .2s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.lang-select:hover {
    background-color: var(--primary-light);
    color: var(--text);
    border-color: var(--primary);
}

.theme-toggle:hover {
    background: var(--primary-light);
    color: var(--text);
}

.theme-toggle i {
    font-size: 16px;
}

/* 默认（浅色）显示月亮，隐藏太阳 */
.theme-toggle .tb-theme-icon-sun {
    display: none;
}
.theme-toggle .tb-theme-icon-moon {
    display: inline-block;
}

/* 深色模式下显示太阳，隐藏月亮 */
html[data-theme="dark"] .theme-toggle .tb-theme-icon-moon {
    display: none;
}
html[data-theme="dark"] .theme-toggle .tb-theme-icon-sun {
    display: inline-block;
}

/* 扫一扫登录按钮 */
.tb-scan-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    color: var(--text-secondary);
    transition: background .2s, color .2s;
    flex-shrink: 0;
    cursor: pointer;
}

.tb-scan-btn:hover {
    background: var(--primary-light);
    color: var(--text);
}

.tb-scan-btn i {
    font-size: 16px;
}

/* 扫一扫（扫码登录）为移动端功能，桌面端（≥768px）隐藏入口按钮 */
@media (min-width: 768px) {
    .tb-scan-btn {
        display: none;
    }
}

/* 通用主题切换按钮（theme.js 注入，认证页/后台使用） */
.tm-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: background .25s, color .25s, transform .25s, border-color .25s;
}

.tm-toggle:hover {
    color: var(--primary);
    border-color: var(--primary);
    transform: scale(1.06);
}

.tm-toggle:active {
    transform: scale(.94);
}

.tm-toggle__icon {
    display: none;
    align-items: center;
    justify-content: center;
    position: absolute;
    animation: tmIconIn .35s ease;
}

.tm-toggle__icon--show {
    display: inline-flex;
}

@keyframes tmIconIn {
    from { opacity: 0; transform: rotate(-90deg) scale(.5); }
    to { opacity: 1; transform: rotate(0deg) scale(1); }
}

/* 主题切换过渡动画 */
html.theme-switching body,
html.theme-switching .auth-body,
html.theme-switching .auth-card,
html.theme-switching .el-card,
html.theme-switching .el-dialog,
html.theme-switching .topbar,
html.theme-switching .sidebar {
    transition: background-color .4s ease, color .4s ease, border-color .4s ease, box-shadow .4s ease !important;
}

html.theme-switching {
    animation: tmFlash .45s ease;
}

@keyframes tmFlash {
    0% { filter: brightness(1); }
    50% { filter: brightness(1.08); }
    100% { filter: brightness(1); }
}

/* 头像容器 / 光环 / 下拉菜单 */
.tb-avatar-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.tb-avatar-ring {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    cursor: pointer;
    border-radius: 999px;
    background: transparent;
}

.tb-avatar {
    display: block;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--primary-light);
    border: 2px solid transparent;
    background-clip: padding-box;
    transition: box-shadow .2s, transform .2s;
}

.tb-avatar-ring:hover .tb-avatar {
    box-shadow: 0 0 0 2px var(--primary-light);
}

.tb-avatar-caret {
    font-size: 12px;
    color: var(--text-muted);
    transition: transform .2s;
}

.tb-avatar-wrap.open .tb-avatar-caret {
    transform: rotate(180deg);
}

/* 头像 fallback（无头像或加载失败时显示首字母） */
.tb-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    flex-shrink: 0;
}

.tb-avatar-fallback-lg {
    width: 40px;
    height: 40px;
    font-size: 18px;
}

.tb-avatar-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 200;
    width: 200px;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .18s, transform .18s, visibility .18s;
}

.tb-avatar-wrap.open .tb-avatar-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tb-menu-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 8px;
}

.tb-menu-avatar {
    display: block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--primary-light);
    flex-shrink: 0;
}

.tb-menu-username {
    font-weight: 600;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tb-menu-divider {
    height: 1px;
    margin: 6px 0;
    background: var(--border);
}

.tb-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background .15s, color .15s;
    text-align: left;
}

.tb-menu-item:hover {
    background: var(--primary-light);
    color: var(--text);
}

.tb-menu-item-danger {
    color: var(--danger);
}

.tb-menu-item-danger:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

.tb-menu-toggle {
    display: none;
}

/* ============ 底部导航栏（移动端 · 实心贴底，无模糊） ============ */
.tabbar {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    background: var(--surface);
    border-top: 1px solid var(--border);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.tabbar-inner {
    display: flex;
    align-items: stretch;
    height: 56px;
}

/* ---- Tab 项 ---- */
.tab-item {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.2;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    position: relative;
    padding: 0 2px;
    transition: color .25s ease;
}

/* 每个 Tab 的主题色：图标色 / 圆点 / 浅色圆底 */
.tab-item[data-tab="dashboard"] { --tab-c1: #2563eb; --tab-c2: #3b82f6; }
.tab-item[data-tab="apikey"]    { --tab-c1: #0ea5e9; --tab-c2: #22d3ee; }
.tab-item[data-tab="shop"]      { --tab-c1: #f59e0b; --tab-c2: #f97316; }
.tab-item[data-tab="kami"]      { --tab-c1: #10b981; --tab-c2: #34d399; }
.tab-item[data-tab="recharge"]  { --tab-c1: #2563eb; --tab-c2: #3b82f6; }
.tab-item[data-tab="models"]    { --tab-c1: #dc2626; --tab-c2: #f43f5e; }
.tab-item[data-tab="mymod"]     { --tab-c1: #3b82f6; --tab-c2: #dc2626; }
.tab-item[data-tab="settings"]  { --tab-c1: #64748b; --tab-c2: #94a3b8; }

.tab-icon {
    position: relative;
    width: 30px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    transition: background-color .25s ease, transform .25s ease;
}

.tab-icon svg {
    width: 22px !important;
    height: 22px !important;
    display: block;
}

.tab-icon .el-icon {
    font-size: 22px;
    line-height: 1;
}

/* 激活：彩色图标 + 浅色圆形背景 */
.tab-item.active {
    color: var(--tab-c1);
    font-weight: 600;
}

.tab-item.active .tab-icon {
    background: color-mix(in srgb, var(--tab-c1) 16%, transparent);
    transform: translateY(-2px);
}

/* 激活指示器：顶部渐变小圆点 */
.tab-item.active::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--tab-c1), var(--tab-c2));
    box-shadow: 0 0 6px color-mix(in srgb, var(--tab-c1) 60%, transparent);
}

/* 激活时图标 bounce */
.tab-item.active .tab-icon svg {
    animation: tab-bounce .45s cubic-bezier(.28, .84, .42, 1);
}

@keyframes tab-bounce {
    0%   { transform: translateY(0) scale(1); }
    35%  { transform: translateY(-5px) scale(1.12); }
    65%  { transform: translateY(1px) scale(.96); }
    100% { transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .tab-item.active .tab-icon svg {
        animation: none;
    }
}

/* ---- 中间凸起按钮（充值） ---- */
.tab-fab {
    flex: 0 0 auto;
    align-self: center;
    width: 52px;
    height: 52px;
    margin: 0 6px;
    transform: translateY(-16px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, #3b82f6 0%, #dc2626 100%);
    box-shadow: 0 8px 20px rgba(59, 130, 246, .40),
                0 2px 6px rgba(220, 38, 38, .30),
                inset 0 1px 0 rgba(255, 255, 255, .35);
    -webkit-tap-highlight-color: transparent;
    transition: transform .2s ease, box-shadow .2s ease;
}

.tab-fab svg {
    width: 24px;
    height: 24px;
    display: block;
}

.tab-fab:active {
    transform: translateY(-16px) scale(.92);
    box-shadow: 0 4px 12px rgba(59, 130, 246, .35);
}

/* ============ 主内容区 ============ */
.app-main {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-w);
    padding: 24px 24px 60px;
    max-width: calc(var(--sidebar-w) + var(--content-max));
    width: 100%;
    transition: margin-left .28s cubic-bezier(.4, 0, .2, 1), max-width .28s cubic-bezier(.4, 0, .2, 1);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeIn .25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-header {
    margin-bottom: 20px;
}

.page-header h2 {
    font-size: 20px;
    font-weight: 700;
}

.page-header p {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 2px;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow);
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.stat-card .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    word-break: break-all;
}

.stat-card .stat-value.stat-primary {
    color: var(--primary);
}

.stat-card .stat-value.stat-success {
    color: var(--success);
}

/* 用户仪表盘：最近7日 / 最近活动 */
.ud-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

.ud-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow);
}

.ud-panel-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
}

.ud-chart-block {
    margin-bottom: 22px;
}

.ud-chart-block:last-child {
    margin-bottom: 0;
}

.ud-chart-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.ud-empty {
    padding: 28px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* 近7日消耗 Tokens 曲线图 */
.ud-line-chart {
    width: 100%;
}

.ud-line-svg {
    width: 100%;
    height: 200px;
    display: block;
    overflow: visible;
}

.ud-line-area {
    transition: opacity .2s ease;
}

.ud-line-path {
    transition: stroke-width .2s ease;
}

.ud-line-dot {
    transition: r .2s ease;
}

.ud-line-dot:hover {
    r: 5;
}

.ud-line-label {
    font-size: 11px;
    fill: var(--text-muted, #9ca3af);
    text-anchor: middle;
    font-family: inherit;
}

.ud-act-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 360px;
    overflow-y: auto;
}

.ud-act-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.ud-act-item:last-child {
    border-bottom: none;
}

.ud-act-main {
    flex: 1;
    min-width: 0;
}

.ud-act-model {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    word-break: break-all;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.ud-act-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
}

.ud-act-time {
    flex-shrink: 0;
    font-size: 12px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ud-act-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    padding: 3px 7px;
    border-radius: 999px;
}

.ud-act-badge.ud-act-ok {
    color: var(--success);
    background: var(--success-bg);
}

.ud-act-badge.ud-act-fail {
    color: var(--danger);
    background: var(--danger-bg);
}

/* 表格 */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th, td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

th {
    background: #fafbfc;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
}

tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: #fafbfd;
}

/* 标签 */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.tag-success {
    background: var(--success-bg);
    color: var(--success);
}

.tag-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.tag-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.tag-neutral {
    background: #f3f4f6;
    color: var(--text-secondary);
}

.mono {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 13px;
}

/* 分页 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
}

.pagination .page-btn {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text-secondary);
    font-size: 13px;
}

.pagination .page-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination .page-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.pagination .page-info {
    font-size: 13px;
    color: var(--text-muted);
}

/* API 密钥 */
.apikey-display {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    flex-wrap: wrap;
}

.apikey-display code {
    flex: 1;
    word-break: break-all;
    color: var(--text);
}

.key-meta {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.key-meta .meta-item .meta-label {
    font-size: 12px;
    color: var(--text-muted);
}

.key-meta .meta-item .meta-value {
    font-size: 15px;
    font-weight: 600;
    margin-top: 2px;
}

.api-info-card {
    margin-bottom: 16px;
}

.api-info-card .api-info-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.api-info-card .api-info-row:last-child {
    margin-bottom: 0;
}

.api-info-card .api-info-row .meta-label {
    font-size: 12px;
    color: var(--text-muted);
}

.api-info-card .api-info-value {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.api-info-card .api-info-value code {
    flex: 1;
    word-break: break-all;
    background: #f8fafc;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    color: var(--text);
}

.api-info-card .api-intro-text {
    font-size: 14px;
    color: var(--text);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

/* 充值面板现代化（.rc- 前缀） */
.rc-app {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.rc-app[v-cloak] {
    display: none;
}

/* ---- 余额展示大卡片 ---- */
.rc-balance-card {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    padding: 28px 30px;
    background: linear-gradient(118deg, #f87171 0%, #fee140 100%);
    color: #fff;
    box-shadow: 0 16px 40px -12px rgba(248, 113, 113, .45);
}
.rc-balance-glow {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, .28);
    filter: blur(2px);
    pointer-events: none;
}
.rc-balance-glow-a {
    width: 220px;
    height: 220px;
    top: -90px;
    right: -60px;
    opacity: .55;
}
.rc-balance-glow-b {
    width: 150px;
    height: 150px;
    bottom: -80px;
    left: 18%;
    opacity: .35;
}
.rc-balance-inner {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    z-index: 1;
}
.rc-balance-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .5px;
    color: rgba(255, 255, 255, .92);
}
.rc-balance-label .bi {
    font-size: 16px;
}
.rc-balance-amount {
    margin-top: 8px;
    display: flex;
    align-items: baseline;
    gap: 6px;
    line-height: 1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .12);
}
.rc-balance-currency {
    font-size: 26px;
    font-weight: 700;
}
.rc-balance-num {
    font-size: 46px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    font-family: "SF Mono", "JetBrains Mono", Consolas, "Courier New", monospace;
    letter-spacing: .5px;
}
.rc-balance-sub {
    margin-top: 12px;
    font-size: 12.5px;
    color: rgba(255, 255, 255, .82);
    letter-spacing: .3px;
}
.rc-balance-refresh {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .35);
    backdrop-filter: blur(6px);
    transition: background .2s ease, transform .2s ease;
}
.rc-balance-refresh:hover:not(:disabled) {
    background: rgba(255, 255, 255, .3);
    transform: translateY(-1px);
}
.rc-balance-refresh:disabled {
    opacity: .6;
    cursor: not-allowed;
}
.rc-spin {
    display: inline-block;
    animation: rc-rotate 1s linear infinite;
}
@keyframes rc-rotate {
    to { transform: rotate(360deg); }
}

/* ---- 通用卡片 ---- */
.rc-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
}
.rc-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}
.rc-card-title {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
}
.rc-card-title .bi {
    font-size: 18px;
    background: linear-gradient(120deg, #f87171, #fee140);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.rc-card-sub {
    font-size: 12.5px;
    color: var(--text-muted);
}
.rc-section-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0 12px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: .5px;
}
.rc-section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border), transparent);
}
.rc-card-head + .rc-section-label {
    margin-top: 2px;
}

/* ---- 币种切换（人民币 / 美元） ---- */
.rc-currency-switch {
    display: inline-flex;
    gap: 8px;
    margin-top: 14px;
    padding: 4px;
    /* 改用通用浅色底变量，保证深色主题下不再出现亮白胶囊 */
    background: var(--bg-soft, rgba(148, 163, 184, .14));
    border-radius: 10px;
}
.rc-currency-btn {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    padding: 7px 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: background .2s, color .2s, box-shadow .2s;
}
.rc-currency-btn:hover {
    color: var(--primary);
}
.rc-currency-btn.rc-active {
    background: var(--surface, #fff);
    color: var(--primary);
    box-shadow: 0 1px 4px rgba(15, 23, 42, .12);
}
/* 深色主题：激活态投影改为深色环境可见的阴影，避免投影不可见 */
html[data-theme="dark"] .rc-currency-btn.rc-active {
    box-shadow: 0 1px 4px rgba(0, 0, 0, .45);
}

/* ---- 充值档位网格 ---- */
.rc-plan-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    min-height: 88px;
}
@media (min-width: 768px) {
    .rc-plan-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (min-width: 1200px) {
    .rc-plan-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
.rc-plan-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 18px 16px 15px;
    border-radius: 14px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    text-align: left;
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.rc-plan-card:hover {
    transform: translateY(-3px) scale(1.03);
    border-color: #f87171;
    box-shadow: 0 12px 26px -10px rgba(248, 113, 113, .35);
}
.rc-plan-card.rc-active {
    border-color: #f87171;
    background: linear-gradient(180deg, rgba(248, 113, 113, .08) 0%, rgba(254, 225, 64, .08) 100%);
    box-shadow: 0 12px 26px -10px rgba(248, 113, 113, .4);
}
.rc-plan-badge {
    position: absolute;
    top: -9px;
    right: 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(120deg, #22c55e, #16a34a);
    box-shadow: 0 4px 10px -2px rgba(34, 197, 94, .5);
}
.rc-plan-badge .bi {
    font-size: 10px;
}
.rc-plan-pay {
    display: flex;
    align-items: baseline;
    gap: 2px;
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}
.rc-plan-cny {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
}
.rc-plan-card.rc-active .rc-plan-pay {
    background: linear-gradient(120deg, #ef4444, #e8a400);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.rc-plan-credit {
    font-size: 12px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}
.rc-plan-check {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #fff;
    background: linear-gradient(120deg, #f87171, #fee140);
    opacity: 0;
    transform: scale(.5);
    transition: opacity .18s ease, transform .18s ease;
}
.rc-plan-card.rc-active .rc-plan-check {
    opacity: 1;
    transform: scale(1);
}
.rc-plan-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 26px 0;
    color: var(--text-muted);
    font-size: 13px;
}
.rc-plan-empty .bi {
    font-size: 28px;
    opacity: .6;
}

/* ---- 自定义金额输入 ---- */
.rc-custom-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 52px;
    border-radius: 12px;
    box-shadow: 0 0 0 1.5px var(--border) inset;
    cursor: pointer;
    transition: box-shadow .18s ease;
    user-select: none;
    -webkit-user-select: none;
}
.rc-custom-trigger:hover {
    box-shadow: 0 0 0 1.5px #fca5a5 inset;
}
.rc-custom-trigger:active {
    box-shadow: 0 0 0 1.5px #f87171 inset, 0 0 0 4px rgba(248, 113, 113, .14);
}
.rc-custom-trigger-main {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}
.rc-custom-trigger-value {
    font-size: 24px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--text);
    letter-spacing: .5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rc-custom-trigger-value.rc-custom-placeholder {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 16px;
}
.rc-custom-trigger-arrow {
    color: var(--text-secondary);
    font-size: 16px;
}
.rc-input-prefix {
    font-size: 19px;
    font-weight: 800;
    color: #f87171;
    margin-right: 2px;
}

/* ---- 自定义金额底部弹窗数字键盘 ---- */
.rc-sheet-mask {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(16, 24, 40, .5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.rc-sheet {
    width: 100%;
    max-width: 560px;
    background: var(--surface, #fff);
    border-radius: 20px 20px 0 0;
    padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
    box-shadow: 0 -12px 40px -12px rgba(16, 24, 40, .35);
}
.rc-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.rc-sheet-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}
.rc-sheet-close {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: var(--bg, #f3f4f6);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}
.rc-sheet-close:hover {
    background: #fee2e2;
    color: #f87171;
}
.rc-sheet-amount {
    display: flex;
    align-items: baseline;
    justify-content: center;
    padding: 14px 0 18px;
    margin-bottom: 6px;
}
.rc-sheet-amount-value {
    font-size: 34px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--text);
    letter-spacing: .5px;
}
.rc-sheet-amount-value.rc-custom-placeholder {
    color: var(--text-secondary);
    font-weight: 500;
}
.rc-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.rc-key {
    height: 56px;
    border: none;
    border-radius: 14px;
    background: var(--bg, #f3f4f6);
    color: var(--text);
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .08s ease, background .15s ease;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}
.rc-key:hover {
    background: #e5e7eb;
}
.rc-key:active {
    transform: scale(.94);
    background: #d1d5db;
}
.rc-key-fn {
    background: #fee2e2;
    color: #f87171;
    font-size: 18px;
}
.rc-key-fn:hover {
    background: #fecaca;
}
.rc-key-fn:active {
    background: #fca5a5;
}
.rc-key-done {
    grid-column: 1 / -1;
    height: 58px;
    background: #f87171;
    color: #fff;
    font-size: 19px;
}
.rc-key-done:hover {
    background: #f87171;
}
.rc-key-done:active {
    background: #ef4444;
}
.rc-key-empty {
    background: transparent;
    cursor: default;
}
.rc-key-empty:hover,
.rc-key-empty:active {
    background: transparent;
    transform: none;
}
.rc-sheet-fade-enter-active,
.rc-sheet-fade-leave-active {
    transition: opacity .22s ease;
}
.rc-sheet-fade-enter-active .rc-sheet,
.rc-sheet-fade-leave-active .rc-sheet {
    transition: transform .26s cubic-bezier(.22, .8, .36, 1);
}
.rc-sheet-fade-enter-from,
.rc-sheet-fade-leave-to {
    opacity: 0;
}
.rc-sheet-fade-enter-from .rc-sheet,
.rc-sheet-fade-leave-to .rc-sheet {
    transform: translateY(100%);
}

/* ---- 收银台 ---- */
.rc-cashier {
    max-width: 620px;
}
.rc-cashier-amount {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    margin-bottom: 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, #eff6ff, #fef2f2);
}
.rc-cashier-label {
    font-size: 14px;
    color: var(--text-secondary);
}
.rc-cashier-money {
    font-size: 26px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}
.rc-cashier-money .rc-plan-cny {
    font-size: 16px;
    margin-right: 2px;
}
.rc-cashier-convert {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: -6px 0 14px;
    padding: 9px 14px;
    border-radius: 10px;
    background: rgba(245, 158, 11, .1);
    color: #b45309;
    font-size: 13px;
    font-weight: 600;
}
.rc-cashier-convert i { font-size: 14px; }
html[data-theme="dark"] .rc-cashier-convert {
    background: rgba(245, 158, 11, .16);
    color: #fbbf24;
}
.rc-cashier-section {
    margin-bottom: 14px;
}
.rc-cashier-section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}
.rc-cashier-section-title i {
    color: #3b82f6;
}
.rc-cashier-agreement-link {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 12px;
    background: var(--bg, #f3f4f6);
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}
.rc-cashier-agreement-link:hover {
    background: #eef2ff;
    border-color: #3b82f6;
}
.rc-cashier-agreement-link i:first-child {
    color: #3b82f6;
    font-size: 16px;
}
.rc-cashier-agreement-link i:last-child {
    margin-left: auto;
    color: var(--text-secondary);
    font-size: 14px;
}
.rc-agreement-mask {
    position: fixed;
    inset: 0;
    z-index: 3100;
    background: rgba(16, 24, 40, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.rc-agreement-dialog {
    width: 100%;
    max-width: 520px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    background: var(--surface, #fff);
    border-radius: 16px;
    box-shadow: 0 20px 50px -12px rgba(16, 24, 40, .4);
    padding: 20px;
    overflow: hidden;
}
.rc-agreement-dialog .rc-sheet-title {
    display: flex;
    align-items: center;
    gap: 6px;
}
.rc-agreement-dialog .rc-sheet-title i {
    color: #3b82f6;
}
.rc-agreement-body {
    flex: 1;
    overflow-y: auto;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 12px;
    background: var(--bg, #f3f4f6);
    padding: 14px;
    margin-bottom: 14px;
}
.rc-agreement-text {
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
}
.rc-agreement-text h1 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 10px;
}
.rc-agreement-text h2 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 16px 0 8px;
}
.rc-agreement-text p {
    margin: 0 0 8px;
}
.rc-agreement-text .agreement-updated {
    font-size: 12px;
    color: var(--text-tertiary, var(--text-secondary));
    margin-bottom: 12px;
}
.rc-agreement-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    min-height: 18px;
}
.rc-agreement-hint i {
    font-size: 14px;
}
.rc-agreement-hint-ok {
    color: #16a34a;
}
.rc-agreement-foot {
    display: flex;
    justify-content: flex-end;
}
.rc-agreement-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 10px;
    background: #3b82f6;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, opacity .15s ease;
}
.rc-agreement-btn:hover {
    background: #2563eb;
}
.rc-agreement-btn:disabled {
    background: #c7d2fe;
    cursor: not-allowed;
    opacity: .8;
}
.rc-cashier-agreement-empty {
    color: var(--text-secondary);
    text-align: center;
    padding: 20px 0;
}
.rc-cashier-check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0 14px;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}
.rc-cashier-checkbox {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 2px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    transition: background .15s ease, border-color .15s ease;
}
.rc-cashier-checkbox.rc-checked {
    background: #3b82f6;
    border-color: #3b82f6;
}
.rc-cashier .rc-submit {
    width: 100%;
}

/* ---- 支付方式卡片 ---- */
.rc-pay-list {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.rc-pay-card {
    flex: 1;
    min-width: 130px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 14px 12px;
    border-radius: 12px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, color .18s ease;
}
.rc-pay-card .bi {
    font-size: 21px;
    line-height: 1;
}
.rc-pay-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px -8px rgba(16, 24, 40, .18);
}
.rc-pay-alipay .bi { color: #1677ff; }
.rc-pay-wxpay .bi { color: #07c160; }
.rc-pay-alipay.rc-active { border-color: #1677ff; color: #1677ff; background: rgba(22, 119, 255, .06); box-shadow: 0 0 0 3px rgba(22, 119, 255, .12); }
.rc-pay-wxpay.rc-active { border-color: #07c160; color: #07c160; background: rgba(7, 193, 96, .06); box-shadow: 0 0 0 3px rgba(7, 193, 96, .12); }
.rc-pay-check {
    position: absolute;
    top: -7px;
    right: -7px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #fff;
    background: currentColor;
    opacity: 0;
    transform: scale(.5);
    transition: opacity .18s ease, transform .18s ease;
}
.rc-pay-alipay .rc-pay-check { color: #1677ff; }
.rc-pay-wxpay .rc-pay-check { color: #07c160; }
.rc-pay-card.rc-active .rc-pay-check {
    opacity: 1;
    transform: scale(1);
}
.rc-pay-card.rc-active .rc-pay-check .bi {
    color: #fff;
    font-size: 11px;
}

/* ---- 到账提示 ---- */
.rc-tip {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 13.5px;
    color: var(--warning);
    background: var(--warning-bg);
    border: 1px solid var(--border);
}
.rc-tip strong {
    font-variant-numeric: tabular-nums;
    font-weight: 800;
}
.rc-tip .bi {
    color: #f59e0b;
}

/* ---- 立即充值主按钮 ---- */
.rc-submit {
    width: 100%;
    margin-top: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 15px 20px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #fff;
    background: linear-gradient(115deg, #f87171 0%, #fd8f52 55%, #fee140 130%);
    box-shadow: 0 10px 24px -8px rgba(248, 113, 113, .55);
    transition: transform .2s ease, box-shadow .25s ease, filter .2s ease;
}
.rc-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    filter: brightness(1.05);
    box-shadow: 0 0 0 3px rgba(248, 113, 113, .22), 0 14px 34px -8px rgba(248, 113, 113, .7);
}
.rc-submit:active:not(:disabled) {
    transform: translateY(0) scale(.99);
}
.rc-submit:disabled {
    opacity: .65;
    cursor: not-allowed;
}
.rc-submit .bi {
    font-size: 18px;
}

/* ---- 充值记录表格 ---- */
.rc-refresh-btn .bi {
    font-size: 13px;
}
.rc-table {
    width: 100%;
    --el-table-header-bg-color: var(--surface);
    --el-table-border-color: var(--border);
    --el-table-row-hover-bg-color: var(--primary-light);
    --el-table-bg-color: var(--surface);
    --el-table-tr-bg-color: var(--surface);
    border-radius: 12px;
    overflow: hidden;
}
.rc-table .el-table__header th {
    font-weight: 700;
    color: var(--text-secondary);
}
.rc-table .el-table__body td.el-table__cell,
.rc-table .el-table__body .el-table__cell {
    background-color: var(--surface);
}
.rc-table .el-table__body tr:hover > td.el-table__cell {
    background-color: var(--primary-light);
}
.rc-table .el-table__body tr.current-row > td.el-table__cell {
    background-color: var(--primary-light);
}
.rc-table .el-table__empty-block {
    background-color: var(--surface);
}
.rc-table .el-table__empty-text {
    color: var(--text-secondary);
}
.rc-mono {
    font-family: "SF Mono", "JetBrains Mono", Consolas, monospace;
    font-size: 12.5px;
    color: var(--text-secondary);
}
.rc-amount {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}
.rc-amount-credit {
    color: #ef4444;
}
.rc-tag-success.el-tag {
    --el-tag-bg-color: rgba(16, 185, 129, .12);
    --el-tag-border-color: rgba(16, 185, 129, .35);
    --el-tag-text-color: #10b981;
    font-weight: 700;
}
.rc-tag-warning.el-tag {
    --el-tag-bg-color: rgba(245, 158, 11, .12);
    --el-tag-border-color: rgba(245, 158, 11, .35);
    --el-tag-text-color: #f59e0b;
    font-weight: 700;
}
.rc-tag-danger.el-tag {
    --el-tag-bg-color: rgba(239, 68, 68, .1);
    --el-tag-border-color: rgba(239, 68, 68, .32);
    --el-tag-text-color: #ef4444;
    font-weight: 700;
}
.rc-pager {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 16px;
}
.rc-pager-total {
    font-size: 13px;
    color: var(--text-secondary);
}
/* 钱包分页在深色主题下的 Element Plus 变量适配 */
html[data-theme="dark"] .rc-pager .el-pagination {
    --el-pagination-bg-color: var(--surface);
    --el-pagination-text-color: var(--text-secondary);
    --el-pagination-button-color: var(--text-secondary);
    --el-pagination-button-disabled-bg-color: var(--surface);
    --el-pagination-button-disabled-color: var(--text-muted);
    --el-pagination-hover-color: var(--primary);
}

/* ---- 充值记录卡片 ---- */
.rc-record-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 60px;
}
.rc-record-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 48px 12px;
    text-align: center;
    color: var(--text-secondary);
}
.rc-record-empty .bi {
    font-size: 32px;
    color: var(--text-muted);
    opacity: .55;
    margin-bottom: 6px;
}
.rc-record-empty p {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text);
}
.rc-record-empty span {
    font-size: 12.5px;
    color: var(--text-muted);
}
.rc-record-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    padding: 14px 16px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    transition: box-shadow .18s ease, transform .18s ease;
}
.rc-record-card:hover {
    box-shadow: 0 8px 18px -8px rgba(16, 24, 40, .18);
}
.rc-record-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.rc-record-order {
    word-break: break-all;
    line-height: 1.4;
}
.rc-record-amounts {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    margin-bottom: 12px;
}
.rc-record-amount {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.rc-record-label {
    font-size: 12px;
    color: var(--text-secondary);
}
.rc-record-amount .rc-amount {
    font-size: 16px;
}
.rc-record-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
}
.rc-record-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    color: var(--text-secondary);
}
.rc-record-item .bi {
    font-size: 13px;
    opacity: .8;
}

/* ---- 响应式 ---- */
@media (max-width: 640px) {
    .rc-balance-card {
        padding: 22px 20px;
        border-radius: 16px;
    }
    .rc-balance-num {
        font-size: 36px;
    }
    .rc-balance-inner {
        flex-direction: column;
    }
    .rc-balance-refresh {
        align-self: flex-start;
    }
    .rc-card {
        padding: 18px 16px;
    }
    .rc-pay-card {
        min-width: calc(50% - 6px);
    }
    .rc-pager {
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rc-plan-card,
    .rc-pay-card,
    .rc-submit,
    .rc-balance-refresh {
        transition: none;
    }
    .rc-spin {
        animation: none;
    }
}

/* 商城 */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.shop-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s, transform .2s;
}

.shop-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.shop-card .shop-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--primary-light, rgba(79, 70, 229, .1));
    color: var(--primary);
    font-size: 24px;
    margin-bottom: 12px;
}

.shop-card .shop-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.shop-card .shop-model {
    font-size: 13px;
    color: var(--primary);
    margin-bottom: 10px;
}

.shop-card .shop-desc {
    font-size: 13px;
    color: var(--text-secondary);
    flex: 1;
    margin-bottom: 14px;
    min-height: 20px;
}

.shop-card .shop-price {
    font-size: 22px;
    font-weight: 700;
    color: var(--danger);
    margin-bottom: 4px;
}

.shop-card .shop-price small {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-muted);
}

.shop-card .shop-prices {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 14px;
    flex-wrap: wrap;
}

/* ============ 商城现代化重构（.sh- 前缀） ============ */
[v-cloak] { display: none; }

/* Banner */
.sh-banner {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    background: linear-gradient(120deg, #4facfe 0%, #00f2fe 100%);
    padding: 44px 40px 74px;
    margin-bottom: 22px;
    box-shadow: 0 16px 40px rgba(79, 172, 254, .35);
}
.sh-banner-inner { position: relative; z-index: 1; }
.sh-banner-title {
    font-size: 30px;
    font-weight: 800;
    color: #fff;
    letter-spacing: .5px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-shadow: 0 2px 12px rgba(0, 90, 140, .25);
}
.sh-banner-title .bi { font-size: 30px; }
.sh-banner-sub {
    margin-top: 8px;
    font-size: 14px;
    color: rgba(255, 255, 255, .92);
    letter-spacing: 1px;
}
.sh-banner-wave {
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 100%;
    height: 76px;
    display: block;
}

/* 分类胶囊 Tab */
.sh-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.sh-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 20px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: all .22s cubic-bezier(.4, 0, .2, 1);
}
.sh-tab .bi { font-size: 14px; }
.sh-tab:hover { transform: translateY(-2px); border-color: #4facfe; color: #4facfe; }
.sh-tab.active {
    background: linear-gradient(120deg, #4facfe, #00f2fe);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 8px 20px rgba(79, 172, 254, .4);
}

/* 状态 */
.sh-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 70px 20px;
    color: var(--text-muted);
    font-size: 14px;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 16px;
}
.sh-state .bi { font-size: 26px; }
.sh-state-error { color: var(--danger); }

/* 卡片网格 */
.sh-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
    gap: 20px;
}
.sh-card {
    position: relative;
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .28s cubic-bezier(.4, 0, .2, 1), box-shadow .28s cubic-bezier(.4, 0, .2, 1);
}
.sh-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 22px 48px rgba(16, 24, 40, .18);
}

/* 热门徽章 */
.sh-badge-hot {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: 52px;
    height: 52px;
    justify-content: center;
    flex-direction: column;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #f43f5e, #ef4444 60%, #f97316);
    box-shadow: 0 8px 18px rgba(239, 68, 68, .45);
    line-height: 1.1;
}
.sh-badge-hot .bi { font-size: 15px; }

/* 卡片头部彩色区：4 套主题 */
.sh-card-head {
    padding: 26px 22px 20px;
    color: #fff;
    position: relative;
}
.sh-theme-0 .sh-card-head { background: linear-gradient(135deg, #1f2937, #0f172a); }
.sh-theme-1 .sh-card-head { background: linear-gradient(135deg, #2563eb, #0ea5e9); }
.sh-theme-2 .sh-card-head { background: linear-gradient(135deg, #ef4444, #f97316); }
.sh-theme-3 .sh-card-head { background: linear-gradient(135deg, #16a34a, #22c55e); }
.sh-theme-0 .sh-buy { background: linear-gradient(135deg, #1f2937, #0f172a); }
.sh-theme-1 .sh-buy { background: linear-gradient(135deg, #2563eb, #0ea5e9); }
.sh-theme-2 .sh-buy { background: linear-gradient(135deg, #ef4444, #f97316); }
.sh-theme-3 .sh-buy { background: linear-gradient(135deg, #16a34a, #22c55e); }

.sh-head-icon {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .22);
    backdrop-filter: blur(4px);
    font-size: 23px;
    margin-bottom: 12px;
}
.sh-head-name { font-size: 17px; font-weight: 700; }
.sh-head-model { font-size: 12px; opacity: .88; margin-top: 3px; }

/* 卡身 */
.sh-card-body {
    padding: 18px 22px 22px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.sh-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.sh-price-now { font-size: 30px; font-weight: 800; color: #ef4444; letter-spacing: -.5px; }
.sh-price-old {
    font-size: 14px;
    color: var(--text-muted);
    text-decoration: line-through;
}
.sh-price-unit { font-size: 12px; color: var(--text-muted); }
.sh-limit {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    align-self: flex-start;
    margin-top: 9px;
    padding: 3px 11px;
    font-size: 11px;
    font-weight: 700;
    color: #d97706;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 999px;
}
.sh-features {
    list-style: none;
    margin: 14px 0 18px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    flex: 1;
}
.sh-features li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}
.sh-features .bi { color: #22c55e; font-size: 15px; margin-top: 1px; flex-shrink: 0; }

/* 套餐图标图片与关联模型 */
.sh-head-icon {
    overflow: hidden;
}
.sh-icon-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.sh-models {
    margin: 0 0 18px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg, #f5f6fa);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sh-models-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
}
.sh-models-title .bi { font-size: 13px; }
.sh-model-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 12.5px;
}
.sh-model-name {
    color: var(--text);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sh-model-price {
    color: #ef4444;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

/* 购买按钮 + ripple */
.sh-buy {
    position: relative;
    overflow: hidden;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px;
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    box-shadow: 0 8px 18px rgba(16, 24, 40, .14);
    transition: transform .2s, box-shadow .2s, filter .2s;
}
.sh-buy .bi { transition: transform .25s; }
.sh-buy:hover { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 12px 26px rgba(16, 24, 40, .2); }
.sh-buy:hover .bi { transform: translateX(4px); }
.sh-buy:active { transform: translateY(0) scale(.98); }
.sh-buy::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, .55) 10%, transparent 10.01%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10, 10);
    opacity: 0;
    transition: transform .55s, opacity .9s;
    pointer-events: none;
}
.sh-buy:active::after {
    transform: scale(0, 0);
    opacity: .4;
    transition: 0s;
}
.sh-buy.disabled,
.sh-buy[disabled] {
    background: var(--border, #e5e7eb) !important;
    color: var(--text-muted, #9ca3af);
    cursor: not-allowed;
    box-shadow: none;
}
.sh-buy.disabled:hover,
.sh-buy[disabled]:hover {
    transform: none;
    filter: none;
    box-shadow: none;
}
.sh-buy.disabled .bi,
.sh-buy[disabled] .bi {
    transform: none;
}

@media (max-width: 640px) {
    .sh-banner { padding: 32px 22px 60px; }
    .sh-banner-title { font-size: 24px; }
    .sh-grid { grid-template-columns: 1fr; }
}

/* ============ 模型广场现代化重构（.md- 前缀） ============ */
#panel-models {
    min-height: 400px;
}

#panel-models [v-cloak] {
    display: none;
}

/* 顶部工具栏：搜索 + 筛选 */
.md-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.md-search-wrap {
    flex: 1;
    min-width: 280px;
    position: relative;
    display: flex;
    align-items: center;
}

.md-search-icon {
    position: absolute;
    left: 18px;
    font-size: 18px;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 1;
}

.md-search-input {
    width: 100%;
    height: 52px;
    padding: 0 48px 0 50px;
    font-size: 15px;
    border: 2px solid var(--border);
    border-radius: 28px;
    background: var(--surface);
    color: var(--text);
    transition: border-color .2s, box-shadow .2s;
    outline: none;
}

.md-search-input::placeholder {
    color: var(--text-muted);
}

.md-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(17, 24, 39, .08);
}

.md-search-clear {
    position: absolute;
    right: 16px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-muted);
    transition: color .15s, background .15s;
    z-index: 1;
}

.md-search-clear:hover {
    color: var(--text);
    background: var(--bg);
}

.md-filter-select {
    width: 140px;
}

.md-filter-select .el-select__wrapper {
    min-height: 44px;
    border-radius: 22px;
    border: 2px solid var(--border);
    box-shadow: none;
    transition: border-color .2s;
}

.md-filter-select .el-select__wrapper:hover {
    border-color: var(--primary);
}

.md-filter-select .el-select__wrapper.is-focused {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(17, 24, 39, .08);
}

/* 厂商 Tab：横向滚动胶囊 */
.md-vendor-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.md-vendor-tabs::-webkit-scrollbar {
    display: none;
}

.md-vendor-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 24px;
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: all .2s;
    flex-shrink: 0;
}

.md-vendor-tab:hover {
    border-color: var(--vendor-color, var(--primary));
    color: var(--vendor-color, var(--primary));
}

.md-vendor-tab.active {
    border-color: var(--vendor-color, var(--primary));
    background: var(--vendor-color, var(--primary));
    color: #fff;
}

.md-vendor-tab.active .md-vendor-dot {
    background: #fff;
}

.md-vendor-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--vendor-color, var(--primary));
    flex-shrink: 0;
}

/* 模型卡片网格 */
.md-models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
}

.md-model-card {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
    position: relative;
}

.md-model-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(16, 24, 40, .12);
    border-color: var(--primary);
}

.md-model-card.is-fav {
    border-color: #ffd700;
}

/* 卡片头部：Logo + 厂商名 + 收藏 */
.md-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.md-card-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
    overflow: hidden;
}

.md-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.md-card-vendor {
    flex: 1;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.md-fav-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 18px;
    transition: all .2s;
    flex-shrink: 0;
}

.md-fav-btn:hover {
    background: var(--bg);
    color: #ffd700;
    transform: scale(1.1);
}

.md-fav-btn.active {
    color: #ffd700;
}

.md-fav-btn.active i {
    animation: favPop .3s ease;
}

@keyframes favPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* 卡片主体 */
.md-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.md-model-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.4;
    word-break: break-all;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.md-model-ctx {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg);
    padding: 4px 10px;
    border-radius: 12px;
    width: fit-content;
}

.md-model-ctx i {
    font-size: 11px;
}

.md-model-prices {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.md-price-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.md-price-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.md-price-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.md-model-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
}

.md-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.md-tag i {
    font-size: 11px;
}

.md-tag-vision {
    background: #eff6ff;
    color: #2563eb;
}

.md-tag-tool {
    background: #f0fdf4;
    color: #16a34a;
}

.md-tag-reason {
    background: #fef3c7;
    color: #d97706;
}

/* 卡片底部：立即使用按钮 */
.md-card-foot {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.md-use-btn {
    width: 100%;
    padding: 10px 16px;
    border-radius: 24px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    transition: opacity .2s, transform .2s;
    opacity: .95;
}

.md-use-btn:hover {
    opacity: 1;
    transform: scale(1.02);
}

.md-use-btn:active {
    transform: scale(.98);
}

/* 空状态 */
.md-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.md-empty-illustration {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.md-empty-illustration i {
    font-size: 48px;
    color: var(--text-muted);
    opacity: .5;
}

.md-empty-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.md-empty-sub {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.md-empty-reset {
    padding: 10px 28px;
    border-radius: 24px;
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    transition: opacity .2s;
}

.md-empty-reset:hover {
    opacity: .9;
}

/* 响应式 */
@media (max-width: 768px) {
    .md-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .md-search-wrap {
        min-width: 100%;
    }

    .md-filter-select {
        width: 100%;
    }

    .md-models-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 14px;
    }

    .md-model-card {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .md-models-grid {
        grid-template-columns: 1fr;
    }

    .md-search-input {
        height: 48px;
        font-size: 14px;
    }
}

/* 我的套餐 */
.mod-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.mod-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow);
}

.mod-card .mod-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.mod-card .mod-name {
    font-size: 15px;
    font-weight: 600;
}

.progress {
    height: 8px;
    background: #eef0f4;
    border-radius: 20px;
    overflow: hidden;
    margin: 8px 0;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 20px;
    transition: width .3s;
}

.mod-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 10px;
    font-size: 13px;
}

.mod-stats .ms-label {
    color: var(--text-muted);
    font-size: 12px;
}

.mod-stats .ms-value {
    font-weight: 500;
}

/* ============ 我的套餐（现代化重构 .mm-） ============ */
/* ---- 计费方式切换卡片 ---- */
.mm-billing-card {
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 20px;
}
.mm-billing-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}
.mm-billing-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.mm-billing-title i { color: var(--primary); }
.mm-billing-balance { font-size: 13px; color: var(--text-secondary); }
.mm-billing-balance strong { color: var(--primary); font-weight: 700; }
.mm-billing-cur-switch { display: inline-flex; gap: 4px; margin-left: 10px; vertical-align: middle; }
.mm-cur-btn {
    min-width: 26px;
    height: 22px;
    padding: 0 6px;
    font-size: 12px;
    line-height: 20px;
    color: var(--text-secondary);
    background: var(--bg-soft, rgba(148, 163, 184, .12));
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all .15s ease;
}
.mm-cur-btn:hover { color: var(--primary); }
.mm-cur-btn.mm-cur-active {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}
.mm-billing-modes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}
.mm-billing-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    text-align: left;
    padding: 14px 16px;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    background: var(--bg-soft, #f8fafc);
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.mm-billing-btn i { font-size: 20px; color: var(--text-muted); }
.mm-billing-btn span { font-size: 14px; font-weight: 700; color: var(--text); }
.mm-billing-btn em { font-size: 12px; font-style: normal; color: var(--text-muted); }
.mm-billing-btn:hover { border-color: var(--primary); }
.mm-billing-btn.mm-billing-active {
    border-color: var(--primary);
    background: var(--primary-light, rgba(37, 99, 235, .08));
    box-shadow: 0 0 0 1px var(--primary) inset;
}
.mm-billing-btn.mm-billing-active i { color: var(--primary); }
.mm-billing-tip {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 12px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-muted);
}
.mm-billing-tip i { color: var(--primary); margin-top: 2px; }
/* 当前计费方式概览（只读） */
.mm-billing-current {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border: 1px solid var(--primary);
    border-radius: 12px;
    background: var(--primary-light, rgba(37, 99, 235, .08));
}
.mm-billing-current i { font-size: 18px; color: var(--primary); }
.mm-billing-current-label { font-size: 13px; color: var(--text-secondary); }
.mm-billing-current-value { font-size: 14px; font-weight: 700; color: var(--primary); margin-left: auto; }
/* 切换计费方式（页面下方） */
.mm-billing-switch { margin-top: 20px; margin-bottom: 0; }

.mm-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.mm-stat {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border-radius: var(--radius);
    color: #fff;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .25s ease, box-shadow .25s ease;
}

.mm-stat:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.mm-stat::after {
    content: '';
    position: absolute;
    right: -24px;
    top: -24px;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .14);
}

.mm-stat-1 { background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%); }
.mm-stat-2 { background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%); }
.mm-stat-3 { background: linear-gradient(135deg, #64748b 0%, #94a3b8 100%); }
.mm-stat-4 { background: linear-gradient(135deg, #10b981 0%, #14b8a6 100%); }

.mm-stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, .2);
    font-size: 22px;
}

.mm-stat-meta { min-width: 0; }

.mm-stat-value {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.mm-stat-label {
    margin-top: 2px;
    font-size: 13px;
    opacity: .88;
}

.mm-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.mm-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 18px 22px 18px 26px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease;
}

.mm-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.mm-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    border-radius: 5px 0 0 5px;
}

.mm-item-active .mm-bar { background: linear-gradient(180deg, #34d399, #10b981); }
.mm-item-expiring .mm-bar { background: linear-gradient(180deg, #fbbf24, #f97316); }
.mm-item-expired .mm-bar { background: linear-gradient(180deg, #cbd5e1, #94a3b8); }
.mm-item-idle .mm-bar { background: linear-gradient(180deg, #94a3b8, #64748b); }

.mm-item-expired { opacity: .78; }

.mm-main {
    flex: 1;
    min-width: 0;
}

.mm-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.mm-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mm-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
}

.mm-badge-success { background: var(--success-bg); color: var(--success); }
.mm-badge-warning { background: var(--warning-bg); color: var(--warning); }
.mm-badge-neutral { background: var(--primary-light); color: var(--text-secondary); }
.mm-badge-idle { background: #e2e8f0; color: #64748b; }

.mm-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 22px;
    font-size: 13px;
    color: var(--text-secondary);
}

.mm-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.mm-meta-item i {
    font-size: 13px;
    color: var(--text-muted);
}

.mm-progress {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.mm-progress .el-progress__text {
    font-size: 13px !important;
    font-weight: 600;
}

.mm-progress-label {
    font-size: 12px;
    color: var(--text-muted);
}

.mm-actions {
    flex-shrink: 0;
    display: flex;
    gap: 10px;
}

.mm-btn-renew {
    border: none !important;
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%) !important;
    color: #fff !important;
    font-weight: 500;
    transition: opacity .2s ease, transform .2s ease, box-shadow .2s ease !important;
}

.mm-btn-renew:hover {
    opacity: .92;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, .35);
}

.mm-btn-renew.is-disabled,
.mm-btn-renew.is-disabled:hover {
    background: var(--primary-light) !important;
    color: var(--text-muted) !important;
    box-shadow: none;
    transform: none;
}

.mm-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 64px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.mm-empty-art {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    margin-bottom: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #eff6ff 0%, #eff6ff 100%);
    color: #3b82f6;
    font-size: 44px;
}

.mm-empty-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.mm-empty-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .mm-item {
        flex-wrap: wrap;
        gap: 14px;
    }
    .mm-main { flex: 1 1 100%; }
    .mm-progress { flex-direction: row; }
    .mm-actions { width: 100%; justify-content: flex-end; }
}

/* 弹窗 */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, .5);
    display: flex;
    align-items: center;
    justify-content: center;
    /* 弹层需完整覆盖顶栏/底部导航（1000，m-lock 下 1200） */
    z-index: 3000;
    padding: 20px;
}

.modal-overlay[hidden] {
    display: none;
}

.modal {
    background: var(--surface);
    border-radius: var(--radius);
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    overflow: auto;
}

.modal-sm {
    max-width: 320px;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-head h3 {
    font-size: 16px;
    font-weight: 600;
}

.modal-close {
    font-size: 24px;
    color: var(--text-muted);
    line-height: 1;
    padding: 4px;
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    padding: 20px;
}

.modal-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

.st-field-tip {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.modal-body-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.qrcode-img {
    width: 220px;
    height: 220px;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    margin-bottom: 12px;
}

.qrcode-link {
    font-size: 12px;
    color: var(--text-muted);
    word-break: break-all;
    line-height: 1.5;
    margin-bottom: 8px;
    max-height: 60px;
    overflow-y: auto;
    text-align: left;
}

.qrcode-canvas {
    width: 220px;
    height: 220px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qrcode-canvas img,
.qrcode-canvas canvas {
    width: 220px;
    height: 220px;
}

.pay-qrcode {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 14px 0 10px;
}

.pay-qrcode .qrcode-img,
.pay-qrcode img,
.pay-qrcode canvas {
    width: 200px;
    height: 200px;
}

.pay-status {
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 6px;
}

.pay-status-success {
    color: var(--success, #16a34a);
    font-weight: 600;
}

/* ========== 扫码支付弹窗（.qr- 前缀） ========== */
#qrcode-modal .qr-modal {
    background: #fff;
    border-radius: 24px;
    width: 400px;
    max-width: calc(100vw - 40px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .25), 0 0 0 1px rgba(0, 0, 0, .05);
    overflow: hidden;
    animation: qr-modal-in .3s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes qr-modal-in {
    from {
        opacity: 0;
        transform: scale(.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

#qrcode-modal .qr-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
}

#qrcode-modal .qr-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    letter-spacing: .5px;
}

#qrcode-modal .qr-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .2);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}

#qrcode-modal .qr-close:hover {
    background: rgba(255, 255, 255, .35);
}

#qrcode-modal .qr-body {
    padding: 28px 28px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#qrcode-modal .qr-card {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .06);
    margin-bottom: 20px;
}

#qrcode-modal .qr-img,
#qrcode-modal .qr-canvas {
    width: 220px;
    height: 220px;
    object-fit: contain;
    display: block;
}

#qrcode-modal .qr-canvas {
    display: flex;
    align-items: center;
    justify-content: center;
}

#qrcode-modal .qr-canvas img,
#qrcode-modal .qr-canvas canvas {
    width: 220px;
    height: 220px;
}

#qrcode-modal .qr-amount {
    font-size: 32px;
    font-weight: 700;
    color: #ef4444;
    line-height: 1.2;
    margin-bottom: 8px;
}

#qrcode-modal .qr-order {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #9ca3af;
    margin-bottom: 16px;
}

#qrcode-modal .qr-order-no {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: #6b7280;
}

#qrcode-modal .qr-copy {
    border: none;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background .2s, color .2s;
}

#qrcode-modal .qr-copy:hover {
    background: #e5e7eb;
    color: #374151;
}

#qrcode-modal .qr-countdown {
    width: 100%;
    margin-bottom: 20px;
}

#qrcode-modal .qr-countdown-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 6px;
}

#qrcode-modal .qr-countdown-track {
    width: 100%;
    height: 6px;
    background: #f3f4f6;
    border-radius: 999px;
    overflow: hidden;
}

#qrcode-modal .qr-countdown-bar {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #22c55e 0%, #eab308 50%, #ef4444 100%);
    transition: width 1s linear;
}

#qrcode-modal .qr-actions {
    display: flex;
    gap: 12px;
    width: 100%;
}

#qrcode-modal .qr-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, opacity .15s;
}

#qrcode-modal .qr-btn:active {
    transform: scale(.98);
}

#qrcode-modal .qr-btn-success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(34, 197, 94, .3);
}

#qrcode-modal .qr-btn-success:hover {
    box-shadow: 0 6px 16px rgba(34, 197, 94, .4);
}

#qrcode-modal .qr-btn-cancel {
    background: #f3f4f6;
    color: #6b7280;
}

#qrcode-modal .qr-btn-cancel:hover {
    background: #e5e7eb;
    color: #374151;
}

#qrcode-modal .qr-success {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, .96);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
}

#qrcode-modal .qr-success.show {
    opacity: 1;
    pointer-events: auto;
}

#qrcode-modal .qr-success-icon {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(34, 197, 94, .35);
    transform: scale(0);
    transition: transform .5s cubic-bezier(.34, 1.56, .64, 1);
}

#qrcode-modal .qr-success.show .qr-success-icon {
    transform: scale(1);
}

#qrcode-modal .qr-success-icon svg {
    width: 48px;
    height: 48px;
    color: #fff;
}

#qrcode-modal .qr-success-text {
    font-size: 20px;
    font-weight: 600;
    color: #16a34a;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .4s .15s, transform .4s .15s;
}

#qrcode-modal .qr-success.show .qr-success-text {
    opacity: 1;
    transform: translateY(0);
}

#qrcode-modal .qr-link {
    font-size: 12px;
    color: #9ca3af;
    word-break: break-all;
    line-height: 1.5;
    margin-bottom: 12px;
    max-height: 60px;
    overflow-y: auto;
    text-align: center;
    width: 100%;
}

.order-info {
    display: grid;
    gap: 8px;
    margin: 14px 0;
    padding: 14px;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.order-info .oi-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.order-info .oi-row span:first-child {
    color: var(--text-muted);
}

.order-info .oi-row span:last-child {
    font-weight: 500;
    text-align: right;
    word-break: break-all;
}

/* ========== 支付弹窗现代化重构（.pm- 前缀） ========== */
.pm-overlay {
    background: rgba(15, 12, 30, .45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* PC 端顶栏(.topbar)/底部导航(.tabbar)均为 z-index:1000，
   弹层需抬升到 3000 才能完整覆盖头部与底部 */
#pay-modal.pm-overlay,
#qrcode-modal.modal-overlay {
    z-index: 3000;
}

.pm-modal {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: 92vh;
    overflow-y: auto;
    background: var(--surface);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
    animation: pm-modal-in .32s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes pm-modal-in {
    from {
        opacity: 0;
        transform: scale(.9) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.pm-close {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 2;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .22);
    color: #fff;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .3s ease, background .3s ease;
}

.pm-close:hover {
    background: rgba(255, 255, 255, .38);
    transform: rotate(90deg);
}

.pm-hero {
    position: relative;
    padding: 34px 32px 30px;
    background: linear-gradient(135deg, #2563eb 0%, #dc2626 55%, #dc2626 100%);
    border-radius: 24px 24px 0 0;
    overflow: hidden;
}

.pm-hero::after {
    content: "";
    position: absolute;
    top: -60px;
    right: -40px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
}

.pm-hero::before {
    content: "";
    position: absolute;
    bottom: -70px;
    left: -30px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
}

.pm-hero-title {
    position: relative;
    z-index: 1;
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    letter-spacing: .02em;
}

.pm-hero-sub {
    position: relative;
    z-index: 1;
    margin: 8px 0 0;
    font-size: 13px;
    color: rgba(255, 255, 255, .85);
}

.pm-body {
    padding: 24px 28px 28px;
}

.pm-order-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 20px;
}

.pm-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;
    padding: 5px 0;
    font-size: 13px;
}

.pm-row-label {
    flex-shrink: 0;
    color: var(--text-muted, #94a3b8);
}

.pm-row-value {
    font-weight: 500;
    color: var(--text, #1e293b);
    text-align: right;
    word-break: break-all;
}

.pm-mono {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 12.5px;
    letter-spacing: .01em;
}

.pm-amount-row {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}

.pm-amount {
    font-size: 26px;
    font-weight: 700;
    color: #ef4444;
    line-height: 1.2;
}

.pm-section-title {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text, #1e293b);
}

.pm-pay-methods {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 22px;
}

.pm-pay-btn {
    --pm-brand: #1677ff;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px 12px;
    border: 2px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    cursor: pointer;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.pm-pay-btn i {
    font-size: 26px;
    color: var(--pm-brand);
    line-height: 1;
}

.pm-pay-btn span {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.pm-pay-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(15, 23, 42, .08);
}

.pm-pay-btn.active {
    border-color: transparent;
    background: linear-gradient(var(--surface), var(--surface)) padding-box,
        linear-gradient(135deg, var(--pm-brand), var(--pm-brand-soft, var(--pm-brand))) border-box;
    box-shadow: 0 8px 20px color-mix(in srgb, var(--pm-brand) 28%, transparent);
}

.pm-pay-btn.active::after {
    content: "\F26E";
    font-family: "bootstrap-icons";
    position: absolute;
    top: -8px;
    right: -6px;
    width: 20px;
    height: 20px;
    font-size: 11px;
    line-height: 20px;
    text-align: center;
    color: #fff;
    background: var(--pm-brand);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
    z-index: 2;
}

.pm-pay-btn[data-pay-type="alipay"] { --pm-brand: #1677ff; --pm-brand-soft: #69b1ff; }
.pm-pay-btn[data-pay-type="wxpay"] { --pm-brand: #07c160; --pm-brand-soft: #3ad98a; }

.pm-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 15px 20px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #2563eb 0%, #dc2626 55%, #dc2626 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: .02em;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
    box-shadow: 0 10px 24px rgba(220, 38, 38, .32);
}

.pm-submit:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
    box-shadow: 0 14px 30px rgba(220, 38, 38, .4);
}

.pm-submit:active {
    transform: translateY(0);
    filter: brightness(.97);
}

.pm-submit i {
    font-size: 18px;
}

.pm-qrcode-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 0 2px;
}

.pm-qrcode-wrap .pay-qrcode {
    margin: 4px 0 10px;
    padding: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.pm-alipay-pay-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: fit-content;
    margin: 14px auto 0;
    padding: 12px 22px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #1677ff 0%, #06a4ff 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
    box-shadow: 0 8px 20px rgba(22, 119, 255, .35);
}

.pm-alipay-pay-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
    box-shadow: 0 12px 28px rgba(22, 119, 255, .45);
}

.pm-alipay-pay-btn:active {
    transform: translateY(0);
    filter: brightness(.97);
}

.pm-alipay-pay-btn .bi {
    font-size: 18px;
}

.pm-pay-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #1677ff;
    background: rgba(22, 119, 255, .06);
    text-decoration: none;
    transition: background .18s ease, color .18s ease;
}

.pm-pay-link:hover {
    background: rgba(22, 119, 255, .12);
    color: #0958d9;
}

.pm-pay-link i {
    font-size: 14px;
}

@media (max-width: 560px) {
    .pm-modal {
        border-radius: 20px;
    }
    .pm-hero {
        padding: 28px 24px 24px;
    }
    .pm-body {
        padding: 20px;
    }
    .pm-pay-methods {
        gap: 8px;
    }
    .pm-amount {
        font-size: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pm-modal {
        animation: none;
    }
    .pm-close,
    .pm-pay-btn,
    .pm-submit {
        transition: none;
    }
}
/* ========== /支付弹窗现代化重构 ========== */

.copy-btn {
    padding: 4px 10px;
    font-size: 12px;
}

/* 个人设置布局 */
.settings-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    align-items: start;
}

/* 响应式 */
@media (max-width: 768px) {
    .settings-layout {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .ud-panels {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .ud-line-svg {
        height: 160px;
    }

    .app-main {
        padding: 16px 14px calc(90px + env(safe-area-inset-bottom, 0px));
        margin-left: 0;
    }

    .tabbar {
        display: block;
    }

    /* 移动端隐藏左侧目录栏，改用底部导航 */
    .sidebar {
        display: none;
    }

    /* 移动端侧边栏已隐藏，收缩按钮无意义，一并隐藏 */
    .sidebar-toggle {
        display: none;
    }

    .layout {
        display: block;
        max-width: none;
    }

    /* 移动端顶栏 */
    .tb-inner {
        gap: 12px;
        padding: 0 14px;
    }

    .tb-brand-name {
        font-size: 15px;
    }

    .tb-brand-logo {
        display: none;
    }

    .menu-toggle,
    .tb-menu-toggle {
        display: inline-flex;
        margin-left: auto;
    }

    .tb-user {
        margin-left: auto;
    }

    .tb-avatar-wrap {
        margin-left: 0;
    }

    .username {
        display: none;
    }

    .tb-avatar-menu {
        right: -8px;
    }
}

/* ============ 平板 / 小屏笔记本（769px - 1024px） ============ */
@media (min-width: 769px) and (max-width: 1024px) {
    :root {
        --sidebar-w: 200px;
        --content-max: 1000px;
    }

    .sidebar {
        padding: 16px 10px;
    }

    .app-main {
        padding: 20px 20px 48px;
    }

    .topbar-inner {
        padding: 0 20px;
        gap: 16px;
    }
}

/* ============ 中屏（1025px - 1365px） ============ */
@media (min-width: 1025px) and (max-width: 1365px) {
    :root {
        --content-max: 1200px;
    }
}

/* ============ 大屏（1366px - 1919px） ============ */
@media (min-width: 1366px) and (max-width: 1919px) {
    :root {
        --content-max: 1400px;
    }

    .app-main {
        padding: 28px 32px 72px;
    }
}

/* ============ 超大屏 / 高分辨率（≥1920px） ============ */
@media (min-width: 1920px) {
    :root {
        --content-max: 1600px;
        --sidebar-w: 240px;
    }

    .app-main {
        padding: 32px 40px 80px;
    }

    .sidebar {
        padding: 24px 16px;
    }

    .topbar-inner {
        padding: 0 32px;
    }
}

@media (max-width: 420px) {
    /* 手机版仪表盘卡片保持一行两个 */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card {
        padding: 14px 14px;
    }

    .stat-card .stat-label {
        font-size: 12px;
        margin-bottom: 4px;
    }

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

/* ========== 公告弹窗 #popup-modal (.pp- 前缀) ========== */
.pp-overlay {
    padding: 20px;
}

.pp-modal {
    position: relative;
    width: 100%;
    max-width: 480px;
    background: var(--surface);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(16, 24, 40, .18), 0 4px 16px rgba(16, 24, 40, .08);
    overflow: hidden;
    animation: pp-slide-down .38s cubic-bezier(.21, 1.02, .55, 1) both;
}

.pp-deco {
    height: 6px;
    background: linear-gradient(90deg, #3b82f6 0%, #dc2626 50%, #f59e0b 100%);
}

.pp-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: background .2s, color .2s, transform .2s;
}

.pp-close:hover {
    background: rgba(0, 0, 0, .06);
    color: var(--text);
    transform: rotate(90deg);
}

.pp-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px 28px 12px;
}

.pp-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(59, 130, 246, .12) 0%, rgba(220, 38, 38, .12) 50%, rgba(245, 158, 11, .12) 100%);
    margin-bottom: 14px;
}

.pp-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: .02em;
}

.pp-body {
    padding: 0 28px 20px;
    font-size: 15px;
    line-height: 1.75;
    color: var(--text-secondary);
}

.pp-body p {
    margin: 0 0 12px;
}

.pp-body p:last-child {
    margin-bottom: 0;
}

.pp-body strong {
    color: var(--text);
    font-weight: 600;
}

.pp-body em {
    font-style: italic;
}

.pp-body ul,
.pp-body ol {
    margin: 0 0 12px;
    padding-left: 1.35em;
}

.pp-body li {
    margin-bottom: 6px;
}

.pp-body li:last-child {
    margin-bottom: 0;
}

.pp-body a {
    color: #3b82f6;
    text-decoration: none;
    border-bottom: 1px dashed rgba(59, 130, 246, .45);
    transition: color .2s, border-color .2s;
}

.pp-body a:hover {
    color: #dc2626;
    border-bottom-color: rgba(220, 38, 38, .6);
}

.pp-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    margin: 8px 0;
}

.pp-body blockquote {
    margin: 0 0 12px;
    padding: 10px 14px;
    border-left: 3px solid #3b82f6;
    background: rgba(59, 130, 246, .06);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
}

.pp-body code {
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(59, 130, 246, .08);
    color: #2563eb;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: .92em;
}

.pp-foot {
    padding: 0 28px 28px;
}

.pp-btn {
    width: 100%;
    padding: 13px 20px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(90deg, #3b82f6 0%, #dc2626 50%, #f59e0b 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: .04em;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s, filter .2s;
    box-shadow: 0 4px 14px rgba(59, 130, 246, .28);
}

.pp-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(59, 130, 246, .34);
    filter: brightness(1.05);
}

.pp-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(59, 130, 246, .28);
}

@keyframes pp-slide-down {
    from {
        opacity: 0;
        transform: translateY(-32px) scale(.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 520px) {
    .pp-modal {
        border-radius: 18px;
    }

    .pp-head,
    .pp-body,
    .pp-foot {
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* ========== 卡密核销面板现代化重构（.km- 前缀） ========== */
#panel-kami {
    max-width: 720px;
    margin: 0 auto;
    animation: km-fade-in .45s ease both;
}

@keyframes km-fade-in {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- Hero 卡片 ---- */
.km-hero {
    position: relative;
    border-radius: 20px;
    padding: 44px 32px 38px;
    margin-bottom: 22px;
    background: linear-gradient(135deg, #f87171 0%, #fee140 100%);
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(248, 113, 113, .28);
    text-align: center;
}

.km-hero-glow {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
    pointer-events: none;
}

.km-hero-glow-1 {
    top: -70px;
    right: -50px;
    width: 220px;
    height: 220px;
}

.km-hero-glow-2 {
    bottom: -90px;
    left: -40px;
    width: 180px;
    height: 180px;
    background: rgba(255, 255, 255, .1);
}

.km-hero-content {
    position: relative;
    z-index: 1;
}

.km-hero-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .22);
    backdrop-filter: blur(6px);
    margin-bottom: 16px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .08);
}

.km-hero-icon svg {
    width: 32px;
    height: 32px;
    color: #fff;
}

.km-hero-title {
    margin: 0;
    font-size: 30px;
    font-weight: 700;
    color: #fff;
    letter-spacing: .04em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .1);
}

.km-hero-subtitle {
    margin: 10px 0 0;
    font-size: 14px;
    color: rgba(255, 255, 255, .92);
    letter-spacing: .02em;
}

/* ---- 输入卡片 ---- */
.km-input-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 24px;
    margin-bottom: 22px;
    box-shadow: var(--shadow);
}

.km-input-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.km-input-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.km-input-title-icon {
    display: inline-flex;
    color: #f87171;
}

.km-input-title-icon svg {
    width: 18px;
    height: 18px;
}

.km-input-hint {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--primary-light);
    padding: 3px 10px;
    border-radius: 20px;
}

.km-input-wrap {
    position: relative;
    margin-bottom: 16px;
}

.km-input {
    width: 100%;
    padding: 16px 18px;
    padding-right: 72px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: .14em;
    color: var(--text);
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 14px;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
    text-transform: uppercase;
}

.km-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: .06em;
}

.km-input:focus {
    border-color: #f87171;
    background: var(--surface);
    box-shadow: 0 0 0 4px rgba(248, 113, 113, .12);
}

.km-input-length {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: var(--text-muted);
    font-family: "SFMono-Regular", Consolas, monospace;
    pointer-events: none;
}

/* ---- 核销按钮 ---- */
.km-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 15px 20px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #f87171 0%, #fee140 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: .06em;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
    box-shadow: 0 8px 20px rgba(248, 113, 113, .3);
}

.km-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    filter: brightness(1.07);
    box-shadow: 0 0 0 3px rgba(248, 113, 113, .18), 0 14px 34px rgba(248, 113, 113, .45);
}

.km-submit-btn:active:not(:disabled) {
    transform: translateY(0);
    filter: brightness(.97);
}

.km-submit-btn:disabled {
    opacity: .65;
    cursor: not-allowed;
}

.km-submit-btn-icon {
    display: inline-flex;
}

.km-submit-btn-icon svg {
    width: 19px;
    height: 19px;
}

.km-input-tip {
    margin: 14px 0 0;
    font-size: 12.5px;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.6;
}

.km-go-mine-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 16px;
    padding: 13px 20px;
    border: 1.5px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.km-go-mine-btn:hover {
    border-color: #f87171;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, .12);
    transform: translateY(-1px);
}

.km-go-mine-btn:active {
    transform: translateY(0);
}

.km-go-mine-icon {
    display: inline-flex;
    color: #f87171;
}

.km-go-mine-icon svg {
    width: 18px;
    height: 18px;
}

.km-go-mine-arrow {
    font-size: 14px;
    color: var(--text-muted);
}

/* ---- 历史卡片 ---- */
.km-history-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.km-history-header {
    margin-bottom: 18px;
}

.km-history-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.km-history-title-icon {
    display: inline-flex;
    color: #f87171;
}

.km-history-title-icon svg {
    width: 18px;
    height: 18px;
}

/* ---- 时间线 ---- */
.km-timeline {
    display: flex;
    flex-direction: column;
}

.km-timeline-item {
    position: relative;
    display: flex;
    gap: 16px;
    padding-bottom: 18px;
}

.km-timeline-item:last-child {
    padding-bottom: 0;
}

.km-timeline-dot {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-top: 20px;
    position: relative;
    z-index: 1;
}

.km-timeline-dot-success {
    background: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, .15);
}

.km-timeline-dot-warning {
    background: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, .15);
}

.km-timeline-line {
    position: absolute;
    left: 6px;
    top: 38px;
    bottom: -2px;
    width: 2px;
    background: linear-gradient(180deg, var(--border) 0%, var(--border) 100%);
}

.km-timeline-content {
    flex: 1;
    min-width: 0;
}

.km-history-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 18px;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.km-history-item:hover {
    border-color: #fecaca;
    box-shadow: 0 6px 16px rgba(248, 113, 113, .1);
    transform: translateY(-1px);
}

.km-history-item-clickable {
    cursor: pointer;
    position: relative;
}
.km-history-item-clickable:hover {
    border-color: #f87171;
    box-shadow: 0 8px 22px rgba(248, 113, 113, .18);
    transform: translateY(-2px);
}
.km-history-item-clickable:active {
    transform: translateY(0) scale(.99);
}
.km-history-hint {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
    display: flex;
    align-items: center;
    gap: 6px;
    color: #dc2626;
    font-size: 12px;
    font-weight: 500;
}

.km-history-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.km-history-card-number {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.km-history-card-label {
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.km-history-card-code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: .08em;
    color: var(--text);
    background: var(--surface);
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.km-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.km-status-icon {
    display: inline-flex;
}

.km-status-icon svg {
    width: 13px;
    height: 13px;
}

.km-status-success {
    background: rgba(16, 185, 129, .1);
    color: #10b981;
}

.km-status-pending {
    background: rgba(239, 68, 68, .1);
    color: #ef4444;
}

.km-history-item-body {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.km-history-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.km-history-meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.km-history-meta-label {
    font-size: 11.5px;
    color: var(--text-muted);
}

.km-history-meta-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.km-history-balance {
    color: #f59e0b;
}

.km-history-time {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.km-history-time-icon {
    display: inline-flex;
}

.km-history-time-icon svg {
    width: 13px;
    height: 13px;
}

/* ---- 空状态 ---- */
.km-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px 32px;
    text-align: center;
}

.km-empty-illustration {
    width: 180px;
    max-width: 100%;
    margin-bottom: 16px;
    opacity: .85;
}

.km-empty-illustration svg {
    width: 100%;
    height: auto;
}

.km-empty-title {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
}

.km-empty-desc {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}

/* ---- 响应式 ---- */
@media (max-width: 640px) {
    .km-hero {
        padding: 34px 22px 28px;
        border-radius: 16px;
    }

    .km-hero-title {
        font-size: 24px;
    }

    .km-hero-icon {
        width: 54px;
        height: 54px;
        border-radius: 14px;
    }

    .km-hero-icon svg {
        width: 27px;
        height: 27px;
    }

    .km-input-card,
    .km-history-card {
        padding: 18px;
        border-radius: 16px;
    }

    .km-input {
        font-size: 15px;
        padding: 14px 14px;
        padding-right: 64px;
        letter-spacing: .1em;
    }

    .km-input-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .km-history-item-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .km-history-item-body {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .km-history-meta {
        gap: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #panel-kami {
        animation: none;
    }
    .km-submit-btn,
    .km-history-item,
    .km-input {
        transition: none;
    }
}
/* ========== /卡密核销面板现代化重构 ========== */

/* ========== API 密钥面板现代化重构（.ak- 前缀） ========== */
#panel-apikey .ak-hero {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    padding: 30px 32px;
    margin-bottom: 22px;
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    color: #fff;
    box-shadow: 0 14px 34px rgba(102, 126, 234, .35);
}

#panel-apikey .ak-hero::before,
#panel-apikey .ak-hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    pointer-events: none;
}

#panel-apikey .ak-hero::before {
    width: 240px;
    height: 240px;
    top: -110px;
    right: -60px;
}

#panel-apikey .ak-hero::after {
    width: 160px;
    height: 160px;
    bottom: -80px;
    right: 130px;
}

#panel-apikey .ak-hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

#panel-apikey .ak-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .28);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .4px;
    margin-bottom: 12px;
}

#panel-apikey .ak-hero-badge i {
    font-size: 12px;
}

#panel-apikey .ak-hero-title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: .3px;
    line-height: 1.25;
}

#panel-apikey .ak-hero-sub {
    margin-top: 8px;
    font-size: 13.5px;
    line-height: 1.7;
    color: rgba(255, 255, 255, .82);
    max-width: 520px;
}

#panel-apikey .ak-hero-btn.el-button {
    height: 42px;
    padding: 0 22px;
    border: none;
    border-radius: 10px;
    background: #fff;
    color: #2563eb;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 8px 20px rgba(23, 15, 66, .25);
    transition: transform .2s ease, box-shadow .2s ease;
}

#panel-apikey .ak-hero-btn.el-button:hover,
#panel-apikey .ak-hero-btn.el-button:focus {
    background: #fff;
    color: #1e40af;
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(23, 15, 66, .32);
}

#panel-apikey .ak-hero-btn.el-button:active {
    transform: translateY(0);
}

#panel-apikey .ak-hero-btn i {
    margin-right: 6px;
    font-size: 15px;
}

#panel-apikey .ak-hero-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

#panel-apikey .ak-hero-actions .el-button + .el-button {
    margin-left: 0;
}

#panel-apikey .ak-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

#panel-apikey .ak-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    transition: transform .2s ease, box-shadow .2s ease;
}

#panel-apikey .ak-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 24, 40, .1);
}

#panel-apikey .ak-stat-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    font-size: 18px;
}

#panel-apikey .ak-stat-icon.ak-tint-blue {
    background: #eff6ff;
    color: #3b82f6;
}

#panel-apikey .ak-stat-icon.ak-tint-green {
    background: #ecfdf5;
    color: #10b981;
}

#panel-apikey .ak-stat-icon.ak-tint-amber {
    background: #fffbeb;
    color: #f59e0b;
}

#panel-apikey .ak-stat-icon.ak-tint-blue {
    background: #eff6ff;
    color: #3b82f6;
}

#panel-apikey .ak-stat-num {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
}

#panel-apikey .ak-stat-label {
    font-size: 12px;
    color: var(--text-muted);
}

#panel-apikey .ak-card.el-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
    background: var(--surface);
}

#panel-apikey .ak-card .el-card__header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--primary-light);
}

#panel-apikey .ak-card .el-card__body {
    padding: 0;
}

#panel-apikey .ak-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

#panel-apikey .ak-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

#panel-apikey .ak-card-title i {
    color: var(--primary);
    font-size: 16px;
}

#panel-apikey .ak-card-hint {
    font-size: 12px;
    color: var(--text-muted);
}

#panel-apikey .ak-key-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

#panel-apikey .ak-key-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    padding: 16px;
    box-shadow: var(--shadow);
    transition: box-shadow .18s ease, transform .18s ease;
}

#panel-apikey .ak-key-card:hover {
    box-shadow: var(--shadow-lg);
}

#panel-apikey .ak-key-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

#panel-apikey .ak-key-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text);
}

#panel-apikey .ak-key-name i {
    color: var(--primary);
    font-size: 14px;
}

#panel-apikey .ak-key-code {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--primary-light);
    border: 1px solid var(--border);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    color: var(--text-secondary);
    letter-spacing: .3px;
}

#panel-apikey .ak-key-masked {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#panel-apikey .ak-key-copy {
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    padding: 2px;
    border-radius: 4px;
    transition: color .15s ease, background .15s ease;
}

#panel-apikey .ak-key-copy:hover {
    color: var(--primary);
    background: var(--primary-light);
}

#panel-apikey .ak-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
    box-shadow: 0 0 0 3px var(--border);
}

#panel-apikey .ak-dot-strong {
    background: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, .15);
}

#panel-apikey .ak-dot-medium {
    background: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, .15);
}

#panel-apikey .ak-dot-weak {
    background: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .15);
}

#panel-apikey .ak-strength {
    display: inline-flex;
    align-items: center;
    font-size: 12.5px;
    color: var(--text-secondary);
}

#panel-apikey .ak-date {
    color: var(--text-secondary);
    font-size: 12.5px;
}

#panel-apikey .ak-date i {
    margin-right: 5px;
    color: var(--text-muted);
    font-size: 12px;
}

#panel-apikey .ak-key-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-top: 10px;
}

#panel-apikey .ak-ops {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
}

#panel-apikey .ak-op-btn.el-button {
    padding: 6px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 15px;
    border-radius: 8px;
    transition: color .15s ease, background .15s ease;
}

#panel-apikey .ak-op-btn.el-button:hover,
#panel-apikey .ak-op-btn.el-button:focus {
    background: var(--primary-light);
    color: var(--primary);
}

#panel-apikey .ak-op-btn.ak-op-danger.el-button:hover,
#panel-apikey .ak-op-btn.ak-op-danger.el-button:focus {
    background: var(--danger-bg);
    color: var(--danger);
}

#panel-apikey .ak-empty {
    padding: 56px 20px;
    text-align: center;
    color: var(--text-muted);
}

#panel-apikey .ak-empty-art {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 84px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 36px;
}

#panel-apikey .ak-empty-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

#panel-apikey .ak-empty-desc {
    font-size: 13px;
}

#panel-apikey .ak-add-card {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 108px;
    border: 2px dashed var(--border);
    border-radius: 16px;
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color .2s ease, border-style .2s ease, color .2s ease, background .2s ease, transform .2s ease;
}

#panel-apikey .ak-add-card:hover,
#panel-apikey .ak-add-card:focus-visible {
    border-style: solid;
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-2px);
}

#panel-apikey .ak-add-plus {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-light);
    font-size: 20px;
    color: var(--primary);
    transition: transform .25s ease;
}

#panel-apikey .ak-add-card:hover .ak-add-plus {
    transform: rotate(90deg);
}

#panel-apikey .ak-add-text {
    font-size: 13.5px;
    font-weight: 500;
}

#panel-apikey .ak-dialog .el-dialog {
    border-radius: 16px;
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}

#panel-apikey .ak-dialog .el-dialog__header {
    padding: 18px 22px 14px;
    border-bottom: 1px solid var(--border);
    margin-right: 0;
}

#panel-apikey .ak-dialog .el-dialog__title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

#panel-apikey .ak-dialog .el-dialog__body {
    padding: 22px;
}

#panel-apikey .ak-dialog .el-dialog__footer {
    padding: 14px 22px 18px;
    border-top: 1px solid var(--border);
}

#panel-apikey .ak-form-tip {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 4px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--warning-bg);
    border: 1px solid var(--border);
    color: var(--warning);
    font-size: 12.5px;
    line-height: 1.6;
}

#panel-apikey .ak-form-tip i {
    margin-top: 2px;
    font-size: 13px;
}

@media (max-width: 768px) {
    #panel-apikey .ak-hero {
        padding: 22px 20px;
    }

    #panel-apikey .ak-hero-title {
        font-size: 21px;
    }

    #panel-apikey .ak-hero-btn.el-button {
        width: 100%;
    }

    #panel-apikey .ak-key-card {
        padding: 14px;
    }

    #panel-apikey .ak-key-code {
        flex-direction: column;
        align-items: flex-start;
    }

    #panel-apikey .ak-dialog.el-dialog,
    .ak-dialog.el-dialog {
        width: 92% !important;
        max-width: 92vw;
        margin: 8vh auto !important;
    }

    #panel-apikey .ak-dialog .el-dialog__body {
        padding: 16px;
    }

    #panel-apikey .ak-dialog .el-dialog__footer {
        padding: 12px 16px 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #panel-apikey .ak-stat,
    #panel-apikey .ak-add-card,
    #panel-apikey .ak-add-plus,
    #panel-apikey .ak-hero-btn.el-button {
        transition: none;
    }
}
/* ========== /API 密钥面板现代化重构 ========== */

/* ========== 个人设置面板现代化重构（.st- 前缀） ========== */
.st-shell {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ---- 底部导航 ---- */
.st-sidenav {
    order: 2;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.st-nav-group-label {
    display: none;
}

.st-nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
    padding: 11px 14px;
    margin-bottom: 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background .18s ease, color .18s ease;
}

.st-nav-item:hover {
    background: var(--primary-light);
    color: var(--text);
}

.st-nav-item.active {
    background: var(--primary);
    color: #fff;
}

.st-nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 12px;
    font-size: 26px;
    color: #fff;
    transition: transform .18s ease;
}

.st-nav-icon i { font-size: 26px; }

.st-nav-item.active .st-nav-icon {
    background: rgba(255, 255, 255, .18) !important;
    transform: scale(1.04);
}

.st-nav-item:not(.active) .st-nav-icon {
    box-shadow: 0 2px 8px rgba(16, 24, 40, .14);
}

.st-nav-text { flex: 1; min-width: 0; }

.st-nav-arrow {
    font-size: 12px;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity .18s ease, transform .18s ease;
}

.st-nav-item.active .st-nav-arrow {
    opacity: .9;
    transform: translateX(0);
}

.st-icon-blue    { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.st-icon-amber   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.st-icon-cyan    { background: linear-gradient(135deg, #06b6d4, #14b8a6); }
.st-icon-pink    { background: linear-gradient(135deg, #dc2626, #f43f5e); }
.st-icon-emerald { background: linear-gradient(135deg, #10b981, #34d399); }
.st-icon-green   { background: linear-gradient(135deg, #16a34a, #22c55e); }

/* ---- 上方内容 ---- */
.st-content { min-width: 0; order: 1; }

.st-panel { animation: stFade .28s ease; }

@keyframes stFade {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.st-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
}

.st-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.st-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.st-card-title i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    font-size: 15px;
    color: #fff;
}

.st-card-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 18px;
}

.st-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

/* ---- 基本资料 ---- */
.st-avatar-row {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.st-avatar-wrap {
    position: relative;
    width: 88px;
    height: 88px;
    flex-shrink: 0;
}

.st-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--surface);
    box-shadow: 0 0 0 2px var(--border), var(--shadow);
    background: var(--primary-light);
}

.st-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: 700;
    color: var(--primary);
}

.st-avatar-edit {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: transform .18s ease, background .18s ease;
}

.st-avatar-edit:hover { transform: scale(1.1); background: var(--primary-hover); }

.st-avatar-meta { min-width: 0; }

.st-avatar-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
}

.st-avatar-sub {
    margin-top: 4px;
    font-size: 13px;
    color: var(--text-muted);
}

/* 头像上传：按钮组、隐藏的文件选择框与格式提示 */
.st-avatar-actions {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.st-avatar-file {
    display: none;
}

.st-avatar-hint {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.st-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 18px;
}

.st-form-grid .st-field-full { grid-column: 1 / -1; }

.st-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 7px;
}

.st-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* ---- 安全设置 ---- */
.st-pwd-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px 18px;
}

.st-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
}

.st-switch-row + .st-switch-row { border-top: 1px solid var(--border); }

.st-switch-info { min-width: 0; }

.st-switch-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.st-switch-desc {
    margin-top: 4px;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

.st-device-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.st-device {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.st-device:hover {
    border-color: #d4d8e0;
    box-shadow: var(--shadow);
}

.st-device-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 11px;
    font-size: 18px;
    color: #fff;
}

.st-device-info { flex: 1; min-width: 0; }

.st-device-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.st-device-meta {
    margin-top: 3px;
    font-size: 12px;
    color: var(--text-muted);
}

.st-badge-current {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    background: #ecfdf5;
    color: #059669;
}

.st-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
}

/* ---- 通知偏好矩阵 ---- */
.st-notify-table { width: 100%; border-collapse: collapse; }

.st-notify-table th,
.st-notify-table td {
    padding: 13px 12px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.st-notify-table th {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    color: var(--text-muted);
}

.st-notify-table th:first-child,
.st-notify-table td:first-child { text-align: left; }

.st-notify-table tbody tr:last-child td { border-bottom: none; }

.st-notify-scene {
    display: flex;
    align-items: center;
    gap: 12px;
}

.st-notify-scene-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 10px;
    font-size: 15px;
    color: #fff;
}

.st-notify-scene-name { font-size: 14px; font-weight: 600; color: var(--text); }
.st-notify-scene-desc { margin-top: 2px; font-size: 12px; color: var(--text-muted); }

/* ---- 个性化 ---- */
.st-theme-dots {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.st-theme-dot {
    position: relative;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    transition: transform .18s ease, box-shadow .18s ease;
}

.st-theme-dot:hover { transform: scale(1.12); }

.st-theme-dot.active {
    box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px currentColor;
    transform: scale(1.06);
}

.st-theme-dot i {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 15px;
    opacity: 0;
    transition: opacity .18s ease;
}

.st-theme-dot.active i { opacity: 1; }

.st-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
}

.st-setting-row + .st-setting-row { border-top: 1px solid var(--border); }

.st-bind-panel {
    border-top: 1px dashed var(--border);
    margin-top: 4px;
    padding: 16px 0 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.st-bind-code {
    display: flex;
    gap: 10px;
    align-items: center;
}

.st-bind-code .el-input { flex: 1; }

.st-lang-select { width: 220px; }

/* ---- 危险区 ---- */
.st-danger-card {
    background: var(--surface);
    border: 1.5px solid #fca5a5;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}

.st-danger-head {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: #dc2626;
    margin-bottom: 4px;
}

.st-danger-head i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    font-size: 15px;
    color: #fff;
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.st-danger-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 10px 0 18px;
}

/* ---- Element Plus 局部微调（仅限设置面板内） ---- */
#panel-settings .el-input__wrapper,
#panel-settings .el-select__wrapper,
#panel-settings .el-textarea__inner {
    border-radius: 9px;
    box-shadow: 0 0 0 1px var(--border) inset;
    transition: box-shadow .18s ease;
}

#panel-settings .el-input__wrapper:hover,
#panel-settings .el-select__wrapper:hover,
#panel-settings .el-textarea__inner:hover {
    box-shadow: 0 0 0 1px #c7cbd4 inset;
}

#panel-settings .el-input__wrapper.is-focus,
#panel-settings .el-select__wrapper.is-focused,
#panel-settings .el-textarea__inner:focus {
    box-shadow: 0 0 0 1px var(--primary) inset, 0 0 0 4px rgba(17, 24, 39, .07);
}

/* ---- 响应式 ---- */
@media (max-width: 960px) {
    .st-shell { gap: 14px; }

    .st-sidenav {
        flex-wrap: wrap;
        padding: 10px;
    }

    .st-nav-item {
        flex: 1 1 calc(33.333% - 8px);
        min-width: 96px;
        justify-content: center;
        padding: 12px 10px;
    }

    .st-nav-icon { width: 44px; height: 44px; font-size: 24px; }
    .st-nav-icon i { font-size: 24px; }
    .st-nav-arrow { display: none; }
}

@media (max-width: 720px) {
    .st-form-grid,
    .st-pwd-grid { grid-template-columns: 1fr; }

    .st-card { padding: 18px; }
    .st-lang-select { width: 170px; }
}
/* ========== /个人设置面板现代化重构 ========== */

/* ========== 认证页响应式 ========== */
@media (max-width: 480px) {
    .auth-body {
        padding: 16px 12px;
    }

    .auth-card {
        padding: 28px 20px;
        border-radius: 16px;
    }

    .auth-logo h1 {
        font-size: 20px;
    }

    .captcha-row img {
        height: 40px;
    }

    .input-action-btn {
        padding: 4px 8px;
        font-size: 11px;
    }
}

/* ========== 深色模式 ========== */
html[data-theme="dark"] {
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --primary-light: #2a2f45;
    --bg: #0f1115;
    --surface: #1a1d24;
    --border: #2c3038;
    --text: #e5e7eb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --success: #34d399;
    --success-bg: #0f2e22;
    --danger: #f87171;
    --danger-bg: #3a1a1a;
    --warning: #fbbf24;
    --warning-bg: #3a2d12;
    --shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5);
    /* Element Plus 组件内部变量 — 同步到深色 */
    --el-fill-color-blank: #1a1d24;
    --el-fill-color-light: #232830;
    --el-fill-color-lighter: #2a2f37;
    --el-text-color-primary: #e5e7eb;
    --el-text-color-regular: #cbd0d8;
    --el-text-color-secondary: #9ca3af;
    --el-text-color-placeholder: #6b7280;
    --el-border-color: #2c3038;
    --el-border-color-light: #2c3038;
    --el-border-color-lighter: #232830;
    --el-mask-color: rgba(0, 0, 0, .6);
}

html[data-theme="dark"] body {
    color-scheme: dark;
}

/* Element Plus 卡片/弹窗 — 暗色背景 */
html[data-theme="dark"] .el-card,
html[data-theme="dark"] .el-card.is-always-shadow,
html[data-theme="dark"] .el-card.is-hover-shadow {
    background-color: var(--surface) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

html[data-theme="dark"] .el-card__header,
html[data-theme="dark"] .el-card__body {
    background-color: var(--surface);
    color: var(--text);
}

/* Element Plus 弹窗/对话框/确认框 */
html[data-theme="dark"] .el-dialog,
html[data-theme="dark"] .el-dialog__wrapper {
    background-color: transparent;
}

html[data-theme="dark"] .el-overlay {
    background-color: var(--el-mask-color);
}

html[data-theme="dark"] .el-popper,
html[data-theme="dark"] .el-popper.is-light,
html[data-theme="dark"] .el-popconfirm .el-popper {
    background: var(--surface) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}

html[data-theme="dark"] .el-popper .el-popper__arrow::before,
html[data-theme="dark"] .el-popper.is-light .el-popper__arrow::before {
    background: var(--surface) !important;
    border-color: var(--border) !important;
}

/* Element Plus 按钮 — 暗色文字 */
html[data-theme="dark"] .el-button {
    color: var(--text);
}

html[data-theme="dark"] .el-button.is-plain {
    background-color: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

html[data-theme="dark"] .el-button--default {
    background-color: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

html[data-theme="dark"] .topbar,
html[data-theme="dark"] .sidebar {
    background: var(--surface);
    border-color: var(--border);
}

html[data-theme="dark"] .nav-item:hover {
    background: var(--primary-light);
}

html[data-theme="dark"] .nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
}

html[data-theme="dark"] .tb-avatar {
    background: var(--primary-light);
}

html[data-theme="dark"] .tb-avatar-menu {
    background: var(--surface);
    border-color: var(--border);
}

html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
    background: var(--surface);
    color: var(--text);
}

html[data-theme="dark"] .el-input__wrapper,
html[data-theme="dark"] .el-select__wrapper,
html[data-theme="dark"] .el-textarea__inner {
    background-color: var(--surface) !important;
    color: var(--text) !important;
}

html[data-theme="dark"] #panel-settings .el-input__wrapper,
html[data-theme="dark"] #panel-settings .el-select__wrapper,
html[data-theme="dark"] #panel-settings .el-textarea__inner {
    box-shadow: 0 0 0 1px var(--border) inset;
}

/* ========== 数据表格深色模式（请求日志/卡密等原生表格） ========== */
html[data-theme="dark"] th {
    background: #20242c;
    color: var(--text-secondary);
}

html[data-theme="dark"] tbody tr:hover {
    background: #232830;
}

html[data-theme="dark"] .table-wrap {
    background: var(--surface);
}

html[data-theme="dark"] .tag-neutral {
    background: #2a2f37;
    color: var(--text-secondary);
}

html[data-theme="dark"] .pagination .page-btn {
    background: var(--surface);
    color: var(--text-secondary);
}

html[data-theme="dark"] .apikey-display {
    background: var(--surface);
}

/* ========== 认证页面深色模式（登录/注册/验证码/忘记密码） ========== */
html[data-theme="dark"] .auth-body {
    background:
        radial-gradient(1200px 600px at 50% -10%, #16213a 0%, #0f1115 55%, #0f1115 100%),
        linear-gradient(180deg, #0f1115 0%, #0a0c10 100%);
}

html[data-theme="dark"] .auth-card {
    background: var(--surface);
    border-color: var(--border);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .5), 0 8px 24px rgba(0, 0, 0, .4);
}

html[data-theme="dark"] .auth-card::before {
    background: linear-gradient(90deg, #3b82f6, #60a5fa, #1e40af);
}

html[data-theme="dark"] .auth-title,
html[data-theme="dark"] .auth-logo h1 {
    color: var(--text);
}

html[data-theme="dark"] .auth-logo p {
    color: var(--text-muted);
}

html[data-theme="dark"] .auth-links a,
html[data-theme="dark"] .auth-footer a {
    color: var(--primary);
}

/* 认证页底部协议勾选/第三方登录等 */
html[data-theme="dark"] .auth-agreement,
html[data-theme="dark"] .auth-third {
    color: var(--text-secondary);
}

/* ========== 主题色同步（密钥/充值/卡密/模型/套餐等页面） ========== */
/* 品牌主色渐变统一走 var(--primary) / var(--primary-hover) */
.tab-fab {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    box-shadow: 0 8px 20px var(--primary-light), 0 2px 6px rgba(0, 0, 0, .12), inset 0 1px 0 rgba(255, 255, 255, .35);
}

.mm-stat-1 { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%); }

.mm-btn-renew {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%) !important;
}

.mm-btn-renew:hover {
    box-shadow: 0 6px 16px var(--primary-light);
}

.mm-empty-art {
    background: linear-gradient(135deg, var(--primary-light) 0%, rgba(59, 130, 246, .08) 100%);
    color: var(--primary);
}

#qrcode-modal .qr-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
}

#panel-apikey .ak-hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    box-shadow: 0 14px 34px var(--primary-light);
}

#panel-apikey .ak-hero-btn.el-button,
#panel-apikey .ak-hero-btn.el-button:hover,
#panel-apikey .ak-hero-btn.el-button:focus {
    color: var(--primary);
}

#panel-apikey .ak-card-title i { color: var(--primary); }

#panel-apikey .ak-key-copy:hover {
    color: var(--primary);
    background: var(--primary-light);
}

#panel-apikey .ak-op-btn.el-button:hover,
#panel-apikey .ak-op-btn.el-button:focus {
    background: var(--primary-light);
    color: var(--primary);
}

#panel-apikey .ak-empty-art {
    background: linear-gradient(135deg, var(--primary-light) 0%, rgba(59, 130, 246, .08) 100%);
    color: var(--primary);
}

#panel-apikey .ak-add-card:hover,
#panel-apikey .ak-add-card:focus-visible {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

#panel-apikey .ak-add-plus {
    background: var(--primary-light);
    color: var(--primary);
}

#panel-apikey .ak-key-card {
    border-color: var(--border);
    background: var(--surface);
    box-shadow: var(--shadow);
}

#panel-apikey .ak-key-card:hover {
    box-shadow: var(--shadow-lg);
}

#panel-apikey .ak-ops {
    border-top-color: var(--border);
}

#panel-apikey .ak-date i { color: var(--text-muted); }

#panel-apikey .ak-op-btn.el-button { color: var(--text-secondary); }

#panel-apikey .ak-add-card {
    border-color: var(--border);
    color: var(--text-secondary);
}

.pp-body a {
    color: var(--primary);
    border-bottom-color: var(--primary-light);
}

.pp-body a:hover {
    color: var(--primary-hover);
    border-bottom-color: var(--primary-light);
}

.pp-body blockquote {
    border-left-color: var(--primary);
    background: var(--primary-light);
}

.pp-body code {
    background: var(--primary-light);
    color: var(--primary);
}

.tb-avatar-fallback {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
}

.pm-hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
}

.pm-submit {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
}


/* ===== settings: bind alert ===== */
.st-bind-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, rgba(245, 158, 11, .12), rgba(239, 68, 68, .08));
    border: 1px solid rgba(245, 158, 11, .25);
    color: #92400e;
}
html[data-theme="dark"] .st-bind-alert {
    background: linear-gradient(135deg, rgba(245, 158, 11, .18), rgba(239, 68, 68, .12));
    border-color: rgba(245, 158, 11, .35);
    color: #fbbf24;
}
.st-bind-alert > i.bi {
    font-size: 22px;
    color: #f59e0b;
    flex-shrink: 0;
}
.st-bind-alert-text {
    flex: 1;
    min-width: 0;
}
.st-bind-alert-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}
.st-bind-alert-desc {
    margin-top: 2px;
    font-size: 12px;
    opacity: .8;
}
.st-bind-alert-btn {
    flex-shrink: 0;
    padding: 6px 14px;
    border: 1px solid #f59e0b;
    border-radius: 999px;
    background: #fff;
    color: #d97706;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .18s ease;
}
.st-bind-alert-btn:hover {
    background: #f59e0b;
    color: #fff;
}
html[data-theme="dark"] .st-bind-alert-btn {
    background: transparent;
    color: #fbbf24;
}
html[data-theme="dark"] .st-bind-alert-btn:hover {
    background: #f59e0b;
    color: #1f1305;
}

/* ===== settings: form-list / form-row (one column) ===== */
.st-form-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.st-form-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg);
    transition: background .18s ease;
}
.st-form-row:hover {
    background: var(--primary-light);
}
.st-form-row-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    min-width: 96px;
}
.st-form-row-value {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: var(--text-secondary);
    word-break: break-all;
}
.st-form-row-action {
    flex-shrink: 0;
}
.st-form-row-action .el-button {
    margin-left: 0;
}

/* ===== settings: quick list (navigation shortcuts) ===== */
.st-quick-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.st-quick-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    color: #fff;
    text-align: left;
    transition: transform .18s ease, box-shadow .18s ease;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .08);
    position: relative;
    overflow: hidden;
}
.st-quick-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .15);
}
.st-quick-item:active {
    transform: translateY(0) scale(.99);
}
.st-quick-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .22);
    font-size: 20px;
    flex-shrink: 0;
}
.st-quick-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.st-quick-label {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
}
.st-quick-desc {
    margin-top: 3px;
    font-size: 12px;
    opacity: .9;
    line-height: 1.2;
}
.st-quick-arrow {
    flex-shrink: 0;
    font-size: 18px;
    opacity: .85;
}

/* ===== settings: about footer ===== */
.st-about-footer {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.8;
}

/* ===== settings: status ok ===== */
.st-status-ok {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--success-bg);
    color: var(--success);
    font-size: 14px;
    font-weight: 600;
}

/* ===== settings: device empty ===== */
.st-device-empty {
    text-align: center;
    padding: 20px;
    font-size: 13px;
    color: var(--text-muted);
}

/* ===== dialog dark mode (Element Plus) ===== */
html[data-theme="dark"] .el-overlay {
    background-color: rgba(0, 0, 0, .65) !important;
}
html[data-theme="dark"] .el-dialog {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
}
html[data-theme="dark"] .el-dialog__title {
    color: var(--text) !important;
}
html[data-theme="dark"] .el-dialog__body {
    color: var(--text-secondary) !important;
    background: transparent !important;
}
html[data-theme="dark"] .el-dialog__header {
    border-bottom: 1px solid var(--border);
}
html[data-theme="dark"] .el-message-box {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
}
html[data-theme="dark"] .el-message-box__title,
html[data-theme="dark"] .el-message-box__content,
html[data-theme="dark"] .el-message-box__message,
html[data-theme="dark"] .el-message-box__message p {
    color: var(--text) !important;
}
html[data-theme="dark"] .el-message-box__btns {
    border-top: 1px solid var(--border);
}
html[data-theme="dark"] .el-message {
    background: var(--surface) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}
html[data-theme="dark"] .el-notification {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
}
html[data-theme="dark"] .el-notification__title {
    color: var(--text) !important;
}
html[data-theme="dark"] .el-notification__content {
    color: var(--text-secondary) !important;
}
html[data-theme="dark"] .el-popover.is-light,
html[data-theme="dark"] .el-popper.is-light {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
}
html[data-theme="dark"] .el-popper.is-light .el-popper__arrow::before {
    background: var(--surface) !important;
    border-color: var(--border) !important;
}
html[data-theme="dark"] .el-dropdown-menu,
html[data-theme="dark"] .el-menu--popup {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
}
html[data-theme="dark"] .el-dropdown-menu__item,
html[data-theme="dark"] .el-menu--popup .el-menu-item {
    color: var(--text-secondary) !important;
}
html[data-theme="dark"] .el-dropdown-menu__item:hover,
html[data-theme="dark"] .el-menu--popup .el-menu-item:hover {
    background: var(--primary-light) !important;
    color: var(--text) !important;
}
html[data-theme="dark"] .el-select-dropdown,
html[data-theme="dark"] .el-select__popper {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
}
html[data-theme="dark"] .el-select-dropdown__item {
    color: var(--text-secondary) !important;
}
html[data-theme="dark"] .el-select-dropdown__item:hover,
html[data-theme="dark"] .el-select-dropdown__item.is-hovering {
    background: var(--primary-light) !important;
}
html[data-theme="dark"] .el-select-dropdown__item.is-selected {
    color: var(--primary) !important;
    font-weight: 600;
}
html[data-theme="dark"] .el-tooltip__popper.is-dark {
    background: rgba(50, 50, 50, .9) !important;
    color: #f5f5f5 !important;
}

/* responsive: keep forms single column on mobile */
@media (max-width: 768px) {
    .st-form-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .st-form-row-action {
        align-self: stretch;
        display: flex;
        justify-content: flex-end;
    }
    .st-form-row-value {
        width: 100%;
    }
}


/* ===== settings: quick table (navigation shortcuts as table) ===== */
.st-quick-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
}
.st-quick-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.st-quick-table thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .03em;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.st-quick-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background .18s ease;
}
.st-quick-table tbody tr:last-child {
    border-bottom: none;
}
.st-quick-table tbody tr:hover {
    background: var(--primary-light);
}
.st-quick-table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
}
.st-quick-td-name {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 180px;
}
.st-quick-table .st-quick-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    font-size: 18px;
    color: #fff;
    flex-shrink: 0;
}
.st-quick-table .st-quick-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}
.st-quick-td-desc {
    color: var(--text-secondary);
    font-size: 13px;
}
.st-quick-th-action {
    text-align: right;
}
.st-quick-td-action {
    text-align: right;
    white-space: nowrap;
}
.st-quick-go {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .18s ease;
}
.st-quick-go:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.st-quick-go i {
    font-size: 12px;
    transition: transform .18s ease;
}
.st-quick-go:hover i {
    transform: translateX(2px);
}

@media (max-width: 768px) {
    .st-quick-table thead th,
    .st-quick-table tbody td {
        padding: 10px 12px;
    }
    .st-quick-td-desc {
        display: none;
    }
    .st-quick-table thead th:nth-child(2) {
        display: none;
    }
}

/* ============ 对接地址弹窗 ============ */
.ak-hero-btn-ghost.el-button {
    background: rgba(255, 255, 255, .12) !important;
    color: #fff !important;
    box-shadow: none !important;
    border: 1px solid rgba(255, 255, 255, .25) !important;
}
.ak-hero-btn-ghost.el-button:hover,
.ak-hero-btn-ghost.el-button:focus {
    background: rgba(255, 255, 255, .2) !important;
    color: #fff !important;
}
.ak-hero-btn-ghost i {
    margin-right: 6px;
    font-size: 15px;
}

.ak-dialog .el-dialog {
    border-radius: 16px;
    overflow: hidden;
    background: var(--surface, #fff);
}
.ak-dialog .el-dialog__header {
    padding: 18px 22px 14px;
    border-bottom: 1px solid var(--border, #eef0f4);
    margin-right: 0;
}
.ak-dialog .el-dialog__title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text, #111827);
}
.ak-dialog .el-dialog__body {
    padding: 18px 22px;
}
.ak-dialog .el-dialog__footer {
    padding: 14px 22px 18px;
    border-top: 1px solid var(--border, #eef0f4);
}

.ak-channel-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 55vh;
    overflow-y: auto;
}
.ak-channel-item {
    padding: 14px 16px;
    border: 1px solid var(--border, #eef0f4);
    border-radius: 12px;
    background: var(--surface, #fff);
    transition: border-color .2s ease, box-shadow .2s ease;
}
.ak-channel-item:hover {
    border-color: var(--primary, #2563eb);
    box-shadow: 0 6px 16px rgba(16, 24, 40, .08);
}
.ak-channel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.ak-channel-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text, #111827);
}
.ak-channel-name i {
    color: var(--primary, #2563eb);
}
.ak-channel-copy {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
    background: transparent;
    color: var(--primary, #2563eb);
    font-size: 12.5px;
    cursor: pointer;
    transition: background .2s ease;
}
.ak-channel-copy:hover {
    background: rgba(37, 99, 235, .08);
}
.ak-channel-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.ak-channel-ping {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    line-height: 1.5;
    flex-wrap: wrap;
}
.ak-channel-ping.is-online {
    color: #16a34a;
}
.ak-channel-ping.is-offline {
    color: #dc2626;
}
.ak-channel-ping i {
    font-size: 14px;
}
.ak-channel-ip {
    color: var(--text-secondary, #6b7280);
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 12px;
}
.ak-channel-url {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--bg, #f7f8fa);
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 12.5px;
    color: var(--text, #111827);
    word-break: break-all;
    line-height: 1.5;
}
.ak-channel-remark {
    margin-top: 8px;
    font-size: 12.5px;
    color: var(--text-secondary, #6b7280);
    line-height: 1.5;
}

.auth-links-sep {
    color: var(--border, #cbd5e1);
    margin: 0 4px;
}

/* ---- 发票功能 ---- */
.rc-card-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}
.rc-invoice-list-btn {
    font-size: 13px;
}
.rc-record-foot {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border, #e5e7eb);
}
.rc-invoice-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border: 1px solid #3b82f6;
    border-radius: 8px;
    background: rgba(59, 130, 246, .06);
    color: #3b82f6;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.rc-invoice-btn:hover {
    background: #3b82f6;
    color: #fff;
}
.rc-invoice-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.rc-invoice-tag-success {
    background: rgba(22, 163, 74, .12);
    color: #16a34a;
}
.rc-invoice-tag-warning {
    background: rgba(217, 119, 6, .12);
    color: #d97706;
}
.rc-invoice-tag-danger {
    background: rgba(220, 38, 38, .12);
    color: #dc2626;
}
.rc-invoice-dialog {
    max-width: 460px;
}
.rc-invoice-form {
    overflow-y: auto;
    padding-right: 2px;
}
.rc-invoice-order {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--bg, #f3f4f6);
    margin-bottom: 10px;
    font-size: 13px;
}
.rc-invoice-order-label {
    color: var(--text-secondary);
}
.rc-invoice-order-amount {
    font-weight: 700;
    color: #3b82f6;
}
.rc-invoice-field {
    margin-bottom: 12px;
}
.rc-invoice-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}
.rc-invoice-type {
    display: flex;
    gap: 10px;
}
.rc-invoice-type-btn {
    flex: 1;
    padding: 9px 0;
    border: 1.5px solid var(--border, #e5e7eb);
    border-radius: 10px;
    background: var(--surface, #fff);
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.rc-invoice-type-btn.rc-active {
    border-color: #3b82f6;
    color: #3b82f6;
    background: rgba(59, 130, 246, .06);
    font-weight: 600;
}
.rc-invoice-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    background: var(--surface, #fff);
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.rc-invoice-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .12);
}
.rc-invoice-list {
    max-height: 60vh;
    overflow-y: auto;
    margin-bottom: 14px;
}
.rc-invoice-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 12px;
    margin-bottom: 10px;
}
.rc-invoice-item-main {
    flex: 1;
    min-width: 0;
}
.rc-invoice-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rc-invoice-item-meta {
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rc-invoice-item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}
.rc-invoice-item-amount {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}
.rc-invoice-view-btn {
    flex: 0 0 auto;
    padding: 6px 12px;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
    background: var(--surface, #fff);
    color: var(--text-secondary);
    font-size: 12.5px;
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease;
}
.rc-invoice-view-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}
.rc-invoice-preview-dialog {
    max-width: 480px;
}
.rc-invoice-foot {
    justify-content: flex-end;
    gap: 10px;
}
.rc-invoice-foot .rc-agreement-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.rc-agreement-btn-ghost {
    background: var(--surface, #fff);
    color: var(--text-secondary);
    border: 1px solid var(--border, #e5e7eb);
}
.rc-agreement-btn-ghost:hover {
    background: var(--bg, #f3f4f6);
    color: var(--text);
}
.rc-invoice-paper {
    position: relative;
    overflow-y: auto;
    max-height: 62vh;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 12px;
    background: #fff;
    padding: 12px;
    margin-bottom: 14px;
}
.rc-invoice-img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
}
.rc-invoice-img-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 60px 0;
    color: var(--text-secondary);
    font-size: 13px;
}
.rc-inv-head {
    text-align: center;
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 2px solid #3b82f6;
}
.rc-inv-title {
    font-size: 17px;
    font-weight: 700;
    color: #1e3a8a;
    letter-spacing: 1px;
}
.rc-inv-head-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}
.rc-inv-head-meta b {
    color: var(--text);
}
.rc-inv-party {
    margin-bottom: 12px;
}
.rc-inv-party-label {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
}
.rc-inv-party-body {
    padding-left: 4px;
}
.rc-inv-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 5px 0;
    font-size: 13px;
    line-height: 1.5;
}
.rc-inv-row > span {
    flex: 0 0 auto;
    color: var(--text-secondary);
}
.rc-inv-row > strong {
    text-align: right;
    color: var(--text, #1f2937);
    word-break: break-all;
    font-weight: 600;
}
.rc-inv-items {
    margin: 12px 0;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    overflow: hidden;
}
.rc-inv-items-row {
    display: flex;
    align-items: center;
    padding: 9px 12px;
    font-size: 13px;
}
.rc-inv-items-row > span:nth-child(1) { flex: 1; text-align: left; }
.rc-inv-items-row > span:nth-child(2) { flex: 0 0 100px; text-align: center; }
.rc-inv-items-row > span:nth-child(3) { flex: 0 0 80px; text-align: right; }
.rc-inv-items-head {
    background: #f8fafc;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12px;
    border-bottom: 1px solid var(--border, #e5e7eb);
}
.rc-inv-items-amount {
    color: #dc2626;
    font-weight: 700;
    font-size: 14px;
}
.rc-inv-items-meta {
    padding: 4px 12px;
    font-size: 11.5px;
    color: var(--text-secondary);
    word-break: break-all;
}
.rc-inv-items-meta:last-child {
    padding-bottom: 9px;
}
.rc-inv-total {
    padding-top: 4px;
    border-top: 1px dashed var(--border, #e5e7eb);
}
.rc-inv-total-num {
    color: #dc2626 !important;
    font-size: 16px;
}
.rc-inv-foot {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border, #e5e7eb);
    font-size: 12.5px;
    color: var(--text-secondary);
}
.rc-invoice-stamp {
    position: relative;
    margin: 12px 8px 0 auto;
    width: 100px;
    height: 100px;
    border: 3px solid #dc2626;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(-14deg);
    opacity: .85;
    pointer-events: none;
}
.rc-invoice-stamp::before {
    content: '';
    position: absolute;
    inset: 5px;
    border: 1px solid #dc2626;
    border-radius: 50%;
}
.rc-invoice-stamp-inner {
    text-align: center;
    padding: 0 8px;
    color: #dc2626;
}
.rc-invoice-stamp-name {
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 4px;
    word-break: break-all;
}
.rc-invoice-stamp-text {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 1px;
    padding-top: 4px;
    border-top: 1px solid #dc2626;
}

/* ==========================================================================
   手机端体验优化（迁移至 phone/ 时追加）
   ========================================================================== */

/* 触摸反馈：去除高亮闪烁，统一点击态 */
button,
.tab-item,
.nav-item,
.rc-plan-card,
.rc-pay-card,
.km-go-mine-btn,
.rc-invoice-btn,
[role="button"] {
    -webkit-tap-highlight-color: transparent;
}

button:active,
.tab-item:active,
.nav-item:active,
.rc-plan-card:active,
.rc-pay-card:active {
    opacity: .84;
}

/* 底部导航安全区适配（全面屏 / iPhone 刘海屏） */
.tabbar {
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.tabbar-inner {
    padding-bottom: max(6px, env(safe-area-inset-bottom, 0px));
}

/* 移动端字号与行高微调 */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    .rc-record-item,
    .km-input-tip,
    .rc-balance-sub,
    .rc-inv-items-meta {
        line-height: 1.65;
    }
    .rc-invoice-paper {
        padding: 14px 12px;
    }
}

/* 弹层滚动锁定：遮罩出现时禁止背景滚动穿透
   （:has() 不被支持的老浏览器会自动忽略该规则，无副作用） */
body.modal-open,
body:has(.modal-overlay:not([hidden])),
body:has(.rc-sheet-mask),
body:has(.rc-agreement-mask) {
    overflow: hidden;
}

/* ============ 请求日志（PC 端表格 .rz-） ============ */
.rz-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}
.rz-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.rz-table th,
.rz-table td {
    padding: 11px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    vertical-align: middle;
}
.rz-table th {
    background: #fafbfc;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    letter-spacing: .3px;
}
.rz-table th i { margin-right: 5px; font-size: 13px; vertical-align: -1px; }
.rz-table th i.bi-cpu { color: #2563eb; }
.rz-table th i.bi-stack { color: #7c3aed; }
.rz-table th i.bi-stopwatch { color: #0d9488; }
.rz-table th i.bi-wallet2 { color: #f59e0b; }
.rz-table th i.bi-coin { color: #16a34a; }
.rz-table th i.bi-activity { color: #dc2626; }
.rz-table th i.bi-clock { color: #64748b; }
.rz-table tbody tr:last-child td { border-bottom: none; }
.rz-table tbody tr:hover { background: #fafbfd; }
.rz-time-col { color: var(--text-muted); font-size: 12px; }
.rz-model { color: var(--text); font-weight: 600; }

/* Tokens/缓存 概要 + 悬停明细气泡 */
.rz-tokens {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: default;
}
.rz-tk { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; font-size: 13px; }
.rz-tk i { font-size: 15px; }
.rz-tk-in { color: #2563eb; }
.rz-tk-out { color: #16a34a; }
.rz-tk-cache { color: #7c3aed; }
.rz-tk-rate { color: #0d9488; font-weight: 700; }
.rz-sep { color: var(--text-muted); }
/* 明细气泡「内容源」：隐藏，仅由 JS 克隆到 body 上的浮层，避免被表格裁剪 */
.rz-tip { display: none; }

/* 悬停明细浮层：position:fixed 挂到 body，彻底脱离 .rz-table-wrap 的裁剪上下文 */
#rz-tip-float {
    position: fixed;
    left: 0;
    top: 0;
    min-width: 210px;
    padding: 10px 12px;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .35);
    z-index: 3000;
    pointer-events: none;
    display: none;
}
#rz-tip-float.is-open { display: block; }
#rz-tip-float::after {
    content: '';
    position: absolute;
    left: var(--tip-arrow-x, 50%);
    top: 100%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #0f172a;
}
#rz-tip-float.rz-tip-below::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: #0f172a;
}
.rz-tip-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-size: 12px;
    line-height: 1.9;
}
.rz-tip-row span { color: #94a3b8; display: inline-flex; align-items: center; gap: 6px; }
.rz-tip-row span i { font-size: 13px; color: #64748b; }
.rz-tip-row b { color: #fff; font-variant-numeric: tabular-nums; }
.rz-tip-rate { border-top: 1px solid rgba(148, 163, 184, .25); margin-top: 4px; padding-top: 4px; }
.rz-tip-rate b { color: #4ade80; }

/* 耗时列：首 / 总 / 速 */
.rz-time { color: var(--text-secondary); font-size: 12px; white-space: nowrap; }
.rz-time .rz-sep { margin: 0 2px; }
.rz-quota { color: #2563eb; font-weight: 600; font-variant-numeric: tabular-nums; }
.rz-cost { color: #d97706; font-weight: 600; font-variant-numeric: tabular-nums; }
.rz-muted { color: var(--text-muted); }

html[data-theme="dark"] .rz-table th { background: rgba(148, 163, 184, .08); }
html[data-theme="dark"] .rz-table tbody tr:hover { background: rgba(148, 163, 184, .06); }
html[data-theme="dark"] .rz-table-wrap { background: var(--surface); }
/* ===== App install page (panel-app) ===== */
.ai-root {
    max-width: 720px;
}
.ai-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
}
.ai-hero {
    display: flex;
    align-items: center;
    gap: 16px;
}
.ai-icon-wrap {
    flex-shrink: 0;
}
.ai-icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    object-fit: cover;
    display: block;
    box-shadow: 0 6px 18px rgba(16, 24, 40, .12);
}
.ai-icon-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: #fff;
    font-size: 32px;
}
.ai-hero-meta {
    min-width: 0;
}
.ai-app-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ai-app-sub {
    margin-top: 4px;
    font-size: 13px;
    color: var(--text-muted);
}
.ai-tip {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 18px 0;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--primary-light);
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
}
.ai-tip i {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--primary);
}
.ai-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.ai-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 42px;
    padding: 0 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all .16s ease;
}
.ai-btn i {
    font-size: 17px;
}
.ai-btn-primary {
    flex: 1 1 100%;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: #fff;
    box-shadow: 0 6px 16px rgba(99, 102, 241, .28);
}
.ai-btn-primary:hover {
    filter: brightness(1.06);
}
.ai-btn-ghost {
    flex: 1 1 auto;
    background: var(--surface);
    border-color: var(--border);
    color: var(--text-secondary);
}
.ai-btn-ghost:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.ai-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.ai-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.ai-step-no {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 14px;
    font-weight: 700;
}
.ai-step-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}
.ai-step-desc {
    margin-top: 3px;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
}
html[data-theme="dark"] .ai-tip {
    background: rgba(99, 102, 241, .14);
}
@media (max-width: 768px) {
    .ai-card { padding: 18px; }
    .ai-icon { width: 60px; height: 60px; border-radius: 15px; }
    .ai-app-name { font-size: 18px; }
    .ai-btn { flex: 1 1 100%; }
}
