/* 主样式文件 */
:root {
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --text-color: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --overlay-bg: rgba(0, 0, 0, 0.2);
    --text-overlay-bg: rgba(0, 0, 0, 0.4);
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --max-width: 1200px;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-xxl: 4rem;
}

/* 全局重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--text-color);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* 背景动画容器 */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* 顶部导航栏 */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1.5rem 0;
    background: transparent;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    text-decoration: none;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* 移动端面板触发按钮 */
.mobile-panel-trigger {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    flex-direction: column;
    gap: 3px;
    width: 24px;
    height: 24px;
}

.hamburger-line {
    width: 20px;
    height: 2px;
    background: var(--text-color);
    transition: var(--transition);
}

/* 语言切换按钮 */
.lang-switch {
    background: var(--text-overlay-bg);
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    font-size: 0.9rem;
}

.lang-switch:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 123, 255, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.3);
}

/* 主内容区域 */
.main-content {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8rem var(--spacing-md) 6rem;
    text-align: center;
    position: relative;
    overflow-y: auto;
}

.content-container {
    max-width: 900px;
    width: 100%;
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: calc(100vh - 14rem);
}

.main-title {
    font-family: var(--font-serif);
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.main-subtitle {
    font-family: var(--font-serif);
    font-size: clamp(1.3rem, 3.5vw, 2.2rem);
    font-weight: 400;
    margin-bottom: var(--spacing-lg);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.domain-content {
    margin-bottom: var(--spacing-xl);
    max-height: 40vh;
    overflow-y: auto;
    padding: 1rem 0;
}

.domain-text {
    font-size: clamp(0.95rem, 2.2vw, 1.1rem);
    line-height: 1.7;
    text-align: justify;
    text-indent: 2em;
    margin-bottom: var(--spacing-md);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    word-break: break-word;
    hyphens: auto;
}

.domain-text:lang(en) {
    text-indent: 0;
}

/* 行动区域 */
.action-section {
    margin-top: var(--spacing-lg);
    flex-shrink: 0;
}

.cta-button {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
    border: none;
    padding: 0.9rem 2rem;
    border-radius: var(--border-radius);
    font-size: clamp(0.9rem, 2vw, 1rem);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    margin-bottom: var(--spacing-sm);
    min-width: 200px;
    max-width: 280px;
    width: 100%;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.button-note {
    font-size: clamp(0.8rem, 1.8vw, 0.9rem);
    color: var(--text-secondary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    line-height: 1.4;
    margin-top: 0.5rem;
}

/* 侧边栏面板（桌面端） */
.sidebar-panel {
    position: fixed;
    top: 80px;
    right: -400px;
    width: 400px;
    height: calc(100vh - 80px - 60px); /* 减去底部信息栏高度 */
    background: var(--text-overlay-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 2000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px 0 0 16px;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.2);
}

.sidebar-panel.active {
    right: 0;
}

.sidebar-content {
    padding: var(--spacing-lg);
    height: calc(100% - 2 * var(--spacing-lg));
    overflow-y: auto;
    box-sizing: border-box;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.sidebar-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.sidebar-close {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
}

.sidebar-body {
    color: var(--text-secondary);
    max-height: calc(100vh - 200px); /* 限制最大高度，避免溢出 */
    overflow-y: auto;
    padding-right: 8px; /* 为滚动条预留空间 */
}

.sidebar-text {
    margin-bottom: var(--spacing-md);
    line-height: 1.7;
    text-align: justify;
    text-indent: 2em;
}

.sidebar-text:lang(en) {
    text-indent: 0;
}

.sidebar-action {
    margin-top: var(--spacing-xl);
    text-align: center;
}

.sidebar-button {
    background: linear-gradient(135deg, var(--success-color), #218838);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    margin-bottom: var(--spacing-sm);
}

.sidebar-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.sidebar-button-note {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* 移动端面板 */
.mobile-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.mobile-panel-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 90vh;
    background: var(--text-overlay-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transform: translateY(-100%);
    transition: var(--transition);
    border-radius: 0 0 20px 20px;
}

.mobile-panel-overlay.active .mobile-panel {
    transform: translateY(0);
}

.mobile-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-panel-title {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-color);
}

.mobile-panel-close {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
}

.mobile-panel-content {
    padding: var(--spacing-lg);
    height: calc(90vh - 80px);
    overflow-y: auto;
    color: var(--text-secondary);
}

.mobile-panel-text {
    margin-bottom: var(--spacing-md);
    line-height: 1.7;
    text-align: justify;
    text-indent: 2em;
}

.mobile-panel-text:lang(en) {
    text-indent: 0;
}

.mobile-panel-action {
    margin-top: var(--spacing-xl);
    text-align: center;
}

.mobile-panel-button {
    background: linear-gradient(135deg, var(--success-color), #218838);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    margin-bottom: var(--spacing-sm);
    width: 100%;
    max-width: 280px;
}

.mobile-panel-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.mobile-panel-button-note {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* 底部信息栏 */
.bottom-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: transparent;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 1rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
}

.footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.footer-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: left;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    font-weight: 400;
}

/* 鼠标交互效果 */
.interactive-element {
    position: absolute;
    pointer-events: none;
    z-index: 1;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* 选择文本样式 */
::selection {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-color);
}

/* 焦点样式 */
button:focus,
button:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* 加载动画 */
.loading {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.loaded {
    opacity: 1;
}