/* ===== 管理后台公共样式 ===== */
:root {
    --primary: #00f0ff;
    --secondary: #ff00ff;
    --accent: #ffd700;
    --bg-dark: #0a0a0f;
    --bg-card: #12121a;
    --bg-input: #1a1a24;
    --border: #2a2a3a;
    --text: #e0e0e0;
    --text-muted: #888;
    --success: #00ff88;
    --danger: #ff4757;
    --warning: #ffa502;
    --info: #00f0ff;
}

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

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

/* ===== 登录页样式 ===== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a0a2e 100%);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 20% 80%, rgba(0, 240, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(255, 0, 255, 0.1) 0%, transparent 50%);
    animation: bgMove 20s linear infinite;
}

@keyframes bgMove {
    0% { transform: translate(-25%, -25%) rotate(0deg); }
    100% { transform: translate(-25%, -25%) rotate(360deg); }
}

.login-box {
    position: relative;
    z-index: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 48px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 0 60px rgba(0, 240, 255, 0.1);
}

.login-box h1 {
    font-family: 'Orbitron', 'Noto Serif SC', serif;
    font-size: 28px;
    text-align: center;
    margin-bottom: 8px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-box .subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 32px;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-muted);
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 15px;
    transition: all 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(90deg, var(--primary), #00c8d4);
    color: #000;
    width: 100%;
}

.btn-primary:hover {
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.4);
    transform: translateY(-2px);
}

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

.btn-danger:hover {
    box-shadow: 0 0 20px rgba(255, 71, 87, 0.4);
}

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

.btn-success:hover {
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
}

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

.login-error {
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    display: none;
}

/* ===== 管理后台布局 ===== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: 240px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 24px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.sidebar-logo .logo-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), #0080ff);
    border-radius: 8px;
    font-size: 20px;
    color: #000;
}

.sidebar-logo .logo-text {
    display: flex;
    flex-direction: column;
}

.sidebar-logo h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    color: var(--primary);
    margin: 0;
}

.sidebar-logo span {
    font-size: 12px;
    color: var(--text-muted);
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.3s;
    font-size: 14px;
}

.sidebar-menu li a:hover,
.sidebar-menu li a.active {
    background: rgba(0, 240, 255, 0.1);
    color: var(--primary);
    border-right: 3px solid var(--primary);
}

.sidebar-menu li a i {
    width: 20px;
    text-align: center;
}

.sidebar-user {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    margin-top: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-user .avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #000;
    font-size: 16px;
}

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

.sidebar-user .info .name {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user .info .role {
    font-size: 12px;
    color: var(--text-muted);
}

.sidebar-user .sidebar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-user .sidebar-link,
.sidebar-user .sidebar-logout {
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.3s;
    font-size: 14px;
    padding: 4px;
}

.sidebar-user .sidebar-link:hover,
.sidebar-user .sidebar-logout:hover {
    color: var(--primary);
}

.sidebar-user .sidebar-logout:hover {
    color: var(--danger);
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: 240px;
    padding: 24px;
}

/* 页面标题 */
.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.page-header h1 i {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 6px rgba(0, 240, 255, 0.5));
}

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

/* 卡片 */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.card-header h3 {
    font-size: 16px;
    font-weight: 500;
}

.card-header h3 i {
    margin-right: 8px;
    color: var(--primary);
}

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 16px;
}

.stat-card .stat-icon.users { background: rgba(0, 240, 255, 0.15); color: var(--primary); }
.stat-card .stat-icon.novels { background: rgba(255, 0, 255, 0.15); color: var(--secondary); }
.stat-card .stat-icon.recharge { background: rgba(0, 255, 136, 0.15); color: var(--success); }
.stat-card .stat-icon.consumption { background: rgba(255, 165, 2, 0.15); color: var(--warning); }

.stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 4px;
    font-family: 'Orbitron', monospace;
}

.stat-card .stat-label {
    font-size: 14px;
    color: var(--text-muted);
}

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

table {
    width: 100%;
    border-collapse: collapse;
}

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

th {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tbody tr:hover {
    background: rgba(0, 240, 255, 0.05);
}

tbody tr td:last-child {
    text-align: right;
}

/* 标签 */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-free { background: rgba(136, 136, 136, 0.2); color: #888; }
.badge-monthly { background: rgba(0, 240, 255, 0.2); color: var(--primary); }
.badge-quarterly { background: rgba(255, 0, 255, 0.2); color: var(--secondary); }
.badge-yearly { background: rgba(255, 215, 0, 0.2); color: var(--accent); }
.badge-lifetime { background: rgba(0, 255, 136, 0.2); color: var(--success); }

.badge-pending { background: rgba(255, 165, 2, 0.2); color: var(--warning); }
.badge-resolved { background: rgba(0, 255, 136, 0.2); color: var(--success); }
.badge-reviewed { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.badge-rejected { background: rgba(107, 114, 128, 0.2); color: #6b7280; }
.badge-used { background: rgba(0, 255, 136, 0.2); color: var(--success); }
.badge-unused { background: rgba(0, 240, 255, 0.2); color: var(--primary); }

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

.pagination button {
    padding: 8px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s;
}

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

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination .page-info {
    padding: 8px 16px;
    color: var(--text-muted);
    font-size: 14px;
}

/* 搜索和筛选 */
.toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 16px;
    flex: 1;
    max-width: 300px;
}

.search-box input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text);
    font-size: 14px;
}

.search-box input:focus {
    outline: none;
}

.search-box i {
    color: var(--text-muted);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group select {
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--primary);
}

/* 模态框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform 0.3s;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

/* 模态框类型变体 - 统一风格（无发光） */
.modal.info .modal-header h3,
.modal.warning .modal-header h3,
.modal.danger .modal-header h3,
.modal.success .modal-header h3 {
    color: var(--text-primary);
}

/* 默认使用主题色(primary) */

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

.modal-header h3 {
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    transition: color 0.3s;
}

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

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--border);
}

/* 表单 */
.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* ===== 编辑会员弹窗美化 ===== */
.modal.edit-modal {
    max-width: 480px;
}

.edit-user-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.08) 0%, rgba(255, 0, 255, 0.08) 100%);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.edit-user-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.edit-user-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #000;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

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

.edit-user-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text);
}

.edit-user-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
}

.edit-user-badge {
    flex-shrink: 0;
}

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

.edit-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.edit-form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.edit-form-group label i {
    width: 16px;
    color: var(--primary);
}

.edit-input,
.edit-select {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    transition: all 0.3s;
}

.edit-input:focus,
.edit-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 16px rgba(0, 240, 255, 0.15);
}

.edit-select {
    cursor: pointer;
    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='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.edit-quota {
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--accent);
    font-family: 'Orbitron', monospace;
    letter-spacing: 1px;
}

.edit-inviter {
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text);
    border: 1px solid var(--border);
}

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

.modal-footer .btn-primary i {
    margin-right: 6px;
}

.form-row.full {
    grid-template-columns: 1fr;
}

textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 15px;
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* Toast 提示 */
.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 2000;
    transform: translateX(120%);
    transition: transform 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast i {
    font-size: 16px;
}

.toast.show {
    transform: translateX(0);
}

.toast.toast-success {
    background: rgba(0, 255, 136, 0.12);
    color: var(--success);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.15);
}

.toast.toast-error {
    background: rgba(255, 71, 87, 0.12);
    color: var(--danger);
    box-shadow: 0 0 20px rgba(255, 71, 87, 0.15);
}

.toast.toast-warning {
    background: rgba(255, 165, 2, 0.12);
    color: var(--warning);
    box-shadow: 0 0 20px rgba(255, 165, 2, 0.15);
}

.toast.toast-info {
    background: rgba(0, 240, 255, 0.12);
    color: var(--info);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.15);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 15px;
}

/* 加载状态 */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    color: var(--text-muted);
}

.loading i {
    margin-right: 8px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式 */
@media (max-width: 768px) {
    .sidebar {
        width: 200px;
    }
    .main-content {
        margin-left: 200px;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
}
