/*
 * 智能思考工具箱 - 个人站长主页样式
 * 现代化深色主题，渐变色彩，响应式设计
 */

/* CSS变量定义 */
:root {
    /* 主色调 */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent-gradient: linear-gradient(135deg, #00D4FF 0%, #7B2FF7 100%);

    /* 背景色 */
    --bg-primary: #0a0e27;
    --bg-secondary: #151935;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --bg-overlay: rgba(0, 0, 0, 0.6);

    /* 文字颜色 */
    --text-primary: #ffffff;
    --text-secondary: #b8bcc8;
    --text-muted: #6b7280;
    --text-dimmed: #4a5568;

    /* 边框和阴影 */
    --border-color: rgba(255, 255, 255, 0.1);
    --border-color-hover: rgba(102, 126, 234, 0.3);
    --shadow-color: rgba(0, 0, 0, 0.3);
    --shadow-glow: rgba(102, 126, 234, 0.2);
    --glow-color: rgba(102, 126, 234, 0.3);

    /* 间距系统 */
    --spacing-xs: 0.5rem;    /* 8px */
    --spacing-sm: 1rem;      /* 16px */
    --spacing-md: 2rem;      /* 32px */
    --spacing-lg: 3rem;      /* 48px */
    --spacing-xl: 4rem;      /* 64px */
    --spacing-2xl: 6rem;     /* 96px */

    /* 圆角系统 */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-2xl: 32px;

    /* 字体系统 */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'Fira Code', 'Monaco', 'Consolas', monospace;

    /* 字体大小 */
    --text-xs: 0.75rem;      /* 12px */
    --text-sm: 0.875rem;     /* 14px */
    --text-base: 1rem;       /* 16px */
    --text-lg: 1.125rem;     /* 18px */
    --text-xl: 1.25rem;      /* 20px */
    --text-2xl: 1.5rem;      /* 24px */
    --text-3xl: 1.875rem;    /* 30px */
    --text-4xl: 2.25rem;     /* 36px */
    --text-5xl: 3rem;        /* 48px */
    --text-6xl: 3.75rem;     /* 60px */

    /* 动画时长 */
    --duration-fast: 0.15s;
    --duration-normal: 0.3s;
    --duration-slow: 0.6s;

    /* 断点 */
    --breakpoint-sm: 640px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 1024px;
    --breakpoint-xl: 1280px;
}

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基础样式 */
html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* 背景渐变效果 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(245, 87, 108, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(240, 147, 251, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

/* 主容器 */
.app-container {
    position: relative;
    z-index: 2;
}

/* 顶部导航 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 14, 39, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    transition: background var(--duration-normal) ease;
    padding: var(--spacing-sm) 0;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    text-decoration: none;
    color: var(--text-primary);
    transition: transform var(--duration-normal) ease;
}

.logo:hover {
    transform: scale(1.02);
}

.logo-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.logo-text {
    font-size: var(--text-xl);
    font-weight: 600;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    gap: var(--spacing-md);
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: var(--text-sm);
    transition: color var(--duration-normal) ease;
    position: relative;
    padding: var(--spacing-xs) 0;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link.active {
    color: var(--text-primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-gradient);
    transition: width var(--duration-normal) ease;
}

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

/* 英雄区域 */
.hero {
    padding: calc(100px + var(--spacing-xl)) 0 var(--spacing-xl);
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 400px;
    background: radial-gradient(ellipse at center top, rgba(102, 126, 234, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
    align-items: center;
    position: relative;
    z-index: 2;
}

.hero-text {
    z-index: 3;
}

.hero-title {
    font-size: var(--text-6xl);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: var(--spacing-md);
    letter-spacing: -0.02em;
}

.gradient-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
    margin-bottom: var(--spacing-sm);
}

.hero-subtitle {
    display: block;
    font-size: var(--text-2xl);
    color: var(--text-secondary);
    font-weight: 400;
    line-height: 1.4;
}

.hero-description {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    margin: var(--spacing-lg) 0;
    max-width: 600px;
    line-height: 1.7;
}

.hero-stats {
    display: flex;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.stat {
    text-align: center;
    padding: var(--spacing-md);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all var(--duration-normal) ease;
}

.stat:hover {
    transform: translateY(-2px);
    border-color: var(--border-color-hover);
    box-shadow: 0 10px 30px var(--shadow-glow);
}

.stat-number {
    display: block;
    font-size: var(--text-3xl);
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-xs);
}

.stat-label {
    color: var(--text-muted);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

/* 英雄视觉区域 */
.hero-visual {
    position: relative;
    height: 400px;
    z-index: 1;
}

.floating-cards {
    position: relative;
    width: 100%;
    height: 100%;
}

.floating-card {
    position: absolute;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px var(--shadow-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--duration-normal) ease;
    animation: float 6s ease-in-out infinite;
}

.floating-card:hover {
    transform: translateY(-10px) scale(1.05);
    border-color: var(--border-color-hover);
    box-shadow: 0 20px 40px var(--shadow-glow);
}

.floating-card.card-1 {
    top: 20%;
    left: 20%;
    width: 120px;
    height: 120px;
    animation-delay: 0s;
}

.floating-card.card-2 {
    top: 60%;
    left: 10%;
    width: 100px;
    height: 100px;
    animation-delay: 1s;
}

.floating-card.card-3 {
    top: 30%;
    right: 20%;
    width: 110px;
    height: 110px;
    animation-delay: 2s;
}

.floating-card.card-4 {
    top: 70%;
    right: 10%;
    width: 90px;
    height: 90px;
    animation-delay: 3s;
}

.card-icon {
    font-size: var(--text-3xl);
    line-height: 1;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        box-shadow: 0 8px 32px var(--shadow-color);
    }
    50% {
        transform: translateY(-20px) rotate(2deg);
        box-shadow: 0 15px 40px var(--shadow-glow);
    }
}

/* 工具分类区域 */
.tools-section {
    padding: var(--spacing-xl) 0;
    position: relative;
}

.category-section {
    margin-bottom: var(--spacing-2xl);
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
    position: relative;
}

.section-title {
    font-size: var(--text-4xl);
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    color: var(--text-primary);
}

.title-icon {
    font-size: var(--text-3xl);
    line-height: 1;
}

.section-description {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--spacing-lg);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* 工具卡片 */
.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all var(--duration-normal) ease;
    position: relative;
    overflow: hidden;
    animation: fadeInUp var(--duration-slow) ease-out forwards;
    opacity: 0;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transition: transform var(--duration-normal) ease;
}

.tool-card:hover {
    transform: translateY(-8px);
    border-color: var(--border-color-hover);
    box-shadow: 0 20px 40px var(--shadow-glow);
}

.tool-card:hover::before {
    transform: scaleX(1);
}

.tool-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
}

.tool-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.tool-icon svg {
    width: 24px;
    height: 24px;
}

.tool-title {
    font-size: var(--text-xl);
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
}

.tool-badge {
    background: var(--secondary-gradient);
    color: white;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-xs);
    font-size: var(--text-xs);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

.tool-description {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    line-height: 1.7;
    font-size: var(--text-base);
}

.tool-features {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
}

.feature-tag {
    background: rgba(102, 126, 234, 0.1);
    color: var(--text-primary);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-xs);
    font-size: var(--text-xs);
    border: 1px solid rgba(102, 126, 234, 0.2);
    transition: all var(--duration-normal) ease;
}

.feature-tag:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: var(--border-color-hover);
}

.tool-link {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--duration-normal) ease;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-card-hover);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.tool-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--primary-gradient);
    transition: left var(--duration-normal) ease;
    z-index: -1;
}

.tool-link:hover {
    transform: translateX(4px);
    color: white;
    border-color: transparent;
}

.tool-link:hover::before {
    left: 0;
}

.link-arrow {
    width: 16px;
    height: 16px;
    transition: transform var(--duration-normal) ease;
}

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

/* 页脚 */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: var(--spacing-2xl) 0 var(--spacing-md);
    margin-top: var(--spacing-2xl);
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.footer-section h4 {
    font-size: var(--text-lg);
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.footer-section p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--spacing-sm);
}

.footer-section a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--duration-normal) ease;
}

.footer-section a:hover {
    color: var(--text-primary);
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

.tech-tag {
    background: rgba(102, 126, 234, 0.1);
    color: var(--text-primary);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-xs);
    font-size: var(--text-xs);
    border: 1px solid rgba(102, 126, 234, 0.2);
    transition: all var(--duration-normal) ease;
}

.tech-tag:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: var(--border-color-hover);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
    max-width: 1200px;
    margin: 0 auto;
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: var(--text-sm);
}

/* 动画延迟 */
.tool-card:nth-child(1) { animation-delay: 0.1s; }
.tool-card:nth-child(2) { animation-delay: 0.2s; }
.tool-card:nth-child(3) { animation-delay: 0.3s; }
.tool-card:nth-child(4) { animation-delay: 0.4s; }
.tool-card:nth-child(5) { animation-delay: 0.5s; }
.tool-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr 0.8fr;
        gap: var(--spacing-lg);
    }

    .hero-title {
        font-size: var(--text-5xl);
    }

    .tools-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        gap: var(--spacing-md);
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: var(--spacing-md);
    }

    .nav-menu {
        flex-direction: column;
        gap: var(--spacing-sm);
        align-items: center;
    }

    .hero-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
        text-align: center;
        padding: 0 var(--spacing-sm);
    }

    .hero-title {
        font-size: var(--text-4xl);
    }

    .hero-subtitle {
        font-size: var(--text-xl);
    }

    .hero-description {
        font-size: var(--text-base);
        max-width: 500px;
    }

    .hero-stats {
        justify-content: center;
        flex-wrap: wrap;
        gap: var(--spacing-md);
    }

    .stat {
        min-width: 120px;
    }

    .hero-visual {
        height: 300px;
        order: -1;
    }

    .floating-cards {
        height: 100%;
    }

    .floating-card {
        padding: var(--spacing-sm);
        font-size: var(--text-sm);
    }

    .floating-card.card-1,
    .floating-card.card-3 {
        width: 100px;
        height: 100px;
    }

    .floating-card.card-2,
    .floating-card.card-4 {
        width: 80px;
        height: 80px;
    }

    .section-title {
        font-size: var(--text-3xl);
        flex-direction: column;
        gap: var(--spacing-xs);
    }

    .section-description {
        font-size: var(--text-base);
        padding: 0 var(--spacing-sm);
    }

    .tools-grid {
        grid-template-columns: 1fr;
        padding: 0 var(--spacing-sm);
    }

    .tool-card {
        padding: var(--spacing-md);
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
}

@media (max-width: 480px) {
    .hero {
        padding: calc(80px + var(--spacing-lg)) 0 var(--spacing-lg);
    }

    .hero-title {
        font-size: var(--text-3xl);
    }

    .hero-subtitle {
        font-size: var(--text-lg);
    }

    .section-title {
        font-size: var(--text-2xl);
    }

    .section-description {
        font-size: var(--text-sm);
    }

    .tool-card {
        padding: var(--spacing-sm);
    }

    .tool-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }

    .tool-title {
        font-size: var(--text-lg);
    }

    .hero-stats {
        gap: var(--spacing-sm);
    }

    .stat {
        padding: var(--spacing-sm);
        min-width: 100px;
    }

    .floating-card {
        width: 70px !important;
        height: 70px !important;
        font-size: var(--text-xs);
        padding: var(--spacing-xs);
    }

    .card-icon {
        font-size: var(--text-2xl);
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    :root {
        --text-secondary: #ffffff;
        --text-muted: #cccccc;
        --border-color: rgba(255, 255, 255, 0.3);
        --bg-card: rgba(255, 255, 255, 0.1);
    }
}

/* 暗色模式偏好 */
@media (prefers-color-scheme: dark) {
    /* 当前已经是暗色主题，无需更改 */
}

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

    .floating-card {
        animation: none !important;
    }

    .tool-card {
        animation: none !important;
        opacity: 1 !important;
    }
}

/* 打印样式 */
@media print {
    .header,
    .hero-visual,
    .floating-cards,
    .footer {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
        font-size: 12pt !important;
    }

    .hero-content {
        grid-template-columns: 1fr !important;
        text-align: center !important;
    }

    .tool-card {
        background: white !important;
        border: 1px solid black !important;
        color: black !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .tool-link {
        display: none !important;
    }
}

/* 无障碍改进 */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 焦点样式 */
.tool-link:focus,
.nav-link:focus {
    outline: 2px solid var(--glow-color);
    outline-offset: 2px;
}

/* 选择文本样式 */
::selection {
    background: rgba(102, 126, 234, 0.3);
    color: white;
}

::-moz-selection {
    background: rgba(102, 126, 234, 0.3);
    color: white;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-color-hover);
}

/* 深色模式兼容 */
@media (prefers-color-scheme: dark) {
    /* 优化暗色主题对比度 */
    :root {
        --text-secondary: #d1d5db;
        --text-muted: #9ca3af;
    }
}

/* 性能优化 */
.tool-card,
.floating-card {
    will-change: transform;
    backface-visibility: hidden;
    perspective: 1000px;
}

/* 加载状态 */
.loading {
    pointer-events: none;
    opacity: 0.6;
}

/* 错误状态 */
.error {
    border-color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.1) !important;
}

/* 成功状态 */
.success {
    border-color: #10b981 !important;
    background: rgba(16, 185, 129, 0.1) !important;
}

/* 警告状态 */
.warning {
    border-color: #f59e0b !important;
    background: rgba(245, 158, 11, 0.1) !important;
}