/* 公共样式 - 现代简洁设计 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1a73e8;
    --primary-hover: #1557b0;
    --success-color: #34a853;
    --danger-color: #ea4335;
    --warning-color: #fbbc04;
    --info-color: #4285f4;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --border-color: #dadce0;
    --bg-light: #f8f9fa;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.1);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --transition: all 0.2s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    background: #f0f2f5;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 布局 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部 - 现代设计 */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0d47a1 100%);
    color: #fff;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-md);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header .logo {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header .logo img {
    height: 36px;
    max-width: 150px;
}

.header .user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header .user-info a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-size: 13px;
    transition: var(--transition);
}

.header .user-info a:hover {
    color: #fff;
    text-decoration: none;
}

/* 侧边栏 */
.sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    width: 240px;
    background: #fff;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    z-index: 900;
    box-shadow: var(--shadow-sm);
}

.sidebar .menu {
    list-style: none;
    padding: 12px 0;
}

.sidebar .menu-item {
    position: relative;
}

.sidebar .menu-title {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.sidebar .menu-title:hover {
    background: rgba(26,115,232,0.08);
    color: var(--primary-color);
}

.sidebar .menu-title.active {
    background: rgba(26,115,232,0.12);
    color: var(--primary-color);
    border-left: 3px solid var(--primary-color);
    margin-left: -3px;
}

.sidebar .menu-title .icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.sidebar .menu-title .arrow {
    margin-left: auto;
    font-size: 12px;
    transition: var(--transition);
}

.sidebar .menu-item.open .arrow {
    transform: rotate(90deg);
}

.sidebar .submenu {
    display: none;
    background: var(--bg-light);
    padding: 8px 0;
}

.sidebar .menu-item.open > .submenu {
    display: block;
}

.sidebar .submenu a {
    display: block;
    padding: 10px 20px 10px 56px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    transition: var(--transition);
}

.sidebar .submenu a:hover {
    background: rgba(26,115,232,0.08);
    color: var(--primary-color);
}

.sidebar .submenu a.active {
    color: var(--primary-color);
    background: rgba(26,115,232,0.12);
    font-weight: 500;
}

/* 主内容区 */
.main {
    margin-left: 240px;
    margin-top: 56px;
    padding: 24px;
    min-height: calc(100vh - 56px);
}

/* 卡片 - 现代圆角设计 */
.card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 24px;
}

/* 表格 - 现代化设计 */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tr:hover {
    background: rgba(26,115,232,0.02);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* 表单 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: var(--transition);
    background: #fff;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26,115,232,0.15);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235f6368' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-success {
    background: var(--success-color);
    color: #fff;
}

.btn-success:hover {
    background: #2d8e47;
}

.btn-danger {
    background: var(--danger-color);
    color: #fff;
}

.btn-danger:hover {
    background: #d33828;
}

.btn-warning {
    background: var(--warning-color);
    color: #333;
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: #e8eaed;
}

.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(260px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-card .icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-card .icon.blue { background: linear-gradient(135deg, #e8f0fe 0%, #d2e3fc 100%); color: #1a73e8; }
.stat-card .icon.green { background: linear-gradient(135deg, #e6f4ea 0%, #ceead6 100%); color: #34a853; }
.stat-card .icon.orange { background: linear-gradient(135deg, #fef7e0 0%, #feefc3 100%); color: #fbbc04; }
.stat-card .icon.red { background: linear-gradient(135deg, #fce8e6 0%, #fad2cf 100%); color: #ea4335; }

.stat-card .info h4 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.2;
}

.stat-card .info p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.pagination a:hover {
    background: var(--bg-light);
}

.pagination .active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* 搜索栏 */
.search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-bar .form-control {
    width: auto;
    flex: 1;
    min-width: 200px;
}

/* 标签页 */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 24px;
    overflow-x: auto;
}

.tabs .tab {
    padding: 14px 24px;
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
    white-space: nowrap;
}

.tabs .tab:hover {
    color: var(--primary-color);
}

.tabs .tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* 图表容器 */
.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: 2000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-header .close {
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.modal-header .close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* 消息提示 */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.alert-success {
    background: #e6f4ea;
    color: #137333;
    border: 1px solid #ceead6;
}

.alert-danger {
    background: #fce8e6;
    color: #c5221f;
    border: 1px solid #fad2cf;
}

.alert-warning {
    background: #fef7e0;
    color: #b06000;
    border: 1px solid #feefc3;
}

.alert-info {
    background: #e8f0fe;
    color: #1967d2;
    border: 1px solid #d2e3fc;
}

/* 空状态 */
.empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty .icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* 工具栏 */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 加载中 */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* 响应式设计 */
@media (max-width: 1199px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0 16px;
    }
    
    .header .logo {
        font-size: 16px;
    }
    
    .menu-toggle {
        display: flex !important;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-card .icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    .stat-card .info h4 {
        font-size: 24px;
    }
    
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .toolbar-left,
    .toolbar-right {
        width: 100%;
    }
    
    .table {
        font-size: 13px;
    }
    
    .table th,
    .table td {
        padding: 10px 12px;
    }
    
    .card-body {
        padding: 16px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 899;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
}

@media (max-width: 480px) {
    .header {
        height: 50px;
        padding: 0 12px;
    }
    
    .main {
        padding: 16px;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* 登录页面 */
body.login-page {
    background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 50%, #1565c0 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.login-page .login-container {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

body.login-page .login-logo {
    text-align: center;
    margin-bottom: 30px;
}

body.login-page .login-logo h1 {
    font-size: 24px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

body.login-page .login-logo p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* 前台样式 */
.front-layout {
    min-height: 100vh;
    background: var(--bg-light);
}

.front-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0d47a1 100%);
    color: #fff;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.front-header .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
}

.front-header .logo img {
    height: 32px;
}

.front-main {
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

/* 大屏样式 */
.screen-mode {
    background: linear-gradient(135deg, #0a1929 0%, #0d2137 100%);
    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);
    backdrop-filter: blur(10px);
}

.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.08);
    border: 1px solid rgba(255,255,255,0.15);
}

.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: 16px;
}

.compare-table th,
.compare-table td {
    padding: 12px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.compare-table th {
    background: var(--bg-light);
    font-weight: 600;
}

.compare-table .up {
    color: var(--danger-color);
}

.compare-table .down {
    color: var(--success-color);
}

.compare-table .equal {
    color: var(--text-secondary);
}

/* 二次确认弹窗 */
.confirm-box {
    text-align: center;
    padding: 30px;
}

.confirm-box .icon {
    font-size: 56px;
    color: var(--warning-color);
    margin-bottom: 16px;
}

.confirm-box p {
    font-size: 16px;
    margin-bottom: 24px;
    color: var(--text-primary);
}

/* 底部版权信息 */
.footer-bar {
    background: #fff;
    border-top: 1px solid var(--border-color);
    padding: 16px 24px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

.footer-bar a {
    color: var(--primary-color);
    text-decoration: none;
}

.footer-bar a:hover {
    text-decoration: underline;
}

/* 徽章 */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #e6f4ea;
    color: #137333;
}

.badge-warning {
    background: #fef7e0;
    color: #b06000;
}

.badge-info {
    background: #e8f0fe;
    color: #1967d2;
}

/* 页面标题 */
.page-header {
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* 汉堡菜单 */
.hamburger {
    display: none;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 4px;
}

.hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: #fff;
    transition: all 0.3s;
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 选中文字样式 */
::selection {
    background: rgba(26,115,232,0.3);
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #bdc1c6;
}

/* 移动端优化 */
@media (max-width: 480px) {
    .form-control {
        font-size: 16px; /* 防止iOS缩放 */
        padding: 12px;
    }
    .search-bar .form-control {
        min-width: 100%;
    }
    .btn {
        padding: 10px 16px;
        font-size: 14px;
    }
}
