/* 本文件由 scripts/split_css.py 从原 main.css 切分而来，级联顺序不变。 */
/* ============================================================
   iOS 27 骨架屏与空状态增强 v1.0
   提升感知性能和用户体验：骨架屏组件库 + 丰富空状态设计
   ============================================================ */

/* ---------- iOS 27 骨架屏基础样式增强 ---------- */
.skeleton {
    position: relative;
    overflow: hidden;
    background: linear-gradient(
        90deg,
        rgba(120, 120, 128, 0.12) 25%,
        rgba(120, 120, 128, 0.24) 37%,
        rgba(120, 120, 128, 0.12) 63%
    );
    background-size: 400% 100%;
    animation: ios27-skeleton-shimmer 1.4s ease-in-out infinite;
    border-radius: var(--ios27-radius-xs);
    border: none;
}

@keyframes ios27-skeleton-shimmer {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* 骨架屏文本行 */
.skeleton-line {
    height: 12px;
    margin-bottom: 8px;
    border-radius: var(--ios27-radius-full);
}

.skeleton-line:last-child {
    margin-bottom: 0;
}

.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 65%; }
.skeleton-line.long { width: 90%; }
.skeleton-line.full { width: 100%; }

/* 骨架屏标题 */
.skeleton-heading {
    height: 20px;
    width: 50%;
    margin-bottom: 14px;
    border-radius: var(--ios27-radius-full);
}

.skeleton-heading.large {
    height: 28px;
    width: 40%;
}

/* 骨架屏按钮 */
.skeleton-button {
    height: 40px;
    width: 120px;
    border-radius: var(--ios27-radius-sm);
}

.skeleton-button.small {
    height: 32px;
    width: 80px;
}

.skeleton-button.large {
    height: 48px;
    width: 160px;
}

/* 骨架屏头像/图标 */
.skeleton-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-avatar.small {
    width: 32px;
    height: 32px;
}

.skeleton-avatar.large {
    width: 64px;
    height: 64px;
}

.skeleton-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--ios27-radius-sm);
}

/* ---------- 骨架屏卡片组件 ---------- */
.skeleton-card {
    background: var(--cw-card-bg, rgba(255, 255, 255, 0.7));
    backdrop-filter: blur(20px) saturate(1.8);
    -webkit-backdrop-filter: blur(20px) saturate(1.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--ios27-radius-md);
    padding: 16px;
    margin-bottom: 12px;
}

.skeleton-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.skeleton-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-card-footer {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(120, 120, 128, 0.12);
}

/* ---------- 骨架屏KPI卡片组件 ---------- */
.skeleton-kpi-card {
    background: var(--cw-card-bg, rgba(255, 255, 255, 0.7));
    backdrop-filter: blur(20px) saturate(1.8);
    -webkit-backdrop-filter: blur(20px) saturate(1.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--ios27-radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skeleton-kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--ios27-radius-sm);
    margin-bottom: 4px;
}

.skeleton-kpi-value {
    height: 32px;
    width: 70%;
    border-radius: var(--ios27-radius-full);
}

.skeleton-kpi-label {
    height: 12px;
    width: 50%;
    border-radius: var(--ios27-radius-full);
}

.skeleton-kpi-trend {
    height: 12px;
    width: 40%;
    border-radius: var(--ios27-radius-full);
}

/* ---------- 骨架屏表格组件 ---------- */
.skeleton-table {
    width: 100%;
    border-collapse: collapse;
}

.skeleton-table-header {
    height: 44px;
    background: rgba(120, 120, 128, 0.06);
    border-bottom: 1px solid rgba(120, 120, 128, 0.12);
}

.skeleton-table-header-cell {
    height: 14px;
    width: 60%;
    margin: 0 auto;
    border-radius: var(--ios27-radius-full);
}

.skeleton-table-row {
    height: 52px;
    border-bottom: 1px solid rgba(120, 120, 128, 0.08);
}

.skeleton-table-row:last-child {
    border-bottom: none;
}

.skeleton-table-cell {
    padding: 0 16px;
}

.skeleton-table-cell-content {
    height: 14px;
    border-radius: var(--ios27-radius-full);
}

.skeleton-table-cell-content.wide { width: 80%; }
.skeleton-table-cell-content.medium { width: 60%; }
.skeleton-table-cell-content.narrow { width: 40%; }

/* ---------- 骨架屏列表组件 ---------- */
.skeleton-list {
    display: flex;
    flex-direction: column;
}

.skeleton-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(120, 120, 128, 0.08);
}

.skeleton-list-item:last-child {
    border-bottom: none;
}

.skeleton-list-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.skeleton-list-action {
    width: 32px;
    height: 32px;
    border-radius: var(--ios27-radius-sm);
    flex-shrink: 0;
}

/* ---------- 骨架屏图表组件 ---------- */
.skeleton-chart {
    height: 200px;
    border-radius: var(--ios27-radius-md);
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    padding: 20px;
    gap: 8px;
}

.skeleton-chart-bar {
    flex: 1;
    border-radius: var(--ios27-radius-xs) var(--ios27-radius-xs) 0 0;
    max-width: 40px;
}

.skeleton-chart-bar:nth-child(1) { height: 40%; }
.skeleton-chart-bar:nth-child(2) { height: 70%; }
.skeleton-chart-bar:nth-child(3) { height: 55%; }
.skeleton-chart-bar:nth-child(4) { height: 85%; }
.skeleton-chart-bar:nth-child(5) { height: 60%; }
.skeleton-chart-bar:nth-child(6) { height: 75%; }
.skeleton-chart-bar:nth-child(7) { height: 50%; }

/* ---------- 骨架屏表单组件 ---------- */
.skeleton-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.skeleton-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-form-label {
    height: 12px;
    width: 30%;
    border-radius: var(--ios27-radius-full);
}

.skeleton-form-input {
    height: 44px;
    border-radius: var(--ios27-radius-sm);
}

.skeleton-form-textarea {
    height: 100px;
    border-radius: var(--ios27-radius-sm);
}

.skeleton-form-select {
    height: 44px;
    border-radius: var(--ios27-radius-sm);
}

/* ---------- 骨架屏页面布局 ---------- */
.skeleton-page {
    padding: 20px;
}

.skeleton-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.skeleton-page-title {
    height: 28px;
    width: 200px;
    border-radius: var(--ios27-radius-full);
}

.skeleton-page-actions {
    display: flex;
    gap: 8px;
}

.skeleton-page-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ---------- 骨架屏网格布局 ---------- */
.skeleton-grid {
    display: grid;
    gap: 12px;
}

.skeleton-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.skeleton-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.skeleton-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- 骨架屏脉冲动画（替代微光） ---------- */
.skeleton-pulse {
    animation: ios27-skeleton-pulse 2s ease-in-out infinite;
}

@keyframes ios27-skeleton-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ---------- 骨架屏淡入过渡 ---------- */
.skeleton-fade-in {
    animation: ios27-skeleton-fade-in 0.3s ease-out;
}

@keyframes ios27-skeleton-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================================
   空状态设计增强（iOS 27风格）
   ============================================================ */

/* ---------- 空状态基础样式增强 ---------- */
.empty-state,
.no-data {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 24px;
    min-height: 300px;
    background: var(--cw-card-bg, rgba(255, 255, 255, 0.6));
    backdrop-filter: blur(20px) saturate(1.8);
    -webkit-backdrop-filter: blur(20px) saturate(1.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--ios27-radius-md);
}

/* ---------- 空状态图标 ---------- */
.empty-state-icon,
.no-data-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(21, 101, 192, 0.1), rgba(21, 101, 192, 0.05));
    border-radius: 50%;
    position: relative;
}

.empty-state-icon i,
.no-data-icon i {
    font-size: 36px;
    color: rgba(21, 101, 192, 0.5);
    line-height: 1;
}

/* 空状态图标动画 */
.empty-state-icon::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(21, 101, 192, 0.08) 0%, transparent 70%);
    animation: empty-state-pulse 3s ease-in-out infinite;
}

@keyframes empty-state-pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

/* ---------- 空状态标题 ---------- */
.empty-state-title,
.no-data-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--cw-text-primary, #1c1c1e);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

/* ---------- 空状态描述 ---------- */
.empty-state-description,
.no-data-description {
    font-size: 0.875rem;
    color: var(--cw-text-secondary, #8e8e93);
    margin-bottom: 24px;
    max-width: 360px;
    line-height: 1.5;
}

/* ---------- 空状态操作按钮组 ---------- */
.empty-state-actions,
.no-data-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.empty-state-actions .btn,
.no-data-actions .btn {
    min-height: 40px;
    padding: 8px 20px;
    font-size: 0.85rem;
}

/* ---------- 空状态类型变体 ---------- */

/* 无数据类型 */
.empty-state.empty .empty-state-icon {
    background: linear-gradient(135deg, rgba(142, 142, 147, 0.1), rgba(142, 142, 147, 0.05));
}

.empty-state.empty .empty-state-icon i {
    color: rgba(142, 142, 147, 0.6);
}

/* 无搜索结果类型 */
.empty-state.no-results .empty-state-icon {
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.1), rgba(255, 149, 0, 0.05));
}

.empty-state.no-results .empty-state-icon i {
    color: rgba(255, 149, 0, 0.6);
}

/* 无权限类型 */
.empty-state.no-permission .empty-state-icon {
    background: linear-gradient(135deg, rgba(255, 59, 48, 0.1), rgba(255, 59, 48, 0.05));
}

.empty-state.no-permission .empty-state-icon i {
    color: rgba(255, 59, 48, 0.6);
}

/* 错误类型 */
.empty-state.error .empty-state-icon {
    background: linear-gradient(135deg, rgba(255, 59, 48, 0.12), rgba(255, 59, 48, 0.06));
}

.empty-state.error .empty-state-icon i {
    color: rgba(255, 59, 48, 0.7);
}

/* 成功/完成类型 */
.empty-state.success .empty-state-icon {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.1), rgba(52, 199, 89, 0.05));
}

.empty-state.success .empty-state-icon i {
    color: rgba(52, 199, 89, 0.6);
}

/* 首次使用/引导类型 */
.empty-state.first-use .empty-state-icon {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.12), rgba(88, 86, 214, 0.08));
}

.empty-state.first-use .empty-state-icon i {
    color: rgba(0, 122, 255, 0.7);
}

/* ---------- 空状态紧凑模式（用于表格内、小区域） ---------- */
.empty-state.compact,
.no-data.compact {
    padding: 32px 16px;
    min-height: 160px;
}

.empty-state.compact .empty-state-icon,
.no-data.compact .no-data-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
}

.empty-state.compact .empty-state-icon i,
.no-data.compact .no-data-icon i {
    font-size: 22px;
}

.empty-state.compact .empty-state-title,
.no-data.compact .no-data-title {
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.empty-state.compact .empty-state-description,
.no-data.compact .no-data-description {
    font-size: 0.75rem;
    margin-bottom: 16px;
    max-width: 280px;
}

/* ---------- 空状态行内模式（无背景，用于列表末尾） ---------- */
.empty-state.inline,
.no-data.inline {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    padding: 24px 16px;
    min-height: auto;
}

/* ---------- 空状态加载中模式 ---------- */
.empty-state.loading .empty-state-icon {
    animation: empty-state-loading-spin 1s linear infinite;
}

@keyframes empty-state-loading-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ---------- 空状态淡入动画 ---------- */
.empty-state,
.no-data {
    animation: empty-state-fade-in 0.4s ease-out;
}

@keyframes empty-state-fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   通用加载状态管理
   ============================================================ */

/* ---------- 内容加载容器 ---------- */
.loading-content {
    position: relative;
    min-height: 200px;
}

.loading-content .content-loaded {
    display: none;
}

.loading-content.is-loaded .skeleton-wrapper {
    display: none;
}

.loading-content.is-loaded .content-loaded {
    display: block;
    animation: content-fade-in 0.3s ease-out;
}

@keyframes content-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ---------- 骨架屏包装器 ---------- */
.skeleton-wrapper {
    animation: skeleton-fade-in 0.2s ease-out;
}

@keyframes skeleton-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ---------- 页面加载遮罩 ---------- */
.page-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(242, 242, 247, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.page-loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.page-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(21, 101, 192, 0.2);
    border-top-color: rgba(21, 101, 192, 0.8);
    border-radius: 50%;
    animation: page-loading-spin 0.8s linear infinite;
}

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

/* ============================================================
   移动端骨架屏和空状态适配
   ============================================================ */
@media (max-width: 768px) {
    .empty-state,
    .no-data {
        padding: 40px 16px;
        min-height: 240px;
    }

    .empty-state-icon,
    .no-data-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 16px;
    }

    .empty-state-icon i,
    .no-data-icon i {
        font-size: 28px;
    }

    .empty-state-title,
    .no-data-title {
        font-size: 1rem;
    }

    .empty-state-description,
    .no-data-description {
        font-size: 0.8rem;
        margin-bottom: 20px;
    }

    .skeleton-grid.cols-3,
    .skeleton-grid.cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .skeleton-chart {
        height: 160px;
        padding: 16px;
    }

    .skeleton-page {
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .empty-state,
    .no-data {
        padding: 32px 12px;
        min-height: 200px;
    }

    .empty-state.compact,
    .no-data.compact {
        padding: 24px 12px;
    }

    .skeleton-grid.cols-2,
    .skeleton-grid.cols-3,
    .skeleton-grid.cols-4 {
        grid-template-columns: 1fr;
    }
}


/* ============================================================
   iOS 27 动画与操作反馈增强 v1.0
   Toast升级 + 按钮波纹 + 统一弹簧动画 + 微交互
   ============================================================ */

/* ---------- iOS 27 动画曲线变量 ---------- */
:root {
    --ios27-spring: cubic-bezier(0.32, 0.72, 0, 1);
    --ios27-spring-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ios27-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ios27-ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --ios27-duration-fast: 0.2s;
    --ios27-duration-normal: 0.35s;
    --ios27-duration-slow: 0.5s;
}

/* ============================================================
   Toast iOS 27 风格升级
   ============================================================ */

/* Toast容器升级 */
.toast-container {
    top: 70px;
    right: 20px;
    gap: 10px;
    perspective: 1000px;
}

/* Toast项目iOS 27风格重写 */
.toast-item {
    background: rgba(255, 255, 255, 0.72) !important;
    backdrop-filter: blur(24px) saturate(1.8) !important;
    -webkit-backdrop-filter: blur(24px) saturate(1.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: var(--ios27-radius-md, 22px) !important;
    box-shadow:
        0 0.5px 0 rgba(255, 255, 255, 0.9) inset,
        0 12px 32px rgba(0, 0, 0, 0.12),
        0 4px 12px rgba(0, 0, 0, 0.06) !important;
    padding: 14px 16px 14px 16px !important;
    min-width: 300px;
    max-width: 380px;
    animation: ios27-toast-in 0.45s var(--ios27-spring) !important;
    transform-origin: top right;
    border-left: none !important;
    position: relative;
    overflow: hidden;
}

/* Toast顶部高光 */
.toast-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 16px;
    right: 16px;
    height: 0.5px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
}

/* Toast进入动画（iOS 27弹簧） */
@keyframes ios27-toast-in {
    0% {
        opacity: 0;
        transform: translateX(100%) scale(0.9);
    }
    60% {
        opacity: 1;
        transform: translateX(-8px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* Toast退出动画 */
.toast-item.toast-exit {
    animation: ios27-toast-out 0.35s var(--ios27-ease-in) forwards !important;
}

@keyframes ios27-toast-out {
    0% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(100%) scale(0.9);
    }
}

/* Toast堆叠效果（第2个及以后的Toast稍微缩放偏移） */
.toast-item:nth-child(n+2) {
    transform: scale(0.97) translateY(-4px);
    opacity: 0.9;
}

.toast-item:nth-child(n+3) {
    transform: scale(0.94) translateY(-8px);
    opacity: 0.8;
}

/* Toast图标容器 */
.toast-item .toast-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 16px !important;
    flex-shrink: 0;
}

.toast-item.success .toast-icon {
    background: rgba(52, 199, 89, 0.12);
    color: #34c759 !important;
}

.toast-item.error .toast-icon {
    background: rgba(255, 59, 48, 0.12);
    color: #ff3b30 !important;
}

.toast-item.warning .toast-icon {
    background: rgba(255, 149, 0, 0.12);
    color: #ff9500 !important;
}

.toast-item.info .toast-icon {
    background: rgba(0, 122, 255, 0.12);
    color: #007aff !important;
}

/* Toast内容 */
.toast-item .toast-content {
    font-size: 14px !important;
    font-weight: 500;
    color: #1c1c1e !important;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

/* Toast关闭按钮 */
.toast-item .toast-close {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(120, 120, 128, 0.12);
    border-radius: 50%;
    cursor: pointer;
    color: #8e8e93;
    font-size: 14px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.toast-item .toast-close:hover {
    background: rgba(120, 120, 128, 0.2);
    color: #1c1c1e;
}

.toast-item .toast-close:active {
    transform: scale(0.9);
}

/* Toast进度条 */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--toast-color, #007aff), transparent);
    border-radius: 0 0 22px 22px;
    animation: toast-progress linear forwards;
    transform-origin: left;
}

@keyframes toast-progress {
    from { width: 100%; }
    to { width: 0%; }
}

/* Toast颜色变量 */
.toast-item.success { --toast-color: #34c759; }
.toast-item.error { --toast-color: #ff3b30; }
.toast-item.warning { --toast-color: #ff9500; }
.toast-item.info { --toast-color: #007aff; }

/* ============================================================
   按钮点击波纹效果（Ripple）
   ============================================================ */

.btn {
    position: relative;
    overflow: hidden;
}

.btn-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: ripple-effect 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-effect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* 按钮按压缩放反馈 */
.btn:active:not(.btn-no-scale) {
    transform: scale(0.97);
    transition: transform 0.1s ease;
}

.btn {
    transition: all 0.2s var(--ios27-spring);
}

/* 按钮hover上浮效果 */
.btn:hover:not(:active) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 图标按钮波纹 */
.btn-icon {
    position: relative;
    overflow: hidden;
}

/* ============================================================
   统一动画曲线升级
   ============================================================ */

/* 模态框动画升级为iOS 27弹簧 */
.modal.show .modal-dialog,
.modal.active .modal-dialog {
    animation: ios27-modal-in 0.4s var(--ios27-spring) !important;
}

@keyframes ios27-modal-in {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 侧边栏动画升级 */
.sidebar {
    transition: transform 0.35s var(--ios27-spring) !important;
}

/* 卡片hover动画升级 */
.card,
.table-card,
.kpi-card {
    transition: all 0.3s var(--ios27-spring) !important;
}

/* 表格行动画 */
.data-table tbody tr {
    transition: background 0.2s var(--ios27-ease-out) !important;
}

/* 输入框focus动画 */
input:focus,
select:focus,
textarea:focus,
.form-control:focus {
    transition: all 0.25s var(--ios27-spring) !important;
}

/* 标签页切换动画 */
.tab-item,
.nav-tabs .nav-link {
    transition: all 0.25s var(--ios27-spring) !important;
}

/* 下拉菜单动画 */
.dropdown-menu,
.select-dropdown {
    animation: ios27-dropdown-in 0.25s var(--ios27-spring);
}

@keyframes ios27-dropdown-in {
    0% {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================================
   微交互增强
   ============================================================ */

/* 链接hover下划线动画 */
a:not(.btn):not(.nav-link) {
    position: relative;
}

/* 可点击元素cursor统一 */
[role="button"],
.clickable,
.cursor-pointer {
    cursor: pointer;
}

/* 焦点可见性增强（无障碍） */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid rgba(0, 122, 255, 0.5);
    outline-offset: 2px;
}

/* 禁用状态样式增强 */
.btn:disabled,
.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* 加载中按钮 */
.btn.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    margin-left: -9px;
    margin-top: -9px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-loading-spin 0.8s linear infinite;
}

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

/* ============================================================
   页面过渡动画
   ============================================================ */

/* 页面内容淡入 */
.main-content,
.page-content,
.content-wrapper {
    animation: page-fade-in 0.4s var(--ios27-ease-out);
}

@keyframes page-fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 卡片依次入场动画（stagger） */
.stagger-children > * {
    opacity: 0;
    animation: stagger-in 0.4s var(--ios27-spring) forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.4s; }

@keyframes stagger-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   移动端动画适配
   ============================================================ */
@media (max-width: 768px) {
    .toast-container {
        top: 60px;
        right: 12px;
        left: 12px;
    }

    .toast-item {
        min-width: auto;
        max-width: 100%;
    }

    /* 移动端禁用hover上浮，避免粘滞 */
    .btn:hover:not(:active) {
        transform: none;
        box-shadow: none;
    }

    /* 移动端减少动画时长，提升响应速度 */
    .toast-item {
        animation-duration: 0.35s !important;
    }
}

/* 减少动画偏好（无障碍） */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .toast-progress {
        display: none;
    }
}


/* ============================================================
   新记录高亮与操作反馈增强
   ============================================================ */

/* 新记录高亮动画 */
.row-highlight {
    animation: row-highlight-pulse 2s ease-out;
    background: linear-gradient(90deg, rgba(52, 199, 89, 0.15), rgba(52, 199, 89, 0.05)) !important;
}

@keyframes row-highlight-pulse {
    0% {
        background: linear-gradient(90deg, rgba(52, 199, 89, 0.35), rgba(52, 199, 89, 0.15));
        transform: scale(1.01);
    }
    50% {
        background: linear-gradient(90deg, rgba(52, 199, 89, 0.2), rgba(52, 199, 89, 0.08));
    }
    100% {
        background: transparent;
        transform: scale(1);
    }
}

/* 表格行进入动画 */
.data-table tbody tr {
    animation: row-fade-in 0.3s ease-out;
}

@keyframes row-fade-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 列表容器滚动到顶部的平滑过渡 */
.table-container,
.data-table-wrapper {
    scroll-behavior: smooth;
}

