/* 
 * 寻址网名系统 - 统一样式表
 * Author: Xunzhi System
 */

/* ==================== 变量定义 ==================== */
:root {
    /* 主色调 */
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: rgba(79, 70, 229, 0.1);
    
    /* 辅助色 */
    --secondary-color: #6366f1;
    --accent-color: #f59e0b;
    --accent-hover: #d97706;
    
    /* Admin 主题色 */
    --admin-primary: #ef4444;
    --admin-primary-hover: #dc2626;
    --admin-secondary: #f87171;
    --admin-dark-bg: #111827;
    
    /* 状态色 */
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    
    /* 中性色 */
    --dark-color: #1f2937;
    --light-color: #f9fafb;
    --muted-color: #6b7280;
    --border-color: #e2e8f0;
    
    /* 阴影 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* 圆角 */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* 过渡 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ==================== 基础样式 ==================== */
body {
    background-color: var(--light-color);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--dark-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #f3f4f6;
    }
    
    .card {
        background-color: #2d2d2d;
        color: #f3f4f6;
    }
    
    .table {
        --bs-table-bg: #2d2d2d;
        --bs-table-color: #f3f4f6;
    }
    
    .form-control, .form-select {
        background-color: #3d3d3d;
        border-color: #4d4d4d;
        color: #f3f4f6;
    }
    
    .navbar {
        background-color: #1f2937 !important;
    }
    
    .sidebar {
        background-color: #2d2d2d;
    }
    
    .text-muted {
        color: #9ca3af !important;
    }
}

/* ==================== 导航栏 ==================== */
.navbar {
    backdrop-filter: blur(10px);
    padding: 0.75rem 0;
}

/* 白色导航栏 - 默认/浅色风格 */
.navbar.bg-white {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.navbar-brand {
    font-size: 1.25rem;
    color: #1e293b;
    font-weight: 700;
}

.navbar.bg-white .navbar-brand {
    color: #1e293b;
}

.navbar.bg-white .nav-link {
    color: #64748b;
    font-weight: 500;
    padding: 0.5rem 0.85rem;
    border-radius: 6px;
    transition: all var(--transition-fast);
}

.navbar.bg-white .nav-link:hover {
    color: #6366f1;
    background: #f1f5f9;
}

.navbar.bg-white .nav-link.active {
    color: #6366f1;
    background: #f0f9ff;
}

.navbar.bg-white .navbar-toggler {
    border-color: #e2e8f0;
    background-color: #f8f9fa;
    color: #64748b;
}

.navbar.bg-white .navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.15);
}

.navbar.bg-white .dropdown-menu {
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
}

.navbar.bg-white .dropdown-item {
    color: #475569;
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

.navbar.bg-white .dropdown-item:hover {
    background: #f1f5f9;
    color: #6366f1;
}

.lang-switch {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    background: #f1f5f9;
    color: #64748b;
    transition: all var(--transition-fast);
}

.lang-switch:hover {
    background: #6366f1;
    color: #fff;
}

/* 深色导航栏 - 保持原有风格 */
.navbar.bg-dark {
    background: rgba(26, 32, 44, 0.95) !important;
}

.navbar.bg-dark .nav-link {
    color: rgba(255,255,255,0.85);
}

.navbar.bg-dark .nav-link:hover,
.navbar.bg-dark .nav-link.active {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.navbar.bg-dark .lang-switch {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.8);
}

.navbar.bg-dark .lang-switch:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

/* ==================== 侧边栏 ==================== */
.sidebar {
    min-height: 100vh;
    background: white;
    box-shadow: var(--shadow-lg);
}

@media (prefers-color-scheme: dark) {
    .sidebar {
        background: #2d2d2d;
    }
}

.sidebar .nav-link {
    color: var(--muted-color);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin: 0.25rem 0;
    transition: all var(--transition-fast);
}

.sidebar .nav-link:hover, 
.sidebar .nav-link.active {
    background: var(--primary-light);
    color: var(--primary-color);
}

/* 用户中心侧边栏链接 */
.sidebar-link {
    border-radius: var(--radius-xl);
    margin-bottom: 0.5rem;
    border: none;
    transition: all var(--transition-normal);
    padding: 0.8rem 1.25rem;
    font-weight: 500;
    color: #4b5563;
    cursor: pointer;
    display: block;
    width: 100%;
    text-decoration: none !important;
    outline: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

.sidebar-link:hover {
    background-color: rgba(79, 70, 229, 0.1);
    color: var(--primary-color);
    transform: translateX(5px);
}

.sidebar-link.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%) !important;
    border: none;
    color: white !important;
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3);
}

/* Admin 后台侧边栏链接 */
.admin-sidebar-link {
    border-radius: var(--radius-lg);
    margin-bottom: 0.4rem;
    border: none;
    transition: all var(--transition-fast);
    padding: 0.75rem 1.25rem;
    font-weight: 500;
    color: #4b5563;
}

.admin-sidebar-link:hover {
    background-color: #fee2e2;
    color: var(--admin-primary);
}

.admin-sidebar-link.active {
    background: var(--admin-primary) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

/* 粘性侧边栏 */
@media (min-width: 992px) {
    .sidebar-sticky {
        position: sticky;
        top: 1.5rem;
        height: calc(100vh - 100px);
        overflow-y: auto;
        z-index: 1000;
    }
}

/* 确保小屏幕上侧边栏也能正常显示和点击 */
@media (max-width: 991px) {
    .sidebar-sticky {
        position: relative;
        z-index: 1000;
    }
}

/* 修复 Bootstrap list-group-item-action 点击问题 */
.list-group-item-action {
    cursor: pointer !important;
    outline: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent !important;
    position: relative !important;
    z-index: 1001 !important;
}

.list-group-item-action:focus,
.list-group-item-action:active {
    box-shadow: none !important;
    outline: none !important;
    background-color: inherit !important;
}

/* 确保 list-group 中的链接可以正常点击 */
.list-group a.list-group-item-action,
.list-group button.list-group-item-action {
    position: relative !important;
    z-index: 1001 !important;
    cursor: pointer !important;
}

/* 确保侧边栏内所有元素都可以点击 */
.sidebar-sticky * {
    pointer-events: auto !important;
}

/* ==================== 卡片 ==================== */
.card {
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-normal);
    background: #fff;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
}

/* ==================== 按钮 ==================== */
.btn {
    border-radius: var(--radius-md);
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    transition: all var(--transition-normal);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #7c3aed);
    border: none;
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover), #6d28d9);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-warning {
    background: linear-gradient(135deg, var(--accent-color), #fbbf24);
    border: none;
    color: #1f2937;
}

.btn-warning:hover {
    background: linear-gradient(135deg, var(--accent-hover), #f59e0b);
    transform: translateY(-2px);
}

.btn-search {
    border-radius: 1.25rem;
    padding: 0.75rem 2.5rem;
    font-weight: 600;
    background: var(--accent-color);
    border: none;
    color: #fff;
    box-shadow: 0 10px 15px -3px rgba(245, 158, 11, 0.4);
    transition: all var(--transition-normal);
}

.btn-search:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(245, 158, 11, 0.5);
    color: #fff;
}

/* Admin 主题按钮 */
.btn-admin-primary {
    background-color: var(--admin-primary);
    border: none;
    color: white;
}

.btn-admin-primary:hover {
    background-color: var(--admin-primary-hover);
}

/* ==================== 表单 ==================== */
.form-control, .form-select {
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-control-lg {
    border-radius: 1.25rem;
    border: none;
    padding: 1.25rem 1.5rem;
    font-size: 1.1rem;
    box-shadow: var(--shadow-md);
}

/* ==================== 表格 ==================== */
.table {
    margin-bottom: 0;
}

.table thead th {
    background-color: #f9fafb;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: #6b7280;
    border: none;
    padding: 1rem;
}

.table tbody td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid #f3f4f6;
}

.table-hover tbody tr {
    transition: all var(--transition-fast);
}

.table-hover tbody tr:hover {
    background-color: var(--primary-light);
}

/* ==================== 徽章 ==================== */
.badge {
    padding: 0.35em 0.65em;
    font-weight: 500;
    border-radius: var(--radius-sm);
}

/* ==================== 英雄区域 ==================== */
.hero {
    background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
    color: #1e293b;
    padding: 80px 0 0;
    margin-bottom: 0;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to top, #fff, transparent);
    z-index: 1;
}

.hero h1 {
    color: #0f172a;
}

.hero .lead {
    color: #64748b;
}

.search-bar-wrap {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 2rem;
    margin: 2rem auto;
    max-width: 900px;
    position: relative;
    z-index: 2;
}

.search-bar-wrap .form-control-lg,
.search-bar-wrap .form-select-lg {
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.search-bar-wrap .form-control-lg:focus,
.search-bar-wrap .form-select-lg:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.search-bar-wrap .btn-search {
    border-radius: 12px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    padding: 0.875rem 2rem;
    font-weight: 600;
    color: white;
    transition: all 0.2s ease;
}

.search-bar-wrap .btn-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
    color: white;
}

/* ==================== 功能卡片 ==================== */
.feature-icon {
    width: 64px;
    height: 64px;
    background: var(--primary-light);
    color: var(--primary-color);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1.5rem;
    transition: all var(--transition-normal);
}

.card:hover .feature-icon {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1) rotate(5deg);
}

/* ==================== 最新列表 ==================== */
.latest-item {
    border: none;
    padding: 1.25rem 1rem;
    border-radius: var(--radius-lg);
    margin-bottom: 0.5rem;
    transition: all var(--transition-fast);
}

.latest-item:hover {
    background: #f3f4f6;
}

/* ==================== 代码块 ==================== */
code {
    background: #f1f5f9;
    color: #475569;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-lg);
    display: block;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
}

/* ==================== 统计卡片 ==================== */
.stat-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-normal);
    border-bottom: 4px solid transparent;
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-bottom-color: var(--primary-color);
}

@media (prefers-color-scheme: dark) {
    .stat-card {
        background: #2d2d2d;
    }
}

/* ==================== 登录/注册页面 ==================== */
.auth-card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    max-width: 900px;
    width: 100%;
}

.auth-visual {
    background: linear-gradient(135deg, var(--primary-color), #7c3aed);
    color: white;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-form {
    padding: 3rem;
}

.auth-visual, .auth-form {
    position: relative;
}

@media (max-width: 768px) {
    .auth-visual {
        padding: 2rem;
    }
    .auth-form {
        padding: 1.5rem;
    }
}

/* 登录卡片特殊样式 */
.login-card {
    width: 100%;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.brand-logo {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
    margin: 0 auto 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.4);
    transition: transform 0.3s ease;
}

.brand-logo:hover {
    transform: scale(1.05) rotate(5deg);
}

.input-group {
    background: #ffffff;
    border-radius: 1rem;
    border: 1.5px solid #e5e7eb;
    transition: all 0.2s ease;
    overflow: hidden;
}

.input-group:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.input-group-text {
    background: transparent;
    border: none;
    color: #9ca3af;
    padding-left: 1.25rem;
    padding-right: 0.75rem;
}

.back-home {
    position: absolute;
    top: 2rem;
    left: 2rem;
    color: #4b5563;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.back-home:hover {
    color: var(--primary-color);
    transform: translateX(-5px);
}

/* ==================== 加载动画 ==================== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==================== 按钮加载状态 ==================== */
.btn-loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::after {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
    margin-left: 0.5em;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== 响应式工具 ==================== */
@media (max-width: 768px) {
    .hero {
        padding: 80px 0 0;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .card {
        border-radius: var(--radius-lg);
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .back-home {
        top: 1rem;
        left: 1rem;
    }
}

/* ==================== 页脚 ==================== */
footer {
    margin-top: auto;
}

/* ==================== 下拉菜单 ==================== */
.dropdown-menu {
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.dropdown-item {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

/* ==================== 警告框 ==================== */
.alert {
    border: none;
    border-radius: var(--radius-md);
}

/* ==================== 标题样式 ==================== */
.section-title {
    position: relative;
    display: inline-block;
    margin-bottom: 3rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* ==================== 价格标签 ==================== */
.price-tag {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--danger-color);
}

/* ==================== 主容器 ==================== */
.main-container {
    flex: 1;
}

/* ==================== 登录/注册页面主内容区 ==================== */
.main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 0;
}

/* ==================== Language Switcher ==================== */
.lang-switcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.lang-switcher a {
    background: white;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.3s;
    display: inline-block;
}

.lang-switcher a:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.3);
}

/* ==================== QR Code 样式 ==================== */
.qr-code {
    max-width: 200px;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 8px;
}

/* ==================== Admin 后台特定样式 ==================== */
.admin-body {
    background-color: #f9fafb;
}

.admin-navbar {
    background: #ffffff !important;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    padding: 0.75rem 0;
}

.admin-stat-card {
    border-bottom: 4px solid transparent;
    transition: all 0.3s;
}

.admin-stat-card:hover {
    transform: translateY(-5px);
    border-bottom-color: var(--admin-primary);
}

.admin-code {
    background: #fee2e2;
    color: var(--admin-primary);
    padding: 0.2rem 0.4rem;
    border-radius: 0.4rem;
    font-size: 0.85rem;
}

/* ==================== User Dashboard 特定样式 ==================== */
.user-body {
    background: #f3f4f6;
    background-image: 
        radial-gradient(at 0% 0%, rgba(79, 70, 229, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(99, 102, 241, 0.05) 0px, transparent 50%);
}

.user-navbar {
    background: rgba(26, 32, 44, 0.95) !important;
    backdrop-filter: blur(10px);
    padding: 0.75rem 0;
}

.user-card {
    border: none;
    border-radius: 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

.user-badge-active {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    font-weight: 600;
}

/* ==================== DataTables 自定义 ==================== */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_processing,
.dataTables_wrapper .dataTables_paginate {
    color: #6b7280;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--primary-color) !important;
    color: white !important;
    border: 1px solid var(--primary-color) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--primary-light) !important;
    color: var(--primary-color) !important;
    border: 1px solid var(--primary-color) !important;
}

/* ===================================
   User Dashboard Styles
   =================================== */

.user-body { 
    background: #f3f4f6;
    background-image: 
        radial-gradient(at 0% 0%, rgba(79, 70, 229, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(99, 102, 241, 0.05) 0px, transparent 50%);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
    display: flex; 
    flex-direction: column; 
    min-height: 100vh; 
}

.user-navbar { 
    background: rgba(26, 32, 44, 0.95) !important; 
    backdrop-filter: blur(10px);
    padding: 0.75rem 0;
}

.sidebar-link { 
    border-radius: 1rem; 
    margin-bottom: 0.5rem; 
    border: none; 
    transition: all 0.3s; 
    padding: 0.8rem 1.25rem;
    font-weight: 500;
    color: #4b5563;
    cursor: pointer;
    display: block;
    width: 100%;
    text-decoration: none !important;
    outline: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

.sidebar-link:hover {
    background-color: rgba(79, 70, 229, 0.1);
    color: var(--primary-color);
    transform: translateX(5px);
}

.sidebar-link.active { 
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%) !important; 
    border: none; 
    color: white !important;
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3);
}

.user-card { 
    border: none; 
    border-radius: 1.5rem; 
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05); 
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

.stat-card { 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

.stat-card:hover { 
    transform: translateY(-8px); 
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.1);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-card:hover::before {
    opacity: 1;
}

/* API统计卡片 - 统一使用stat-card样式 */
.stat-card-api {
    border: none;
    border-radius: 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    background: white;
}

.stat-card-api:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.12);
}

@media (prefers-color-scheme: dark) {
    .stat-card-api {
        background: #2d2d2d;
    }
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.name-item {
    transition: all 0.2s;
    border-radius: 0.75rem;
    padding: 0.75rem;
}

.name-item:hover {
    background-color: #f9fafb;
    transform: translateX(3px);
}

/* ===================================
   NEW User Dashboard Layout
   Modern Sidebar + Main Content
   =================================== */

/* 重置body和html */
body, html {
    margin: 0 !important;
    padding: 0 !important;
    height: auto !important;
}

/* 全局布局 */
.user-layout {
    display: flex !important;
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    width: 100%;
}

/* 固定左侧边栏 */
.user-sidebar {
    width: 260px;
    min-height: 100vh;
    height: 100vh;
    overflow-y: auto;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

/* 侧边栏顶部 - Logo区域 */
.sidebar-header {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: white;
    gap: 0.75rem;
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.sidebar-logo-text {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* 侧边栏导航 */
.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section-title {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.4);
    padding: 0 0.75rem;
    margin-bottom: 0.5rem;
}

/* 现代侧边栏链接 */
.modern-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 0.25rem;
    position: relative;
}

.modern-nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    transform: translateX(4px);
}

.modern-nav-link.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(139, 92, 246, 0.3) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.modern-nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 0 4px 4px 0;
}

.modern-nav-link i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

/* 侧边栏底部 - 用户信息 */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

.sidebar-user:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
}

.user-menu-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.user-menu-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* 主内容区域 */
.user-main {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

/* 顶部导航条 */
.user-topbar {
    height: 64px;
    background: white !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #64748b;
}

.topbar-breadcrumb a {
    color: #64748b;
    text-decoration: none;
    transition: color 0.2s;
}

.topbar-breadcrumb a:hover {
    color: #6366f1;
}

.topbar-breadcrumb .current {
    color: #1e293b;
    font-weight: 600;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* 语言切换按钮 */
.lang-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f1f5f9 !important;
    border: none !important;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.lang-btn:hover {
    background: #e2e8f0 !important;
    color: #1e293b;
}

/* 主内容区 */
.user-content {
    flex: 1;
    padding: 2rem;
}

/* 现代页面标题区 */
.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.page-subtitle {
    font-size: 0.95rem;
    color: #64748b;
    margin: 0;
}

/* 现代统计卡片 */
.modern-stat-card {
    background: white !important;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    height: 100%;
}

.modern-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.12) !important;
    border-color: rgba(99, 102, 241, 0.2) !important;
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.stat-card-icon.primary {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.stat-card-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.stat-card-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.stat-card-icon.danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.stat-card-label {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
}

/* 现代内容卡片 */
.modern-card {
    background: white !important;
    border-radius: 16px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03) !important;
    border: 1px solid rgba(0, 0, 0, 0.04) !important;
    overflow: hidden !important;
}

.modern-card > .card-body {
    padding: 1.5rem;
}

.modern-card-header {
    padding: 1.25rem 1.5rem !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04) !important;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    background: #fafafa !important;
}

.modern-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 !important;
}

.modern-card-title i {
    color: #6366f1;
}

.modern-card-body {
    padding: 1.5rem !important;
}

/* 现代按钮 */
.modern-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 10px;
    border: none !important;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none !important;
}

.modern-btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.modern-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
    color: white !important;
}

.modern-btn-secondary {
    background: #f1f5f9 !important;
    color: #64748b !important;
}

.modern-btn-secondary:hover {
    background: #e2e8f0 !important;
    color: #1e293b !important;
}

.modern-btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.modern-btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
    color: white !important;
}

/* 现代表单输入 */
.modern-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    border: 2px solid #e2e8f0 !important;
    border-radius: 10px;
    background: white;
    transition: all 0.2s ease;
}

.modern-input:focus {
    outline: none !important;
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1) !important;
}

.modern-input::placeholder {
    color: #94a3b8;
}

.modern-select {
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* 现代列表项 */
.modern-list-item {
    display: flex !important;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    transition: background 0.2s ease;
    background: white !important;
}

.modern-list-item:hover {
    background: #f8fafc !important;
}

.modern-list-item:last-child {
    border-bottom: none !important;
}

/* 标签徽章 */
.modern-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 8px;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

/* 移动端响应式 */
@media (max-width: 991px) {
    .user-sidebar {
        transform: translateX(-100%);
    }
    
    .user-sidebar.open {
        transform: translateX(0);
    }
    
    .user-main {
        margin-left: 0;
    }
    
    .user-content {
        padding: 1rem;
    }
    
    .topbar-breadcrumb {
        display: none;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: #f1f5f9;
    border-radius: 10px;
    color: #64748b;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

@media (max-width: 991px) {
    .mobile-menu-btn {
        display: flex;
    }
}

/* 侧边栏遮罩层 */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

@media (max-width: 991px) {
    .sidebar-overlay.show {
        display: block;
    }
}

/* 下拉菜单样式 - 使用特定选择器避免冲突 */
.user-sidebar .dropdown-menu {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    padding: 0.5rem;
    min-width: 180px;
}

.user-sidebar .dropdown-item {
    padding: 0.625rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
    transition: all 0.15s;
}

.user-sidebar .dropdown-item:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.user-sidebar .dropdown-item i {
    margin-right: 0.5rem;
    color: #94a3b8;
}

.user-sidebar .dropdown-divider {
    margin: 0.5rem 0;
    border-color: #f1f5f9;
}

/* 确保Bootstrap下拉菜单正常工作 */
.dropdown-menu.show {
    display: block !important;
}

/* 表格样式 */
.modern-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 !important;
}

.modern-table th {
    text-align: left;
    padding: 0.875rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

.modern-table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9 !important;
    font-size: 0.9rem;
    color: #475569;
    background: white !important;
}

.modern-table tr:hover td {
    background: #f8fafc !important;
}

/* 滚动条美化 */
.user-sidebar::-webkit-scrollbar {
    width: 6px;
}

.user-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.user-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.user-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.ad-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 1rem;
    padding: 1.5rem;
    color: white;
}

/* Bootstrap alert 样式增强 */
.alert {
    border: none !important;
    border-radius: 12px !important;
}

/* Bootstrap Modal 样式增强 */
.modal-content {
    border: none !important;
    border-radius: 16px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
}

.modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.05) !important;
}

/* 确保按钮组正常工作 */
.btn {
    text-decoration: none !important;
}