﻿/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background-color: #f4f7f9;
    color: #333;
    line-height: 1.6;
}

.container {
    display: flex;
    min-height: calc(100vh - 60px);
}

/* 头部样式 */
.header {
    background-color: #2c3e50;
    color: white;
    padding: 0 20px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.logo {
    font-size: 20px;
    font-weight: bold;
    color: #3498db;
}

.user-info {
    display: flex;
    align-items: center;
}

.user-info span {
    margin-right: 15px;
    font-weight: 500;
}

.logout-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.logout-btn:hover {
    background-color: #c0392b;
}

/* 侧边栏样式 */
.sidebar {
    width: 250px;
    background-color: #2c3e50;
    color: white;
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    padding-bottom: 20px;
}

.sidebar-header {
    padding: 15px 20px;
    border-bottom: 1px solid #34495e;
}

.sidebar-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: #3498db;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-menu {
    list-style: none;
    padding: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: block;
    padding: 12px 20px;
    color: #ecf0f1;
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
}

.nav-link:hover, 
.nav-link:focus {
    background-color: #34495e;
    color: #3498db;
}

.dropdown-toggle::after {
    content: "▼";
    font-size: 8px;
    margin-left: 8px;
    vertical-align: middle;
}

.dropdown-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: #34495e;
    display: none;
}

.dropdown-menu a {
    display: block;
    padding: 8px 20px 8px 40px;
    color: #ecf0f1;
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 400;
}

.dropdown-menu a:hover {
    background-color: #3d566e;
    color: #3498db;
    padding-left: 45px;
}

.nav-item:hover .dropdown-menu {
    display: block;
}

/* 主内容区样式 */
.main-content {
    flex: 1;
    margin-left: 250px;
    margin-top: 60px;
    padding: 20px;
}

.system-title {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 28px;
}

.page-title {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 24px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

/* 登录页面样式 */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #3498db, #2c3e50);
}

.login-box {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    padding: 30px;
    width: 400px;
    max-width: 90%;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #34495e;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.btn {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-block;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-warning {
    background-color: #f39c12;
    color: white;
}

.btn-warning:hover {
    background-color: #d35400;
}

/* 表格样式 */
.table-responsive {
    overflow-x: auto;
    margin-top: 20px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.data-table th {
    background-color: #3498db;
    color: white;
    font-weight: 500;
}

.data-table tr:hover {
    background-color: #f8f9fa;
}

/* 完结订单样式 */
.order-completed {
    background-color: #ffffcc !important;
}

/* 搜索表单 */
.search-form {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

/* 操作按钮 */
.action-buttons {
    display: flex;
    gap: 8px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 220px;
    }
    
    .main-content {
        margin-left: 220px;
    }
    
    .login-box {
        width: 90%;
        max-width: 400px;
    }
    
    .table-responsive {
        font-size: 14px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 10px;
    }
}

@media (max-width: 576px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        top: auto;
        left: auto;
        bottom: auto;
    }
    
    .main-content {
        margin-left: 0;
        margin-top: 0;
    }
    
    .header {
        position: relative;
    }
}
/* 欢迎面板 */
.welcome-panel {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    text-align: center;
    margin-top: 20px;
}

.welcome-panel h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 28px;
}

.quick-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.stat-card {
    background: linear-gradient(135deg, #3498db, #2c3e50);
    color: white;
    padding: 20px;
    border-radius: 8px;
    min-width: 180px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.stat-card h3 {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    margin-top: 5px;
}

/* 表单容器 */
.form-container {
    background: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px 15px;
}

.form-group {
    flex: 1;
    min-width: 250px;
    padding: 0 15px;
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.checkbox-group {
    display: flex;
    align-items: center;
    margin-top: 5px;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* 消息提示 */
.success-message,
.error-message {
    padding: 12px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-weight: 500;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 操作栏 */
.action-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

/* 按钮尺寸 */
.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
}

.btn-success {
    background-color: #28a745;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-secondary {
    background-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

/* 页脚 */
.footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    text-align: center;
    padding: 15px;
    margin-top: 20px;
    width: calc(100% - 250px);
    margin-left: 250px;
    position: relative;
    z-index: 10;
}

.footer-content p {
    margin: 5px 0;
    font-size: 14px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .stat-card {
        min-width: 150px;
        padding: 15px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-group {
        min-width: 100%;
    }
    
    .footer {
        width: 100%;
        margin-left: 0;
    }
}
/* 侧边栏增强 */
.sidebar {
    width: 250px;
    background: #2c3e50;
    height: calc(100vh - 60px);
    position: fixed;
    left: 0;
    top: 60px;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    z-index: 100;
}
.menu {
    list-style: none;
    padding: 0;
    margin: 0;
}
.menu li {
    border-bottom: 1px solid #34495e;
}
.menu li a {
    display: block;
    padding: 12px 20px;
    color: #ecf0f1;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 15px;
}
.menu li a:hover, .menu li a.active {
    background: #3498db;
    color: white;
    padding-left: 25px;
}
.menu-title {
    background: #1a252f;
    color: #3498db;
    padding: 10px 20px;
    font-weight: bold;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 表格增强 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
.data-table th {
    background: #3498db;
    color: white;
    font-weight: 600;
    padding: 12px 15px;
    text-align: left;
}
.data-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}
.data-table tr:hover {
    background-color: #f8f9fa;
}
.text-success { color: #28a745; font-weight: 500; }
.text-danger { color: #dc3545; font-weight: 500; }
.text-primary { color: #007bff; }
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}
.badge-success { background: #d4edda; color: #155724; }
.badge-danger { background: #f8d7da; color: #721c24; }
.income-row td:nth-child(5) { color: #28a745; font-weight: 500; }
.expense-row td:nth-child(5) { color: #dc3545; font-weight: 500; }
.order-completed { background-color: #e8f5e9 !important; }

/* 响应式优化 */
@media (max-width: 992px) {
    .sidebar { width: 220px; }
    .main-content { margin-left: 220px; }
    .footer { width: calc(100% - 220px); margin-left: 220px; }
}
@media (max-width: 768px) {
    .sidebar { width: 100%; height: auto; position: relative; top: 0; }
    .main-content { margin-left: 0; }
    .footer { width: 100%; margin-left: 0; }
    .form-row { flex-direction: column; }
    .stat-card { min-width: 100%; }
}

/* ===== 修复侧边栏已访问链接颜色异常 ===== */
.sidebar .nav-item:link,
.sidebar .nav-item:visited {
  color: inherit !important; /* 继承父级文字颜色（暗色模式=白色，亮色模式=深灰） */
}
