/* =========================================
   玻璃拟态 (Glassmorphism) UI 系统
   风格：苹果 Mac 拟物风 + 玻璃拟态
   色调：银灰色调，冷白光感
   ========================================= */

:root {
    /* 主色调 - 银灰冷白 */
    --primary: #5e6d82;
    --primary-hover: #4a5568;
    --primary-light: #e8eaed;
    --primary-dark: #3a4250;
    
    /* 辅助色 */
    --success: #34c759;
    --success-bg: rgba(52, 199, 89, 0.15);
    --warning: #ff9500;
    --warning-bg: rgba(255, 149, 0, 0.15);
    --danger: #ff3b30;
    --danger-bg: rgba(255, 59, 48, 0.15);
    --info: #007aff;
    --info-bg: rgba(0, 122, 255, 0.15);
    
    /* 背景色 */
    --bg-body: #f5f5f7;
    --bg-glass: rgba(255, 255, 255, 0.94);
    --bg-glass-light: rgba(255, 255, 255, 0.88);
    --bg-glass-dark: rgba(255, 255, 255, 0.97);
    --bg-sidebar: rgba(28, 28, 30, 0.97);
    --bg-header: rgba(255, 255, 255, 0.95);
    
    /* 文字色 */
    --text-main: #1d1d1f;
    --text-sub: #6e6e73;
    --text-muted: #86868b;
    --text-inverse: #ffffff;
    
    /* 边框与分割线 */
    --border-light: rgba(255, 255, 255, 0.5);
    --border-medium: rgba(0, 0, 0, 0.08);
    --border-dark: rgba(0, 0, 0, 0.12);
    
    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 12px 48px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 24px rgba(255, 255, 255, 0.3);

    /* 尺寸 */
    --header-height: 60px;
    --sidebar-width: 260px;
    --sidebar-mini: 72px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
}

/* =========================================
   基础重置
   ========================================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    outline: none;
}

html, body {
    height: 100%;
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-main);
    background: linear-gradient(135deg, #eef4f8 0%, #f5f0f5 50%, #f0eef8 100%);
    overflow: hidden;
}

/* =========================================
   背景柔光层
   纯渐变绘制。不用图片 + filter: blur()，
   那会让整个视口每帧重新做一次高斯模糊。
   ========================================= */
.app-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background:
        radial-gradient(ellipse 80% 60% at 15% 20%, rgba(168, 237, 234, 0.55) 0%, transparent 60%),
        radial-gradient(ellipse 70% 60% at 85% 25%, rgba(254, 214, 227, 0.50) 0%, transparent 60%),
        radial-gradient(ellipse 90% 70% at 50% 90%, rgba(224, 195, 252, 0.45) 0%, transparent 65%),
        linear-gradient(135deg, #eef4f8 0%, #f5f0f5 50%, #f0eef8 100%);
}

/* =========================================
   玻璃拟态面板通用样式
   ========================================= */
.glass-panel {
    background: var(--bg-glass);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.glass-panel-light {
    background: var(--bg-glass-light);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.glass-panel-dark {
    background: var(--bg-glass-dark);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

/* =========================================
   高光边缘效果
   ========================================= */
.glass-edge {
    position: relative;
}

.glass-edge::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.8) 20%,
        rgba(255, 255, 255, 0.8) 80%,
        transparent 100%
    );
    border-radius: inherit;
    pointer-events: none;
}

.glass-edge::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 10%,
        rgba(255, 255, 255, 0.2) 90%,
        transparent 100%
    );
    pointer-events: none;
}

/* =========================================
   布局容器
   ========================================= */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    position: relative;
    z-index: 1;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    /* 添加半透明白色背景，提高文字可读性 */
    background: rgba(255, 255, 255, 0.94);
}

.content-area::-webkit-scrollbar {
    width: 8px;
}

.content-area::-webkit-scrollbar-track {
    background: transparent;
}

.content-area::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.content-area::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* =========================================
   顶部滚动欢迎条
   ========================================= */
.top-scroll-bar {
    height: 36px;
    background: linear-gradient(135deg, rgba(94, 109, 130, 0.94), rgba(139, 152, 168, 0.94));
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    overflow: hidden;
    position: relative;
    z-index: 101;
}

/* 原为跑马灯，改为静态展示：padding-left: 100% 是滚动起始位移，去掉动画后会把文字推出视口 */
.top-scroll-content {
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    padding-left: 24px;
    color: rgba(255, 255, 255, 0.95);
    font-size: 13px;
}

.top-scroll-content span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding-right: 40px;
}

.top-scroll-content span::before {
    content: '📢';
    font-size: 14px;
}

/* =========================================
   顶部状态栏
   ========================================= */
.top-status-bar {
    height: var(--header-height);
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-shadow: var(--shadow-sm);
    z-index: 100;
}

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

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

/* 面包屑导航 */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-sub);
}

.breadcrumb-item {
    color: var(--text-sub);
    transition: color 0.2s;
}

.breadcrumb-item:hover {
    color: var(--primary);
}

.breadcrumb-separator {
    color: var(--text-muted);
    opacity: 0.5;
}

.breadcrumb-current {
    color: var(--text-main);
    font-weight: 500;
}

/* 状态指示器 */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-glass-light);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    font-size: 13px;
    color: var(--text-sub);
    transition: all 0.2s;
}

.status-indicator:hover {
    background: var(--bg-glass);
    box-shadow: var(--shadow-sm);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 3px var(--success-bg);
}

.status-dot.warning {
    background: var(--warning);
    box-shadow: 0 0 0 3px var(--warning-bg);
}

.status-dot.danger {
    background: var(--danger);
    box-shadow: 0 0 0 3px var(--danger-bg);
}

/* =========================================
   左侧毛玻璃侧边栏
   ========================================= */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    flex-shrink: 0;
    z-index: 100;
}

.sidebar.collapsed {
    width: var(--sidebar-mini);
}

/* Logo 区域 */
.sidebar-logo {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-inverse);
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-logo svg {
    width: 28px;
    height: 28px;
    margin-right: 12px;
    flex-shrink: 0;
    color: var(--text-inverse);
}

.sidebar.collapsed .sidebar-logo span {
    opacity: 0;
    width: 0;
}

/* 导航列表 */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.sidebar-nav::-webkit-scrollbar {
    width: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    height: 35px!important;
    padding: 0 16px;
    margin-bottom: 4px;
    color: rgba(255, 255, 255, 0.75);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
    position: relative;
    text-decoration: none;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-inverse);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.18);
    color: var(--text-inverse);
    font-weight: 500;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background: var(--text-inverse);
    border-radius: 0 2px 2px 0;
}

/* 移除所有链接下划线 */
a, a:hover, a:active, a:visited,
.nav-item, .nav-item:hover,
.submenu-link, .submenu-link:hover {
    text-decoration: none !important;
}

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

.nav-icon svg {
    width: 18px;
    height: 18px;
}

.nav-text {
    margin-left: 12px;
    flex: 1;
    font-size: 13px;
}

.nav-arrow {
    width: 14px;
    height: 14px;
    opacity: 0.5;
    transition: transform 0.2s;
}

.nav-item.expanded .nav-arrow {
    transform: rotate(180deg);
}

.sidebar.collapsed .nav-text,
.sidebar.collapsed .nav-arrow {
    opacity: 0;
    width: 0;
}

.sidebar.collapsed .nav-item {
    padding: 0;
    justify-content: center;
}

/* 子菜单 */
.submenu {
    display: none;
    padding: 6px 0 10px 0;
    margin: 0 8px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.submenu.show {
    display: block;
}



.submenu-link {
    display: block;
    height: 35px;
    line-height: 35px;
    padding-left: 52px;
    margin: 3px 8px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    transition: all 0.2s;
    position: relative;
}

.submenu-link::before {
    content: '';
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    transition: all 0.2s;
}

.submenu-link:hover {
    color: var(--text-inverse);
    background: rgba(255, 255, 255, 0.12);
}

.submenu-link:hover::before {
    background: rgba(255, 255, 255, 0.8);
}

.submenu-link.active {
    color: var(--text-inverse);
    background: rgba(255, 255, 255, 0.18);
}

.submenu-link.active::before {
    background: var(--text-inverse);
    width: 6px;
    height: 6px;
}

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

.btn-primary {
    background: var(--primary);
    color: var(--text-inverse);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: var(--shadow-md);
}

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

.btn-secondary:hover {
    background: var(--bg-glass-dark);
    border-color: var(--border-dark);
}

.btn-ghost {
    background: transparent;
    color: var(--text-sub);
}

.btn-ghost:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-main);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-md);
}

.btn-sm {
    height: 28px;
    padding: 0 12px;
    font-size: 12px;
}

.btn-lg {
    height: 44px;
    padding: 0 24px;
    font-size: 14px;
}

/* =========================================
   卡片样式
   ========================================= */
.card {
    background: var(--bg-glass);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 20px;
    transition: all 0.3s;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
}

.card-body {
    color: var(--text-sub);
}

/* =========================================
   表格样式
   ========================================= */
.table-container {
    background: var(--bg-glass);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

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

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.table th {
    background: rgba(0, 0, 0, 0.02);
    font-weight: 500;
    color: var(--text-sub);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.table tr:hover td {
    background: rgba(0, 0, 0, 0.02);
}

/* =========================================
   表单元素
   ========================================= */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
}

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

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

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

/* =========================================
   徽章/标签
   ========================================= */
.badge {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary-dark);
}

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

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

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

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

/* =========================================
   工具类
   ========================================= */
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sub { color: var(--text-sub); }

.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.hidden { display: none; }
.visible { display: block; }

/* =========================================
   加载指示器
   仅保留功能性的 spin；装饰性动画（脉冲、跑马灯、渐入、
   背景渐变漂移）已全部移除 —— 它们叠在大面积图层上会持续触发重绘。
   ========================================= */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* 兼容旧类名：保留占位，不再产生动画 */
.animate-fade-in,
.animate-pulse {
    animation: none;
}

/* =========================================
   响应式
   ========================================= */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
    }

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

    .sidebar.collapsed {
        width: var(--sidebar-width);
    }
}

/* =========================================
   无障碍：尊重系统「减少动态效果」设置
   ========================================= */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* =========================================
   呼出管控 · 批量审核按钮（全部通过 / 全部驳回）
   —— 四个审批页共用，替换原先的浏览器默认按钮
   ========================================= */
.batch-audit-btn {
    height: 34px;
    padding: 0 16px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.7);
    color: var(--text-sub);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-appearance: none;
    appearance: none;
}
.batch-audit-btn svg { width: 14px; height: 14px; }
.batch-audit-btn:active { transform: translateY(0); }

/* 通过：绿色描边胶囊 */
.batch-audit-btn.approve {
    color: #1a9e4b;
    background: rgba(52, 199, 89, 0.10);
    border-color: rgba(52, 199, 89, 0.24);
}
.batch-audit-btn.approve:hover {
    background: rgba(52, 199, 89, 0.18);
    border-color: rgba(52, 199, 89, 0.42);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 199, 89, 0.20);
}

/* 驳回 / 拒绝：红色描边胶囊 */
.batch-audit-btn.reject {
    color: #e0492f;
    background: rgba(255, 59, 48, 0.09);
    border-color: rgba(255, 59, 48, 0.22);
}
.batch-audit-btn.reject:hover {
    background: rgba(255, 59, 48, 0.16);
    border-color: rgba(255, 59, 48, 0.40);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 59, 48, 0.18);
}

/* 兜底：没加修饰类时也不再是丑陋的原生按钮 */
.batch-audit-btn:not(.approve):not(.reject) {
    border-color: rgba(0, 0, 0, 0.12);
    color: var(--text-main);
}
.batch-audit-btn:not(.approve):not(.reject):hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

/* =========================================
   通用开关（呼出配置页使用）
   ========================================= */
.ob-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    flex-shrink: 0;
}
.ob-switch input { opacity: 0; width: 0; height: 0; }
.ob-switch .slider {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.18);
    border-radius: 26px;
    cursor: pointer;
    transition: background 0.25s;
}
.ob-switch .slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: transform 0.25s;
}
.ob-switch input:checked + .slider { background: var(--success); }
.ob-switch input:checked + .slider::before { transform: translateX(20px); }
.ob-switch input:disabled + .slider { opacity: 0.5; cursor: not-allowed; }
