/* Generated by Trae Work */
:root {
    --primary: #4F46E5;
    --primary-light: #6366F1;
    --primary-dark: #4338CA;
    --primary-bg: #EEF2FF;
    
    --success: #10B981;
    --success-light: #34D399;
    --success-bg: #ECFDF5;
    
    --warning: #F59E0B;
    --warning-light: #FBBF24;
    --warning-bg: #FFFBEB;
    
    --danger: #EF4444;
    --danger-light: #F87171;
    --danger-bg: #FEF2F2;
    
    --info: #3B82F6;
    --info-light: #60A5FA;
    --info-bg: #EFF6FF;
    
    --purple: #8B5CF6;
    --purple-light: #A78BFA;
    --purple-bg: #F5F3FF;
    
    --pink: #EC4899;
    --pink-light: #F472B6;
    --pink-bg: #FDF2F8;
    
    --bg: #F8FAFC;
    --bg-card: #FFFFFF;
    --bg-sidebar: #1E293B;
    --bg-sidebar-hover: #334155;
    --bg-sidebar-active: #4F46E5;
    
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --text-sidebar: #CBD5E1;
    --text-sidebar-active: #FFFFFF;
    
    --border: #E2E8F0;
    --border-light: #F1F5F9;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    --sidebar-width: 260px;
    --header-height: 64px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 应用容器 */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    color: var(--text-sidebar);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 20px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.company-logo svg {
    width: 40px;
    height: 40px;
}

.company-info .company-name {
    font-size: 15px;
    font-weight: 600;
    color: #FFFFFF;
    white-space: nowrap;
}

.company-info .system-title {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.sidebar-nav ul {
    list-style: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 4px;
    color: var(--text-sidebar);
}

.nav-item:hover {
    background-color: var(--bg-sidebar-hover);
    color: #FFFFFF;
}

.nav-item.active {
    background-color: var(--bg-sidebar-active);
    color: var(--text-sidebar-active);
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-icon svg {
    width: 100%;
    height: 100%;
}

.nav-text {
    font-size: 14px;
    font-weight: 500;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.version {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-header {
    height: var(--header-height);
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-right .date-display {
    font-size: 14px;
    color: var(--text-secondary);
}

/* 页面容器 */
.page-container {
    flex: 1;
    padding: 24px;
}

.page-content {
    display: none;
}

.page-content.active {
    display: block;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 28px;
    height: 28px;
}

.stat-primary .stat-icon {
    background-color: var(--primary-bg);
    color: var(--primary);
}

.stat-success .stat-icon {
    background-color: var(--success-bg);
    color: var(--success);
}

.stat-warning .stat-icon {
    background-color: var(--warning-bg);
    color: var(--warning);
}

.stat-info .stat-icon {
    background-color: var(--info-bg);
    color: var(--info);
}

.stat-purple .stat-icon {
    background-color: var(--purple-bg);
    color: var(--purple);
}

.stat-pink .stat-icon {
    background-color: var(--pink-bg);
    color: var(--pink);
}

.stat-orange .stat-icon {
    background-color: var(--warning-bg);
    color: var(--warning);
}

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* 卡片 */
.card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    margin-bottom: 24px;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 20px;
}

/* 工具栏 */
.page-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 搜索框 */
.search-box {
    position: relative;
    width: 280px;
}

.search-box svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    height: 38px;
    padding: 0 12px 0 38px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-primary);
    background-color: var(--bg-card);
    transition: all 0.2s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

/* 筛选下拉 */
.filter-select {
    height: 38px;
    padding: 0 32px 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-primary);
    background-color: var(--bg-card);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    appearance: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 0 16px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background-color: var(--primary);
    color: #FFFFFF;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-secondary {
    background-color: var(--bg);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background-color: var(--border-light);
}

.btn-success {
    background-color: var(--success);
    color: #FFFFFF;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-warning {
    background-color: var(--warning);
    color: #FFFFFF;
}

.btn-warning:hover {
    background-color: #D97706;
}

.btn-danger {
    background-color: var(--danger);
    color: #FFFFFF;
}

.btn-danger:hover {
    background-color: #DC2626;
}

.btn-sm {
    height: 30px;
    padding: 0 10px;
    font-size: 13px;
}

.btn-sm svg {
    width: 14px;
    height: 14px;
}

/* 数据表格 */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background-color: var(--bg);
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table td {
    padding: 14px 16px;
    font-size: 14px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background-color: var(--bg);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* 状态标签 */
.status-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
}

.status-tag.success {
    background-color: var(--success-bg);
    color: var(--success);
}

.status-tag.warning {
    background-color: var(--warning-bg);
    color: var(--warning);
}

.status-tag.danger {
    background-color: var(--danger-bg);
    color: var(--danger);
}

.status-tag.info {
    background-color: var(--info-bg);
    color: var(--info);
}

.status-tag.secondary {
    background-color: var(--bg);
    color: var(--text-secondary);
}

.status-tag.purple {
    background-color: var(--purple-bg);
    color: var(--purple);
}

/* 操作按钮组 */
.action-btns {
    display: flex;
    gap: 6px;
}

.action-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.action-btn:hover {
    background-color: var(--bg);
    color: var(--text-primary);
}

.action-btn.edit:hover {
    color: var(--primary);
}

.action-btn.delete:hover {
    color: var(--danger);
}

.action-btn svg {
    width: 16px;
    height: 16px;
}

/* 空状态 */
.empty-state {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
}

/* 模态框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 560px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: translateY(-20px);
    transition: transform 0.2s ease;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.modal-close:hover {
    background-color: var(--bg);
    color: var(--text-primary);
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* 表单 */
.form-group {
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-label .required {
    color: var(--danger);
    margin-left: 2px;
}

.form-control {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-primary);
    background-color: var(--bg-card);
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    padding-right: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    appearance: none;
    cursor: pointer;
}

textarea.form-control {
    height: auto;
    padding: 10px 12px;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-row .form-group {
    margin-bottom: 0;
}

.form-row + .form-group {
    margin-top: 20px;
}

/* Toast 提示 */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary);
    min-width: 280px;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.warning {
    border-left-color: var(--warning);
}

.toast.info {
    border-left-color: var(--info);
}

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    color: var(--success);
}

.toast.error .toast-icon {
    color: var(--danger);
}

.toast.warning .toast-icon {
    color: var(--warning);
}

.toast.info .toast-icon {
    color: var(--info);
}

.toast-message {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast.hiding {
    animation: slideOut 0.3s ease forwards;
}

/* 确认对话框 */
.confirm-dialog {
    text-align: center;
    padding: 10px 0;
}

.confirm-dialog .confirm-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm-dialog.warning .confirm-icon {
    background-color: var(--warning-bg);
    color: var(--warning);
}

.confirm-dialog.danger .confirm-icon {
    background-color: var(--danger-bg);
    color: var(--danger);
}

.confirm-dialog .confirm-icon svg {
    width: 32px;
    height: 32px;
}

.confirm-dialog h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.confirm-dialog p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* 响应式设计 */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    margin-right: 8px;
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    align-items: center;
    justify-content: center;
}

.menu-toggle svg {
    width: 24px;
    height: 24px;
}

.menu-toggle:active {
    background-color: var(--bg-secondary);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

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

    .sidebar.mobile-open ~ .sidebar-overlay,
    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }

    .main-content {
        margin-left: 0;
    }

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

    .form-row {
        grid-template-columns: 1fr;
    }

    .page-container {
        padding: 12px;
        padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    }

    .top-header {
        padding: 0 12px;
    }

    .header-left h2 {
        font-size: 16px;
    }

    .header-right .date-display {
        font-size: 12px;
        white-space: nowrap;
    }

    .search-box {
        width: 100%;
    }

    .page-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .toolbar-left,
    .toolbar-right {
        width: 100%;
    }

    .toolbar-right {
        justify-content: flex-end;
    }

    .modal {
        width: 95%;
        max-height: 95vh;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .stat-card {
        padding: 14px;
        gap: 12px;
    }

    .stat-icon {
        width: 44px;
        height: 44px;
    }

    .stat-icon svg {
        width: 22px;
        height: 22px;
    }

    .stat-label {
        font-size: 12px;
    }

    .stat-value {
        font-size: 22px;
    }

    .stat-desc {
        font-size: 11px;
    }

    .data-table {
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 8px 6px;
    }

    .filter-select {
        max-width: 120px;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: #CBD5E1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #94A3B8;
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: #475569;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background-color: #64748B;
}

/* ==================== 登录页面 ==================== */
.login-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 48px 40px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    text-align: center;
}

.login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    color: #1E293B;
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 14px;
    color: #64748B;
    margin-bottom: 32px;
}

.login-form {
    text-align: left;
}

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

.login-form .form-control {
    height: 42px;
}

.login-error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #DC2626;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 16px;
    text-align: left;
}

.btn-block {
    width: 100%;
    height: 42px;
    font-size: 15px;
}

.login-hint {
    margin-top: 20px;
    font-size: 12px;
    color: #94A3B8;
}

/* ==================== 用户信息区域 ==================== */
.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-info .user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-right: 4px;
}
