/**
 * 全局样式表
 *
 * 风格：玻璃拟态 + 科技感极简风
 * 色调：深灰蓝主调，半透明毛玻璃效果
 */

/* ============================================================
 * 基础重置与全局变量
 * ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 主色调：深灰蓝科技风 + 紫色点缀 */
    --color-bg: #0b1016;
    --color-bg-deep: #070a0f;
    --color-bg-light: #141a23;
    --color-glass: rgba(255, 255, 255, 0.06);
    --color-glass-strong: rgba(255, 255, 255, 0.10);
    --color-border: rgba(255, 255, 255, 0.12);
    --color-border-strong: rgba(255, 255, 255, 0.20);
    --color-text: #e6ebf1;
    --color-text-muted: #939da8;
    --color-primary: #58a6ff;
    --color-primary-hover: #2f81f7;
    --color-primary-soft: rgba(88, 166, 255, 0.18);
    --color-secondary: #a371f7;
    --color-secondary-soft: rgba(163, 113, 247, 0.18);
    --color-success: #3fb950;
    --color-warning: #d29922;
    --color-danger: #f85149;

    /* 多层柔光阴影 */
    --shadow-sm:  0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-md:  0 8px 24px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    --shadow-lg:  0 16px 48px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    --shadow-glow-primary: 0 0 0 3px rgba(88, 166, 255, 0.18), 0 8px 24px rgba(88, 166, 255, 0.22);
    --shadow-glow-hover: 0 12px 32px rgba(88, 166, 255, 0.20),
                         0 8px 20px rgba(163, 113, 247, 0.12),
                         inset 0 1px 0 rgba(255, 255, 255, 0.08);

    /* 间距/圆角设计令牌 */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-pill: 999px;

    /* 动效参数：弹性缓动曲线 + 标准持续时间 */
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --dur-fast: 0.18s;
    --dur-md:   0.28s;
    --dur-slow: 0.45s;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    line-height: 1.55;
    letter-spacing: 0.01em;
    -webkit-font-smoothing: antialiased;
    /* 科技感背景：动态柔光光斑 + 渐变基底 + 细网格噪点 */
    background-color: #0b1016;
    background-image:
        radial-gradient(ellipse 55% 45% at 12% 8%,  rgba(88, 166, 255, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 88% 12%, rgba(163, 113, 247, 0.10) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 50% 100%,rgba(63, 185, 80, 0.06) 0%, transparent 60%),
        linear-gradient(180deg, #0a0f15 0%, #111720 50%, #0b1016 100%);
    background-attachment: fixed;
    position: relative;
    overflow-x: hidden;
}

/* 背景动态光斑（呼吸动画） */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background:
        radial-gradient(circle at 30% 20%, rgba(88, 166, 255, 0.07), transparent 45%),
        radial-gradient(circle at 70% 80%, rgba(163, 113, 247, 0.06), transparent 45%);
    animation: bgPulse 9s ease-in-out infinite alternate;
}
@keyframes bgPulse {
    from { opacity: 0.75; transform: scale(1); }
    to   { opacity: 1;    transform: scale(1.05); }
}

/* 自定义滚动条（玻璃科技感） */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(88, 166, 255, 0.30), rgba(163, 113, 247, 0.25));
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(88, 166, 255, 0.45), rgba(163, 113, 247, 0.40));
    background-clip: padding-box;
    border: 2px solid transparent;
}

/* 统一 textarea / select 美观化 */
textarea, select {
    font-family: inherit;
}

/* ============================================================
 * 玻璃拟态卡片组件（升级版：柔光双层阴影 + 内发光边）
 * ============================================================ */
.glass-card {
    background: var(--color-glass);
    backdrop-filter: blur(24px) saturate(140%);
    -webkit-backdrop-filter: blur(24px) saturate(140%);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    transition: transform var(--dur-md) var(--ease-bounce),
                box-shadow var(--dur-md) var(--ease-smooth),
                border-color var(--dur-md) var(--ease-smooth),
                background var(--dur-md) var(--ease-smooth);
    position: relative;
    overflow: hidden;
}

/* 卡片顶边细腻高光条 */
.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 12%;
    right: 12%;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.18) 30%,
        rgba(88, 166, 255, 0.35) 50%,
        rgba(255, 255, 255, 0.18) 70%,
        transparent 100%);
    opacity: 0.7;
    pointer-events: none;
}

.glass-card:hover {
    border-color: rgba(88, 166, 255, 0.35);
    box-shadow: var(--shadow-glow-hover);
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.08);
}

/* selection 文本选中统一色 */
::selection {
    background: var(--color-primary-soft);
    color: #fff;
}

/* ============================================================
 * 登录页面样式（科技玻璃登录屏）
 * ============================================================ */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

/* 登录页专属背景光晕 */
.login-container::before,
.login-container::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: -1;
}
.login-container::before {
    width: 520px; height: 520px;
    top: -160px; left: -120px;
    background: radial-gradient(circle, rgba(88, 166, 255, 0.22), transparent 70%);
    animation: floatOrb 12s ease-in-out infinite alternate;
}
.login-container::after {
    width: 480px; height: 480px;
    bottom: -180px; right: -140px;
    background: radial-gradient(circle, rgba(163, 113, 247, 0.18), transparent 70%);
    animation: floatOrb 14s ease-in-out infinite alternate-reverse;
}
@keyframes floatOrb {
    from { transform: translate(0,0) scale(1); }
    to   { transform: translate(40px,-30px) scale(1.1); }
}

.login-card {
    width: 100%;
    max-width: 440px;
    padding: 44px 40px 36px;
    animation: fadeInUp 0.7s var(--ease-bounce);
    box-shadow: var(--shadow-lg);
}

.login-card h1 {
    font-size: 30px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    letter-spacing: 0.02em;
    background: linear-gradient(135deg, var(--color-primary) 0%, #7aa8ff 50%, var(--color-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 8px rgba(88, 166, 255, 0.25));
}

.login-card .subtitle {
    text-align: center;
    color: var(--color-text-muted);
    margin-bottom: 32px;
    font-size: 14px;
    opacity: 0.9;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 12.5px;
    color: var(--color-text-muted);
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 13px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: 14px;
    transition: all var(--dur-md) var(--ease-smooth);
    outline: none;
    backdrop-filter: blur(8px);
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    background: rgba(255, 255, 255, 0.075);
    border-color: rgba(88, 166, 255, 0.30);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--color-primary);
    background: rgba(88, 166, 255, 0.07);
    box-shadow: var(--shadow-glow-primary);
    transform: translateY(-1px);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--color-text-muted);
    opacity: 0.7;
}

/* ========== 按钮全系升级（玻璃 / 渐变 + 浮起弹性回弹） ========== */
.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-hover) 55%, var(--color-secondary) 100%);
    background-size: 200% 200%;
    background-position: 0% 50%;
    border: none;
    border-radius: var(--radius-md);
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: all var(--dur-md) var(--ease-bounce);
    margin-top: 8px;
    box-shadow: 0 6px 18px rgba(88, 166, 255, 0.30),
                0 2px 6px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 25%, rgba(255,255,255,0.16) 50%, transparent 75%);
    transform: translateX(-120%);
    transition: transform 0.7s var(--ease-smooth);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.015);
    background-position: 100% 50%;
    box-shadow: 0 12px 32px rgba(88, 166, 255, 0.40),
                0 4px 10px rgba(163, 113, 247, 0.25);
}
.btn-primary:hover::before {
    transform: translateX(120%);
}

.btn-primary:active {
    transform: translateY(1px) scale(0.99);
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.30);
}

.btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-secondary {
    padding: 10px 20px;
    background: var(--color-glass-strong);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--dur-md) var(--ease-bounce);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(88, 166, 255, 0.45);
    transform: translateY(-1.5px);
    box-shadow: 0 6px 16px rgba(88, 166, 255, 0.18);
    color: #fff;
}
.btn-secondary:active {
    transform: translateY(0) scale(0.98);
}

.btn-danger {
    padding: 10px 20px;
    background: rgba(248, 81, 73, 0.12);
    border: 1px solid rgba(248, 81, 73, 0.35);
    border-radius: var(--radius-md);
    color: var(--color-danger);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--dur-md) var(--ease-bounce);
}

.btn-danger:hover {
    background: rgba(248, 81, 73, 0.22);
    transform: translateY(-1.5px);
    box-shadow: 0 6px 16px rgba(248, 81, 73, 0.20);
    color: #ffb8b4;
}
.btn-danger:active { transform: translateY(0) scale(0.98); }

.btn-success {
    padding: 10px 20px;
    background: rgba(63, 185, 80, 0.12);
    border: 1px solid rgba(63, 185, 80, 0.35);
    border-radius: var(--radius-md);
    color: var(--color-success);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--dur-md) var(--ease-bounce);
}

.btn-success:hover {
    background: rgba(63, 185, 80, 0.22);
    transform: translateY(-1.5px);
    box-shadow: 0 6px 16px rgba(63, 185, 80, 0.20);
    color: #a4e3af;
}
.btn-success:active { transform: translateY(0) scale(0.98); }

/* 提示消息（玻璃升级） */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
    animation: fadeInUp 0.35s var(--ease-bounce);
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow-sm);
}

.alert-error {
    background: rgba(248, 81, 73, 0.12);
    border: 1px solid rgba(248, 81, 73, 0.38);
    color: #ffb3af;
}

.alert-success {
    background: rgba(63, 185, 80, 0.12);
    border: 1px solid rgba(63, 185, 80, 0.38);
    color: #9de8ad;
}

.alert-warning {
    background: rgba(210, 153, 34, 0.12);
    border: 1px solid rgba(210, 153, 34, 0.38);
    color: #f1c775;
}

/* ============================================================
 * 主页布局 & 侧边栏导航（科技感玻璃抽屉风）
 * ============================================================ */
.main-layout {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏：玻璃抽屉 + 内侧柔光条 */
.sidebar {
    width: 232px;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.07) 0%,
        rgba(255, 255, 255, 0.05) 100%);
    backdrop-filter: blur(28px) saturate(150%);
    -webkit-backdrop-filter: blur(28px) saturate(150%);
    border-right: 1px solid var(--color-border);
    padding: 22px 14px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: relative;
}

/* 侧边栏右侧细柔光分隔 */
.sidebar::after {
    content: '';
    position: absolute;
    top: 10%;
    bottom: 10%;
    right: -1px;
    width: 1px;
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(88, 166, 255, 0.35) 30%,
        rgba(163, 113, 247, 0.35) 70%,
        transparent 100%);
    pointer-events: none;
    opacity: 0.6;
}

.sidebar .logo {
    font-size: 21px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 28px;
    letter-spacing: 0.02em;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    filter: drop-shadow(0 2px 6px rgba(88, 166, 255, 0.25));
}

.sidebar .logo::after {
    content: '';
    display: block;
    margin: 12px auto 0;
    width: 40px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, var(--color-primary), var(--color-secondary), transparent);
    opacity: 0.7;
}

/* 通用导航项：玻璃胶囊按钮 */
.sidebar .nav-item {
    padding: 11px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--color-text-muted);
    font-size: 14px;
    font-weight: 600;
    transition: all var(--dur-md) var(--ease-bounce);
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    border: 1px solid transparent;
}

/* hover：胶囊左发光条 + 轻微右移 + 玻璃高亮 */
.sidebar .nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 18%;
    bottom: 18%;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, var(--color-primary), var(--color-secondary));
    opacity: 0;
    transform: scaleY(0.2);
    transform-origin: center;
    transition: all var(--dur-md) var(--ease-bounce);
    box-shadow: 0 0 8px var(--color-primary);
}

.sidebar .nav-item:hover {
    background: rgba(88, 166, 255, 0.10);
    color: #fff;
    transform: translateX(3px);
    border-color: rgba(88, 166, 255, 0.18);
}
.sidebar .nav-item:hover::before {
    opacity: 1;
    transform: scaleY(1);
}

/* active：高亮发光胶囊 */
.sidebar .nav-item.active {
    background: linear-gradient(90deg,
        rgba(88, 166, 255, 0.22) 0%,
        rgba(163, 113, 247, 0.14) 100%);
    color: #e3efff;
    border: 1px solid rgba(88, 166, 255, 0.35);
    box-shadow: 0 6px 18px rgba(88, 166, 255, 0.18),
                inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transform: translateX(2px);
}
.sidebar .nav-item.active::before {
    opacity: 1;
    transform: scaleY(1);
}

/* 导航分组 */
.sidebar .nav-group {
    margin-bottom: 6px;
}

.sidebar .nav-group-title {
    padding: 11px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--color-text);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--dur-md) var(--ease-smooth);
    user-select: none;
    border: 1px solid transparent;
}

.sidebar .nav-group-title:hover {
    background: rgba(88, 166, 255, 0.08);
    color: #fff;
    border-color: rgba(88, 166, 255, 0.14);
}

.sidebar .nav-group-title .arrow {
    font-size: 10px;
    transition: transform 0.3s var(--ease-smooth);
    color: var(--color-text-muted);
}

/* 折叠状态 */
.sidebar .nav-group.collapsed .arrow {
    transform: rotate(-90deg);
}

.sidebar .nav-group.collapsed .nav-group-items {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* 子菜单容器 */
.sidebar .nav-group-items {
    max-height: 500px;
    opacity: 1;
    overflow: hidden;
    transition: max-height 0.3s var(--ease-smooth),
                opacity 0.25s var(--ease-smooth),
                padding 0.3s var(--ease-smooth);
    padding-top: 4px;
    padding-bottom: 4px;
}

/* 子菜单项 */
.sidebar .nav-group-items .nav-item {
    padding: 10px 16px 10px 36px;
    margin-bottom: 2px;
    text-align: left;
    font-size: 13px;
    position: relative;
}

/* 子菜单项前缀指示 */
.sidebar .nav-group-items .nav-item::before {
    content: '';
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-text-muted);
    transition: all var(--dur-md) var(--ease-bounce);
}

.sidebar .nav-group-items .nav-item:hover::before {
    background: var(--color-primary);
    transform: translateY(-50%) scale(1.8);
    box-shadow: 0 0 10px var(--color-primary);
}

.sidebar .nav-group-items .nav-item.active::before {
    background: var(--color-primary);
    transform: translateY(-50%) scale(2);
    box-shadow: 0 0 12px var(--color-primary);
}

/* 底部用户卡片 */
.sidebar .user-info {
    margin-top: auto;
    padding: 16px 14px 10px;
    border-top: 1px solid var(--color-border);
    text-align: center;
    position: relative;
}
.sidebar .user-info::before {
    content: '';
    position: absolute;
    left: 20%;
    right: 20%;
    top: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(88,166,255,0.35), transparent);
}

.sidebar .user-info .username {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--color-text);
}

.sidebar .user-info .role {
    font-size: 12px;
    color: var(--color-text-muted);
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.05);
    display: inline-block;
}

/* 主内容区：左右呼吸留白 */
.content {
    flex: 1;
    padding: 36px 44px 44px;
    overflow-y: auto;
    position: relative;
}

/* 页面主标题 */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
    position: relative;
}
.content-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    border-radius: 2px;
    box-shadow: 0 0 12px rgba(88, 166, 255, 0.4);
}

.content-header h2 {
    font-size: 25px;
    font-weight: 700;
    letter-spacing: 0.015em;
    background: linear-gradient(135deg, #fff 0%, var(--color-text) 50%, var(--color-text-muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================================
 * 通用表格样式（玻璃高光风 + 悬浮行）
 * ============================================================ */
.toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--color-glass);
    backdrop-filter: blur(22px) saturate(140%);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
}

thead {
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.07) 0%,
        rgba(255, 255, 255, 0.04) 100%);
}

th {
    padding: 13px 18px;
    text-align: left;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.03);
    position: relative;
}
th::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20px; right: 20px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(88,166,255,0.3), transparent);
    opacity: 0.7;
}

td {
    padding: 13px 18px;
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
}

tbody tr {
    transition: all var(--dur-md) var(--ease-smooth);
    position: relative;
}

tbody tr:hover {
    background: linear-gradient(90deg,
        rgba(88, 166, 255, 0.07) 0%,
        rgba(163, 113, 247, 0.05) 100%);
    transform: scale(1.001);
}

tbody tr:hover td {
    color: #fff;
}

tbody tr:last-child td {
    border-bottom: none;
}

/* 角色/状态 badge：玻璃发光胶囊 */
.role-badge,
.log-badge,
.diary-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    backdrop-filter: blur(4px);
    transition: all var(--dur-fast) var(--ease-bounce);
}
.role-badge:hover,
.log-badge:hover,
.diary-status-badge:hover {
    transform: translateY(-1px);
    filter: brightness(1.15);
}

.role-admin {
    background: rgba(248, 81, 73, 0.14);
    color: #ff9b97;
    box-shadow: inset 0 0 0 1px rgba(248, 81, 73, 0.25);
}

.role-user {
    background: rgba(88, 166, 255, 0.14);
    color: #9ec8ff;
    box-shadow: inset 0 0 0 1px rgba(88, 166, 255, 0.25);
}

.role-manager {
    background: rgba(210, 153, 34, 0.14);
    color: #f1c775;
    box-shadow: inset 0 0 0 1px rgba(210, 153, 34, 0.25);
}

.role-leader {
    background: rgba(163, 113, 247, 0.14);
    color: #c5a4fb;
    box-shadow: inset 0 0 0 1px rgba(163, 113, 247, 0.25);
}

.role-anchor {
    background: rgba(63, 185, 80, 0.14);
    color: #9de8ad;
    box-shadow: inset 0 0 0 1px rgba(63, 185, 80, 0.25);
}

.role-service {
    background: rgba(139, 148, 158, 0.18);
    color: #b5bdc7;
    box-shadow: inset 0 0 0 1px rgba(139, 148, 158, 0.25);
}

.row-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.row-actions button {
    padding: 6px 13px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--dur-fast) var(--ease-bounce);
}

.row-actions .btn-edit {
    background: rgba(88, 166, 255, 0.12);
    color: #9ec8ff;
    border-color: rgba(88, 166, 255, 0.25);
}
.row-actions .btn-edit:hover {
    background: rgba(88, 166, 255, 0.22);
    transform: translateY(-1.5px);
    color: #fff;
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.20);
}

/* 权限按钮 */
.row-actions .btn-perm {
    background: rgba(163, 113, 247, 0.12);
    color: #c5a4fb;
    border-color: rgba(163, 113, 247, 0.25);
}
.row-actions .btn-perm:hover {
    background: rgba(163, 113, 247, 0.22);
    transform: translateY(-1.5px);
    color: #fff;
    box-shadow: 0 4px 12px rgba(163, 113, 247, 0.20);
}

/* 删除按钮：玻璃红光 */
.row-actions .btn-delete {
    background: rgba(248, 81, 73, 0.12);
    color: #ff9b97;
    border-color: rgba(248, 81, 73, 0.25);
}
.row-actions .btn-delete:hover {
    background: rgba(248, 81, 73, 0.22);
    transform: translateY(-1.5px);
    color: #fff;
    box-shadow: 0 4px 12px rgba(248, 81, 73, 0.20);
}

/* ============================================================
 * 权限设置表格样式
 * ============================================================ */
.perm-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.perm-table th {
    padding: 11px 14px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--color-text-muted);
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
    border-bottom: 1px solid var(--color-border);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.perm-table th:first-child {
    text-align: left;
}

.perm-table td {
    padding: 11px 14px;
    text-align: center;
    font-size: 13px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.perm-table td:first-child {
    text-align: left;
    font-weight: 500;
}

.perm-table tbody tr {
    transition: all var(--dur-md) var(--ease-smooth);
}
.perm-table tbody tr:hover {
    background: linear-gradient(90deg,
        rgba(88, 166, 255, 0.06) 0%,
        rgba(163, 113, 247, 0.04) 100%);
}

/* 复选框样式（玻璃发光） */
.perm-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--color-primary);
    border-radius: 5px;
    transition: all var(--dur-fast) var(--ease-bounce);
}
.perm-table input[type="checkbox"]:hover {
    transform: scale(1.15);
    filter: drop-shadow(0 0 4px rgba(88,166,255,0.6));
}

/* ============================================================
 * 操作日志徽章样式（玻璃胶囊发光）
 * ============================================================ */

/* 登录：蓝色 */
.log-login {
    background: rgba(88, 166, 255, 0.14);
    color: #9ec8ff;
    box-shadow: inset 0 0 0 1px rgba(88, 166, 255, 0.25);
}

/* 登出：灰色 */
.log-logout {
    background: rgba(139, 148, 158, 0.18);
    color: #b5bdc7;
    box-shadow: inset 0 0 0 1px rgba(139, 148, 158, 0.25);
}

/* 新增：绿色 */
.log-create {
    background: rgba(63, 185, 80, 0.14);
    color: #9de8ad;
    box-shadow: inset 0 0 0 1px rgba(63, 185, 80, 0.25);
}

/* 编辑：橙色 */
.log-update {
    background: rgba(210, 153, 34, 0.14);
    color: #f1c775;
    box-shadow: inset 0 0 0 1px rgba(210, 153, 34, 0.25);
}

/* 删除：红色 */
.log-delete {
    background: rgba(248, 81, 73, 0.14);
    color: #ff9b97;
    box-shadow: inset 0 0 0 1px rgba(248, 81, 73, 0.25);
}

/* 设置权限：紫色 */
.log-permission {
    background: rgba(163, 113, 247, 0.14);
    color: #c5a4fb;
    box-shadow: inset 0 0 0 1px rgba(163, 113, 247, 0.25);
}

/* 修改密码：青色 */
.log-password {
    background: rgba(34, 197, 209, 0.14);
    color: #6de3eb;
    box-shadow: inset 0 0 0 1px rgba(34, 197, 209, 0.25);
}

/* ============================================================
 * 分页按钮样式（玻璃胶囊风）
 * ============================================================ */
.page-btn {
    padding: 6px 13px;
    margin: 0 3px;
    font-size: 12.5px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--dur-md) var(--ease-bounce);
}

.page-btn:hover:not(.active) {
    background: linear-gradient(135deg,
        rgba(88, 166, 255, 0.18),
        rgba(163, 113, 247, 0.14));
    color: #fff;
    border-color: rgba(88, 166, 255, 0.40);
    transform: translateY(-1.5px);
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.18);
}

.page-btn.active {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: #fff;
    border-color: transparent;
    cursor: default;
    box-shadow: 0 4px 14px rgba(88, 166, 255, 0.35);
    transform: translateY(-0.5px);
}

/* ============================================================
 * 考勤方点指示器样式（发光霓虹风）
 * ============================================================ */
.att-dot {
    display: inline-block;
    width: 19px;
    height: 19px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: all var(--dur-md) var(--ease-bounce);
    position: relative;
    transform: translateZ(0);
}

/* 鼠标悬停放大 + 抬升 */
.att-dot:hover {
    transform: scale(1.45);
    z-index: 20;
    filter: brightness(1.2);
}

/* 正常：绿色 */
.dot-normal {
    background: linear-gradient(135deg, #47c25c, #2ea043);
    box-shadow: 0 0 0 1px rgba(63,185,80,0.25),
                0 0 8px rgba(63, 185, 80, 0.55);
}

/* 迟到：橙色 */
.dot-late {
    background: linear-gradient(135deg, #e2a938, #c5891a);
    box-shadow: 0 0 0 1px rgba(210,153,34,0.25),
                0 0 8px rgba(210, 153, 34, 0.55);
}

/* 早退：红色 */
.dot-early {
    background: linear-gradient(135deg, #ff7b73, #e54840);
    box-shadow: 0 0 0 1px rgba(248,81,73,0.25),
                0 0 8px rgba(248, 81, 73, 0.55);
}

/* 请假：紫色 */
.dot-leave {
    background: linear-gradient(135deg, #b98dfa, #8b5cf6);
    box-shadow: 0 0 0 1px rgba(163,113,247,0.25),
                0 0 8px rgba(163, 113, 247, 0.55);
}

/* 缺勤：灰色 */
.dot-absent {
    background: linear-gradient(135deg, #7e8691, #5b626b);
    box-shadow: 0 0 0 1px rgba(110,118,129,0.25),
                0 0 6px rgba(110, 118, 129, 0.4);
}

/* 未到（未来日期）：虚边玻璃 */
.dot-future {
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.20);
}
.dot-future:hover {
    border-color: rgba(88, 166, 255, 0.45);
}

/* ============================================================
 * 考勤表格样式
 * ============================================================ */
.att-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.att-table th,
.att-table td {
    padding: 8px 4px;
    text-align: center;
    font-size: 13px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.att-table th {
    color: var(--color-text-muted);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.03);
    position: sticky;
    top: 0;
    z-index: 5;
}

/* 第一列（姓名）固定宽度（仅管理员全员考勤表使用 sticky 首列）*/
#attendanceAdminSection .att-table th:first-child,
#attendanceAdminSection .att-table td:first-child {
    text-align: left;
    min-width: 100px;
    position: sticky;
    left: 0;
    background: rgba(20, 22, 28, 0.95);
    z-index: 6;
}

/* ============================================================
 * 我的考勤日历：独立样式（无姓名列，紧凑排列 + 无边框 + 对齐校准）
 * ============================================================ */
/* ===== 1. 整个卡片：去掉外框，保留柔和阴影 ===== */
#myAttendanceSection {
    border: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
    outline: 0 !important;
}
#myAttendanceSection:hover {
    border-color: transparent !important;
    border-style: none !important;
}

/* ===== 2. 统一内部容器左右 padding：全部 20px，左右对齐一条线 ===== */
#myAttendanceSection .toolbar {
    padding: 16px 20px 0 20px;   /* 顶部16，左右20，底部交给下方元素用间距 */
    margin-bottom: 12px;        /* 工具栏底部与下方表格间距 */
}
/* 日历表格容器：左右 20px（与工具栏对齐），上下 12px */
#myAttendanceSection > .table-container:first-of-type {
    padding: 4px 20px 12px 20px !important;
    overflow-x: visible;
    text-align: center;
}
/* 月度统计外层容器：左右 20px 与上面对齐，底部 20px */
#myAttendanceSection > div:last-child {
    padding: 4px 20px 20px 20px !important;
}
/* 月度统计表内部 table-container：不要额外 padding */
#myAttendanceSection > div:last-child .table-container {
    padding: 0;
}

/* ===== 3. 日历表格整体：占满容器宽度，每列平均分配，不留左右空白 ===== */
.my-att-table {
    width: 100% !important;         /* 占满父容器，消除左右留白 */
    min-width: 100% !important;
    margin: 0 auto;
    table-layout: fixed;            /* 固定布局 + 等比分列 */
    border: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
}

/* ===== 4. 表头：等宽分配，数字与下方圆点中心对齐 ===== */
.my-att-table th {
    position: static !important;
    top: auto !important;
    z-index: auto !important;
    background: transparent !important;
    text-align: center !important;
    padding: 10px 0 14px 0 !important;  /* 上下间距略增大更舒展 */
    width: auto !important;             /* 让 table-layout:fixed 平均分配每列宽 */
    min-width: 0 !important;            /* 取消之前36px硬限制 */
    font-size: 13px;
    color: var(--color-text-muted);
    font-weight: 500;
    /* 清除所有边框 */
    border-bottom: 0 !important;
    border-top: 0 !important;
    border-left: 0 !important;
    border-right: 0 !important;
}

/* ===== 5. 表体单元格：等宽分配，圆点绝对居中 ===== */
.my-att-table td {
    position: static !important;
    background: transparent !important;
    z-index: auto !important;
    text-align: center !important;
    padding: 14px 0 10px 0 !important;  /* 与表头对称 */
    width: auto !important;             /* 取消之前36px硬限制 */
    min-width: 0 !important;
    vertical-align: middle;
    /* 清除单元格分隔线 */
    border-bottom: 0 !important;
    border-top: 0 !important;
    border-left: 0 !important;
    border-right: 0 !important;
}
/* 圆点本身强制在格子正中央，大小略增大更易点击 */
.my-att-table td .att-dot {
    display: block;
    margin: 0 auto;
    width: 20px;
    height: 20px;
}

/* ===== 6. 彻底覆盖管理员表格首列 sticky 深色块（含 :first-child 优先） ===== */
#myAttendanceSection .my-att-table th:first-child,
#myAttendanceSection .my-att-table td:first-child {
    position: static !important;
    left: auto !important;
    background: transparent !important;
    z-index: auto !important;
    text-align: center !important;
    width: auto !important;
    min-width: 0 !important;
    border: 0 !important;
}

/* ===== 7. 行悬浮效果：柔和，不刺眼 ===== */
#myAttendanceSection .my-att-table tbody tr:hover {
    background: transparent;
}

/* ===== 8. 月度统计表：无边框 + 列宽均匀 ===== */
#myAttendanceSection div:last-child table {
    border: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
}
#myAttendanceSection div:last-child th,
#myAttendanceSection div:last-child td {
    border-bottom: 0 !important;
    border-top: 0 !important;
    border-left: 0 !important;
    border-right: 0 !important;
    text-align: center;
    padding: 10px 12px;
}

.att-table tbody tr:hover {
    background: linear-gradient(90deg,
        rgba(88, 166, 255, 0.06) 0%,
        rgba(163, 113, 247, 0.04) 100%);
}

/* 删除旧版重复的 .btn-delete 规则，升级版本位于 row-actions 区块（已覆盖） */


/* ============================================================
 * 日记本模块样式
 * ============================================================ */

/* 日记列表容器 */
.diary-list-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 空状态提示 */
.diary-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-muted);
    font-size: 14px;
}

/* 日记卡片（文章列表样式） */
.diary-card {
    background: var(--color-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 14px;
    padding: 20px 24px;
    cursor: pointer;
    transition: all 0.3s var(--ease-smooth);
    border: 1px solid var(--color-border);
    box-shadow: 0 4px 16px var(--color-shadow);
}

/* 悬浮上浮效果 */
.diary-card:hover {
    transform: translateY(-3px);
    border-color: rgba(77, 156, 255, 0.3);
    box-shadow: 0 8px 32px rgba(77, 156, 255, 0.12);
}

/* 卡片头部：标题 + 状态标签 */
.diary-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

/* 日记标题 */
.diary-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 内容预览 */
.diary-card-preview {
    color: var(--color-text-muted);
    font-size: 13px;
    line-height: 1.6;
    margin: 0 0 12px 0;
    /* 最多显示两行，超出省略 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 卡片底部：时间信息 */
.diary-card-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--color-text-muted);
}

.diary-card-time {
    color: var(--color-text-muted);
}

.diary-card-updated {
    color: var(--color-text-muted);
    opacity: 0.7;
}

/* 状态标签 */
.diary-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

/* 正常状态（绿色） */
.diary-status-badge.status-normal {
    background: rgba(63, 185, 80, 0.15);
    color: var(--color-success);
}

/* 待审核删除状态（橙色） */
.diary-status-badge.status-pending {
    background: rgba(210, 153, 34, 0.15);
    color: var(--color-warning);
}

/* 删除申请已被拒绝状态（红色） */
.diary-status-badge.status-rejected {
    background: rgba(248, 81, 73, 0.15);
    color: var(--color-danger);
    cursor: help;
}

/* ============================================================
 * 日记富文本编辑器样式
 * ============================================================ */

/* 工具栏容器 */
.diary-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--color-border);
    border-bottom: none;
    border-radius: 10px 10px 0 0;
}

/* 工具栏按钮 */
.diary-editor-toolbar button {
    min-width: 32px;
    height: 30px;
    padding: 0 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--color-text);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* 悬浮效果 */
.diary-editor-toolbar button:hover {
    background: rgba(77, 156, 255, 0.15);
    border-color: rgba(77, 156, 255, 0.3);
}

/* 激活状态（如已加粗） */
.diary-editor-toolbar button.active {
    background: rgba(77, 156, 255, 0.2);
    border-color: rgba(77, 156, 255, 0.4);
    color: var(--color-primary);
}

/* 工具栏分隔线 */
.toolbar-divider {
    width: 1px;
    height: 20px;
    background: var(--color-border);
    margin: 0 4px;
    display: inline-block;
}

/* 可编辑区域 */
.diary-editor {
    width: 100%;
    min-height: 240px;
    max-height: 500px;
    overflow-y: auto;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--color-border);
    border-radius: 0 0 10px 10px;
    color: var(--color-text);
    font-size: 14px;
    line-height: 1.8;
    outline: none;
    transition: border-color 0.2s ease;
}

/* 聚焦时边框高亮 */
.diary-editor:focus {
    border-color: rgba(77, 156, 255, 0.4);
}

/* 空内容占位符（通过 data-placeholder + :empty 实现） */
.diary-editor:empty::before {
    content: attr(data-placeholder);
    color: var(--color-text-muted);
    opacity: 0.5;
    pointer-events: none;
}

/* ===== 编辑器内部富文本格式样式 ===== */

/* 标题 */
.diary-editor h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 16px 0 8px;
    color: var(--color-text);
    line-height: 1.4;
}
.diary-editor h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 12px 0 6px;
    color: var(--color-text);
    line-height: 1.4;
}

/* 段落 */
.diary-editor p {
    margin: 0 0 10px 0;
}

/* 列表 */
.diary-editor ul {
    margin: 8px 0;
    padding-left: 24px;
    list-style: disc;
}
.diary-editor ol {
    margin: 8px 0;
    padding-left: 24px;
    list-style: decimal;
}
.diary-editor li {
    margin-bottom: 4px;
}

/* 链接 */
.diary-editor a {
    color: var(--color-primary);
    text-decoration: underline;
}

/* 引用块 */
.diary-editor blockquote {
    margin: 10px 0;
    padding: 8px 16px;
    border-left: 3px solid var(--color-primary);
    background: rgba(255, 255, 255, 0.03);
    color: var(--color-text-muted);
    font-style: italic;
}

/* ===== 日记详情查看区域富文本样式 ===== */

#diaryDetailContent h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 16px 0 8px;
    line-height: 1.4;
}
#diaryDetailContent h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 12px 0 6px;
    line-height: 1.4;
}
#diaryDetailContent p {
    margin: 0 0 10px 0;
}
#diaryDetailContent ul {
    margin: 8px 0;
    padding-left: 24px;
    list-style: disc;
}
#diaryDetailContent ol {
    margin: 8px 0;
    padding-left: 24px;
    list-style: decimal;
}
#diaryDetailContent li {
    margin-bottom: 4px;
}
#diaryDetailContent a {
    color: var(--color-primary);
    text-decoration: underline;
}
#diaryDetailContent blockquote {
    margin: 10px 0;
    padding: 8px 16px;
    border-left: 3px solid var(--color-primary);
    background: rgba(255, 255, 255, 0.03);
    color: var(--color-text-muted);
    font-style: italic;
}

/* ============================================================
 * 模态框样式（玻璃全屏弹窗风）
 * ============================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(88, 166, 255, 0.08), transparent 60%),
        radial-gradient(ellipse at 70% 80%, rgba(163, 113, 247, 0.08), transparent 60%),
        rgba(5, 7, 11, 0.72);
    backdrop-filter: blur(14px) saturate(130%);
    -webkit-backdrop-filter: blur(14px) saturate(130%);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease-out;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px 32px 28px;
    animation: modalPopIn 0.4s var(--ease-bounce);
    position: relative;
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* 模态框顶部高光装饰条 */
.modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 15%;
    right: 15%;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--color-primary) 40%,
        var(--color-secondary) 60%,
        transparent 100%);
    box-shadow: 0 0 14px rgba(88, 166, 255, 0.5);
}

.modal h3 {
    font-size: 21px;
    font-weight: 700;
    margin-bottom: 22px;
    letter-spacing: 0.015em;
    background: linear-gradient(135deg, #fff 0%, var(--color-text) 60%, var(--color-text-muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal .form-group {
    margin-bottom: 17px;
}

.modal .actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 26px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* 模态框尺寸变体 */
.modal.wide { max-width: 720px; }
.modal.large { max-width: 880px; }

/* ============================================================
 * 动画（丰富关键帧）
 * ============================================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(22px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 模态框弹性入场：缩小半透明 → 弹回原始尺寸 */
@keyframes modalPopIn {
    0% {
        opacity: 0;
        transform: translateY(16px) scale(0.94);
    }
    60% {
        opacity: 1;
        transform: translateY(-4px) scale(1.015);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 卡片依次入场动画 */
.stagger-card {
    animation: fadeInUp 0.55s var(--ease-bounce) both;
}

.stagger-card:nth-child(1) { animation-delay: 0.05s; }
.stagger-card:nth-child(2) { animation-delay: 0.10s; }
.stagger-card:nth-child(3) { animation-delay: 0.15s; }
.stagger-card:nth-child(4) { animation-delay: 0.20s; }
.stagger-card:nth-child(5) { animation-delay: 0.25s; }
.stagger-card:nth-child(6) { animation-delay: 0.30s; }
.stagger-card:nth-child(7) { animation-delay: 0.35s; }
.stagger-card:nth-child(8) { animation-delay: 0.40s; }

/* 通过 --delay 自定义交错延迟（首页统计卡片使用） */
.stagger-card[style*="--delay"] {
    animation-delay: calc(var(--delay, 0) * 0.07s);
}

/* ============================================================
 * Toast 全局提示（右上玻璃通知风）
 * ============================================================ */
.toast-container {
    position: fixed;
    top: 24px;
    right: 28px;
    z-index: 30000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 360px;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    min-width: 220px;
    background: rgba(18, 23, 31, 0.85);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: 13.5px;
    font-weight: 500;
    box-shadow:
        0 10px 36px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    animation: toastIn 0.35s var(--ease-bounce);
    position: relative;
    overflow: hidden;
}
.toast::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--color-primary);
    box-shadow: 0 0 8px var(--color-primary);
}
.toast.toast-success { color: var(--color-success); }
.toast.toast-success::before {
    background: var(--color-success);
    box-shadow: 0 0 8px var(--color-success);
}
.toast.toast-error   { color: var(--color-danger); }
.toast.toast-error::before {
    background: var(--color-danger);
    box-shadow: 0 0 8px var(--color-danger);
}
.toast.toast-warning { color: var(--color-warning); }
.toast.toast-warning::before {
    background: var(--color-warning);
    box-shadow: 0 0 8px var(--color-warning);
}

.toast .toast-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.toast.leaving {
    animation: toastOut 0.28s var(--ease-smooth) forwards;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(40px) scale(0.95);
    }
}

/* 全屏处理遮罩（密码修改后/权限设置时锁定交互） */
#globalOverlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 7, 11, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 50000;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 18px;
    color: #fff;
    animation: fadeIn 0.18s ease-out;
}
#globalOverlay.active { display: flex; }
#globalOverlay .spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--color-primary);
    border-right-color: var(--color-secondary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    box-shadow: 0 0 18px rgba(88, 166, 255, 0.35);
}

/* ============================================================
 * 首页统计模块样式
 * ============================================================ */

/* 统计卡片行（4个紧凑卡片横排） */
.stats-card-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

/* 单个统计卡片 */
.stat-card-mini {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    transition: transform 0.3s var(--ease-bounce), box-shadow 0.3s ease;
}
.stat-card-mini:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* 卡片图标 */
.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

/* 卡片文字信息 */
.stat-info { flex: 1; min-width: 0; }
.stat-number {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}
.stat-label {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-top: 2px;
}

/* 图表行（2个图表横排） */
.chart-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

/* 单个图表卡片 */
.chart-card {
    padding: 20px;
    transition: transform 0.3s var(--ease-bounce), box-shadow 0.3s ease;
}
.chart-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* 图表标题 */
.chart-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 14px;
    color: var(--color-text);
}

/* 图表容器（固定高度，防止 canvas 溢出） */
.chart-container {
    position: relative;
    height: 260px;
    width: 100%;
}

/* 响应式：小屏幕下卡片和图表改为单列 */
@media (max-width: 768px) {
    .stats-card-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .chart-row {
        grid-template-columns: 1fr;
    }
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--color-text-muted);
}

/* ============================================================
 * 通用搜索框 & 搜索按钮样式（玻璃科技风）
 * ============================================================ */

/* 统一搜索框：透明玻璃质感 + 聚焦蓝色光圈 */
.search-input {
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    color: var(--color-text);
    font-size: 13px;
    transition: all 0.25s var(--ease-smooth);
    backdrop-filter: blur(10px);
    outline: none;
}

.search-input::placeholder {
    color: var(--color-text-muted);
    opacity: 0.8;
}

.search-input:hover {
    border-color: rgba(88, 166, 255, 0.35);
    background: rgba(255, 255, 255, 0.08);
}

.search-input:focus {
    border-color: var(--color-primary);
    background: rgba(255, 255, 255, 0.10);
    box-shadow: 0 0 0 4px rgba(77, 156, 255, 0.15);
}

/* 统一搜索按钮：玻璃质感 + hover 浮起 */
.btn-search {
    padding: 10px 18px;
    background: linear-gradient(135deg, rgba(77, 156, 255, 0.15), rgba(163, 113, 247, 0.12));
    border: 1px solid rgba(88, 166, 255, 0.35);
    border-radius: 10px;
    color: var(--color-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s var(--ease-smooth);
    backdrop-filter: blur(10px);
}

.btn-search:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, rgba(77, 156, 255, 0.25), rgba(163, 113, 247, 0.22));
    border-color: var(--color-primary);
    box-shadow: 0 6px 18px rgba(77, 156, 255, 0.25);
    color: #cfe3ff;
}

.btn-search:active {
    transform: translateY(0) scale(0.98);
}

/* ============================================================
 * 应聘管理模块样式
 * ============================================================ */

/* 应聘表格行 hover 效果 */
#applyTable tbody tr:hover {
    background: rgba(77, 156, 255, 0.05);
}

/* 应聘分类筛选标签 hover 效果 */
.apply-tab:hover {
    border-color: rgba(88, 166, 255, 0.4) !important;
    background: rgba(88, 166, 255, 0.08) !important;
    color: var(--color-text) !important;
}

/* 应聘表格操作按钮 hover 效果 */
#applyTable .btn-edit:hover {
    background: rgba(88, 166, 255, 0.25) !important;
}
#applyTable .btn-delete:hover {
    background: rgba(248, 81, 73, 0.25) !important;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    margin-left: 8px;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 响应式 */
@media (max-width: 768px) {
    .sidebar {
        width: 64px;
        padding: 16px 8px;
    }
    .sidebar .logo,
    .sidebar .nav-item span,
    .sidebar .user-info .username,
    .sidebar .user-info .role {
        display: none;
    }
    .sidebar .nav-item {
        padding: 12px;
    }
    .content {
        padding: 20px;
    }
}
