/* ==========================================================================
   HpMir 游戏盒子 - 用户端公共样式
   设计风格：清爽亮色系 · 无阴影 · 统一圆角与字号层级
   ========================================================================== */

/* ---------- 1. 设计变量 ---------- */
:root {
    /* 品牌色 */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-active: #1e40af;
    --primary-light: #eff6ff;
    --primary-light-border: #bfdbfe;

    /* 语义色 */
    --success: #10b981;
    --success-light: #ecfdf5;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --danger: #ef4444;
    --danger-light: #fef2f2;

    /* 中性色 */
    --bg: #f5f7fa;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --border-light: #eef2f6;
    --text: #0f172a;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;

    /* 字号 */
    --fs-xs: 12px;
    --fs-sm: 13px;
    --fs-base: 14px;
    --fs-md: 15px;
    --fs-lg: 16px;
    --fs-xl: 18px;
    --fs-2xl: 20px;
    --fs-3xl: 24px;
    --fs-stat: 30px;

    /* 字重 */
    --fw-regular: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;

    /* 圆角 */
    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* 间距 */
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 20px;
    --sp-6: 24px;
    --sp-8: 32px;

    /* 布局尺寸 */
    --header-h: 60px;
    --sidebar-w: 224px;

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- 2. 重置与基础 ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    font-family: var(--font);
    font-size: var(--fs-base);
    font-weight: var(--fw-regular);
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

img {
    display: block;
    max-width: 100%;
}

h1,
h2,
h3,
h4 {
    font-weight: var(--fw-semibold);
    line-height: 1.4;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

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

/* ---------- 3. 整体布局 ---------- */
.app-layout {
    min-height: 100vh;
}

/* 顶栏 */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-h);
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--sp-6);
    z-index: 1000;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: var(--fs-lg);
    font-weight: var(--fw-bold);
    color: var(--text);
    letter-spacing: .2px;
}

.app-brand img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.app-brand .brand-mark {
    width: 30px;
    height: 30px;
    /*border-radius: var(--radius-sm);*/
    /*background: var(--primary);*/
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.app-header-right {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
}

/* 顶栏用户下拉 */
.user-menu {
    position: relative;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--text);
    font-size: var(--fs-base);
    border: 1px solid transparent;
    transition: background .15s ease, border-color .15s ease;
    background: none;
    font-family: inherit;
}

.user-menu-trigger:hover {
    background: var(--bg);
    border-color: var(--border);
}

.user-menu-trigger .avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
}

.user-menu-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 160px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 6px;
    display: none;
    z-index: 1200;
}

.user-menu-dropdown.show {
    display: block;
}

.user-menu-dropdown a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: var(--fs-base);
}

.user-menu-dropdown a:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.user-menu-dropdown a i {
    width: 16px;
    text-align: center;
    font-size: var(--fs-sm);
}

/* 侧边栏 */
.app-sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: #fff;
    border-right: 1px solid var(--border);
    padding: var(--sp-4) var(--sp-3);
    overflow-y: auto;
    z-index: 900;
}

.nav-group {
    list-style: none;
}

.nav-group-title {
    font-size: var(--fs-xs);
    color: #94a3b8;
    font-weight: var(--fw-semibold);
    letter-spacing: .5px;
    padding: 16px 12px 6px;
    text-transform: none;
}

.nav-item>a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 2px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: var(--fs-base);
    font-weight: var(--fw-medium);
    transition: background .15s ease, color .15s ease;
}

.nav-item>a i {
    width: 20px;
    text-align: center;
    font-size: 15px;
    flex-shrink: 0;
}

.nav-item>a:hover {
    background: var(--bg);
    color: var(--text);
}

.nav-item.active>a {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: var(--fw-semibold);
}

.nav-sub {
    list-style: none;
    padding-left: 6px;
}

.nav-sub a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px 8px 32px;
    margin-bottom: 2px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: var(--fs-sm);
}

.nav-sub a:hover {
    background: var(--bg);
    color: var(--text);
}

.nav-sub li.active>a {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: var(--fw-semibold);
}

.nav-collapse {
    cursor: pointer;
}

.nav-collapse .caret {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-tertiary);
    transition: transform .2s ease;
}

.nav-collapse.open .caret {
    transform: rotate(90deg);
}

.nav-collapse-body {
    display: none;
}

.nav-collapse.open+.nav-collapse-body {
    display: block;
}

/* 主内容区 */
.app-main {
    margin-left: var(--sidebar-w);
    padding: calc(var(--header-h) + var(--sp-6)) var(--sp-6) var(--sp-8);
    min-height: 100vh;
}

/* 移动端遮罩 */
.app-mask {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .4);
    z-index: 899;
}

/* 菜单按钮（仅移动端） */
.header-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text);
    cursor: pointer;
    padding: 4px 8px;
}

/* ---------- 4. 页头 ---------- */
.page-head {
    margin-bottom: var(--sp-5);
}

.page-title {
    font-size: var(--fs-2xl);
    font-weight: var(--fw-semibold);
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-desc {
    margin-top: 6px;
    font-size: var(--fs-base);
    color: var(--text-secondary);
}

/* ---------- 5. 卡片 ---------- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--sp-5);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px var(--sp-6);
    border-bottom: 1px solid var(--border-light);
    font-size: var(--fs-md);
    font-weight: var(--fw-semibold);
    color: var(--text);
}

.card-header .title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header .title i {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--primary-light);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.card-body {
    padding: var(--sp-6);
}

.card-body.tight {
    padding: var(--sp-5);
}

.card-body.flush {
    padding: 0;
}

/* 栅格 */
.row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-5);
}

.col-6 {
    flex: 1 1 calc(50% - var(--sp-5));
    min-width: 280px;
}

.col-4 {
    flex: 1 1 calc(33.333% - var(--sp-5));
    min-width: 240px;
}

.col-3 {
    flex: 1 1 calc(25% - var(--sp-5));
    min-width: 200px;
}

.col-12 {
    flex: 1 1 100%;
}

/* ---------- 6. 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 40px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: var(--fs-base);
    font-weight: var(--fw-medium);
    font-family: inherit;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
    background: none;
}

.btn i {
    font-size: var(--fs-base);
}

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

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

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

.btn-outline {
    background: #fff;
    border-color: var(--border);
    color: var(--text);
}

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

.btn-soft {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary-light-border);
}

.btn-soft:hover:not(:disabled) {
    background: #dbeafe;
    color: var(--primary);
}

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

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    color: #fff;
}

.btn-danger-soft {
    background: var(--danger-light);
    color: var(--danger);
    border-color: #fecaca;
}

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

.btn-success:hover:not(:disabled) {
    background: #059669;
    color: #fff;
}

.btn-sm {
    height: 32px;
    padding: 0 12px;
    font-size: var(--fs-sm);
    border-radius: var(--radius-sm);
}

.btn-sm i {
    font-size: var(--fs-xs);
}

.btn-xs {
    height: 28px;
    padding: 0 10px;
    font-size: var(--fs-xs);
    border-radius: var(--radius-sm);
}

.btn-num {
    margin-right: 3px;
    font-weight: var(--fw-semibold);
}

.btn-block {
    width: 100%;
}

.btn-lg {
    height: 46px;
    font-size: var(--fs-md);
}

.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ---------- 7. 表单 ---------- */
.form-item {
    margin-bottom: 28px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: var(--fs-base);
    font-weight: var(--fw-medium);
    color: #334155;
}

.form-label .req {
    color: var(--danger);
    margin-left: 3px;
}

.form-hint {
    margin-top: 8px;
    font-size: var(--fs-xs);
    color: var(--text-tertiary);
    line-height: 1.6;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    font-family: inherit;
    font-size: var(--fs-base);
    color: var(--text);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.form-input,
.form-select {
    height: 44px;
    padding: 0 14px;
}

.form-textarea {
    min-height: 96px;
    padding: 12px 14px;
    line-height: 1.6;
    resize: vertical;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-tertiary);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.form-input:disabled,
.form-input[disabled] {
    background: var(--bg);
    color: var(--text-secondary);
    cursor: not-allowed;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    cursor: pointer;
}

.form-row {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.form-row>.form-item {
    flex: 1 1 200px;
    margin-bottom: 0;
}

/* 输入组（前缀图标） */
.input-group {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    height: 40px;
    transition: border-color .15s ease, box-shadow .15s ease;
    background: #fff;
}

.input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.input-group .input-icon {
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: var(--fs-base);
}

.input-group input {
    flex: 1;
    height: 100%;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: var(--fs-base);
    color: var(--text);
    padding-right: 12px;
}

.input-group.mono input {
    font-family: Consolas, Menlo, monospace;
    letter-spacing: 2px;
}

.input-group .input-suffix {
    padding: 0 10px;
    border-left: 1px solid var(--border);
    height: 100%;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.input-group .input-suffix img {
    height: 34px;
    width: auto;
    border-radius: 4px;
    cursor: pointer;
}

/* 获取验证码按钮（输入框后缀） */
.input-group .input-suffix .btn-send-code {
    border: none;
    background: transparent;
    padding: 0 2px;
    font-family: inherit;
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    color: var(--primary);
    cursor: pointer;
    white-space: nowrap;
    transition: color .15s ease;
}

.input-group .input-suffix .btn-send-code:hover {
    color: var(--primary-hover);
}

.input-group .input-suffix .btn-send-code.disabled,
.input-group .input-suffix .btn-send-code:disabled {
    color: var(--text-tertiary);
    cursor: not-allowed;
}

/* 单选 / 复选（自定义） */
.radio-line,
.check-line {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: var(--fs-base);
    color: var(--text);
    margin-right: var(--sp-5);
}

.radio-line input,
.check-line input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* 单选卡片 */
.choose-cards {
    display: flex;
    gap: var(--sp-4);
    flex-wrap: wrap;
}

.choose-card {
    flex: 1 1 220px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--sp-4);
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}

.choose-card:hover {
    border-color: var(--primary-light-border);
}

.choose-card.active {
    border-color: var(--primary);
    background: var(--primary-light);
}

.choose-card .cc-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: var(--fw-semibold);
    font-size: var(--fs-base);
}

.choose-card .cc-title input {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
}

.choose-card .cc-desc {
    margin-top: 6px;
    font-size: var(--fs-xs);
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ---------- 8. 表格 ---------- */
.table-wrap {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-sm);
}

.table th {
    text-align: left;
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    color: var(--text-secondary);
    background: #f8fafc;
    padding: 12px 16px;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
    vertical-align: middle;
}

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

.table tbody tr:hover td {
    background: #f8fafc;
}

.table .col-actions {
    white-space: nowrap;
}

.table .col-actions .btn {
    margin-right: 6px;
}

/* ---------- 9. 徽章 ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    line-height: 1.8;
    white-space: nowrap;
}

.badge-blue {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-green {
    background: var(--success-light);
    color: var(--success);
}

.badge-orange {
    background: var(--warning-light);
    color: #b45309;
}

.badge-gray {
    background: #f1f5f9;
    color: var(--text-secondary);
}

.badge-red {
    background: var(--danger-light);
    color: var(--danger);
}

/* 文本语义色 */
.text-primary {
    color: var(--primary);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-muted {
    color: var(--text-secondary);
}

.text-tertiary {
    color: var(--text-tertiary);
}

.mono {
    font-family: Consolas, Menlo, monospace;
    letter-spacing: .5px;
}

/* ---------- 10. 空状态 ---------- */
.empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
}

.empty i {
    font-size: 42px;
    color: #cbd5e1;
    margin-bottom: 14px;
    display: block;
}

.empty p {
    font-size: var(--fs-base);
}

/* ---------- 11. 提示条 ---------- */
.notice {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: var(--fs-sm);
    line-height: 1.7;
    margin-bottom: var(--sp-4);
}

.notice i {
    margin-top: 3px;
}

.notice-info {
    background: var(--primary-light);
    color: #1e40af;
    border: 1px solid var(--primary-light-border);
}

.notice-success {
    background: var(--success-light);
    color: #047857;
    border: 1px solid #a7f3d0;
}

.notice-warning {
    background: var(--warning-light);
    color: #b45309;
    border: 1px solid #fde68a;
}

.notice-danger {
    background: var(--danger-light);
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* 特性/说明列表 */
.tip-list {
    list-style: none;
}

.tip-list li {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 9px 0;
    font-size: var(--fs-base);
    color: var(--text-secondary);
    line-height: 1.7;
    border-bottom: 1px solid var(--border-light);
}

.tip-list li:last-child {
    border-bottom: none;
}

.tip-list li i {
    color: var(--success);
    margin-top: 4px;
    font-size: var(--fs-xs);
}

/* 描述列表（键值展示） */
.desc-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 0;
}

.desc-list .desc-item {
    flex: 0 0 50%;
    display: flex;
    padding: 7px 0;
    font-size: var(--fs-base);
}

.desc-list .desc-item .k {
    color: var(--text-secondary);
    width: 104px;
    flex-shrink: 0;
}

.desc-list .desc-item .v {
    color: var(--text);
    font-weight: var(--fw-medium);
    word-break: break-all;
}

/* ---------- 12. 动态行 ---------- */
.dyn-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.dyn-row .form-input {
    flex: 1;
    min-width: 120px;
}

.dyn-row .w-sort {
    flex: 0 0 84px;
    width: 84px;
    min-width: 84px;
}

.dyn-row .w-color {
    flex: 0 0 56px;
    width: 56px;
    min-width: 56px;
    height: 40px;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    cursor: pointer;
}

/* ---------- 13. 分页 ---------- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: var(--sp-6);
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    color: var(--text-secondary);
    background: #fff;
}

.pagination a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination .current {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: var(--fw-medium);
}

.pagination .disabled {
    color: #cbd5e1;
    cursor: not-allowed;
}

/* ---------- 14. 统计卡片 ---------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--sp-4);
}

.stat-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    background: #fff;
    transition: border-color .15s ease;
}

.stat-card:hover {
    border-color: #cbd5e1;
}

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

.stat-label {
    font-size: var(--fs-sm);
    color: var(--text-secondary);
}

.stat-value {
    margin-top: 10px;
    font-size: 30px;
    font-weight: var(--fw-bold);
    color: var(--text);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.stat-foot {
    margin-top: 10px;
    font-size: var(--fs-xs);
    color: var(--text-tertiary);
}

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

.icon-blue {
    background: #eff6ff;
    color: #2563eb;
}

.icon-indigo {
    background: #eef2ff;
    color: #4f46e5;
}

.icon-cyan {
    background: #ecfeff;
    color: #0e7490;
}

.icon-green {
    background: #ecfdf5;
    color: #059669;
}

.icon-orange {
    background: #fffbeb;
    color: #d97706;
}

.icon-violet {
    background: #f5f3ff;
    color: #7c3aed;
}

/* ---------- 15. 加载态 ---------- */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 37%, #f1f5f9 63%);
    background-size: 400% 100%;
    animation: skeleton 1.4s ease infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton {
    0% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0 50%;
    }
}

/* ---------- 16. 工具类 ---------- */
.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gap-2 {
    gap: var(--sp-2);
}

.gap-3 {
    gap: var(--sp-3);
}

.gap-4 {
    gap: var(--sp-4);
}

.mb-0 {
    margin-bottom: 0;
}

.mb-2 {
    margin-bottom: var(--sp-2);
}

.mb-3 {
    margin-bottom: var(--sp-3);
}

.mb-4 {
    margin-bottom: var(--sp-4);
}

.mb-5 {
    margin-bottom: var(--sp-5);
}

.mt-3 {
    margin-top: var(--sp-3);
}

.mt-4 {
    margin-top: var(--sp-4);
}

.mt-5 {
    margin-top: var(--sp-5);
}

.w-100 {
    width: 100%;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.fw-600 {
    font-weight: var(--fw-semibold);
}

.fs-sm {
    font-size: var(--fs-sm);
}

.fs-xs {
    font-size: var(--fs-xs);
}

.hidden {
    display: none !important;
}

/* ---------- 20. 购买卡密 ---------- */
.buy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--sp-5);
    margin-top: var(--sp-5);
}

.buy-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: #fff;
    padding: var(--sp-8) var(--sp-5);
    text-align: center;
}

.buy-card .buy-title {
    font-size: var(--fs-lg);
    font-weight: var(--fw-semibold);
    color: var(--text);
}

.buy-card .buy-price {
    font-size: 34px;
    font-weight: var(--fw-bold);
    color: var(--danger);
    margin: 14px 0 24px;
    line-height: 1;
}

.buy-card .buy-btn {
    min-width: 160px;
}

/* ---------- 21. 登录/注册页 ---------- */
.auth-wrap {
    display: flex;
    min-height: 100vh;
    background: #fff;
}

.auth-side {
    width: 52%;
    background: linear-gradient(160deg, #1e3a8a 0%, #2563eb 55%, #3b82f6 100%);
    color: #fff;
    padding: 48px 56px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.auth-side::before,
.auth-side::after {
    content: '';
    position: absolute;
    border-radius: 50%;
}

.auth-side::before {
    width: 440px;
    height: 440px;
    background: rgba(255, 255, 255, .06);
    top: -130px;
    right: -110px;
}

.auth-side::after {
    width: 340px;
    height: 340px;
    background: rgba(255, 255, 255, .05);
    bottom: -100px;
    left: -70px;
}

.auth-side-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-logo .mark {
    width: 46px;
    height: 46px;
    /* border-radius: 12px; */
    /* background: rgba(255, 255, 255, .16); */
    /* backdrop-filter: blur(4px); */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.auth-logo .name {
    font-size: 20px;
    font-weight: var(--fw-bold);
}

.auth-logo .en {
    font-size: 11px;
    color: rgba(255, 255, 255, .7);
    letter-spacing: 2px;
    margin-top: 2px;
}

.auth-middle {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
}

.auth-slogan {
    font-size: 32px;
    font-weight: var(--fw-semibold);
    line-height: 1.4;
}

.auth-sub {
    font-size: var(--fs-md);
    color: rgba(255, 255, 255, .78);
    line-height: 1.8;
    max-width: 360px;
}

.auth-features {
    list-style: none;
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.auth-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: var(--fs-base);
    color: rgba(255, 255, 255, .92);
}

.auth-features li i {
    color: #93c5fd;
    width: 16px;
    text-align: center;
}

.auth-copy {
    font-size: var(--fs-xs);
    color: rgba(255, 255, 255, .55);
}

.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
}

.auth-box {
    width: 100%;
    max-width: 380px;
}

.auth-mobile-brand {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 24px;
    font-size: var(--fs-lg);
    font-weight: var(--fw-bold);
}

.auth-mobile-brand .mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-title {
    font-size: var(--fs-3xl);
    font-weight: var(--fw-bold);
}

.auth-subtext {
    margin-top: 8px;
    font-size: var(--fs-base);
    color: var(--text-secondary);
}

.auth-tabs {
    display: flex;
    gap: 24px;
    border-bottom: 1px solid var(--border);
    margin: 24px 0;
}

.auth-tab {
    padding: 8px 2px 12px;
    font-size: var(--fs-md);
    color: var(--text-secondary);
    cursor: pointer;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    background: none;
    font-family: inherit;
    transition: color .15s ease, border-color .15s ease;
}

.auth-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: var(--fw-semibold);
}

.auth-panel {
    display: none;
}

.auth-panel.active {
    display: block;
}

.auth-copy-mobile {
    text-align: center;
    font-size: var(--fs-xs);
    color: var(--text-tertiary);
    margin-top: 24px;
}

/* ---------- 18. 响应式 ---------- */
@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
        transition: transform .25s ease;
        z-index: 1001;
        top: 0;
        padding-top: 16px;
    }

    .app-sidebar.open {
        transform: translateX(0);
    }

    .app-mask.show {
        display: block;
    }

    .app-main {
        margin-left: 0;
        padding-left: var(--sp-4);
        padding-right: var(--sp-4);
    }

    .header-toggle {
        display: block;
    }

    .col-6,
    .col-4,
    .col-3 {
        flex: 1 1 100%;
    }

    /* 登录页移动端 */
    .auth-side {
        display: none;
    }

    .auth-main {
        background: var(--bg);
    }

    .auth-mobile-brand {
        display: flex;
    }

    .auth-box {
        background: #fff;
        border: 1px solid var(--border);
        border-radius: var(--radius-xl);
        padding: 36px 28px;
    }
}

@media (max-width: 575.98px) {
    .app-header {
        padding: 0 var(--sp-4);
    }

    /* 页头工具栏：窄屏换行、搜索框全宽 */
    .flex-between {
        flex-wrap: wrap;
        gap: 12px;
    }

    .header-tools {
        width: 100%;
    }

    .header-tools .search-box {
        flex: 1 1 100%;
        width: auto;
        max-width: 100%;
    }

    .header-tools .search-input {
        width: 100%;
    }

    .header-tools .form-select {
        flex: 1 1 auto;
        min-width: 0;
    }

    .card-body {
        padding: var(--sp-4);
    }

    .card-header {
        padding: 14px var(--sp-4);
    }

    .page-title {
        font-size: var(--fs-xl);
    }

    .desc-list .desc-item {
        flex: 0 0 100%;
    }

    .stat-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- 品牌版本号徐章（绿色系） ---------- */
.brand-version {
    flex: 0 0 auto;
    margin-left: 8px;
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--success-light);
    color: var(--success);
    border: 1px solid #a7f3d0;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .3px;
    line-height: 1.6;
    white-space: nowrap;
}

/* 登录页左侧深蓝底上的徐章适配 */
.auth-side .brand-version {
    margin-left: 10px;
    vertical-align: middle;
    background: rgba(16, 185, 129, .18);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, .42);
}

/* 登录页移动端品牌区 */
.auth-mobile-brand .brand-version {
    margin-left: 2px;
}

/* ---------- 联系客服弹层 ---------- */
.contact-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
}

.contact-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #f8fafc;
}

.contact-icon {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 18px;
}

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

.contact-label {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 4px;
}

.contact-value {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    word-break: break-all;
}

a.contact-value:hover {
    color: var(--primary);
}

.contact-value.mono {
    font-family: ui-monospace, Consolas, monospace;
    letter-spacing: 1px;
}

.contact-action {
    flex: 0 0 auto;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--primary);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: border-color .15s ease, background .15s ease;
}

.contact-action:hover {
    border-color: var(--primary);
    background: #eff6ff;
}

/* ---------- 19. SweetAlert2 轻量适配（无阴影） ---------- */
.swal2-popup {
    border-radius: var(--radius-lg) !important;
    border: 1px solid var(--border) !important;
    box-shadow: none !important;
    font-family: var(--font) !important;
}

.swal2-title {
    font-size: var(--fs-lg) !important;
    font-weight: var(--fw-semibold) !important;
    color: var(--text) !important;
}

.swal2-html-container {
    font-size: var(--fs-base) !important;
    color: var(--text-secondary) !important;
}

.swal2-styled.swal2-confirm {
    background: var(--primary) !important;
    font-size: var(--fs-base) !important;
    box-shadow: none !important;
}

.swal2-styled.swal2-cancel {
    background: #fff !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    box-shadow: none !important;
}

.swal2-toast {
    box-shadow: none !important;
    border: 1px solid var(--border) !important;
}

/* ---------- 22. 统计趋势/环比 ---------- */
.stat-trend {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    font-size: var(--fs-xs);
}

.stat-trend .label {
    color: var(--text-tertiary);
}

.trend-up,
.trend-down,
.trend-flat {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-weight: var(--fw-semibold);
}

.trend-up {
    color: var(--success);
}

.trend-down {
    color: var(--danger);
}

.trend-flat {
    color: var(--text-tertiary);
}

/* ---------- 23. 悬浮提示卡片 ---------- */
.app-tooltip {
    position: fixed;
    z-index: 9999;
    max-width: 280px;
    padding: 9px 14px;
    background: #0f172a;
    color: #fff;
    font-size: 12px;
    line-height: 1.6;
    border-radius: 8px;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .15s ease, transform .15s ease;
    white-space: normal;
}

.app-tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

.app-tooltip::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #0f172a;
}

/* ---------- 24. 表单列分割线与可选标注 ---------- */
.form-divider {
    border-left: 1px solid var(--border);
    padding-left: var(--sp-6);
}

.optional {
    margin-left: 4px;
    font-size: var(--fs-xs);
    font-weight: var(--fw-regular);
    color: var(--text-tertiary);
}

@media (max-width: 991.98px) {
    .form-divider {
        border-left: none;
        padding-left: 0;
    }
}

/* ---------- 25. 拖拽手柄 ---------- */
.drag-handle {
    width: 46px;
    text-align: center;
    cursor: grab;
    color: #cbd5e1;
    user-select: none;
}

.drag-handle i {
    font-size: 15px;
}

.drag-handle:hover {
    color: var(--primary);
}

.drag-handle:active {
    cursor: grabbing;
}

/* 拖拽进行中：全局禁止选中文字，避免拖拽时选中到其他单元格文字 */
body.is-dragging,
body.is-dragging * {
    user-select: none !important;
    -webkit-user-select: none !important;
    cursor: grabbing !important;
}

/* ---------- 26. 游戏封面缩略图 ---------- */
.cover-thumb {
    width: 80px;
    height: 46px;
    min-width: 80px;
    max-width: none;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: #f8fafc;
    display: block;
}

/* ---------- 27. 拖拽跟手效果 ---------- */
tr.drag-active {
    position: fixed !important;
    z-index: 1000;
    display: table !important;
    table-layout: fixed;
    background: #fff;
    border: 1px solid var(--primary);
    border-radius: 8px;
    overflow: hidden;
    pointer-events: none;
    opacity: 0.96;
}

tr.drag-active td {
    background: #fff !important;
}

tr.placeholder-row td {
    padding: 0 !important;
}

/* ---------- 28. 开关组件 ---------- */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
    vertical-align: middle;
}

.switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 24px;
    transition: background .2s ease;
}

.switch-slider::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s ease;
}

.switch input:checked+.switch-slider {
    background: var(--success);
}

.switch input:checked+.switch-slider::before {
    transform: translateX(20px);
}

.switch input:disabled+.switch-slider {
    opacity: .5;
    cursor: not-allowed;
}

/* 封面图上传区（横向：预览 + 操作） */
.cover-upload {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.cover-upload-side {
    padding-top: 2px;
}
.cover-preview {
    width: 280px;
    max-width: 100%;
    height: 160px;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
    flex-shrink: 0;
}

/* ---------- 30. 打包说明文本 ---------- */
.guide-body p {
    margin: 0 0 8px;
    font-size: 13px;
    line-height: 1.8;
    color: #475569;
}

.guide-body .warn {
    color: #b91c1c;
}

.guide-body .tip {
    color: #2563eb;
}

/* ---------- 31. 列表工具栏搜索框 ---------- */
.header-tools {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    width: 260px;
}

.search-box>i {
    position: absolute;
    left: 12px;
    color: #94a3b8;
    font-size: 13px;
    pointer-events: none;
}

.search-input {
    width: 100%;
    height: 36px;
    padding: 0 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.search-input::placeholder {
    color: #94a3b8;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.search-clear {
    position: absolute;
    right: 8px;
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    background: #e2e8f0;
    color: #64748b;
    border-radius: 50%;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.search-clear:hover {
    background: #cbd5e1;
    color: #334155;
}

/* ---------- 32. 窄栏居中页面 ---------- */
.page-narrow {
    max-width: 560px;
    margin: 0 auto;
}

/* ---------- 33. 支付弹窗 ---------- */
.pay-mask {
    position: fixed;
    inset: 0;
    z-index: 1500;
    background: rgba(15, 23, 42, .45);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.pay-mask.show {
    display: flex;
}

.pay-dialog {
    width: 100%;
    max-width: 380px;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
}

.pay-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.pay-dialog-head i {
    color: var(--primary);
}

.pay-dialog-close {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    border-radius: 6px;
    font-size: 14px;
}

.pay-dialog-close:hover {
    background: var(--bg);
    color: var(--text);
}

.pay-dialog-body {
    padding: 22px 20px;
    text-align: center;
}

.pay-amount {
    font-size: 32px;
    font-weight: 700;
    color: var(--danger);
    margin-bottom: 18px;
}

.pay-methods {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.pay-method {
    flex: 1;
    height: 48px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: border-color .15s ease, color .15s ease;
}

.pay-method i {
    font-size: 18px;
}

.pay-wechat i {
    color: #07c160;
}

.pay-alipay i {
    color: #1677ff;
}

.pay-method:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pay-qr-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.pay-qr-wrap img {
    width: 220px;
    height: 220px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px;
    background: #fff;
}

/* 本地生成的二维码容器（不依赖第三方接口） */
.pay-qr-box {
    width: 220px;
    height: 220px;
    margin: 0 auto;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pay-qr-box img,
.pay-qr-box canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
    border-radius: 6px;
}

.pay-qr-tip {
    margin-top: 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

.pay-open-link {
    display: inline-block;
    margin-top: 10px;
    font-size: 13px;
    color: var(--primary);
}

.pay-note {
    margin-top: 14px;
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.7;
}

.pay-loading,
.pay-error {
    padding: 30px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.pay-error {
    color: var(--danger);
}

.pay-success {
    font-size: 15px;
    color: var(--success);
    font-weight: 600;
    margin-bottom: 12px;
}

.pay-code {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 1px;
    word-break: break-all;
    background: #f8fafc;
    border: 1px dashed var(--border);
    border-radius: 10px;
    padding: 16px 12px;
}

.pay-notice {
    margin-top: 14px;
    padding: 12px 14px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-left: 3px solid #f97316;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.7;
    color: #c2410c;
    text-align: left;
}

.pay-notice i {
    color: #f97316;
    margin-right: 4px;
}
