/* ============================================
   创动算元科技 - 公共样式文件 (TRAE Work Light Theme)
   Shenzhen Chuangdong SuanYuan Technology Co., Ltd.
   ============================================ */

/* --- TRAE Work Design Tokens (Light Theme, Purple Brand) --- */
:root {
    /* Background */
    --bg-base-default: #ffffff;
    --bg-base-secondary: #f5f5f5;
    --bg-base-tertiary: #e5e5e5;
    --bg-overlay-l1: rgba(115, 115, 115, 0.08);
    --bg-overlay-l2: rgba(115, 115, 115, 0.12);
    --bg-overlay-l3: rgba(115, 115, 115, 0.16);
    --bg-overlay-l4: rgba(115, 115, 115, 0.2);
    --bg-white: #ffffff;
    --bg-menu: #ffffff;
    --bg-brand: #4b3fe3;
    --bg-brand-hover: #6a6fff;
    --bg-brand-active: #3f31c6;
    --bg-brand-popup: rgba(170, 183, 255, 0.36);
    --bg-invert: #262626;
    --bg-invert-hover: #404040;

    /* Text */
    --text-default: #171717;
    --text-secondary: #404040;
    --text-tertiary: #737373;
    --text-disabled: #a1a1a1;
    --text-onbrand: #ffffff;
    --text-brand: #4b3fe3;
    --text-brand-hover: #6a6fff;

    /* Border */
    --border-neutral-l1: rgba(115, 115, 115, 0.12);
    --border-neutral-l2: rgba(115, 115, 115, 0.18);
    --border-neutral-l3: rgba(115, 115, 115, 0.36);
    --border-brand: #4b3fe3;

    /* Radii */
    --radius-2: 2px;
    --radius-4: 4px;
    --radius-6: 6px;
    --radius-8: 8px;
    --radius-10: 10px;
    --radius-12: 12px;
    --radius-full: 9999px;

    /* Spacing */
    --spacer-4: 4px;
    --spacer-6: 6px;
    --spacer-8: 8px;
    --spacer-12: 12px;
    --spacer-16: 16px;
    --spacer-24: 24px;
    --spacer-32: 32px;
    --spacer-40: 40px;

    /* Status */
    --status-primary-default: #2f74ff;
    --status-success-default: #15a877;
    --status-warning-default: #e27900;
    --status-error-default: #e8463a;

    /* Transition */
    --transition-fast: 0.12s ease;
    --transition-normal: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- 基础重置 --- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: "SF Pro Text", "PingFang SC", "Noto Sans SC", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-base-default);
    color: var(--text-default);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.6;
    overflow-x: hidden;
}

.font-serif {
    font-family: "Noto Serif SC", Georgia, serif;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- 导航栏 (Light Theme with blur) --- */
.nav-main {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-neutral-l1);
    transition: all var(--transition-normal);
}

.nav-main.scrolled {
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
    transition: color var(--transition-fast);
    position: relative;
    padding: var(--spacer-4) 0;
    text-decoration: none;
}

.nav-link:hover {
    color: var(--text-default);
}

.nav-link.active {
    color: var(--text-brand);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--bg-brand);
    border-radius: var(--radius-2);
    transition: width var(--transition-normal);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* --- 按钮系统 (TRAE Work Light Theme) --- */
.btn-primary {
    background: #ffffff;
    color: #171717;
    padding: 6px 16px;
    height: 32px;
    line-height: 20px;
    border-radius: var(--radius-6);
    font-weight: 500;
    font-size: 13px;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacer-8);
    border: 1px solid var(--border-neutral-l2);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary:hover {
    background: var(--bg-overlay-l2);
}

.btn-brand {
    background: var(--bg-brand);
    color: var(--text-onbrand);
    padding: 6px 16px;
    height: 32px;
    line-height: 20px;
    border-radius: var(--radius-6);
    font-weight: 500;
    font-size: 13px;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacer-8);
    border: none;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.btn-brand:hover {
    background: var(--bg-brand-hover);
}

.btn-brand:active {
    background: var(--bg-brand-active);
}

.btn-secondary {
    background: transparent;
    color: var(--text-default);
    border: 1px solid var(--border-neutral-l2);
    padding: 6px 16px;
    height: 32px;
    line-height: 20px;
    border-radius: var(--radius-6);
    font-weight: 500;
    font-size: 13px;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacer-8);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.btn-secondary:hover {
    background: var(--bg-overlay-l1);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: 6px 16px;
    height: 32px;
    line-height: 20px;
    border-radius: var(--radius-6);
    font-weight: 500;
    font-size: 13px;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacer-8);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.btn-ghost:hover {
    background: var(--bg-overlay-l1);
    color: var(--text-default);
}

/* --- 卡片系统 (TRAE: white bg, no shadow) --- */
.card {
    background: #ffffff;
    border-radius: var(--radius-8);
    overflow: hidden;
    transition: all var(--transition-normal);
    border: 1px solid var(--border-neutral-l1);
}

.card:hover {
    border-color: var(--border-neutral-l2);
}

/* --- 渐变文字 (Purple brand gradient) --- */
.gradient-text {
    background: linear-gradient(135deg, var(--bg-brand), var(--bg-brand-hover), #aab7ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-text-warm {
    background: linear-gradient(135deg, var(--status-warning-default), #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- 滚动动画 --- */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
    transition: all var(--transition-slow);
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-30px);
}

.fade-in-left.visible {
    opacity: 1;
    transform: translateX(0);
    transition: all var(--transition-slow);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(30px);
}

.fade-in-right.visible {
    opacity: 1;
    transform: translateX(0);
    transition: all var(--transition-slow);
}

.scale-in {
    opacity: 0;
    transform: scale(0.95);
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
    transition: all var(--transition-slow);
}

.stagger-delay-1 { transition-delay: 0.1s; }
.stagger-delay-2 { transition-delay: 0.2s; }
.stagger-delay-3 { transition-delay: 0.3s; }
.stagger-delay-4 { transition-delay: 0.4s; }
.stagger-delay-5 { transition-delay: 0.5s; }

/* --- 页面头部横幅 (Light bg with subtle purple gradient overlay) --- */
.page-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-neutral-l1);
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 600px 300px at 30% 100%, rgba(75, 63, 227, 0.04), transparent),
        radial-gradient(ellipse 400px 400px at 80% 100%, rgba(106, 111, 255, 0.03), transparent);
    pointer-events: none;
}

/* --- 特色图标容器 (Purple brand) --- */
.feature-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-brand-popup);
    border: 1px solid rgba(75, 63, 227, 0.2);
    border-radius: var(--radius-6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-brand);
    font-size: 20px;
    margin-bottom: var(--spacer-16);
    transition: all var(--transition-fast);
}

.feature-icon:hover {
    background: rgba(170, 183, 255, 0.48);
}

/* --- 页脚 (与首屏深紫科技背景呼应) --- */
.footer {
    background:
        radial-gradient(ellipse 720px 320px at 50% 0%, rgba(124, 58, 237, 0.18), transparent 70%),
        linear-gradient(135deg, #3b2566 0%, #4a2d80 48%, #5a3798 100%);
    color: #ffffff !important;
    padding: 48px 0 24px;
    position: relative;
    border-top: 1px solid rgba(168, 85, 247, 0.30);
}

.footer p,
.footer li,
.footer h3,
.footer span {
    color: #ffffff !important;
}

.footer a {
    color: #ffffff !important;
    transition: color var(--transition-fast);
    text-decoration: none;
}

.footer a:hover {
    color: #c4b5fd !important;
}

/* --- 新闻条目 --- */
.news-item {
    border-left: 3px solid var(--bg-brand);
    padding-left: var(--spacer-16);
    margin-bottom: var(--spacer-24);
    transition: border-color var(--transition-fast);
}

.news-item:hover {
    border-left-color: var(--status-primary-default);
}

.news-date {
    color: var(--text-brand);
    font-size: 12px;
    font-weight: 500;
}

/* --- 阴影文字 (for dark hero overlays) --- */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.text-shadow-lg {
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
}

/* --- 分隔线装饰 --- */
.section-divider {
    height: 1px;
    background: var(--border-neutral-l2);
    margin: 0 auto;
    max-width: 200px;
}

/* --- 数字统计展示 --- */
.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--bg-brand);
}

/* --- 输入框 (Light theme) --- */
input, textarea, select {
    background: #ffffff;
    border: 1px solid var(--border-neutral-l1);
    color: var(--text-default);
    border-radius: var(--radius-6);
    padding: var(--spacer-8) var(--spacer-12);
    font-size: 14px;
    transition: border-color var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--bg-brand);
    box-shadow: 0 0 0 2px var(--bg-brand-popup);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-tertiary);
}

/* --- 响应式 --- */
@media (max-width: 768px) {
    .btn-primary,
    .btn-brand,
    .btn-secondary,
    .btn-ghost {
        height: 32px;
        font-size: 13px;
        padding: 6px 14px;
    }
}

@media (max-width: 640px) {
    .hero-content h1 {
        font-size: 2rem !important;
        line-height: 2.5rem !important;
    }

    .hero-content p {
        font-size: 1rem !important;
    }
}

/* --- 滚动条 (Light theme) --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #ffffff;
}

::-webkit-scrollbar-thumb {
    background: #d4d4d4;
    border-radius: var(--radius-4);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* --- 选中文字颜色 (Purple brand tint) --- */
::selection {
    background: var(--bg-brand-popup);
    color: var(--text-brand);
}
