/* 导入自定义字体 */
@font-face {
    font-family: 'ZhuZiAWan2';
    src: url('ZhuZiAWan2.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
/* 禁用CSS伪元素tooltip和原生title，改用JavaScript动态创建的tooltip */
.tooltip-cell::after,
.tooltip-cell::before,
.tooltip-cell:hover::after,
.tooltip-cell:hover::before {
    display: none !important;
    content: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    border: none !important;
}

/* 完全禁用tooltip-cell的原生title属性tooltip */
.tooltip-cell[title] {
    pointer-events: auto !important;
}
/* 强制移除title的浏览器默认行为 */
.tooltip-cell[title]:hover,
.tooltip-cell[title]:focus,
.tooltip-cell[title]:active {
    visibility: hidden !important;
}
/* 针对所有title属性的全局禁用 */
[title] {
    visibility: visible !important;
    pointer-events: auto !important;
}
[title]:hover {
    visibility: visible !important;
}

/* 自定义tooltip样式 - 由JavaScript动态创建 */
#custom-tooltip {
    position: fixed !important;
    background-color: rgba(0, 0, 0, 0.8) !important;
    color: white !important;
    padding: 8px 12px !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    max-width: 800px !important;
    word-wrap: break-word !important;
    white-space: normal !important;
    z-index: 99999 !important;
    pointer-events: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    min-width: 200px !important;
    text-align: center !important;
}

#tooltip-arrow {
    position: fixed !important;
    width: 0 !important;
    height: 0 !important;
    border-left: 5px solid transparent !important;
    border-right: 5px solid transparent !important;
    border-bottom: 5px solid rgba(0, 0, 0, 0.8) !important;
    z-index: 99999 !important;
    pointer-events: none !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'ZhuZiAWan2', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body {
    font-family: 'ZhuZiAWan2', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    min-height: 100vh;
}

/* 日期选择器样式 */
#date-picker {
    font-family: 'ZhuZiAWan2', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

#date-picker input[type="date"] {
    font-family: 'ZhuZiAWan2', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

#date-picker button {
    font-family: 'ZhuZiAWan2', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

#date-picker label {
    font-family: 'ZhuZiAWan2', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* 搜索框和按钮样式 */
input[type="text"] {
    font-family: 'ZhuZiAWan2', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

button {
    font-family: 'ZhuZiAWan2', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* 时间类型单选按钮标签 */
input[type="radio"] + span {
    font-family: 'ZhuZiAWan2', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* 登录页面样式 */
.login-container {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

/* 登录页面的body样式 */
body.login-page {
    font-family: 'ZhuZiAWan2', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.login-header p {
    font-size: 14px;
    color: #666;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: transparent;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input:invalid {
    border-color: #ff4d4f;
}

.form-group input:invalid:focus {
    border-color: #ff4d4f;
    box-shadow: 0 0 0 2px rgba(255, 77, 79, 0.2);
}

.form-error {
    color: #ff4d4f;
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

.form-error.show {
    display: block;
}

/* 密码可见性切换图标样式 */
#toggle-password {
    color: #999 !important;
    cursor: pointer;
    font-size: 18px;
}

#toggle-password.active {
    color: #ff4d4f !important;
}

.slider-container {
    margin: 20px 0;
}

.slider {
    position: relative;
    width: 100%;
    height: 40px;
    background: #f5f5f5;
    border-radius: 20px;
    overflow: hidden;
    user-select: none;
}

.slider-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #666;
    z-index: 1;
}

.slider-track {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #667eea;
    z-index: 2;
    width: 0;
    transition: width 0.3s ease;
}

.slider-handle {
    position: absolute;
    top: 5px;
    left: 0;
    width: 30px;
    height: 30px;
    background: white;
    border: 2px solid #667eea;
    border-radius: 50%;
    z-index: 3;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-handle:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.slider-handle.success {
    background: #52c41a;
    border-color: #52c41a;
}

.slider-handle.success::after {
    content: '✓';
    color: white;
    font-size: 16px;
    font-weight: bold;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* 管理系统布局 */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
    width: 100%;
}

/* 侧边栏 */
.sidebar {
    width: 240px;
    background: white;
    border-right: 1px solid #e0e0e0;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    flex-shrink: 0;
}

.sidebar-overlay {
    display: none;
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.logo img {
    width: 32px;
    height: 32px;
}

.logo-text {
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .logo-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 0 12px;
}

.nav-link:hover {
    background: #f5f5f5;
    color: #1a1a1a;
}

.sidebar-nav .nav-item .nav-link.active {
    background: #e8ebff !important;
    color: #667eea !important;
    border-left: 3px solid #667eea !important;
    border-radius: 4px !important;
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-text {
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .nav-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* 下拉菜单样式 */
.dropdown-toggle {
    cursor: pointer;
    position: relative;
}

.nav-arrow {
    position: absolute;
    right: 12px;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.nav-dropdown {
    display: none;
    padding-left: 20px;
    background: #f9f9f9;
    border-radius: 0 0 8px 8px;
    margin: 0 12px;
    overflow: hidden;
}

.nav-dropdown .nav-link {
    padding-left: 32px;
    font-size: 14px;
    margin: 0;
    border-radius: 0;
}

.nav-dropdown .nav-link:hover {
    background: #f0f0f0;
}

.sidebar.collapsed .nav-dropdown {
    display: none !important;
}

/* 主内容区 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* 顶部导航栏 */
.header {
    height: 64px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.toggle-sidebar {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.toggle-sidebar:hover {
    background: #f5f5f5;
}

.header-menu {
    display: flex;
    gap: 16px;
}

.header-menu-item {
    padding: 8px 16px;
    color: #666;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.header-menu-item:hover {
    background: #f5f5f5;
    color: #1a1a1a;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.header-btn:hover {
    background: #f5f5f5;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    cursor: pointer;
}

/* 内容区域 */
.content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    width: 100%;
    box-sizing: border-box;
}

/* 面包屑导航 */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    color: #666;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-separator {
    margin: 0 8px;
    color: #999;
}

.breadcrumb-item.active {
    color: #1a1a1a;
    font-weight: 500;
}

/* 标签页 */
.tabs {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    border-bottom: 1px solid #e0e0e0;
}

.tab {
    padding: 12px 0;
    color: #666;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.tab:hover {
    color: #1a1a1a;
}

.tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

/* 数据卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
    width: 100%;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.stat-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.stat-title {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
}

.stat-value {
    font-size: 28px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.stat-change {
    font-size: 12px;
    color: #4CAF50;
}

/* 图表区域 */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    width: 100%;
}

.chart-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.chart-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 20px;
}

.chart-placeholder {
    height: 300px;
    background: #f5f5f5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
}

/* 工作台内容 */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
    width: 100%;
}

.dashboard-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.dashboard-card:hover:not(:has(table)) {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* 包含表格的dashboard-card不应用hover移动效果 */
.dashboard-card:has(table) {
    transition: box-shadow 0.3s ease;
}

.dashboard-card:has(table):hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: none;
}

/* 表格行hover效果 */
table tr {
    transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

table tr:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background-color: rgba(102, 126, 234, 0.05);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 16px;
}

.card-content {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

.quick-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.action-btn {
    padding: 8px 16px;
    background: #f5f5f5;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: #e8e8e8;
    color: #1a1a1a;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 1000;
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.35);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
        z-index: 999;
    }

    .sidebar-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }

    .content {
        padding: 12px;
        -webkit-overflow-scrolling: touch;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}
