/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-bg: #0a0e1a;
    --secondary-bg: #1a1f2e;
    --accent-gold: #d4af37;
    --accent-silver: #c0c0c0;
    --accent-cyan: #00ffff;
    --text-primary: #ffffff;
    --text-secondary: #b8c5d1;
    --border-color: rgba(212, 175, 55, 0.3);
    --gradient-primary: linear-gradient(135deg, #0a0e1a 0%, #1a1f2e 100%);
    --gradient-accent: linear-gradient(135deg, #d4af37 0%, #00ffff 100%);
}

body {
    font-family: 'Noto Sans SC', 'Inter', sans-serif;
    background: var(--primary-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

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

/* 导航栏 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 14, 26, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: all 0.3s ease;
}

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

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

.bagua-symbol {
    font-size: 24px;
    color: var(--accent-gold);
    animation: rotate 10s linear infinite;
}

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

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-item a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-item a:hover,
.nav-item.active a {
    color: var(--accent-gold);
}

.nav-item a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-gold);
    transition: width 0.3s ease;
}

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

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--accent-gold);
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero区域 */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 70px;
    background: var(--gradient-primary);
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

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

.hero-text {
    animation: fadeInUp 1s ease-out;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 20px;
}

.title-main {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.title-sub {
    color: var(--text-primary);
}

.hero-description {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    line-height: 1.8;
}

.hero-actions {
    display: flex;
    gap: 20px;
}

.btn-primary,
.btn-secondary {
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-primary {
    background: var(--gradient-accent);
    color: var(--primary-bg);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(212, 175, 55, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--accent-gold);
    border: 2px solid var(--accent-gold);
}

.btn-secondary:hover {
    background: var(--accent-gold);
    color: var(--primary-bg);
}

/* Hero视觉效果 */
.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeInRight 1s ease-out 0.5s both;
}

.taiji-container {
    position: relative;
    width: 300px;
    height: 300px;
}

.taiji-symbol {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 120px;
    color: var(--accent-gold);
    animation: rotate 20s linear infinite;
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.5);
}

.trigrams-circle {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    animation: rotate 30s linear infinite reverse;
}

.trigram {
    position: absolute;
    font-size: 24px;
    color: var(--accent-cyan);
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.trigram:nth-child(1) { top: 0; left: 50%; transform: translateX(-50%); }
.trigram:nth-child(2) { top: 15%; right: 15%; }
.trigram:nth-child(3) { top: 50%; right: 0; transform: translateY(-50%); }
.trigram:nth-child(4) { bottom: 15%; right: 15%; }
.trigram:nth-child(5) { bottom: 0; left: 50%; transform: translateX(-50%); }
.trigram:nth-child(6) { bottom: 15%; left: 15%; }
.trigram:nth-child(7) { top: 50%; left: 0; transform: translateY(-50%); }
.trigram:nth-child(8) { top: 15%; left: 15%; }

.trigram:hover {
    color: var(--accent-gold);
    transform: scale(1.2);
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.8);
}

/* 转换器区域 */
.converter-section {
    padding: 100px 0;
    background: var(--secondary-bg);
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 20px;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 60px;
}

.converter-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 40px;
    margin-bottom: 60px;
}

.input-panel,
.output-panel {
    background: rgba(26, 31, 46, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 30px;
    backdrop-filter: blur(10px);
}

.input-panel h3,
.output-panel h3 {
    color: var(--accent-gold);
    margin-bottom: 20px;
    font-size: 1.3rem;
}

#text-input {
    width: 100%;
    min-height: 120px;
    background: rgba(10, 14, 26, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    color: var(--text-primary);
    font-size: 16px;
    resize: vertical;
    transition: all 0.3s ease;
}

#text-input:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
}

.input-options {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.option-btn {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.option-btn.active,
.option-btn:hover {
    background: var(--accent-gold);
    color: var(--primary-bg);
    border-color: var(--accent-gold);
}

.conversion-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.arrow-icon {
    font-size: 3rem;
    color: var(--accent-gold);
    margin-bottom: 20px;
    animation: pulse 2s ease-in-out infinite;
}

.conversion-steps {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.step {
    margin-bottom: 8px;
    opacity: 0.7;
}

.bagua-output {
    min-height: 120px;
    background: rgba(10, 14, 26, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    font-size: 24px;
    line-height: 1.8;
    word-wrap: break-word;
    text-align: center;
}

.bagua-output .placeholder {
    color: var(--text-secondary);
    font-size: 16px;
    text-align: center;
    line-height: 120px;
}

.output-info {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.info-item {
    text-align: center;
}

.info-item .label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.info-item span:last-child {
    color: var(--accent-gold);
    font-weight: 600;
}

.meaning-panel {
    background: rgba(26, 31, 46, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 30px;
    backdrop-filter: blur(10px);
}

.meaning-panel h3 {
    color: var(--accent-gold);
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.philosophy-content {
    min-height: 100px;
    line-height: 1.8;
}

.philosophy-content .placeholder {
    color: var(--text-secondary);
    text-align: center;
    line-height: 100px;
}

/* 网络图区域 */
.network-section {
    padding: 100px 0;
    background: var(--primary-bg);
}

.network-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    align-items: start;
}

.network-chart {
    height: 500px;
    background: rgba(26, 31, 46, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.network-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-card {
    background: rgba(26, 31, 46, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.info-card:hover {
    border-color: var(--accent-gold);
    transform: translateY(-2px);
}

.info-card h4 {
    color: var(--accent-gold);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.info-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* 特性区域 */
.features-section {
    padding: 100px 0;
    background: var(--secondary-bg);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.feature-card {
    background: rgba(26, 31, 46, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 30px;
    backdrop-filter: blur(10px);
    text-align: center;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-gold);
    box-shadow: 0 15px 35px rgba(212, 175, 55, 0.2);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    display: block;
}

.feature-card h3 {
    color: var(--accent-gold);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* 页脚 */
.footer {
    background: var(--primary-bg);
    border-top: 1px solid var(--border-color);
    padding: 60px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    color: var(--accent-gold);
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-section p,
.footer-section li {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 10px;
}

.footer-section ul {
    list-style: none;
}

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

.footer-section a:hover {
    color: var(--accent-gold);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

/* 动画 */
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .taiji-container {
        width: 250px;
        height: 250px;
    }
    
    .taiji-symbol {
        font-size: 80px;
    }
    
    .converter-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .conversion-panel {
        order: 2;
    }
    
    .network-container {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .section-title {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .taiji-container {
        width: 200px;
        height: 200px;
    }
    
    .taiji-symbol {
        font-size: 60px;
    }
    
    .trigram {
        font-size: 18px;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
}