* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* 登录页 */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 24px;
}

.login-box .subtitle {
    text-align: center;
    color: #888;
    margin-bottom: 25px;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #f0f0f0;
    color: #666;
}

.btn-secondary:hover {
    background: #e0e0e0;
    box-shadow: none;
}

.btn-danger {
    background: #ff4757;
}

.btn-danger:hover {
    background: #ff3742;
    box-shadow: 0 5px 20px rgba(255, 71, 87, 0.4);
}

.btn-small {
    width: auto;
    padding: 6px 12px;
    font-size: 13px;
}

/* 消息提示 */
.flash-messages {
    margin-bottom: 20px;
}

.flash-message {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 14px;
}

.flash-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flash-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 后台布局 */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 220px;
    background: #2c3e50;
    color: white;
    padding: 20px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar .logo {
    padding: 0 20px 20px;
    border-bottom: 1px solid #34495e;
    margin-bottom: 20px;
}

.sidebar .logo h3 {
    font-size: 18px;
    color: white;
}

.sidebar nav ul {
    list-style: none;
}

.sidebar nav ul li a {
    display: block;
    padding: 12px 20px;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 14px;
}

.sidebar nav ul li a:hover,
.sidebar nav ul li a.active {
    background: #34495e;
    color: white;
    border-left: 3px solid #667eea;
    padding-left: 17px;
}

.main-content {
    flex: 1;
    margin-left: 220px;
    padding: 30px;
}

.page-header {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-header h1 {
    font-size: 24px;
    color: #333;
}

.user-info {
    font-size: 14px;
    color: #666;
}

.user-info a {
    color: #667eea;
    text-decoration: none;
    margin-left: 15px;
}

/* 卡片 */
.card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.card h3 {
    margin-bottom: 20px;
    font-size: 18px;
    color: #333;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    text-align: center;
}

.stat-card .number {
    font-size: 36px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 8px;
}

.stat-card .label {
    color: #888;
    font-size: 14px;
}

/* 表格 */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    border: 1px solid #ddd;
}

table th,
table td {
    padding: 12px 15px;
    text-align: left;
    border: 1px solid #ddd;
}

table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}

table tr:hover {
    background: #f8f9fa;
}

.status-normal {
    color: #27ae60;
    font-weight: 500;
}

.status-error {
    color: #e74c3c;
    font-weight: 500;
}

.status-warning {
    color: #f39c12;
    font-weight: 500;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-bar input,
.filter-bar select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.filter-bar input {
    min-width: 200px;
}

/* 上传区域 */
.upload-area {
    border: 2px dashed #ddd;
    border-radius: 12px;
    padding: 50px;
    text-align: center;
    transition: border-color 0.3s;
}

.upload-area:hover {
    border-color: #667eea;
}

.upload-area .icon {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 15px;
}

.upload-area p {
    color: #888;
    margin-bottom: 20px;
}

.upload-area input[type="file"] {
    display: none;
}

.upload-label {
    display: inline-block;
    padding: 10px 25px;
    background: #667eea;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.upload-label:hover {
    background: #5568d3;
}

/* 客户列表操作 */
.actions {
    display: flex;
    gap: 8px;
}

.actions button,
.actions a {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 4px;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.btn-edit {
    background: #3498db;
    color: white;
}

.btn-delete {
    background: #e74c3c;
    color: white;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    width: 100%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

/* 客户前台样式 */
.client-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.client-header h1 {
    font-size: 20px;
}

.client-header .user-area {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
}

.client-header .user-area a {
    color: white;
    text-decoration: none;
    padding: 6px 15px;
    background: rgba(255,255,255,0.2);
    border-radius: 6px;
    transition: background 0.3s;
}

.client-header .user-area a:hover {
    background: rgba(255,255,255,0.3);
}

.client-content {
    padding: 30px;
}

/* 响应式 - 平板和手机 */
@media (max-width: 768px) {
    /* 侧边栏：变窄，只显示图标 */
    .sidebar {
        width: 60px;
    }
    
    .sidebar .logo {
        padding: 15px 10px;
        text-align: center;
    }
    
    .sidebar .logo h3 {
        font-size: 0;
    }
    
    .sidebar .logo h3::before {
        content: "⚙️";
        font-size: 24px;
    }
    
    .sidebar nav ul li a {
        padding: 15px 0;
        text-align: center;
    }
    
    .sidebar nav ul li a span {
        display: none;
    }
    
    .sidebar nav ul li a:hover,
    .sidebar nav ul li a.active {
        padding-left: 0;
        border-left: none;
        border-right: 3px solid #667eea;
    }
    
    /* 主内容区 */
    .main-content {
        margin-left: 60px;
        padding: 15px;
    }
    
    /* 页面标题 */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 20px;
    }
    
    .page-header h1 {
        font-size: 20px;
    }
    
    /* 统计卡片：2列 */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-bottom: 20px;
    }
    
    .stat-card {
        padding: 18px 12px;
    }
    
    .stat-card .number {
        font-size: 26px;
    }
    
    .stat-card .label {
        font-size: 12px;
    }
    
    /* 卡片 */
    .card {
        padding: 18px;
        border-radius: 10px;
    }
    
    .card h3 {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    /* 表格 */
    table {
        font-size: 13px;
    }
    
    table th,
    table td {
        padding: 10px 12px;
    }
    
    /* 按钮 */
    .btn {
        padding: 12px;
        font-size: 15px;
    }
    
    .btn-small {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    /* 筛选栏 */
    .filter-bar {
        gap: 10px;
    }
    
    .filter-bar input,
    .filter-bar select {
        font-size: 14px;
        padding: 10px 12px;
    }
    
    .filter-bar input {
        min-width: auto;
        flex: 1;
    }
    
    /* 表单 */
    .form-group input {
        padding: 12px 15px;
        font-size: 15px;
    }
    
    /* 模态框 */
    .modal-content {
        padding: 20px;
        margin: 15px;
    }
    
    /* 操作按钮 */
    .actions {
        flex-direction: column;
        gap: 5px;
    }
    
    .actions button,
    .actions a {
        padding: 6px 12px;
        font-size: 12px;
        text-align: center;
    }
    
    /* 登录页 */
    .login-box {
        padding: 30px 25px;
        margin: 15px;
    }
    
    .login-box h2 {
        font-size: 22px;
    }
}

/* 响应式 - 小屏手机（480px以下） */
@media (max-width: 480px) {
    .main-content {
        padding: 12px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card .number {
        font-size: 24px;
    }
    
    .page-header h1 {
        font-size: 18px;
    }
    
    .card {
        padding: 15px;
    }
    
    table {
        font-size: 12px;
    }
    
    table th,
    table td {
        padding: 8px 10px;
    }
    
    .btn {
        padding: 12px;
        font-size: 14px;
    }
}
