/* ===== 品牌CSS变量 ===== */
:root {
    --xhj-blue: #2A5C99;
    /* 静谧蓝 */
    --xhj-green: #4A8F5D;
    /* 草木绿 */
    --xhj-silver: #D4D9E2;
    /* 星光银 */
    --xhj-oat: #F2EBDC;
    /* 燕麦米 */
    --xhj-navy: #1A3F6E;
    /* 深海蓝 */
}

/* ===== 全局滚动条 ===== */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

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

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

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

/* ===== Toast 动画 ===== */
@keyframes toast-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toast-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast-enter {
    animation: toast-in 0.3s ease-out;
}

.toast-exit {
    animation: toast-out 0.3s ease-in forwards;
}

/* ===== 加载/旋转 ===== */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    animation: spin 0.8s linear infinite;
}

.scrollbar-none::-webkit-scrollbar {
    display: none;
}

.scrollbar-none {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ===== 安全区域 + 移动端 ===== */
@supports (padding: env(safe-area-inset-bottom)) {
    .safe-bottom {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

@media (max-width: 640px) {

    button,
    a,
    [onclick] {
        -webkit-tap-highlight-color: transparent;
    }

    input,
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* ===== line-clamp ===== */
.line-clamp-1 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
}

.line-clamp-3 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* ============================================
           亮色设计系统 v3 — 白底 · 大字号 · 高对比度 · WCAG AA
           ============================================ */

/* --- 标签 --- */
.tag {
    font-size: 13px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 9999px;
}

/* --- 辅助文字 --- */
.text-assist {
    font-size: 14px;
    color: #64748b;
}

/* --- 正文字号 --- */
.text-base {
    font-size: 15px;
}

/* --- 卡片标题 --- */
.card-title {
    font-size: 16px;
    font-weight: 600;
}

/* --- 区块标题 --- */
.block-title {
    font-size: 18px;
    font-weight: 600;
}

/* --- 页面标题 --- */
.page-title {
    font-size: 24px;
    font-weight: 600;
}

/* --- 卡片 --- */
.card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: box-shadow 0.2s, border-color 0.2s;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

.premium-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s, border-color 0.2s;
}

.premium-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

/* --- 指标卡 --- */
.metric-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, rgba(42, 92, 153, 0.06), transparent 70%);
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: var(--xhj-silver);
}

/* --- 按钮 --- */
.btn-primary {
    background: var(--xhj-navy);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    height: 40px;
    padding: 0 20px;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: #153560;
    box-shadow: 0 2px 8px rgba(26, 63, 110, 0.3);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #334155;
    border-radius: 8px;
    font-weight: 500;
    font-size: 15px;
    height: 40px;
    padding: 0 16px;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.btn-ghost {
    background: transparent;
    border: 1px solid #e2e8f0;
    color: #64748b;
    border-radius: 8px;
    font-size: 15px;
    height: 40px;
    padding: 0 16px;
    transition: all 0.2s;
}

.btn-ghost:hover {
    background: #f1f5f9;
    color: #334155;
    border-color: #cbd5e1;
}

.btn-danger {
    background: #ef4444;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: #dc2626;
}

/* --- 输入框 --- */
.input-premium {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #1e293b;
    font-size: 15px;
    height: 40px;
    padding: 0 12px;
    transition: all 0.2s;
}

.input-premium:focus {
    border-color: var(--xhj-blue);
    box-shadow: 0 0 0 3px rgba(42, 92, 153, 0.15);
    outline: none;
}

.input-premium::placeholder {
    color: #94a3b8;
}

textarea.input-premium {
    height: auto;
    padding: 10px 12px;
}

/* --- 徽章 --- */
.badge-glow {
    background: #f0f5fa;
    color: var(--xhj-navy);
    border: 1px solid var(--xhj-silver);
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 500;
    padding: 2px 8px;
}

.badge-success {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 500;
    padding: 2px 8px;
}

.badge-warning {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 500;
    padding: 2px 8px;
}

.badge-danger {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 500;
    padding: 2px 8px;
}

.badge-rev {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 500;
    padding: 2px 8px;
}

.badge-qual {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 500;
    padding: 2px 8px;
}

.badge-cost {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 500;
    padding: 2px 8px;
}

.badge-eff {
    background: #f0f5fa;
    color: var(--xhj-navy);
    border: 1px solid var(--xhj-silver);
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 500;
    padding: 2px 8px;
}

/* --- 分隔线 --- */
.divider {
    height: 1px;
    background: #e2e8f0;
}

/* --- 渐变文字 --- */
.text-gradient {
    background: linear-gradient(135deg, var(--xhj-navy), var(--xhj-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- 脉冲光点 --- */
.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--xhj-blue);
    box-shadow: 0 0 6px rgba(42, 92, 153, 0.4);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 4px rgba(42, 92, 153, 0.2);
    }

    50% {
        box-shadow: 0 0 10px rgba(42, 92, 153, 0.5);
    }
}

/* --- 淡入动画 (v3: 200ms) --- */
@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-up {
    animation: fade-up 0.2s ease-out forwards;
}

.fade-up-delay-1 {
    animation-delay: 0.05s;
    opacity: 0;
}

.fade-up-delay-2 {
    animation-delay: 0.1s;
    opacity: 0;
}

.fade-up-delay-3 {
    animation-delay: 0.15s;
    opacity: 0;
}

/* --- Modal动画 (v3: scale-in 200ms) --- */
@keyframes modal-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes modal-out {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

.modal-enter {
    animation: modal-in 0.2s ease-out;
}

.modal-exit {
    animation: modal-out 0.2s ease-in forwards;
}

/* --- 骨架屏 --- */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 20px;
    width: 60%;
    margin-bottom: 12px;
}

.skeleton-card {
    height: 120px;
}

/* --- AI打字机效果 --- */
@keyframes cursor-blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.typing-cursor::after {
    content: '|';
    color: var(--xhj-navy);
    animation: cursor-blink 1s step-end infinite;
    margin-left: 1px;
}

.ai-pulse {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* --- Tab指示线 (v3: 底部2px·text-15·间距32px) --- */
.tab-v3 {
    display: inline-flex;
    align-items: center;
    padding: 8px 0;
    margin-right: 32px;
    font-size: 15px;
    color: #64748b;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
    cursor: pointer;
}

.tab-v3:hover {
    color: #334155;
}

.tab-v3.active {
    color: var(--xhj-navy);
    border-bottom-color: var(--xhj-navy);
    font-weight: 600;
}

/* --- 板块色条（侧栏导航） --- */
.nav-item {
    position: relative;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--section-color, var(--xhj-navy));
}

/* --- 表格 --- */
.table-light thead th {
    background: #f8fafc;
    color: #64748b;
    font-weight: 500;
    font-size: 13px;
    border-bottom: 1px solid #e2e8f0;
}

.table-light tbody tr {
    border-bottom: 1px solid #f1f5f9;
}

.table-light tbody tr:hover {
    background: rgba(42, 92, 153, 0.03);
}

/* --- 响应式网格 (v3) --- */
.grid-v3 {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(1, 1fr);
}

@media (min-width: 768px) {
    .grid-v3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1280px) {
    .grid-v3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1440px) {
    .grid-v3 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* --- 空状态 (v3) --- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.empty-state .empty-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.empty-state .empty-desc {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 16px;
}