/* 公共样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    font-size: 14px;
    line-height: 1.5;
}

/* 布局 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部 */
.header {
    background: #1a73e8;
    color: #fff;
    padding: 0 20px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.header .logo {
    font-size: 18px;
    font-weight: bold;
}

.header .user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header .user-info a {
    color: #fff;
    text-decoration: none;
}

.header .user-info a:hover {
    text-decoration: underline;
}

/* 侧边栏 */
.sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    width: 220px;
    background: #fff;
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
    z-index: 90;
}

.sidebar .menu {
    list-style: none;
    padding: 10px 0;
}

.sidebar .menu-item {
    border-bottom: 1px solid #f0f0f0;
}

.sidebar .menu-title {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.sidebar .menu-title:hover {
    background: #e8f0fe;
}

.sidebar .menu-title.active {
    background: #e8f0fe;
    color: #1a73e8;
    border-left: 3px solid #1a73e8;
}

.sidebar .menu-title .icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar .submenu {
    background: #fafafa;
}

.sidebar .submenu a {
    display: block;
    padding: 10px 20px 10px 50px;
    color: #666;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
}

.sidebar .submenu a:hover {
    background: #e8f0fe;
    color: #1a73e8;
}

.sidebar .submenu a.active {
    background: #e8f0fe;
    color: #1a73e8;
}

/* 主内容区 */
.main {
    margin-left: 220px;
    margin-top: 60px;
    padding: 20px;
    min-height: calc(100vh - 60px);
}

/* 卡片 */
.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.card-body {
    padding: 20px;
}

/* 表格 */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.table th {
    background: #fafafa;
    font-weight: 600;
    color: #333;
}

.table tr:hover {
    background: #f9f9f9;
}

/* 表单 */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #333;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26,115,232,0.1);
}

textarea.form-control {
    min-height: 80px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: #1a73e8;
    color: #fff;
}

.btn-primary:hover {
    background: #1557b0;
}

.btn-success {
    background: #34a853;
    color: #fff;
}

.btn-success:hover {
    background: #2d8e47;
}

.btn-danger {
    background: #ea4335;
    color: #fff;
}

.btn-danger:hover {
    background: #d33828;
}

.btn-warning {
    background: #fbbc04;
    color: #333;
}

.btn-warning:hover {
    background: #e5a703;
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: #e8e8e8;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-card .icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-card .icon.blue { background: #e8f0fe; color: #1a73e8; }
.stat-card .icon.green { background: #e6f4ea; color: #34a853; }
.stat-card .icon.orange { background: #fef7e0; color: #fbbc04; }
.stat-card .icon.red { background: #fce8e6; color: #ea4335; }

.stat-card .info h4 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.stat-card .info p {
    font-size: 13px;
    color: #666;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
}

.pagination a:hover {
    background: #f5f5f5;
}

.pagination .active {
    background: #1a73e8;
    color: #fff;
    border-color: #1a73e8;
}

/* 搜索栏 */
.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-bar .form-control {
    width: auto;
    flex: 1;
    min-width: 150px;
}

/* 标签页 */
.tabs {
    display: flex;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 20px;
}

.tabs .tab {
    padding: 12px 24px;
    cursor: pointer;
    color: #666;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tabs .tab:hover {
    color: #1a73e8;
}

.tabs .tab.active {
    color: #1a73e8;
    border-bottom-color: #1a73e8;
}

/* 图表容器 */
.chart-container {
    width: 100%;
    height: 400px;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.modal-header .close {
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 消息提示 */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
}

.alert-success {
    background: #e6f4ea;
    color: #34a853;
    border: 1px solid #ceead6;
}

.alert-danger {
    background: #fce8e6;
    color: #ea4335;
    border: 1px solid #fad2cf;
}

.alert-warning {
    background: #fef7e0;
    color: #fbbc04;
    border: 1px solid #feefc3;
}

.alert-info {
    background: #e8f0fe;
    color: #1a73e8;
    border: 1px solid #d2e3fc;
}

/* 空状态 */
.empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty .icon {
    font-size: 48px;
    margin-bottom: 15px;
}

/* 工具栏 */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 加载中 */
.loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* 响应式 */
@media (max-width: 1199px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        display: block;
        z-index: 100;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 99;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    .main {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .header .logo {
        font-size: 14px;
    }
    
    /* 汉堡菜单按钮 */
    .menu-toggle {
        display: flex !important;
        width: 40px;
        height: 40px;
        background: none;
        border: none;
        cursor: pointer;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;
        margin-right: 10px;
    }
    
    .menu-toggle span {
        display: block;
        width: 24px;
        height: 2px;
        background: #fff;
        transition: all 0.3s;
    }
    
    .header {
        padding: 0 10px;
    }
    
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .toolbar-left,
    .toolbar-right {
        width: 100%;
    }
    
    .table {
        font-size: 12px;
    }
    
    .table th,
    .table td {
        padding: 8px;
    }
}

/* 登录页面特殊样式 */
body.login-page {
    background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
}

body.login-page .header,
body.login-page .sidebar {
    display: none;
}

body.login-page .main {
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

/* 前台样式 */
.front-layout {
    min-height: 100vh;
    background: #f5f5f5;
}

.front-header {
    background: #1a73e8;
    color: #fff;
    padding: 0 20px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.front-main {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* 大屏样式 */
.screen-mode {
    background: #0a1929;
    color: #fff;
    min-height: 100vh;
    padding: 20px;
}

.screen-mode .card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
}

.screen-mode .card-header {
    border-bottom-color: rgba(255,255,255,0.1);
}

.screen-mode .card-header h3 {
    color: #fff;
}

.screen-mode .stat-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
}

.screen-mode .stat-card .info h4 {
    color: #fff;
}

.screen-mode .stat-card .info p {
    color: rgba(255,255,255,0.7);
}

/* 数据比较表格 */
.compare-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.compare-table th,
.compare-table td {
    padding: 10px;
    text-align: center;
    border: 1px solid #ddd;
}

.compare-table th {
    background: #f5f5f5;
    font-weight: 600;
}

.compare-table .up {
    color: #ea4335;
}

.compare-table .down {
    color: #34a853;
}

.compare-table .equal {
    color: #999;
}

/* 二次确认弹窗 */
.confirm-box {
    text-align: center;
    padding: 30px;
}

.confirm-box .icon {
    font-size: 48px;
    color: #fbbc04;
    margin-bottom: 15px;
}

.confirm-box p {
    font-size: 16px;
    margin-bottom: 20px;
    color: #333;
}
