/* ===================================
   基础样式 - Base Styles
   =================================== */

/* 通用重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body 基础样式 */
body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
}

.container-large {
    max-width: 1400px;
    margin: 0 auto;
}

/* ===================================
   布局组件 - Layout Components
   =================================== */

/* 页面头部 */
.header {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.header h1 {
    color: #667eea;
    font-size: 28px;
}

.header-buttons {
    display: flex;
    gap: 10px;
}

/* 内容区域/卡片 */
.section, .card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.section h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 24px;
}

/* ===================================
   按钮样式 - Buttons
   =================================== */

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-secondary {
    background: #667eea;
    color: white;
}

.btn-danger {
    background: #ff4757;
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

/* 按钮组 */
.btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* 小按钮 */
.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 20px;
}

/* 大按钮 */
.btn-lg {
    padding: 15px 50px;
    font-size: 20px;
    border-radius: 50px;
}

/* 全宽按钮 */
.btn-block {
    width: 100%;
}

/* 返回按钮 */
.back-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
}

.back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ===================================
   表单样式 - Forms
   =================================== */

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

.form-group label,
.input-group label,
.modal-input-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: bold;
    font-size: 14px;
}

.form-group input,
.input-group input,
.modal-input-group input,
.form-group select,
.input-group select,
.modal-input-group select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s;
}

.form-group input:focus,
.input-group input:focus,
.modal-input-group input:focus,
.form-group select:focus,
.input-group select:focus,
.modal-input-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.2);
}

/* 搜索框 */
.search-bar {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 250px;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 16px;
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.2);
}

.search-btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ===================================
   消息/提示框 - Messages & Alerts
   =================================== */

.message, .alert {
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    margin-bottom: 15px;
}

.message.success, .alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid #2e7d32;
}

.message.error, .alert-error {
    background: #ffebee;
    color: #c62828;
    border-left: 4px solid #c62828;
}

.message-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.message-error {
    background: #ffebee;
    color: #c62828;
}

/* ===================================
   徽章 - Badges
   =================================== */

.badge {
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    display: inline-block;
}

.badge-admin {
    background: #f093fb;
    color: white;
}

.badge-user {
    background: #e0e0e0;
    color: #333;
}

.badge-open {
    background: #4caf50;
    color: white;
}

.badge-closed {
    background: #ff9800;
    color: white;
}

.badge-settled {
    background: #9e9e9e;
    color: white;
}

/* 状态徽章 */
.status-badge {
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
}

.status-pending {
    background: #ffc107;
    color: white;
}

.status-won {
    background: #4caf50;
    color: white;
}

.status-lost {
    background: #f44336;
    color: white;
}

/* ===================================
   表格样式 - Tables
   =================================== */

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: bold;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid #ddd;
}

tr:hover {
    background: #f5f5f5;
}

.table-container {
    max-height: 600px;
    overflow-y: auto;
    border-radius: 10px;
}

/* ===================================
   模态框 - Modals
   =================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 25px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
}

.close {
    color: white;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
    transition: transform 0.2s;
}

.close:hover {
    transform: scale(1.2);
}

.modal-body {
    padding: 30px 25px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.btn-confirm {
    flex: 1;
    padding: 12px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-confirm:hover {
    transform: translateY(-2px);
}

.btn-cancel {
    flex: 1;
    padding: 12px 0;
    background: #e0e0e0;
    color: #666;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background: #d0d0d0;
}

/* ===================================
   统计卡片 - Stats Cards
   =================================== */

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

.stat-number {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
}

/* 迷你统计 */
.stats-mini {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat-mini {
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    font-size: 14px;
}

.stat-mini strong {
    font-size: 18px;
    margin-left: 5px;
}

/* ===================================
   工具类 - Utility Classes
   =================================== */

/* 间距 */
.mb-10 { margin-bottom: 10px; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }

.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }

.p-10 { padding: 10px; }
.p-15 { padding: 15px; }
.p-20 { padding: 20px; }
.p-30 { padding: 30px; }

/* 文本对齐 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* 颜色 */
.text-primary { color: #667eea; }
.text-danger { color: #f5576c; }
.text-success { color: #4caf50; }
.text-muted { color: #666; }

/* 显示 */
.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

/* Flex */
.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

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

.gap-10 { gap: 10px; }
.gap-15 { gap: 15px; }
.gap-20 { gap: 20px; }

/* 信息框 */
.info-box {
    background: #e7f3ff;
    border-left: 4px solid #2196F3;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
}

.info-box p {
    margin: 5px 0;
    color: #0c5460;
    font-size: 14px;
}

.info-text {
    background: #f5f5f5;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
    color: #666;
}

.info-text strong {
    color: #333;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

/* 加载中 */
.loading {
    text-align: center;
    padding: 40px;
    color: #667eea;
}

/* ===================================
   颜色系统 - Color System
   =================================== */

/* 号码颜色 */
.color-red {
    background: #E74C3C;
    color: white;
}

.color-green {
    background: #27AE60;
    color: white;
}

.color-blue {
    background: #3498DB;
    color: white;
}

/* ===================================
   动画效果 - Animations
   =================================== */

/* 震动动画 */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s infinite;
}

/* 脉冲动画 */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.pulse {
    animation: pulse 1s infinite;
}

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

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    .section, .card {
        padding: 20px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
    
    table {
        font-size: 14px;
    }
    
    th, td {
        padding: 10px;
    }
}
