:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #8b5cf6;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    /* 安全区：优先用 Android 注入的 --sat/--sab/--sal/--sar，否则用 env()，实现各设备自动适配 */
    --safe-top: var(--sat, env(safe-area-inset-top, 0px));
    --safe-bottom: var(--sab, env(safe-area-inset-bottom, 0px));
    --safe-left: var(--sal, env(safe-area-inset-left, 0px));
    --safe-right: var(--sar, env(safe-area-inset-right, 0px));
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    overflow-x: hidden;
    overflow-y: auto;
}

body.sidebar-open {
    overflow: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Admin Login */
.admin-login {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
    box-sizing: border-box;
}

.login-container {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    padding: 3rem;
    border-radius: 1.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.admin-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: white;
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-secondary);
}

.input-group {
    position: relative;
    margin-bottom: 1.25rem;
}

.input-group ion-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1.25rem;
}

.input-group input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(15, 23, 42, 0.8);
}

.btn-login {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 0.75rem;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    margin-top: 1rem;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
}

.login-error {
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    min-height: 1.25rem;
    text-align: center;
}

@media (max-width: 768px) {
    .admin-login {
        padding: var(--safe-top) calc(1rem + var(--safe-right)) var(--safe-bottom) calc(1rem + var(--safe-left));
    }
    .login-container {
        padding: 2rem 1.5rem;
        margin: 0.5rem;
    }
    .btn-login {
        min-height: 48px;
    }
}

/* Dashboard Layout */
.admin-dashboard {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
}

/* Sidebar */
.admin-sidebar {
    width: 280px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    transition: transform 0.3s ease;
}

.sidebar-header {
    margin-bottom: 2.5rem;
    padding: 0 0.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo ion-icon {
    font-size: 1.75rem;
    color: var(--primary-color);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 0.75rem;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0) 100%);
    color: var(--text-primary);
    border-left: 3px solid var(--primary-color);
}

.nav-item ion-icon {
    font-size: 1.25rem;
    color: inherit !important;
}

.nav-item ion-icon::part(icon) {
    color: inherit !important;
}

/* 閽堝 Shadow DOM 缁撴瀯鐨勪竾鑳借ˉ涓?*/
.nav-item ion-icon svg,
.nav-item ion-icon path,
.nav-item ion-icon circle {
    stroke: currentColor !important;
    fill: none;
    /* 閽堝 outline 鍥炬爣锛屽己鍒朵笉濉厖 */
}

.sidebar-footer {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}

/* Main Content */
.admin-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    padding-left: calc(2rem + var(--safe-left));
    padding-right: calc(2rem + var(--safe-right));
    padding-bottom: calc(2rem + var(--safe-bottom));
    background: #0f172a;
}

/* Content Sections */
.content-section {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.content-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.btn-refresh {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-refresh:hover {
    background: rgba(255, 255, 255, 0.05);
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2rem;
}

.admin-user ion-icon {
    font-size: 1.75rem;
    color: var(--secondary-color);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    /* 寮哄埗鎵€鏈夌粺璁″崱鐗囬粯璁や娇鐢ㄥ瀭鐩村竷灞€锛岄槻姝㈠榻愰敊涔?*/
    gap: 1rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    /* 鍏佽鍗＄墖绛夐珮 */
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.stat-info h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    word-break: break-all;
    /* Fix for long URLs */
    line-height: 1.4;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    height: 320px;
    display: flex;
    flex-direction: column;
}

.chart-card h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.chart-card canvas {
    flex: 1;
    max-height: 240px;
}

/* Tables and Lists */
.section-toolbar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

/* 统一控件基础样式 */
.search-box input,
.filter-group select,
.sort-select,
.btn-action,
.btn-action-ghost {
    height: 42px !important;
    border-radius: 0.75rem !important;
    font-size: 0.9rem !important;
    background: rgba(30, 41, 59, 0.5) !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--text-primary) !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-sizing: border-box !important;
}

/* 按钮和容器需要 flex */
.btn-action,
.btn-action-ghost,
.filter-group,
.batch-actions {
    display: flex !important;
    align-items: center !important;
}

/* 搜索框容器 */
.search-box {
    position: relative !important;
    display: inline-block;
    width: 300px;
}

/* 搜索图标定位 */
.search-box ion-icon {
    position: absolute !important;
    left: 1rem !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: var(--text-secondary) !important;
    font-size: 1.1rem !important;
    pointer-events: none !important;
    z-index: 2 !important;
}

/* 搜索框特定样式 */
.search-box input {
    width: 100% !important;
    padding: 0 1rem 0 2.75rem !important;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color) !important;
    background: rgba(99, 102, 241, 0.05) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
}

/* 下拉菜单特定样式 */
.filter-group select,
.sort-select {
    padding: 0 2.5rem 0 1rem !important;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    min-width: 140px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
}

.filter-group select:hover,
.sort-select:hover {
    border-color: var(--primary-color) !important;
    background-color: rgba(99, 102, 241, 0.1) !important;
}

/* 按钮样式统一 */
.btn-action {
    background: var(--primary-color) !important;
    border: none !important;
    padding: 0 1.5rem !important;
    justify-content: center;
    font-weight: 600;
}

.btn-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3) !important;
}

.btn-action-ghost {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 0 1.25rem !important;
    justify-content: center;
}

.btn-action-ghost:hover {
    background: rgba(99, 102, 241, 0.1) !important;
    border-color: var(--primary-color) !important;
    color: var(--primary-color) !important;
}

/* 按钮特定状态扩展 */
.btn-action.danger {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #ef4444 !important;
    border: 1px solid rgba(239, 68, 68, 0.2) !important;
}

.btn-action.danger:hover {
    background: #ef4444 !important;
    color: white !important;
    border-color: #ef4444 !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3) !important;
}

.btn-action:active {
    transform: scale(0.96) !important;
}

/* 鎸夐挳鍒楄〃瀹瑰櫒 - 寮哄埗鍨傜洿瀵归綈 */
.settings-action-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.25rem;
    width: 100%;
}

.settings-action-list .btn-action {
    width: 100% !important;
    justify-content: flex-start !important;
    /* 璁剧疆椤规寜閽缓璁乏瀵归綈锛岄厤鍚堝浘鏍?*/
    padding-left: 1.25rem;
    height: 42px;
    /* 璁剧疆椤规寜閽◢楂樹竴鐐癸紝鏇存槗鐐瑰嚮 */
}

.btn-icon-only {
    width: 38px;
    height: 38px;
    padding: 0 !important;
    flex-shrink: 0;
    border-radius: 0.6rem;
}

/* 妯″瀷鎿嶄綔鎸夐挳缁?- 寮哄埗瀵归綈鐨勬牳蹇?*/
.model-card-actions {
    display: flex;
    gap: 8px;
    width: 100%;
    height: 38px;
    /* 鍥哄畾楂樺害锛屼笌鍏ㄥ眬 btn-action 淇濇寔涓€鑷?*/
    align-items: stretch;
    margin-top: auto;
    /* 鎺ㄥ埌搴曢儴 */
}

.model-card-actions .btn-action {
    height: 100% !important;
    /* 寮哄埗濉弧瀹瑰櫒楂樺害 */
    padding: 0 1rem;
    margin: 0 !important;
}

.model-card-actions .btn-icon-only {
    width: 38px !important;
    min-width: 38px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    /* 缁熶竴璋冧寒鑳屾櫙 */
}

.model-card-actions .btn-icon-only ion-icon {
    font-size: 1.2rem;
}

/* 妯″瀷閰嶇疆涓撶敤缃戞牸 */
.models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    align-items: stretch;
}

.model-config-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1.25rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.model-config-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: transparent;
    transition: all 0.3s;
}

.model-config-card.active-model-card {
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px -10px rgba(99, 102, 241, 0.3);
    background: linear-gradient(145deg, var(--bg-card) 0%, rgba(99, 102, 241, 0.05) 100%);
}

.model-config-card.active-model-card::before {
    background: var(--primary-color);
}

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

.model-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.model-badge.provider {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.model-badge.status-active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.model-name {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.model-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}

.detail-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 0.85rem;
    color: var(--text-primary);
    background: rgba(15, 23, 42, 0.4);
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-family: 'Fira Code', 'Courier New', monospace;
    word-break: break-all;
    line-height: 1.4;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    max-height: 80px;
    overflow-y: auto;
}

.model-card-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.model-card-actions .btn-action {
    flex: 1;
    height: 42px;
}

.model-card-actions .btn-icon-only {
    flex: 0 0 42px;
    width: 42px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
}

/* Galgame 绠＄悊缃戞牸涓庡崱鐗?*/
.galgame-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.galgame-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1.25rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.galgame-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
}

.galgame-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.galgame-user-info {
    display: flex;
    flex-direction: column;
}

.galgame-username {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.galgame-char-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.galgame-score-container {
    background: rgba(0, 0, 0, 0.2);
    padding: 1.25rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.galgame-score-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.galgame-score-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
}

.galgame-score-value {
    font-size: 1.5rem;
    font-weight: 800;
    font-family: 'Inter', sans-serif;
}

/* 鍔ㄦ€佽繘搴︽潯 */
.galgame-progress-bg {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.galgame-progress-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 10px currentColor;
}

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

.galgame-time {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.galgame-card-actions {
    display: flex;
    gap: 0.75rem;
}

.galgame-card-actions .btn-action {
    flex: 1;
    height: 38px;
    font-size: 0.85rem;
}

/* 鐢ㄦ埛绠＄悊缃戞牸涓庡崱鐗?*/
.user-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.user-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1.25rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.user-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.3);
    border-color: rgba(99, 102, 241, 0.2);
}

.user-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 800;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.user-basic-info h4 {
    margin: 0;
    font-size: 1.15rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-password-wrap {
    background: rgba(0, 0, 0, 0.2);
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.03);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-password-wrap code {
    font-family: 'Fira Code', monospace;
    font-size: 0.95rem;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.user-stats-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.user-stat-item {
    background: rgba(255, 255, 255, 0.02);
    padding: 0.6rem;
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.user-stat-label {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
}

.user-stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.user-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.user-date {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.user-actions {
    display: flex;
    gap: 0.5rem;
}

.user-actions .btn-action {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    min-width: auto;
}

.table-container {
    background: var(--bg-card);
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.data-table th,
.data-table td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: rgba(15, 23, 42, 0.5);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

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

.data-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Status Badges */
.status {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    display: inline-block;
}

.status.active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status.inactive {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-secondary);
}

/* Grids */
/* 瑙掕壊澶у巺缃戞牸涓庡崱鐗?*/
.characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.character-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1.25rem;
    padding: 1.25rem;
    display: flex;
    gap: 1.25rem;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    height: 100%;
}

.character-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.4);
    border-color: rgba(99, 102, 241, 0.3);
}

.character-avatar {
    width: 80px;
    height: 80px;
    border-radius: 1.25rem;
    overflow: hidden;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: var(--text-tertiary);
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
}

.character-card:hover .character-avatar {
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.character-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.character-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    justify-content: center;
}

.character-info h4 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.character-bio {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0.4rem 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.character-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.stat-tag {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.15rem 0.5rem;
    border-radius: 0.4rem;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.char-card-actions {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%) translateX(10px);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    opacity: 0;
    transition: all 0.3s;
}

.character-card:hover .char-card-actions {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.char-btn {
    width: 34px;
    height: 34px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.char-btn.edit:hover {
    background: var(--primary-color);
}

.char-btn.delete:hover {
    background: #ef4444;
}

/* Conversations List */
.conversation-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.conversation-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.conv-main {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.conv-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.conversation-governance-grid {
    margin-top: 1.5rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.conversation-governance-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.9rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-height: 320px;
}

.conversation-governance-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.conversation-governance-header h3 {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 1rem;
}

.conversation-governance-note {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.28);
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
}

.conversation-governance-inline {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.conversation-governance-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
}

.governance-stat-item {
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0.75rem;
    background: rgba(15, 23, 42, 0.5);
    padding: 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.governance-stat-item span {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.governance-stat-item strong {
    font-size: 1.15rem;
    color: var(--text-primary);
}

.conversation-governance-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.6rem;
}

.conversation-governance-toolbar .input-group-static {
    min-width: 110px;
    margin: 0;
}

.conversation-governance-toolbar .input-group-static label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.78rem;
    margin-bottom: 0.3rem;
}

.conversation-governance-toolbar .input-group-static input {
    width: 100%;
    background: var(--bg-dark);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.6rem;
    padding: 0.55rem 0.65rem;
    font-size: 0.86rem;
}

.conversation-governance-result {
    color: var(--text-secondary);
    font-size: 0.84rem;
    line-height: 1.45;
    border: 1px dashed rgba(148, 163, 184, 0.35);
    border-radius: 0.65rem;
    padding: 0.6rem 0.75rem;
    background: rgba(15, 23, 42, 0.45);
}

.deletion-audit-list {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    background: rgba(15, 23, 42, 0.6);
    overflow: auto;
    min-height: 220px;
    max-height: 420px;
}

.deletion-audit-item {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.deletion-audit-item:last-child {
    border-bottom: none;
}

.deletion-audit-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    font-size: 0.84rem;
}

.deletion-audit-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.7rem;
    color: var(--text-secondary);
    font-size: 0.76rem;
}

.deletion-audit-pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.6rem;
}

.deletion-audit-pagination #audit-page-info {
    color: var(--text-secondary);
    font-size: 0.82rem;
}

/* Settings */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.setting-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
}

.setting-card h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.setting-card h3 ion-icon {
    color: var(--primary-color);
    font-size: 1.25rem;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

/* Setting Card Buttons */
.setting-card button {
    margin-top: 0.75rem;
}

.setting-card button:first-of-type {
    margin-top: 0;
}

/* 涓簊etting-card娣诲姞flex甯冨眬璁╂寜閽湁闂磋窛 */
.setting-card>button,
.setting-card>.btn-action {
    margin-bottom: 0.75rem;
}

.setting-card>button:last-child,
.setting-card>.btn-action:last-child {
    margin-bottom: 0;
}


/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.modal-body {
    padding: 1.5rem;
}

/* Responsiveness */
@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .admin-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 2000;
        transform: translateX(-100%);
        width: min(260px, calc(100vw - 2rem));
        max-width: 280px;
        padding: var(--safe-top) 0 var(--safe-bottom) 0;
        padding-left: calc(1rem + var(--safe-left));
        padding-right: 1rem;
    }

    .admin-sidebar.active {
        transform: translateX(0);
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 1999;
        backdrop-filter: blur(4px);
    }

    .sidebar-overlay.active {
        display: block;
    }

    .admin-content {
        padding: 1rem;
        padding-top: calc(60px + var(--safe-top) + 1rem);
        padding-left: calc(1rem + var(--safe-left));
        padding-right: calc(1rem + var(--safe-right));
        padding-bottom: calc(1rem + var(--safe-bottom));
        /* 涓虹Щ鍔ㄧ椤堕儴鏍忕暀鐧?*/
    }

    /* 顶栏从屏幕最顶开始，安全区用同色填充，与顶栏视觉一体 */
    .mobile-top-bar {
        display: flex !important;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        min-height: 60px;
        height: calc(60px + var(--safe-top));
        padding-top: var(--safe-top);
        padding-left: calc(1rem + var(--safe-left));
        padding-right: calc(1rem + var(--safe-right));
        background: var(--bg-card);
        border-bottom: 1px solid var(--border-color);
        z-index: 1500;
        align-items: center;
        justify-content: space-between;
        box-sizing: border-box;
    }

    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        /* 鏀逛负涓ゅ垪骞舵帓 */
        gap: 0.75rem !important;
    }

    .stat-card {
        padding: 0.75rem !important;
        flex-direction: row !important;
        /* 鏀逛负妯悜鎺掑垪鍥炬爣鍜屾枃瀛?*/
        align-items: center !important;
        gap: 0.75rem !important;
        min-height: 80px;
    }

    .stat-icon {
        width: 40px !important;
        height: 40px !important;
        font-size: 1.25rem !important;
        border-radius: 0.75rem !important;
        flex-shrink: 0;
    }

    .stat-info h3 {
        font-size: 1.25rem !important;
        margin-bottom: 0px !important;
    }

    .stat-info p {
        font-size: 0.75rem !important;
        white-space: nowrap;
    }

    .search-box {
        width: 100%;
    }

    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }

    .data-table {
        min-width: unset;
    }

    .data-table thead {
        display: none;
    }

    .data-table tr {
        display: block;
        background: rgba(255, 255, 255, 0.02);
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        border-radius: 0.75rem;
        padding: 0.5rem;
    }

    .data-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        text-align: right;
    }

    .data-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary);
        font-size: 0.85rem;
        text-align: left;
    }

    .data-table td:last-child {
        border-bottom: none;
        justify-content: center;
        padding-top: 1rem;
    }

    /* 瑙掕壊澶у巺鍗＄墖浼樺寲 */
    .characters-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .character-card {
        padding: 1rem !important;
        transform: none !important;
        /* 绉婚櫎绉诲姩绔綅绉?*/
    }

    /* 瀵硅瘽璁板綍鍒楄〃浼樺寲 */
    .conversation-item {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem !important;
        padding: 1rem !important;
    }

    .conv-date {
        justify-content: flex-end !important;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        padding-top: 0.75rem;
    }

    .conversation-governance-grid {
        grid-template-columns: 1fr;
    }

    .conversation-governance-stats {
        grid-template-columns: 1fr;
    }

    .deletion-audit-pagination {
        justify-content: space-between;
    }

    /* 绯荤粺璁剧疆鍗＄墖浼樺寲 */
    .settings-grid {
        grid-template-columns: 1fr !important;
    }

    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .setting-item select,
    .setting-item input {
        width: 100%;
    }

    /* 缁熶竴宸ュ叿鏍忔牱寮?*/
    .section-toolbar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem !important;
    }

    .search-box,
    .filter-group,
    .toolbar-group {
        width: 100% !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
    }

    .sort-select {
        width: 100% !important;
        min-width: unset !important;
    }

    .modal-overlay {
        padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
        align-items: center;
        justify-content: center;
    }

    .modal-content {
        max-width: 95%;
        max-height: calc(100vh - var(--safe-top) - var(--safe-bottom) - 2rem);
        max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 2rem);
        margin: 0;
        overflow-y: auto;
    }

    .modal-body {
        padding-bottom: calc(1.5rem + var(--safe-bottom));
    }

    /* 触摸目标最小高度 44px，便于手指点击 */
    .btn-action,
    .btn-action-ghost,
    .nav-item,
    .menu-toggle {
        min-height: 44px;
    }
    .menu-toggle {
        min-width: 44px;
        padding: 0 0.5rem;
    }
    .search-box input,
    .sort-select,
    .filter-group select {
        min-height: 44px;
    }
}

.mobile-top-bar {
    display: none;
}

/* ===== 鍛煎惛鐏姸鎬佹寚绀哄櫒 ===== */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-dot-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
}

/* 缁胯壊鍛煎惛鐏?(鍦ㄧ嚎) */
.status-dot-pulse.online {
    background-color: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: status-pulse-green 2s infinite;
}

@keyframes status-pulse-green {
    0% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }

    100% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* 绾㈣壊鍛煎惛鐏?(宸茬鐢? */
.status-dot-pulse.disabled {
    background-color: #ef4444;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    animation: status-pulse-red 2s infinite;
}

@keyframes status-pulse-red {
    0% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }

    100% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* 绂荤嚎闈欐鐘舵€?*/
.status-dot-pulse.offline {
    background-color: #64748b;
    opacity: 0.6;
}

/* ====================  分页组件样式 ==================== */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    margin-top: 2rem;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(15px);
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    gap: 1.5rem;
    flex-wrap: wrap;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.pagination-info {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.3px;
}

.pagination-info strong {
    color: #818cf8;
    font-weight: 600;
}

.pagination-controls {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-wrap: wrap;
}

.page-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-btn:hover:not(:disabled) {
    border-color: #818cf8;
    background: rgba(129, 140, 248, 0.15);
    color: #818cf8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.page-btn.active {
    background: #6366f1;
    color: white;
    border-color: #6366f1;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.page-btn:disabled {
    opacity: 0.2;
    cursor: not-allowed;
    filter: grayscale(1);
}

.page-ellipsis {
    padding: 0 0.5rem;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.85rem;
}

.page-size-select {
    padding: 0.5rem 2.2rem 0.5rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.75rem;
    background-color: #1e1e2e;
    color: #e2e8f0;
    cursor: pointer;
    font-size: 0.85rem;
    outline: none;
    transition: all 0.25s;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23818cf8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1em;
}

/* 强制下拉选项样式 */
.page-size-select option {
    background-color: #1e1e2e !important;
    color: #e2e8f0 !important;
    padding: 12px !important;
}

.page-size-select:hover {
    border-color: #818cf8;
}

@media (max-width: 768px) {
    .pagination-container {
        flex-direction: column;
        padding: 1.5rem 1rem;
    }
}

/* 角色卡片勾选框美化 */
.character-card {
    position: relative;
}

.char-select-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 22px !important;
    height: 22px !important;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    opacity: 0;
    /* 默认隐藏 */
    transform: scale(0.9);
}

.character-card:hover .char-select-checkbox,
.char-select-checkbox:checked {
    opacity: 1;
    transform: scale(1);
}

.char-select-checkbox:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

.char-select-checkbox:checked {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.char-select-checkbox:checked::after {
    content: '';
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.character-card.selected {
    border-color: var(--primary-color);
    background: linear-gradient(145deg, var(--bg-card) 0%, rgba(99, 102, 241, 0.05) 100%);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.15);
}

/* 批量操作按钮美化 */
.btn-action-ghost {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn-action-ghost:hover {
    background: rgba(99, 102, 241, 0.1) !important;
    border-color: var(--primary-color) !important;
    color: var(--primary-color) !important;
    transform: translateY(-1px);
}

.btn-action-ghost ion-icon {
    font-size: 1.1rem;
}

/* ==================== 管理后台自定义下拉（替换原生 select） ==================== */
.admin-dashboard .custom-select-wrapper,
.admin-dashboard .custom-select-wrapper[data-sync-select] {
    position: relative;
    min-width: 160px;
}

.admin-dashboard .custom-select-trigger {
    width: 100%;
    padding: 0.5rem 2rem 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    transition: border-color 0.2s;
}

.admin-dashboard .custom-select-trigger:hover {
    border-color: var(--primary-color);
}

.admin-dashboard .custom-select-trigger.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.admin-dashboard .custom-select-display {
    flex: 1;
}

.admin-dashboard .custom-select-arrow {
    font-size: 1rem;
    color: var(--text-secondary);
    transition: transform 0.2s;
}

.admin-dashboard .custom-select-trigger.active .custom-select-arrow {
    transform: rotate(180deg);
}

.admin-dashboard .custom-select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    max-height: 220px;
    overflow-y: auto;
}

.admin-dashboard .custom-select-option {
    padding: 0.5rem 1rem;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.admin-dashboard .custom-select-option:hover {
    background: rgba(99, 102, 241, 0.1);
}

.admin-dashboard .custom-select-option.selected {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-color);
    font-weight: 500;
}

.admin-dashboard .custom-select-option .option-check {
    color: var(--primary-color);
    font-size: 1rem;
}

/* 登录页、弹窗等不在 .admin-dashboard 内的自定义下拉 */
.modal-content .custom-select-wrapper,
.input-group-static .custom-select-wrapper {
    position: relative;
    width: 100%;
}

.modal-content .custom-select-trigger,
.input-group-static .custom-select-trigger {
    width: 100%;
    padding: 0.6rem 2rem 0.6rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-content .custom-select-trigger:hover,
.input-group-static .custom-select-trigger:hover {
    border-color: var(--primary-color);
}

.modal-content .custom-select-trigger.active,
.input-group-static .custom-select-trigger.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.modal-content .custom-select-dropdown,
.input-group-static .custom-select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1100;
    max-height: 220px;
    overflow-y: auto;
}

.modal-content .custom-select-option,
.input-group-static .custom-select-option {
    padding: 0.6rem 1rem;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-content .custom-select-option:hover,
.input-group-static .custom-select-option:hover {
    background: rgba(99, 102, 241, 0.1);
}

.modal-content .custom-select-option.selected,
.input-group-static .custom-select-option.selected {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-color);
}

/* ==================== Recovery Center ==================== */
.recovery-toolbar {
    flex-wrap: wrap;
}

.recovery-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.recovery-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.9rem;
    padding: 1rem;
    min-height: 420px;
    display: flex;
    flex-direction: column;
}

.recovery-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.recovery-card-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.recovery-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.18);
    color: #c7d2fe;
    font-size: 0.75rem;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.recovery-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    overflow: auto;
    min-height: 0;
    padding-right: 2px;
}

.recovery-empty {
    text-align: center;
    color: var(--text-secondary);
    opacity: 0.75;
    padding: 2rem 1rem;
}

.recovery-item {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 0.75rem;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
}

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

.recovery-title-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    font-size: 0.92rem;
}

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

.recovery-tag {
    font-size: 0.72rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    color: #cbd5e1;
}

.recovery-tag.active {
    border-color: rgba(16, 185, 129, 0.45);
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
}

.recovery-subtext {
    color: var(--text-secondary);
    font-size: 0.82rem;
    margin-top: 0.2rem;
    word-break: break-all;
}

.recovery-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.8rem;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.recovery-actions {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    align-items: flex-end;
    flex-shrink: 0;
}

.btn-action.success {
    border-color: rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.16);
    color: #6ee7b7;
}

.btn-action.success:hover {
    background: rgba(16, 185, 129, 0.24);
}

@media (max-width: 1024px) {
    .recovery-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .recovery-item {
        flex-direction: column;
    }

    .recovery-actions {
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        flex-wrap: wrap;
    }

    .recovery-card {
        min-height: 320px;
    }
}