/**
 * 领巢 | 深色科技感主题样式
 * 统一全站视觉风格
 */

/* ========== 基础样式 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #0f0c29 0%, #1a1a3e 30%, #24243e 60%, #302b63 100%);
    min-height: 100vh;
    color: rgba(255,255,255,0.9);
    line-height: 1.6;
}

/* ========== 容器布局 ========== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 40px;
}

.auth-container {
    max-width: 480px;
    margin: 80px auto;
    padding: 0 20px;
}

/* ========== 卡片组件 ========== */
.card {
    background: linear-gradient(145deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(20px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.1);
    overflow: hidden;
    transition: all 0.4s ease;
}

.card:hover {
    border-color: rgba(196,76,255,0.3);
    box-shadow: 0 30px 60px rgba(196,76,255,0.15), 0 25px 50px rgba(0,0,0,0.4);
}

.card-header {
    background: linear-gradient(135deg, #ff6b9d, #c44cff);
    color: white;
    padding: 25px 30px;
    font-size: 1.3em;
    font-weight: 700;
    text-align: center;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.card-body {
    padding: 35px 30px;
}

/* ========== 表单样式 ========== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: rgba(255,255,255,0.85);
    font-weight: 500;
    font-size: 0.95em;
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 12px;
    color: white;
    font-size: 1em;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.form-control:hover {
    border-color: rgba(196,76,255,0.4);
}

.form-control:focus {
    outline: none;
    border-color: #c44cff;
    box-shadow: 0 0 0 3px rgba(196,76,255,0.2), 0 4px 15px rgba(0,0,0,0.2);
}

.form-control::placeholder {
    color: rgba(255,255,255,0.4);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='rgba(255,255,255,0.6)' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

select.form-control option {
    background: #1a1a3e;
    color: white;
}

/* ========== 按钮样式 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 1em;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #ff6b9d, #c44cff);
    color: white;
    box-shadow: 0 10px 30px rgba(196,76,255,0.4);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #ff85ae, #d066ff);
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(196,76,255,0.5);
}

.btn-secondary {
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(196,76,255,0.4);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 10px 30px rgba(16,185,129,0.3);
}

.btn-success:hover {
    background: linear-gradient(135deg, #34d399, #10b981);
    transform: translateY(-3px);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 10px 30px rgba(239,68,68,0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #f87171, #ef4444);
    transform: translateY(-3px);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9em;
}

.btn-lg {
    padding: 18px 36px;
    font-size: 1.1em;
}

.btn-block {
    width: 100%;
}

/* ========== 表格样式 ========== */
.table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255,255,255,0.03);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.table th {
    background: linear-gradient(135deg, rgba(196,76,255,0.2), rgba(110,142,251,0.15));
    color: white;
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 0.95em;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.table td {
    padding: 14px 20px;
    color: rgba(255,255,255,0.85);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 0.95em;
}

.table tbody tr {
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    background: rgba(196,76,255,0.1);
}

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

/* ========== 头部导航 ========== */
.header {
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #ff6b9d, #c44cff, #6e8efb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    text-shadow: 0 0 60px rgba(196, 76, 255, 0.4);
}

.header p {
    font-size: 1.1em;
    color: rgba(255,255,255,0.7);
}

/* ========== 侧边栏样式 ========== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    background: linear-gradient(180deg, #1a1a3e 0%, #0f0c29 100%);
    border-right: 1px solid rgba(255,255,255,0.08);
    padding: 20px 0;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar-header {
    padding: 20px 25px 30px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 20px;
}

.sidebar-header h2 {
    font-size: 1.3em;
    background: linear-gradient(135deg, #ff6b9d, #c44cff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.sidebar-menu {
    list-style: none;
    padding: 0 15px;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-size: 0.95em;
}

.sidebar-menu a:hover {
    background: rgba(196,76,255,0.15);
    color: white;
    transform: translateX(5px);
}

.sidebar-menu a.active {
    background: linear-gradient(135deg, rgba(255,107,157,0.2), rgba(196,76,255,0.2));
    color: white;
    border: 1px solid rgba(196,76,255,0.3);
    box-shadow: 0 4px 15px rgba(196,76,255,0.2);
}

.sidebar-menu .icon {
    font-size: 1.2em;
    width: 24px;
    text-align: center;
}

/* ========== 主内容区 ========== */
.main-content {
    margin-left: 260px;
    padding: 30px 40px;
    min-height: 100vh;
}

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

.stat-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
    border-radius: 18px;
    padding: 25px;
    border: 1px solid rgba(255,255,255,0.08);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 4px;
    background: linear-gradient(90deg, #ff6b9d, #c44cff, #6e8efb);
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(196,76,255,0.3);
    box-shadow: 0 20px 40px rgba(196,76,255,0.15);
}

.stat-card .icon {
    font-size: 2.5em;
    margin-bottom: 15px;
}

.stat-card .value {
    font-size: 2.2em;
    font-weight: 700;
    background: linear-gradient(135deg, #ff6b9d, #c44cff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
}

.stat-card .label {
    color: rgba(255,255,255,0.6);
    font-size: 0.95em;
}

/* ========== 徽章样式 ========== */
.badge {
    display: inline-block;
    padding: 5px 12px;
    font-size: 0.8em;
    font-weight: 600;
    border-radius: 20px;
}

.badge-success {
    background: rgba(16,185,129,0.2);
    color: #10b981;
    border: 1px solid rgba(16,185,129,0.3);
}

.badge-warning {
    background: rgba(245,158,11,0.2);
    color: #f59e0b;
    border: 1px solid rgba(245,158,11,0.3);
}

.badge-danger {
    background: rgba(239,68,68,0.2);
    color: #ef4444;
    border: 1px solid rgba(239,68,68,0.3);
}

.badge-info {
    background: rgba(110,142,251,0.2);
    color: #6e8efb;
    border: 1px solid rgba(110,142,251,0.3);
}

.badge-primary {
    background: rgba(196,76,255,0.2);
    color: #c44cff;
    border: 1px solid rgba(196,76,255,0.3);
}

/* ========== 分页样式 ========== */
.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 25px;
}

.pagination a, .pagination span {
    padding: 10px 16px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background: rgba(196,76,255,0.2);
    border-color: rgba(196,76,255,0.4);
    color: white;
}

.pagination .active {
    background: linear-gradient(135deg, #ff6b9d, #c44cff);
    border-color: transparent;
    color: white;
}

/* ========== 提示消息 ========== */
.alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: rgba(16,185,129,0.15);
    border: 1px solid rgba(16,185,129,0.3);
    color: #10b981;
}

.alert-error {
    background: rgba(239,68,68,0.15);
    border: 1px solid rgba(239,68,68,0.3);
    color: #ef4444;
}

.alert-warning {
    background: rgba(245,158,11,0.15);
    border: 1px solid rgba(245,158,11,0.3);
    color: #f59e0b;
}

.alert-info {
    background: rgba(110,142,251,0.15);
    border: 1px solid rgba(110,142,251,0.3);
    color: #6e8efb;
}

/* ========== 链接样式 ========== */
a {
    color: #c44cff;
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: #ff6b9d;
}

/* ========== 页面标题栏 ========== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.page-header h1 {
    font-size: 1.8em;
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-header h1::before {
    content: '';
    width: 5px;
    height: 32px;
    background: linear-gradient(180deg, #ff6b9d, #c44cff);
    border-radius: 3px;
}

/* ========== 模态框/对话框 ========== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal {
    background: linear-gradient(145deg, #1a1a3e, #24243e);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    color: white;
    font-size: 1.2em;
}

.modal-close {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2em;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(239,68,68,0.3);
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ========== Tab选项卡 ========== */
.tabs {
    display: flex;
    gap: 5px;
    background: rgba(255,255,255,0.05);
    padding: 5px;
    border-radius: 12px;
    margin-bottom: 25px;
}

.tab {
    padding: 12px 24px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.tab:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.tab.active {
    background: linear-gradient(135deg, #ff6b9d, #c44cff);
    color: white;
    box-shadow: 0 4px 15px rgba(196,76,255,0.3);
}

/* ========== 用户信息卡片 ========== */
.user-info-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 25px;
    background: linear-gradient(145deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 25px;
}

.user-avatar-large {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #ff6b9d, #c44cff);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    font-weight: bold;
    color: white;
    box-shadow: 0 10px 30px rgba(196,76,255,0.3);
}

.user-details h2 {
    color: white;
    font-size: 1.4em;
    margin-bottom: 5px;
}

.user-details p {
    color: rgba(255,255,255,0.6);
    font-size: 0.95em;
}

/* ========== 积分显示 ========== */
.points-display {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(245,158,11,0.15);
    color: #f59e0b;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    border: 1px solid rgba(245,158,11,0.3);
}

/* ========== 空状态提示 ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255,255,255,0.5);
}

.empty-state .icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    color: rgba(255,255,255,0.7);
    margin-bottom: 10px;
}

/* ========== 工具类 ========== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-success { color: #10b981; }
.text-danger { color: #ef4444; }
.text-warning { color: #f59e0b; }
.text-muted { color: rgba(255,255,255,0.5); }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.mb-10 { margin-bottom: 10px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }

/* ========== 动画效果 ========== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(196,76,255,0.3); }
    50% { box-shadow: 0 0 40px rgba(196,76,255,0.6); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* ========== 响应式设计 ========== */

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1100;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #ff6b9d, #c44cff);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(196,76,255,0.4);
    transition: all 0.3s ease;
}

.mobile-menu-btn:hover {
    transform: scale(1.05);
}

/* 移动端遮罩 */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 999;
}

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

@media (max-width: 1024px) {
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 70px 20px 20px;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    .container {
        padding: 15px;
    }
    
    .auth-container {
        margin: 30px auto;
        padding: 0 15px;
    }
    
    /* 卡片适配 */
    .card {
        border-radius: 16px;
    }
    
    .card-header {
        padding: 18px 20px;
        font-size: 1.1em;
    }
    
    .card-body {
        padding: 20px 18px;
    }
    
    /* 表单适配 */
    .form-control {
        padding: 12px 14px;
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    .form-group {
        margin-bottom: 16px;
    }
    
    /* 按钮适配 */
    .btn {
        padding: 12px 20px;
        font-size: 0.95em;
        width: 100%;
    }
    
    .btn-sm {
        padding: 8px 14px;
        width: auto;
    }
    
    /* 页面标题适配 */
    .page-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
        padding-bottom: 15px;
        margin-bottom: 20px;
    }
    
    .page-header h1 {
        font-size: 1.4em;
    }
    
    .page-header h1::before {
        height: 24px;
        width: 4px;
    }
    
    /* 统计卡片适配 */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .stat-card {
        padding: 18px 15px;
        border-radius: 14px;
    }
    
    .stat-card .icon {
        font-size: 1.8em;
        margin-bottom: 10px;
    }
    
    .stat-card .value {
        font-size: 1.6em;
    }
    
    .stat-card .label {
        font-size: 0.85em;
    }
    
    /* 表格适配 */
    .table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 12px;
    }
    
    .table th,
    .table td {
        padding: 12px 14px;
        font-size: 0.9em;
        white-space: nowrap;
    }
    
    /* 主内容区适配 */
    .main-content {
        padding: 15px;
    }
    
    /* 头部适配 */
    .header {
        padding: 25px 15px;
        margin-bottom: 20px;
    }
    
    .header h1 {
        font-size: 1.8em;
    }
    
    .header p {
        font-size: 0.95em;
    }
    
    /* Tab选项卡适配 */
    .tabs {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .tab {
        padding: 10px 16px;
        font-size: 0.9em;
        flex: 1;
        min-width: calc(50% - 4px);
        text-align: center;
    }
    
    /* 模态框适配 */
    .modal {
        width: calc(100% - 30px);
        max-height: calc(100vh - 40px);
        margin: 20px 15px;
    }
    
    .modal-header {
        padding: 16px 18px;
    }
    
    .modal-body {
        padding: 18px;
    }
    
    .modal-footer {
        padding: 16px 18px;
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    /* 用户信息卡片适配 */
    .user-info-card {
        flex-direction: column;
        text-align: center;
        padding: 20px;
        gap: 15px;
    }
    
    .user-avatar-large {
        width: 70px;
        height: 70px;
        font-size: 1.6em;
    }
    
    .user-details h2 {
        font-size: 1.2em;
    }
    
    /* 分页适配 */
    .pagination {
        flex-wrap: wrap;
    }
    
    .pagination a, .pagination span {
        padding: 8px 12px;
        font-size: 0.9em;
    }
    
    /* 提示消息适配 */
    .alert {
        padding: 14px 16px;
        font-size: 0.9em;
    }
    
    /* 空状态适配 */
    .empty-state {
        padding: 40px 15px;
    }
    
    .empty-state .icon {
        font-size: 3em;
    }
    
    /* 徽章适配 */
    .badge {
        padding: 4px 10px;
        font-size: 0.75em;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 12px;
    }
    
    .header h1 {
        font-size: 1.5em;
    }
    
    .card-header {
        padding: 15px 16px;
        font-size: 1em;
    }
    
    .card-body {
        padding: 16px 14px;
    }
    
    /* 统计卡片单列 */
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        display: flex;
        align-items: center;
        gap: 15px;
        padding: 16px;
    }
    
    .stat-card .icon {
        font-size: 1.5em;
        margin-bottom: 0;
    }
    
    .stat-card .value {
        font-size: 1.4em;
    }
    
    /* Tab单列 */
    .tabs {
        flex-direction: column;
    }
    
    .tab {
        width: 100%;
        min-width: 100%;
    }
    
    /* 页面标题 */
    .page-header h1 {
        font-size: 1.2em;
    }
    
    /* 按钮组 */
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        width: 100%;
    }
}

/* 横屏适配 */
@media (max-height: 500px) and (orientation: landscape) {
    .modal {
        max-height: 90vh;
    }
    
    .auth-container {
        margin: 20px auto;
    }
}

/* 安全区域适配 (iPhone X+) */
@supports (padding: env(safe-area-inset-bottom)) {
    .main-content {
        padding-bottom: calc(15px + env(safe-area-inset-bottom));
    }
    
    .sidebar {
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .modal-footer {
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }
}
