/* 商通天下企业家俱乐部 - 管理后台全局样式 */
/* 主题色：深蓝 #1a365d + 金色 #c9a96e */

:root {
    --primary: #1a365d;
    --primary-light: #2c5282;
    --primary-dark: #0f2440;
    --gold: #c9a96e;
    --gold-light: #d4b87a;
    --gold-dark: #b8955a;
    --bg-light: #f7fafc;
    --bg-white: #ffffff;
    --text-dark: #1a202c;
    --text-gray: #718096;
    --text-light: #a0aec0;
    --border: #e2e8f0;
    --success: #38a169;
    --warning: #dd6b20;
    --danger: #e53e3e;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.15);
    --radius: 8px;
    --radius-lg: 12px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    color: var(--text-dark);
    background: var(--bg-light);
    line-height: 1.6;
}

/* 登录页面布局 */
.login-container {
    min-height: 100vh;
    display: flex;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
}

.login-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: white;
}

.login-left h1 {
    font-size: 48px;
    margin-bottom: 16px;
    color: var(--gold);
}

.login-left p {
    font-size: 18px;
    opacity: 0.9;
}

.login-right {
    width: 480px;
    background: var(--bg-white);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px;
    box-shadow: -4px 0 24px rgba(0,0,0,0.2);
}

.login-logo {
    text-align: center;
    margin-bottom: 40px;
}

.login-logo h2 {
    font-size: 28px;
    color: var(--primary);
    margin-bottom: 8px;
}

.login-logo span {
    color: var(--gold);
}

.login-logo p {
    color: var(--text-gray);
    font-size: 14px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.2);
}

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

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-primary {
    background: var(--gold);
    color: white;
}

.btn-primary:hover {
    background: var(--gold-dark);
}

.btn-secondary {
    background: var(--primary);
    color: white;
}

.btn-secondary:hover {
    background: var(--primary-dark);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dark);
}

.btn-outline:hover {
    border-color: var(--gold);
    color: var(--gold);
}

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

.btn-danger:hover {
    background: #c53030;
}

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

.btn-block {
    width: 100%;
}

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

/* 主布局 - 带侧边栏 */
.main-layout {
    display: flex;
    min-height: 100vh;
}

/* 侧边导航 */
.sidebar {
    width: 240px;
    background: var(--primary);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-logo {
    padding: 24px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo h2 {
    font-size: 20px;
    color: var(--gold);
}

.sidebar-logo p {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
    margin-top: 4px;
}

.sidebar-nav {
    padding: 16px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 14px 24px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
    cursor: pointer;
}

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

.nav-item.active {
    background: rgba(201, 169, 110, 0.2);
    color: var(--gold);
    border-left-color: var(--gold);
}

.nav-item i {
    width: 24px;
    margin-right: 12px;
    font-size: 18px;
}

.sidebar-user {
    padding: 16px 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: auto;
    background: rgba(0,0,0,0.2);
}

.sidebar-user .user-info {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.sidebar-user .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-weight: bold;
    color: var(--primary);
}

.sidebar-user .user-name {
    font-weight: 500;
}

.sidebar-user .user-role {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
}

.sidebar-user .logout-btn {
    width: 100%;
    padding: 10px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s;
}

.sidebar-user .logout-btn:hover {
    background: rgba(255,255,255,0.2);
}

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

/* 页面标题 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 24px;
    color: var(--text-dark);
}

.page-header .actions {
    display: flex;
    gap: 12px;
}

/* 卡片组件 */
.card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
}

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

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
}

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

.stat-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
}

.stat-card .stat-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    color: white;
    font-size: 28px;
}

.stat-card .stat-icon.gold {
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
}

.stat-card .stat-info h3 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.stat-card .stat-info p {
    color: var(--text-gray);
    font-size: 14px;
}

.stat-card .stat-info .trend {
    font-size: 12px;
    margin-top: 4px;
}

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

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

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

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

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

.data-table th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--text-dark);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody tr:hover {
    background: var(--bg-light);
}

.data-table .user-cell {
    display: flex;
    align-items: center;
}

.data-table .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-weight: 500;
    font-size: 14px;
}

.data-table .user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.data-table .user-info-cell {
    display: flex;
    flex-direction: column;
}

.data-table .user-name {
    font-weight: 500;
}

.data-table .user-company {
    font-size: 12px;
    color: var(--text-gray);
}

.data-table .status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.data-table .status-badge.active {
    background: #c6f6d5;
    color: #22543d;
}

.data-table .status-badge.pending {
    background: #fefcbf;
    color: #744210;
}

.data-table .status-badge.expired {
    background: #fed7d7;
    color: #742a2a;
}

.data-table .level-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.data-table .level-badge.gold {
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
    color: white;
}

.data-table .level-badge.silver {
    background: linear-gradient(135deg, #718096, #a0aec0);
    color: white;
}

.data-table .level-badge.bronze {
    background: linear-gradient(135deg, #c05621, #dd6b20);
    color: white;
}

.data-table .actions-cell {
    display: flex;
    gap: 8px;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-top: 1px solid var(--border);
    margin-top: 16px;
}

.pagination-info {
    color: var(--text-gray);
    font-size: 14px;
}

.pagination-buttons {
    display: flex;
    gap: 8px;
}

.pagination-buttons button {
    padding: 8px 14px;
    border: 1px solid var(--border);
    background: white;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s;
}

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

.pagination-buttons button.active {
    background: var(--gold);
    border-color: var(--gold);
    color: white;
}

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

/* 搜索和筛选栏 */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.search-box {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0 16px;
}

.search-box input {
    border: none;
    outline: none;
    padding: 10px 12px;
    width: 280px;
    font-size: 14px;
}

.search-box button {
    background: none;
    border: none;
    color: var(--text-gray);
    cursor: pointer;
    padding: 10px;
}

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

.filter-group select {
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: white;
    font-size: 14px;
    cursor: pointer;
}

/* 弹窗/Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

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

.modal {
    background: white;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(-20px);
    transition: all 0.3s;
}

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

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

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

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

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

.modal-body {
    padding: 24px;
}

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

/* 图表区域 */
.chart-container {
    width: 100%;
    height: 300px;
    position: relative;
}

/* 简单柱状图 */
.bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 200px;
    padding: 20px;
    border-bottom: 2px solid var(--border);
    border-left: 2px solid var(--border);
}

.bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.bar {
    width: 40px;
    background: linear-gradient(to top, var(--primary), var(--primary-light));
    border-radius: 4px 4px 0 0;
    transition: height 0.5s ease;
}

.bar.gold {
    background: linear-gradient(to top, var(--gold-dark), var(--gold));
}

.bar-label {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-gray);
}

.bar-value {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
}

/* 列表项 */
.list-item {
    display: flex;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

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

.list-item .item-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    color: var(--primary);
}

.list-item .item-content {
    flex: 1;
}

.list-item .item-title {
    font-weight: 500;
    margin-bottom: 4px;
}

.list-item .item-meta {
    font-size: 13px;
    color: var(--text-gray);
}

.list-item .item-action {
    color: var(--gold);
    font-size: 13px;
    cursor: pointer;
}

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

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

.empty-state h3 {
    margin-bottom: 8px;
    color: var(--text-dark);
}

/* 加载状态 */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.loading::after {
    content: "";
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast 提示 */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 2000;
}

.toast {
    padding: 16px 24px;
    border-radius: var(--radius);
    margin-bottom: 12px;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: center;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    background: var(--success);
    color: white;
}

.toast.error {
    background: var(--danger);
    color: white;
}

.toast.warning {
    background: var(--warning);
    color: white;
}

.toast.info {
    background: var(--primary);
    color: white;
}

/* 标签页 */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
}

.tab-item {
    padding: 12px 24px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s;
    font-weight: 500;
}

.tab-item:hover {
    color: var(--gold);
}

.tab-item.active {
    border-bottom-color: var(--gold);
    color: var(--gold);
}

.tab-content {
    display: none;
}

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

/* 步骤指示器 */
.step-indicator {
    display: flex;
    justify-content: center;
    margin-bottom: 32px;
}

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

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.step.active .step-number {
    background: var(--gold);
    color: white;
}

.step.completed .step-number {
    background: var(--success);
    color: white;
}

.step-label {
    margin-left: 8px;
    font-weight: 500;
}

.step.active .step-label {
    color: var(--gold);
}

.step-line {
    width: 80px;
    height: 2px;
    background: var(--border);
    margin: 0 16px;
}

.step.completed + .step .step-line,
.step.completed .step-line {
    background: var(--success);
}

/* 响应式 */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 64px;
    }
    
    .sidebar-logo h2,
    .sidebar-logo p,
    .nav-item span,
    .sidebar-user .user-info,
    .sidebar-user .logout-btn span {
        display: none;
    }
    
    .nav-item {
        justify-content: center;
        padding: 14px;
    }
    
    .nav-item i {
        margin-right: 0;
    }
    
    .main-content {
        margin-left: 64px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .login-right {
        width: 100%;
    }
    
    .login-left {
        display: none;
    }
}

/* 辅助类 */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-gold { color: var(--gold); }
.text-gray { color: var(--text-gray); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

/* 邀请码特殊样式 */
.invite-code {
    font-family: 'Courier New', monospace;
    background: var(--bg-light);
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: 1px;
}

/* 文件上传 */
.file-upload {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.file-upload:hover {
    border-color: var(--gold);
    background: rgba(201, 169, 110, 0.05);
}

.file-upload i {
    font-size: 48px;
    color: var(--text-light);
    margin-bottom: 16px;
}

.file-upload p {
    color: var(--text-gray);
}

.file-upload input {
    display: none;
}

/* 两列布局 */
.two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

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

/* 三列布局 */
.three-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

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

/* 积分样式 */
.integral-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--gold);
}

.integral-record {
    display: flex;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.integral-record:last-child {
    border-bottom: none;
}

/* 设置页面 */
.settings-section {
    margin-bottom: 32px;
}

.settings-section h3 {
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

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

/* 开关按钮 */
.switch {
    position: relative;
    width: 48px;
    height: 24px;
}

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

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--border);
    border-radius: 24px;
    transition: 0.3s;
}

.switch-slider::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

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

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