/* ===================================
   20251113 现代化设计系统
   基于温暖米色调和简洁设计
   =================================== */

:root {
    /* 主色调 - 温暖米色系统 */
    --bg-primary: #F7F5EF;
    --bg-secondary: #FAF8F3;
    --bg-white: #FFFFFF;

    /* 文字颜色 - Zinc色系 */
    --text-primary: #27272a;      /* zinc-800 */
    --text-secondary: #52525b;    /* zinc-600 */
    --text-tertiary: #71717a;     /* zinc-500 */
    --text-light: #a1a1aa;        /* zinc-400 */

    /* 边框颜色 */
    --border-primary: rgba(228, 228, 231, 0.8);  /* zinc-200 */
    --border-light: rgba(244, 244, 245, 0.8);    /* zinc-100 */

    /* 功能色 - 简洁现代 */
    --accent-emerald: #10b981;    /* emerald-500 */
    --accent-emerald-light: #d1fae5; /* emerald-100 */
    --accent-sky: #0ea5e9;        /* sky-500 */
    --accent-sky-light: #e0f2fe;  /* sky-100 */
    --accent-rose: #f43f5e;       /* rose-500 */
    --accent-rose-light: #ffe4e6; /* rose-100 */
    --accent-amber: #f59e0b;      /* amber-500 */
    --accent-amber-light: #fef3c7; /* amber-100 */

    /* 深色调 */
    --dark-bg: #18181b;          /* zinc-900 */
    --dark-text: #fafafa;        /* zinc-50 */

    /* 圆角 */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
    --radius-full: 9999px;

    /* 阴影 */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);

    /* 过渡 */
    --transition-fast: 150ms;
    --transition-normal: 250ms;
    --transition-slow: 350ms;
}

/* ===================================
   全局样式重置
   =================================== */

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

html, body {
    height: 100%;
    font-family: 'Inter', 'SF Pro Text', -apple-system, BlinkMacSystemFont,
                 'Segoe UI', 'Roboto', 'Helvetica Neue',
                 'Noto Sans SC', 'PingFang SC', 'Hiragino Sans GB',
                 'Microsoft YaHei', 'WenQuanYi Micro Hei', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===================================
   布局结构
   =================================== */

.app-container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.app-sidebar {
    position: sticky;
    top: 0;
    width: 240px;
    height: 100vh;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-primary);
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
}

/* 自定义滚动条 */
.app-sidebar::-webkit-scrollbar {
    width: 6px;
}

.app-sidebar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: var(--radius-full);
}

.app-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

/* Logo 区域 */
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 1rem;
}

.sidebar-logo img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    object-fit: cover;
}

.sidebar-logo-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* 导航按钮 */
.nav-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.25rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.875rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    width: 100%;
    text-align: left;
}

.nav-button:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.nav-button.active {
    background: rgba(0, 0, 0, 0.08);
    color: var(--text-primary);
    font-weight: 500;
}

.nav-button i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

/* 分隔线 */
.sidebar-divider {
    height: 1px;
    background: var(--border-primary);
    margin: 0.75rem 0;
}

/* 区域标签 */
.sidebar-section {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    padding: 0.5rem 0.75rem 0.25rem;
    margin-top: 0.5rem;
}

/* 主内容区域 */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* ===================================
   卡片组件
   =================================== */

.card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

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

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    background: transparent;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-light);
    background: var(--bg-secondary);
}

/* ===================================
   按钮组件
   =================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    line-height: 1.5;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Primary 按钮 */
.btn-primary {
    background: var(--dark-bg);
    color: var(--dark-text);
    border-color: var(--dark-bg);
}

.btn-primary:hover:not(:disabled) {
    background: #000000;
    border-color: #000000;
}

/* Secondary 按钮 */
.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-primary);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.05);
}

/* Success 按钮 */
.btn-success {
    background: var(--accent-emerald);
    color: white;
    border-color: var(--accent-emerald);
}

.btn-success:hover:not(:disabled) {
    background: #059669;
    border-color: #059669;
}

/* Danger 按钮 */
.btn-danger {
    background: var(--accent-rose);
    color: white;
    border-color: var(--accent-rose);
}

.btn-danger:hover:not(:disabled) {
    background: #e11d48;
    border-color: #e11d48;
}

/* Warning 按钮 */
.btn-warning {
    background: var(--accent-amber);
    color: white;
    border-color: var(--accent-amber);
}

.btn-warning:hover:not(:disabled) {
    background: #d97706;
    border-color: #d97706;
}

/* Info 按钮 */
.btn-info {
    background: var(--accent-sky);
    color: white;
    border-color: var(--accent-sky);
}

.btn-info:hover:not(:disabled) {
    background: #0284c7;
    border-color: #0284c7;
}

/* Outline 按钮 */
.btn-outline-primary {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border-primary);
}

.btn-outline-primary:hover:not(:disabled) {
    background: var(--dark-bg);
    color: var(--dark-text);
    border-color: var(--dark-bg);
}

/* 按钮尺寸 */
.btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.75rem 1.75rem;
    font-size: 1rem;
}

/* ===================================
   表单组件
   =================================== */

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-control,
.form-select {
    display: block;
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-white);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--text-secondary);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

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

/* ===================================
   徽章组件
   =================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-full);
    line-height: 1.5;
}

.badge-emerald {
    background: var(--accent-emerald-light);
    color: #065f46;
}

.badge-sky {
    background: var(--accent-sky-light);
    color: #075985;
}

.badge-rose {
    background: var(--accent-rose-light);
    color: #9f1239;
}

.badge-amber {
    background: var(--accent-amber-light);
    color: #92400e;
}

.badge-zinc {
    background: #f4f4f5;
    color: var(--text-secondary);
}

/* ===================================
   用户头像
   =================================== */

.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--border-primary);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
}

.user-avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
}

.user-avatar-lg {
    width: 56px;
    height: 56px;
    font-size: 1.25rem;
}

/* ===================================
   侧边栏底部用户信息
   =================================== */

.sidebar-user {
    margin-top: auto;
    padding: 0.75rem;
    border-top: 1px solid var(--border-primary);
}

.sidebar-user-button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.5rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.sidebar-user-button:hover {
    background: rgba(0, 0, 0, 0.05);
}

.sidebar-user-info {
    flex: 1;
    text-align: left;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
}

/* ===================================
   欢迎区域
   =================================== */

.welcome-card {
    background: linear-gradient(135deg, #fefaf5 0%, #f6efe5 100%);
    border-radius: var(--radius-xl);
    padding: 3rem 2rem;
    color: var(--text-primary);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
}

.welcome-time {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.welcome-greeting {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.welcome-name {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* ===================================
   角色徽章
   =================================== */

.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    background: var(--bg-white);
    color: var(--text-secondary);
}

.role-组员 {
    background: #e8f3f1;
    color: #1f5445;
}

.role-组长 {
    background: #fdf4e6;
    color: #8a4b16;
}

.role-部门主管 {
    background: #f9ecf0;
    color: #9f1f42;
}

/* ===================================
   仪表盘卡片
   =================================== */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.dashboard-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 2rem;
    text-align: center;
    transition: all var(--transition-normal);
    cursor: pointer;
}

.dashboard-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: var(--border-primary);
}

.dashboard-card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.dashboard-card-icon.text-primary {
    color: var(--accent-sky);
}

.dashboard-card-icon.text-success {
    color: var(--accent-emerald);
}

.dashboard-card-icon.text-warning {
    color: var(--accent-amber);
}

.dashboard-card-icon.text-danger {
    color: var(--accent-rose);
}

.dashboard-card-icon.text-info {
    color: var(--accent-sky);
}

.dashboard-card h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.dashboard-card p {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    margin-bottom: 1.25rem;
}

/* ===================================
   页脚
   =================================== */

.app-footer {
    background: var(--dark-bg);
    color: var(--dark-text);
    padding: 2rem 0 1rem;
    margin-top: auto;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-text {
    font-size: 0.875rem;
    color: rgba(250, 250, 250, 0.7);
}

/* ===================================
   响应式设计
   =================================== */

@media (max-width: 768px) {
    .app-sidebar {
        position: fixed;
        left: -240px;
        z-index: 1000;
        transition: left var(--transition-normal);
    }

    .app-sidebar.mobile-open {
        left: 0;
        box-shadow: var(--shadow-xl);
    }

    .main-content {
        padding: 1rem;
    }

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

    .welcome-card {
        padding: 2rem 1.5rem;
    }

    .welcome-name {
        font-size: 1.5rem;
    }
}

/* ===================================
   工具类
   =================================== */

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* ===================================
   动画效果
   =================================== */

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

.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

/* ===================================
   通知样式
   =================================== */

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--accent-rose);
    color: white;
    font-size: 0.625rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===================================
   加载状态
   =================================== */

.spinner {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid var(--border-primary);
    border-top-color: var(--text-primary);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===================================
   表格样式
   =================================== */

.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

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

.table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-primary);
}

.table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}

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

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

/* ===================================
   Alert 提示框
   =================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 2rem 1rem;
    background: rgba(24, 20, 15, 0.55);
    backdrop-filter: blur(3px);
    z-index: 1060;
    overflow-y: auto;
    align-items: flex-start;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-dialog {
    margin: auto;
    width: min(540px, calc(100% - 2rem));
}

.modal.fade .modal-dialog {
    transform: translateY(-12px);
    transition: transform var(--transition-fast), opacity var(--transition-fast);
    opacity: 0;
}

.modal.fade.show .modal-dialog {
    transform: translateY(0);
    opacity: 1;
}

.modal-content {
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-primary);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.18);
    background: var(--bg-white);
    overflow: hidden;
}

.modal-header,
.modal-footer {
    background: var(--bg-secondary);
    border-color: var(--border-light);
    padding: 1.1rem 1.5rem;
}

.modal-body {
    padding: 1.25rem 1.5rem;
    color: var(--text-secondary);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.modal-footer .btn {
    min-width: 110px;
}

.modal-title {
    font-weight: 600;
    color: var(--text-primary);
}

.btn-close {
    background-color: transparent;
    background-image: var(--bs-btn-close-bg, url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23666'%3e%3cpath d='M.293 1.707a1 1 0 011.414-1.414L8 6.586l6.293-6.293a1 1 0 011.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707z'/%3e%3c/svg%3e"));
    background-repeat: no-repeat;
    background-position: center;
    border: none;
    width: 1.5rem;
    height: 1.5rem;
    opacity: 0.55;
    transition: opacity var(--transition-fast);
}

.btn-close:hover {
    opacity: 1;
}

.modal-backdrop {
    background: rgba(17, 17, 17, 0.45);
    z-index: 1055;
}

.modal-backdrop.show {
    opacity: 1;
}

body.modal-open {
    overflow: hidden;
}

@media (max-width: 576px) {
    .modal {
        padding: 1rem 0.5rem;
    }

    .modal-dialog {
        max-width: 100%;
    }
}

.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.alert-success {
    background: var(--accent-emerald-light);
    color: #065f46;
    border-color: #86efac;
}

.alert-danger {
    background: var(--accent-rose-light);
    color: #9f1239;
    border-color: #fda4af;
}

.alert-warning {
    background: var(--accent-amber-light);
    color: #92400e;
    border-color: #fde68a;
}

.alert-info {
    background: var(--accent-sky-light);
    color: #075985;
    border-color: #bae6fd;
}

.management-card .list-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.management-card .list-group-item {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.9rem 1.1rem;
    color: var(--text-secondary);
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    font-weight: 500;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), color var(--transition-fast);
}

.management-card .list-group-item i {
    color: #c49561;
    font-size: 1rem;
}

.management-card .list-group-item::after {
    content: '\f105';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-left: auto;
    color: var(--text-light);
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.management-card .list-group-item:hover {
    color: var(--text-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.management-card .list-group-item:hover::after {
    color: #c49561;
    transform: translateX(2px);
}
