* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* 登录页面样式 */
.login-container {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    margin: 100px auto;
    text-align: center;
}

.login-container h1 {
    color: #4a5568;
    margin-bottom: 30px;
    font-size: 1.8rem;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    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.15);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 18px rgba(102, 126, 234, 0.25);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-secondary:hover {
    background: #cbd5e0;
}

.btn-logout {
    background: #fc8181;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: #f56565;
}

.message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
}

.message.error {
    background: #fed7d7;
    color: #c53030;
}

.message.success {
    background: #c6f6d5;
    color: #276749;
}

/* 头部样式 */
.header {
    background: white;
    border-radius: 15px;
    padding: 20px 30px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.header h1 {
    color: #4a5568;
    font-size: 1.5rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

#agent-info {
    color: #718096;
    font-size: 0.9rem;
}

/* 内容区域样式 */
.content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.query-form {
    margin-bottom: 30px;
}

.query-form h2 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* 结果容器样式 */
.result-container {
    margin-top: 30px;
}

.user-info {
    background: #f7fafc;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 25px;
    border-left: 4px solid #667eea;
}

.user-info h3 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-label {
    color: #718096;
    font-size: 0.9rem;
}

.order-history {
    margin-top: 20px;
}

.order-history h4 {
    color: #4a5568;
    margin-bottom: 15px;
}

.order-list {
    max-height: 300px;
    overflow-y: auto;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #e2e8f0;
}

.order-item:last-child {
    border-bottom: none;
}

.order-date {
    color: #4a5568;
}

.order-type {
    background: #c6f6d5;
    color: #276749;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.order-type.morning {
    background: #bee3f8;
    color: #2c5282;
}

/* 后台管理样式 */
.admin-section h2 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.admin-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.user-list {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow-x: auto;
    overflow-y: hidden;
}

.user-item {
    display: grid;
    grid-template-columns: minmax(110px, 1fr) minmax(140px, 1fr) minmax(120px, 1fr) minmax(120px, 1fr) minmax(120px, 1fr) minmax(120px, auto);
    gap: 15px;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #e2e8f0;
    background: white;
    min-width: 860px;
}

.user-item:last-child {
    border-bottom: none;
}

.user-item:hover {
    background: #f7fafc;
}

.user-field {
    display: flex;
    flex-direction: column;
}

.field-label {
    font-size: 0.8rem;
    color: #718096;
    margin-bottom: 5px;
}

.field-value {
    font-weight: 600;
    color: #4a5568;
}

.editable-field {
    display: flex;
    align-items: center;
    gap: 10px;
}

.editable-field input {
    width: 80px;
    padding: 5px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    text-align: center;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-sm {
    padding: 6px 10px;
    font-size: 12px;
}

.update-btn {
    background: #48bb78;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

.update-btn:hover {
    background: #38a169;
}

/* 模态框样式 */
.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.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content h3 {
    color: #4a5568;
    margin-bottom: 20px;
    text-align: center;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 20px;
}

.batch-update-form .form-group {
    margin-bottom: 20px;
}

.batch-update-form select,
.batch-update-form input {
    width: 100%;
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .login-container {
        margin: 50px auto;
        padding: 30px 20px;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header-actions {
        justify-content: center;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .user-item {
        gap: 10px;
        text-align: left;
        min-width: 900px;
        padding: 12px;
    }
    
    .admin-actions {
        flex-direction: column;
    }
    
    .modal-content {
        margin: 20px;
        width: calc(100% - 40px);
    }

    .field-label {
        font-size: 0.75rem;
        margin-bottom: 2px;
    }

    .field-value {
        font-size: 0.85rem;
    }

    .editable-field input {
        width: 64px;
        padding: 4px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.2rem;
    }
    
    .content {
        padding: 20px;
    }
    
    .user-info {
        padding: 15px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
}

.btn-danger {
    background: #f56565;
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
}

.btn-danger:disabled {
    background: #e2e8f0;
    color: #a0aec0;
    cursor: not-allowed;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.agents-list {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}

.agent-item {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    background: #f8fafc;
}

.agent-actions {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}