/* ============================================================
   组件系统
   ============================================================ */

/* ============================================================
   1. 按钮系统
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25rem;
    cursor: pointer;
    transition: all 0.2s var(--ease-expo-out);
    text-decoration: none;
    border: none;
    outline: none;
    white-space: nowrap;
    user-select: none;
}

.btn:focus-visible {
    box-shadow: 0 0 0 2px var(--bg-base), 0 0 0 4px var(--accent);
}

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

/* Primary: 强调色 */
.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow:
        inset 0 1px 0 0 rgba(255,255,255,0.15),
        0 0 0 1px rgba(94,106,210,0.5),
        0 4px 12px rgba(94,106,210,0.3);
}
.btn-primary:hover {
    background: var(--accent-bright);
    box-shadow:
        inset 0 1px 0 0 rgba(255,255,255,0.2),
        0 0 0 1px rgba(94,106,210,0.6),
        0 6px 20px rgba(94,106,210,0.4);
}

/* Secondary: 半透明表面 */
.btn-secondary {
    background: rgba(255,255,255,0.05);
    color: var(--foreground);
    box-shadow:
        inset 0 1px 0 0 rgba(255,255,255,0.08),
        0 0 0 1px rgba(255,255,255,0.06);
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.08);
    box-shadow:
        inset 0 1px 0 0 rgba(255,255,255,0.12),
        0 0 0 1px rgba(255,255,255,0.10),
        0 4px 16px rgba(0,0,0,0.3);
}

/* Ghost: 极简 */
.btn-ghost {
    background: transparent;
    color: var(--foreground-muted);
}
.btn-ghost:hover {
    background: rgba(255,255,255,0.05);
    color: var(--foreground);
}

/* ============================================================
   优雅链接
   ============================================================ */

.link-elegant {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--foreground-muted);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.3s ease;
    padding-bottom: 2px;
}

.link-elegant::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1.5px;
    background: linear-gradient(90deg, var(--accent), var(--accent-bright));
    border-radius: 1px;
    transition: width 0.4s var(--ease-expo-out);
}

.link-elegant:hover {
    color: var(--accent);
}

.link-elegant:hover::after {
    width: 100%;
}

.link-elegant .link-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.6;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.link-elegant:hover .link-dot {
    opacity: 1;
    transform: scale(1.3);
}

/* Prev/Next 导航箭头 */
.nav-arrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: transform 0.3s var(--ease-expo-out), color 0.3s ease;
}

.nav-arrow:hover {
    transform: translateX(4px);
}

.nav-arrow.nav-arrow-prev:hover {
    transform: translateX(-4px);
}

/* Danger */
.btn-danger {
    background: rgba(231, 76, 60, 0.12);
    color: #e74c3c;
    box-shadow: inset 0 1px 0 0 rgba(231,76,60,0.1);
}
.btn-danger:hover {
    background: rgba(231, 76, 60, 0.2);
    color: #ff6b5b;
}

/* Success */
.btn-success {
    background: rgba(46, 204, 113, 0.12);
    color: #2ecc71;
    box-shadow: inset 0 1px 0 0 rgba(46,204,113,0.1);
}
.btn-success:hover {
    background: rgba(46, 204, 113, 0.2);
    color: #4ade80;
}

/* 小尺寸 */
.btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
    border-radius: 6px;
}

/* ============================================================
   2. 玻璃态卡片系统
   ============================================================ */

.glass-card {
    position: relative;
    background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%);
    border: 1px solid var(--border-default);
    border-radius: 16px;
    padding: 24px;
    overflow: hidden;
    transition: all 0.3s var(--ease-expo-out);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.glass-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, transparent 40%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.glass-card:hover {
    border-color: var(--border-hover);
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.06),
        0 8px 40px rgba(0,0,0,0.5),
        0 0 80px rgba(94,106,210,0.08);
    transform: translateY(-2px);
}

.glass-card:hover::before {
    opacity: 1;
}

/* 鼠标追踪聚光灯效果 */
.glass-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(
        300px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(94, 106, 210, 0.12),
        transparent 60%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.glass-card:hover::after {
    opacity: 1;
}

/* 小尺寸卡片 */
.glass-card-sm {
    padding: 16px;
    border-radius: 12px;
}

/* 无内边距卡片 */
.glass-card-p0 {
    padding: 0;
}

/* ============================================================
   3. 表单系统
   ============================================================ */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--foreground-muted);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: var(--foreground);
    font-size: 0.9375rem;
    font-family: var(--font-sans);
    transition: all 0.2s var(--ease-expo-out);
    outline: none;
    box-sizing: border-box;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.04);
    box-shadow:
        0 0 0 1px rgba(94, 106, 210, 0.3),
        0 0 20px rgba(94, 106, 210, 0.1),
        0 0 40px rgba(94, 106, 210, 0.05);
    animation: input-glow 2s ease-in-out infinite alternate;
}

@keyframes input-glow {
    0% { box-shadow: 0 0 0 1px rgba(94, 106, 210, 0.3), 0 0 20px rgba(94, 106, 210, 0.1); }
    100% { box-shadow: 0 0 0 1px rgba(94, 106, 210, 0.5), 0 0 30px rgba(94, 106, 210, 0.2), 0 0 50px rgba(94, 106, 210, 0.08); }
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.4)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.form-select option {
    background: #0a0a0c;
    color: var(--foreground);
}

/* 表单错误状态 */
.form-input.is-error,
.form-textarea.is-error {
    border-color: rgba(231, 76, 60, 0.5);
    box-shadow: 0 0 0 1px rgba(231, 76, 60, 0.2);
}

/* ============================================================
   4. 导航栏
   ============================================================ */

.glass-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(5, 5, 6, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-default);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--foreground);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.nav-brand img {
    height: 28px;
    width: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--foreground-muted);
    text-decoration: none;
    transition: all 0.2s var(--ease-expo-out);
}

.nav-link:hover {
    color: var(--foreground);
    background: rgba(255,255,255,0.04);
}

.nav-link.active {
    color: var(--foreground);
    background: rgba(255,255,255,0.06);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-user-info {
    font-size: 0.875rem;
    color: var(--foreground-muted);
}

/* 移动端菜单按钮 */
.nav-menu-toggle {
    display: none;
    padding: 8px;
    background: none;
    border: none;
    color: var(--foreground-muted);
    cursor: pointer;
    border-radius: 8px;
}

.nav-menu-toggle:hover {
    background: rgba(255,255,255,0.05);
    color: var(--foreground);
}

@media (max-width: 767px) {
    .nav-links-desktop {
        display: none;
    }
    .nav-menu-toggle {
        display: flex;
    }
    .nav-user-desktop {
        display: none;
    }
}

/* 移动端下拉菜单 */
.mobile-menu {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(5, 5, 6, 0.95);
    backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border-default);
    padding: 16px;
    flex-direction: column;
    gap: 4px;
}

.mobile-menu.open {
    display: flex;
    z-index: 60;
}

.mobile-menu .nav-link {
    padding: 12px 16px;
    font-size: 1rem;
}

/* ============================================================
   5. 模态框
   ============================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: rgba(2, 2, 3, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s var(--ease-expo-out);
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    background: linear-gradient(180deg, #0f0f12 0%, #0a0a0c 100%);
    border: 1px solid var(--border-default);
    border-radius: 20px;
    padding: 32px;
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.06),
        0 24px 80px rgba(0,0,0,0.6);
    transform: scale(0.96) translateY(10px);
    transition: transform 0.3s var(--ease-expo-out);
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h3 {
    color: var(--foreground);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    color: var(--foreground-muted);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
    padding: 0;
}

.modal-close:hover {
    background: rgba(255,255,255,0.08);
    color: var(--foreground);
    border-color: var(--border-hover);
}

/* ============================================================
   6. Flash 消息
   ============================================================ */

.flash-messages {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.flash {
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 500;
    border: 1px solid;
    animation: fade-up 0.4s var(--ease-expo-out);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.flash-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.6;
    padding: 0 2px;
    transition: opacity 0.2s ease;
}

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

.flash.success {
    background: rgba(46, 204, 113, 0.08);
    color: #4ade80;
    border-color: rgba(46, 204, 113, 0.15);
}

.flash.error {
    background: rgba(231, 76, 60, 0.08);
    color: #ff6b5b;
    border-color: rgba(231, 76, 60, 0.15);
}

.flash.warning {
    background: rgba(243, 156, 18, 0.08);
    color: #fbbf24;
    border-color: rgba(243, 156, 18, 0.15);
}

/* ============================================================
   7. 标签 / Badge
   ============================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.4;
}

.badge-accent {
    background: rgba(94, 106, 210, 0.12);
    color: #a5b4fc;
    border: 1px solid rgba(94, 106, 210, 0.2);
    box-shadow: 0 0 8px rgba(94, 106, 210, 0.1);
}

.badge-muted {
    background: rgba(255, 255, 255, 0.04);
    color: var(--foreground-muted);
    border: 1px solid var(--border-default);
}

.badge-priority-high {
    background: rgba(231, 76, 60, 0.1);
    color: #ff6b5b;
    border: 1px solid rgba(231, 76, 60, 0.15);
}

.badge-priority-medium {
    background: rgba(243, 156, 18, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(243, 156, 18, 0.15);
}

.badge-priority-low {
    background: rgba(46, 204, 113, 0.1);
    color: #4ade80;
    border: 1px solid rgba(46, 204, 113, 0.15);
}

/* ============================================================
   8. 分割线 / 装饰
   ============================================================ */

.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    border: none;
    margin: 0;
}

.gradient-line {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

/* ============================================================
   9. 容器 / 布局
   ============================================================ */

.container-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

@media (min-width: 768px) {
    .container-main {
        padding: 0 32px;
    }
}

@media (min-width: 1024px) {
    .container-main {
        padding: 0 40px;
    }
}

/* ============================================================
   10. 排版工具
   ============================================================ */

.text-gradient {
    background: linear-gradient(180deg, #ffffff 0%, rgba(255,255,255,0.7) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-gradient-accent {
    display: inline-block;
    background: linear-gradient(90deg, #5E6AD2, #a5b4fc, #5E6AD2);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 4s linear infinite;
}

.text-muted { color: var(--foreground-muted); }
.text-subtle { color: var(--foreground-subtle); }
.text-accent { color: var(--accent); }


/* ============================================================
   11. 筛选标签 (Filter Pill)
   ============================================================ */

.filter-pill {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-default);
    background: rgba(255,255,255,0.03);
    color: var(--foreground-muted);
    font-size: 0.82rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s var(--ease-expo-out);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.filter-pill:hover {
    background: rgba(255,255,255,0.06);
    color: var(--foreground);
    border-color: var(--border-hover);
}

.filter-pill.active {
    background: rgba(94,106,210,0.15);
    color: #a5b4fc;
    border-color: rgba(94,106,210,0.3);
}

/* ============================================================
   12. 任务操作图标
   ============================================================ */

.task-action-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: none;
    border: none;
    color: var(--foreground-muted);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s ease;
    padding: 0;
    text-decoration: none;
}

.task-action-icon:hover {
    background: rgba(255,255,255,0.06);
    color: var(--foreground);
}

.task-action-icon.complete:hover {
    background: rgba(46,204,113,0.12);
    color: #4ade80;
}

.task-action-icon.delete:hover {
    background: rgba(231,76,60,0.12);
    color: #ff6b5b;
}

/* ============================================================
   13. 宽度工具
   ============================================================ */

.w-full { width: 100%; }


/* ============================================================
   14. 头像悬浮窗
   ============================================================ */

.nav-avatar-wrap {
    position: relative;
    padding-bottom: 10px;
    margin-bottom: -10px;
}

.nav-avatar-img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s var(--ease-expo-out), box-shadow 0.2s ease;
    filter: none;
}

.nav-avatar-wrap:hover .nav-avatar-img {
    transform: scale(1.1);
    box-shadow: 0 0 0 2px rgba(94,106,210,0.5);
}

.nav-avatar-wrap::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 10px;
    z-index: 199;
}

.nav-avatar-popup {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    display: none;
    z-index: 200;
    pointer-events: none;
    white-space: nowrap;
    background: linear-gradient(180deg, #0f0f12 0%, #0a0a0c 100%);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    padding: 14px 18px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.06);
    cursor: pointer;
}

.nav-avatar-wrap:hover .nav-avatar-popup {
    display: block !important;
    pointer-events: auto;
    cursor: pointer;
}

.nav-avatar-wrap:hover .nav-avatar-popup * {
    cursor: pointer;
}

/* Arrow */
.nav-avatar-popup::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background: #0f0f12;
    border-left: 1px solid var(--border-default);
    border-top: 1px solid var(--border-default);
}

.nav-avatar-popup-name {
    font-weight: 600;
    color: var(--foreground);
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.nav-avatar-popup-role {
    color: var(--foreground-muted);
    font-size: 0.78rem;
    margin-bottom: 6px;
}

.nav-avatar-popup-hint {
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 500;
}

/* ============================================================
   15. 音乐播放器
   ============================================================ */

.ambient-player {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 100;
    background: linear-gradient(180deg, rgba(15,15,20,0.95) 0%, rgba(10,10,12,0.98) 100%);
    border: 1px solid var(--border-default);
    border-radius: 16px;
    padding: 12px 14px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04);
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 160px;
    transition: all 0.3s var(--ease-expo-out);
}

.ambient-player:hover {
    border-color: var(--border-hover);
    box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 0 1px rgba(94,106,210,0.15), 0 0 30px rgba(94,106,210,0.08);
}

.ambient-player.playing {
    border-color: rgba(94,106,210,0.25);
    box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 0 1px rgba(94,106,210,0.2), 0 0 40px rgba(94,106,210,0.1);
}

.player-visualizer {
    width: 100%;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0,0,0,0.2);
}

.player-visualizer canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.player-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: none;
    background: rgba(255,255,255,0.06);
    color: var(--foreground);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.player-btn:hover {
    background: rgba(94,106,210,0.2);
    color: var(--accent-bright);
    transform: scale(1.08);
}

.player-btn:active {
    transform: scale(0.95);
}

#player-volume {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

#player-volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px rgba(94,106,210,0.4);
    cursor: pointer;
}

#player-volume::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    box-shadow: 0 0 8px rgba(94,106,210,0.4);
    cursor: pointer;
}

.player-status {
    font-size: 0.65rem;
    color: var(--foreground-muted);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 768px) {
    .ambient-player {
        bottom: 16px;
        left: 16px;
        width: 140px;
        padding: 10px 12px;
    }
}

/* ============================================================
   16. 故障文字
   ============================================================ */

.glitch-text {
    position: relative;
    display: inline-block;
}

/* ============================================================
   17. 霓虹文字
   ============================================================ */

.neon-text {
    animation: neon-pulse 3s ease-in-out infinite;
}

/* ============================================================
   18. 3D Tilt 增强
   ============================================================ */

.tilt-card {
    transform-style: preserve-3d;
    transition: transform 0.5s var(--ease-expo-out);
}

/* ============================================================
   19. 粒子画布
   ============================================================ */

#starfield-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}


/* ============================================================
   20. 流光边框效果 (Shimmer Border)
   ============================================================ */

.shimmer-border {
    position: relative;
    overflow: hidden;
}

.shimmer-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), #a5b4fc, transparent);
    background-size: 300% 100%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: shimmer-border-rotate 3s linear infinite;
    animation-play-state: paused;
}

.shimmer-border:hover::before {
    opacity: 1;
    animation-play-state: running;
}

@keyframes shimmer-border-rotate {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

/* 卡片流光扫过效果 */
.card-sweep {
    position: relative;
    overflow: hidden;
}

.card-sweep::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
    transform: skewX(-20deg);
    transition: left 0.6s ease;
    pointer-events: none;
}

.card-sweep:hover::after {
    left: 150%;
    transition: left 0.8s ease;
}

/* ============================================================
   21. 扫描线效果 (Scanline)
   ============================================================ */

.scanline-overlay {
    position: fixed;
    inset: 0;
    z-index: 9997;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,0,0,0.03) 2px,
        rgba(0,0,0,0.03) 4px
    );
    opacity: 0.3;
}


/* ============================================================
   22. 暗角效果
   ============================================================ */

.vignette-overlay {
    position: fixed;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.4) 100%);
    opacity: 0.6;
}

/* ============================================================
   23. 文字悬停解码效果
   ============================================================ */

.decode-hover {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

/* ============================================================
   24. 波浪装饰
   ============================================================ */

.wave-footer {
    position: relative;
    overflow: hidden;
}

.wave-footer::before {
    content: '';
    position: absolute;
    top: -40px;
    left: 0;
    right: 0;
    height: 40px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 40'%3E%3Cpath fill='rgba(5,5,6,0.8)' d='M0,20 C240,40 480,0 720,20 C960,40 1200,0 1440,20 L1440,40 L0,40 Z'/%3E%3C/svg%3E");
    background-size: 1440px 40px;
    animation: wave-scroll 20s linear infinite;
}

@keyframes wave-scroll {
    0% { background-position-x: 0; }
    100% { background-position-x: 1440px; }
}

/* ============================================================
   25. 导航链接下划线动画
   ============================================================ */

.nav-link-animated {
    position: relative;
}

.nav-link-animated::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), #a5b4fc);
    border-radius: 1px;
    transition: all 0.3s var(--ease-expo-out);
    transform: translateX(-50%);
    box-shadow: 0 0 6px var(--accent-glow);
}

.nav-link-animated:hover::after,
.nav-link-animated.active::after {
    width: 60%;
}


/* ============================================================
   Lightbox
   ============================================================ */

#lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}

#lightbox-overlay.active {
    opacity: 1;
}

#lightbox-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
    transform: scale(0.92);
    transition: transform 0.35s var(--ease-expo-out);
}

#lightbox-overlay.active img {
    transform: scale(1);
}
