/* header.css - 现代化头部样式 */

/* 主题切换按钮 */
.theme-switch {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.theme-switch:hover {
    transform: rotate(15deg) scale(1.1);
    box-shadow: var(--shadow-md);
}

.theme-switch i {
    font-size: 1.5rem;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.theme-switch:active {
    transform: scale(0.95);
}

/* 导航栏 */
.navbar {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 999;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: rgba(var(--bg-card-rgb, 255, 255, 255), 0.9);
    box-shadow: var(--shadow-sm);
}

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

/* 品牌标志 */
.nav-brand .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.nav-brand .logo:hover {
    transform: translateY(-2px);
}

.nav-brand .logo i {
    color: var(--primary-color);
    font-size: 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-brand .logo span {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 导航菜单 */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    position: relative;
}

.nav-link i {
    font-size: 1.1rem;
}

.nav-link:hover {
    color: var(--primary-color);
    background: color-mix(in srgb, var(--primary-color) 10%, transparent);
    transform: translateY(-2px);
}

.nav-link.active {
    color: var(--primary-color);
    background: color-mix(in srgb, var(--primary-color) 15%, transparent);
    font-weight: 600;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 15px;
    right: 15px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.nav-link.donate {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    font-weight: 600;
}

.nav-link.donate:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 107, 107, 0.3);
}

/* 移动端菜单切换按钮 */
.nav-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.nav-toggle:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.nav-toggle i {
    font-size: 1.2rem;
}

/* 英雄区域 */
.hero {
    position: relative;
    padding: 100px 0 150px;
    background: linear-gradient(135deg, 
        var(--bg-primary) 0%, 
        color-mix(in srgb, var(--bg-primary) 95%, var(--primary-color)) 100%
    );
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(67, 97, 238, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(58, 12, 163, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero .container {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 英雄内容 */
.hero-content {
    animation: slideInLeft 0.8s ease-out;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    line-height: 1.6;
    max-width: 600px;
}

/* 统计卡片 */
.hero-stats {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    min-width: 200px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.stat-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card div {
    flex: 1;
}

.stat-card h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1;
}

.stat-card span {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 搜索区域 */
.search-container {
    max-width: 600px;
    animation: slideInUp 0.8s ease-out 0.2s both;
}

.search-wrapper {
    position: relative;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 5px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.search-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color) 30%, transparent);
    transform: translateY(-2px);
}

.search-wrapper i {
    position: absolute;
    left: 20px;
    color: var(--text-secondary);
    font-size: 1.2rem;
    z-index: 1;
}

.search-input {
    flex: 1;
    padding: 18px 20px 18px 55px;
    border: none;
    background: transparent;
    font-size: 1.1rem;
    color: var(--text-primary);
    outline: none;
    border-radius: var(--radius-md);
}

.search-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.search-btn {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-left: 10px;
}

.search-btn:hover {
    transform: scale(1.05) rotate(5deg);
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.3);
}

.search-btn i {
    position: static;
    font-size: 1.2rem;
}

.search-tags {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.search-tags span {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.search-tags a {
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.search-tags a:hover {
    background: color-mix(in srgb, var(--primary-color) 10%, transparent);
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* 英雄图形区域 */
.hero-graphic {
    animation: slideInRight 0.8s ease-out;
    display: flex;
    justify-content: center;
    align-items: center;
}

.graphic-container {
    position: relative;
    width: 400px;
    height: 400px;
}

.api-node {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.8rem;
    box-shadow: 
        0 10px 30px rgba(67, 97, 238, 0.3),
        inset 0 2px 10px rgba(255, 255, 255, 0.2);
    animation: float 6s ease-in-out infinite;
}

.api-node:nth-child(1) {
    top: 20%;
    left: 20%;
    animation-delay: 0s;
}

.api-node:nth-child(2) {
    top: 60%;
    left: 30%;
    animation-delay: 1s;
}

.api-node:nth-child(3) {
    top: 40%;
    left: 60%;
    animation-delay: 2s;
}

.api-connection {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    border: 2px dashed color-mix(in srgb, var(--primary-color) 30%, transparent);
    border-radius: 50%;
    animation: rotate 20s linear infinite;
}

.api-connection::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 60%;
    border: 2px dashed color-mix(in srgb, var(--secondary-color) 30%, transparent);
    border-radius: 50%;
    animation: rotateReverse 15s linear infinite;
}

/* 安全横幅 */
.security-banner {
    background: linear-gradient(135deg, #016eff, #3a0ca3);
    color: white;
    padding: 15px 25px;
    border-radius: var(--radius-lg);
    margin: 30px auto;
    max-width: 1200px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    animation: slideInDown 0.5s ease-out;
    box-shadow: 0 10px 30px rgba(1, 110, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.security-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 70%
    );
    animation: shine 3s infinite;
}

.security-banner i {
    font-size: 1.5rem;
    animation: pulse 2s infinite;
}

.security-banner span {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* 动画定义 */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes rotate {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes rotateReverse {
    from {
        transform: translate(-50%, -50%) rotate(360deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(0deg);
    }
}

@keyframes shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

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

/* 响应式设计 */
@media (max-width: 1200px) {
    .hero .container {
        gap: 40px;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .graphic-container {
        width: 350px;
        height: 350px;
    }
}

@media (max-width: 992px) {
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-graphic {
        order: -1;
        margin-bottom: 40px;
    }
    
    .hero-stats {
        justify-content: center;
    }
    
    .search-container {
        margin: 0 auto;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-card);
        flex-direction: column;
        padding: 20px;
        box-shadow: var(--shadow-lg);
        border-top: 1px solid var(--border-color);
        gap: 10px;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-link {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 80px 0 120px;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .stat-card {
        min-width: 160px;
        padding: 15px;
    }
    
    .stat-card h3 {
        font-size: 1.8rem;
    }
    
    .graphic-container {
        width: 300px;
        height: 300px;
    }
    
    .api-node {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .security-banner {
        padding: 12px 20px;
        margin: 20px;
    }
    
    .security-banner span {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-stats {
        flex-direction: column;
        align-items: center;
    }
    
    .stat-card {
        width: 100%;
        max-width: 300px;
    }
    
    .search-input {
        font-size: 1rem;
        padding: 15px 20px 15px 45px;
    }
    
    .search-btn {
        width: 45px;
        height: 45px;
    }
    
    .graphic-container {
        width: 250px;
        height: 250px;
    }
    
    .api-node {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .navbar .container {
        padding: 0 15px;
    }
    
    .theme-switch {
        width: 45px;
        height: 45px;
        top: 15px;
        right: 15px;
    }
}

/* 打印样式 */
@media print {
    .theme-switch,
    .nav-toggle,
    .search-btn,
    .hero-graphic {
        display: none !important;
    }
    
    .hero {
        padding: 50px 0;
    }
    
    .hero-title {
        -webkit-text-fill-color: #016eff;
        background: none;
    }
    
    .search-wrapper {
        border: 1px solid #ccc;
    }
}