/* 煤炭智管系统 - 主样式文件 */

/* ==================== 全局基础样式 ==================== */

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

body {
    font-family: 'Inter', 'PingFang SC', sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    transition: background-color 0.2s, color 0.2s;
}

body.dark {
    background-color: #0f172a;
    color: #f1f5f9;
}

[v-cloak] {
    display: none;
}

/* ==================== App容器 ==================== */

.tl-mt-app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ==================== 侧边栏导航 ==================== */

.tl-mt-sidebar {
    display: none;
    flex-direction: column;
    width: 256px;
    background-color: #ffffff;
    border-right: 1px solid #e2e8f0;
    height: 100%;
    position: fixed;
    z-index: 20;
}

body.dark .tl-mt-sidebar {
    background-color: #1e293b;
    border-right-color: #334155;
}

@media (min-width: 768px) {
    .tl-mt-sidebar {
        display: flex;
    }
}

.tl-mt-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 64px;
    border-bottom: 1px solid #e2e8f0;
}

body.dark .tl-mt-sidebar-header {
    border-bottom-color: #334155;
}

.tl-mt-sidebar-header-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 20px;
    color: #0ea5e9;
}

.tl-mt-sidebar-header-logo-icon {
    font-size: 30px;
}

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

.tl-mt-sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    transition: all 0.15s;
    cursor: pointer;
    text-decoration: none;
    margin-bottom: 4px;
    color: #64748b;
}

body.dark .tl-mt-sidebar-nav-item {
    color: #94a3b8;
}

.tl-mt-sidebar-nav-item:hover {
    background-color: #f1f5f9;
}

body.dark .tl-mt-sidebar-nav-item:hover {
    background-color: #334155;
}

.tl-mt-sidebar-nav-item.active {
    background-color: rgba(14, 165, 233, 0.1);
    color: #0ea5e9;
}

.tl-mt-sidebar-nav-item-icon {
    font-size: 20px;
}

.tl-mt-sidebar-nav-item.active .tl-mt-sidebar-nav-item-icon {
    font-variation-settings: 'FILL' 1;
}

.tl-mt-sidebar-nav-item-text {
    font-weight: 500;
}

.tl-mt-sidebar-nav-item-badge {
    margin-left: auto;
    background-color: #ef4444;
    color: #ffffff;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 9999px;
}

.tl-mt-sidebar-footer {
    padding: 16px;
    border-top: 1px solid #e2e8f0;
}

body.dark .tl-mt-sidebar-footer {
    border-top-color: #334155;
}

.tl-mt-sidebar-footer-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tl-mt-sidebar-footer-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 9999px;
    border: 1px solid #e2e8f0;
}

.tl-mt-sidebar-footer-user-info {
    overflow: hidden;
}

.tl-mt-sidebar-footer-user-name {
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tl-mt-sidebar-footer-user-email {
    font-size: 12px;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.dark .tl-mt-sidebar-footer-user-email {
    color: #94a3b8;
}

.tl-mt-sidebar-footer-user-avatar-placeholder {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 9999px;
    background: linear-gradient(135deg, #38bdf8, #818cf8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
}

.tl-mt-sidebar-footer-logout {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.tl-mt-sidebar-footer-logout:hover {
    background: #fee2e2;
    color: #ef4444;
}

body.dark .tl-mt-sidebar-footer-logout:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.tl-mt-sidebar-footer-logout .material-symbols-outlined {
    font-size: 20px;
}

/* ==================== 主内容区域 ==================== */

.tl-mt-main-container {
    flex: 1;
    margin-left: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    position: relative;
}

@media (min-width: 768px) {
    .tl-mt-main-container {
        margin-left: 256px;
    }
}

/* ==================== 顶部Header ==================== */

.tl-mt-main-container-header {
    height: 64px;
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 10;
    flex-shrink: 0;
}

body.dark .tl-mt-main-container-header {
    background-color: #1e293b;
    border-bottom-color: #334155;
}

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

.tl-mt-main-container-header-menu-button {
    display: block;
    color: #64748b;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: color 0.15s;
}

.tl-mt-main-container-header-menu-button:hover {
    color: #0ea5e9;
}

@media (min-width: 768px) {
    .tl-mt-main-container-header-menu-button {
        display: none;
    }
}

.tl-mt-main-container-header-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

body.dark .tl-mt-main-container-header-title {
    color: #ffffff;
}

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

.tl-mt-main-container-header-search-wrapper {
    position: relative;
    display: none;
}

@media (min-width: 640px) {
    .tl-mt-main-container-header-search-wrapper {
        display: block;
    }
}

.tl-mt-main-container-header-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 18px;
}

.tl-mt-main-container-header-search-input {
    padding: 6px 16px 6px 40px;
    background-color: #f1f5f9;
    border: none;
    border-radius: 9999px;
    font-size: 14px;
    width: 256px;
    color: #334155;
}

.tl-mt-main-container-header-search-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px #0ea5e9;
}

body.dark .tl-mt-main-container-header-search-input {
    background-color: #1e293b;
    color: #e2e8f0;
}

.tl-mt-main-container-header-notification-button,
.tl-mt-main-container-header-theme-button {
    position: relative;
    padding: 8px;
    color: #64748b;
    background: none;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    transition: background-color 0.15s;
}

body.dark .tl-mt-main-container-header-notification-button,
body.dark .tl-mt-main-container-header-theme-button {
    color: #94a3b8;
}

.tl-mt-main-container-header-notification-button:hover,
.tl-mt-main-container-header-theme-button:hover {
    background-color: #f1f5f9;
}

body.dark .tl-mt-main-container-header-notification-button:hover,
body.dark .tl-mt-main-container-header-theme-button:hover {
    background-color: #334155;
}

.tl-mt-main-container-header-notification-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    border-radius: 9999px;
    border: 2px solid #ffffff;
}

body.dark .tl-mt-main-container-header-notification-badge {
    border-color: #1e293b;
}

/* ==================== 内容滚动区域 ==================== */

.tl-mt-main-container-content {
    flex: 1;
    overflow-y: auto;
}

/* ==================== 自定义滚动条 ==================== */

.tl-mt-custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.tl-mt-custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.tl-mt-custom-scrollbar::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 10px;
}

body.dark .tl-mt-custom-scrollbar::-webkit-scrollbar-thumb {
    background-color: #475569;
}

/* ==================== 通用工具类 ==================== */

.tl-mt-material-icon {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
}

/* ==================== 模态框样式 ==================== */

.tl-mt-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;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tl-mt-modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

body.dark .tl-mt-modal-content {
    background: #1e293b;
}

.tl-mt-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
}

body.dark .tl-mt-modal-header {
    border-bottom-color: #334155;
}

.tl-mt-modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
}

body.dark .tl-mt-modal-header h3 {
    color: #f1f5f9;
}

.tl-mt-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.15s;
}

.tl-mt-modal-close:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

body.dark .tl-mt-modal-close:hover {
    background-color: #334155;
    color: #f1f5f9;
}

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

.tl-mt-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
}

body.dark .tl-mt-modal-footer {
    border-top-color: #334155;
}

/* ==================== 表单样式 ==================== */

.tl-mt-form-row {
    margin-bottom: 20px;
}

.tl-mt-form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    margin-bottom: 8px;
}

body.dark .tl-mt-form-label {
    color: #cbd5e1;
}

.tl-mt-form-input,
.tl-mt-form-select,
.tl-mt-form-textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: white;
    color: #0f172a;
    transition: all 0.15s;
    box-sizing: border-box;
}

.tl-mt-form-input:focus,
.tl-mt-form-select:focus,
.tl-mt-form-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

body.dark .tl-mt-form-input,
body.dark .tl-mt-form-select,
body.dark .tl-mt-form-textarea {
    background: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

body.dark .tl-mt-form-input:focus,
body.dark .tl-mt-form-select:focus,
body.dark .tl-mt-form-textarea:focus {
    border-color: #3b82f6;
}

.tl-mt-form-textarea {
    min-height: 100px;
    resize: vertical;
}

.tl-mt-form-error {
    margin-top: 16px;
    padding: 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #dc2626;
    font-size: 14px;
}

body.dark .tl-mt-form-error {
    background: rgba(220, 38, 38, 0.1);
    border-color: rgba(220, 38, 38, 0.3);
    color: #fca5a5;
}

/* ==================== 按钮样式 ==================== */

.tl-mt-button {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.tl-mt-button.primary {
    background: #3b82f6;
    color: white;
}

.tl-mt-button.primary:hover {
    background: #2563eb;
}

.tl-mt-button.secondary {
    background: #f1f5f9;
    color: #475569;
}

.tl-mt-button.secondary:hover {
    background: #e2e8f0;
}

body.dark .tl-mt-button.secondary {
    background: #334155;
    color: #cbd5e1;
}

body.dark .tl-mt-button.secondary:hover {
    background: #475569;
}

.tl-mt-button.danger {
    background: #ef4444;
    color: white;
}

.tl-mt-button.danger:hover {
    background: #dc2626;
}

.tl-mt-button.success {
    background: #22c55e;
    color: white;
}

.tl-mt-button.success:hover {
    background: #16a34a;
}

.tl-mt-button.success:disabled {
    background: #86efac;
    cursor: not-allowed;
    opacity: 0.6;
}

/* ==================== 遮罩层 ==================== */

.tl-mt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    animation: fadeIn 0.2s ease;
}

/* ==================== 通知徽章样式优化 ==================== */

.tl-mt-main-container-header-notification-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

/* ==================== 移动端侧边栏 ==================== */

.tl-mt-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 19;
    animation: fadeIn 0.2s ease;
}

@media (max-width: 767px) {
    .tl-mt-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .tl-mt-sidebar.open {
        display: flex;
        transform: translateX(0);
    }
}

@media (min-width: 768px) {
    .tl-mt-sidebar-overlay {
        display: none;
    }
}
