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

/* 强制统一字体渲染 */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
    font-size: 16px;
    box-sizing: border-box;
}

/* 跨浏览器字体渲染优化 */
*, *::before, *::after {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    box-sizing: inherit;
}

/* 浏览器特定的字体大小重置 */
@supports (-webkit-appearance: none) {
    /* WebKit 浏览器 (Chrome, Safari, 新版Edge) */
    body {
        zoom: 1;
    }
}

@-moz-document url-prefix() {
    /* Firefox 特定样式 */
    body {
        font-size: 16px !important;
    }
}

/* Edge 特定优化 */
@supports (-ms-ime-align: auto) {
    body {
        font-size: 1rem !important;
        line-height: 1.6 !important;
    }
}

/* 统一字体度量和间距 */
html, body {
    font-synthesis: none;
    font-optical-sizing: auto;
}

/* 强制统一字体大小计算 */
body, body * {
    font-size: inherit;
    line-height: inherit;
}

/* 重写所有元素的字体大小为相对单位 */
h1, h2, h3, h4, h5, h6, p, div, a, button, input, textarea, select {
    font-size: 1em;
    line-height: 1.6;
}

/* 确保特殊元素不被覆盖 */
.language-label {
    font-size: 14px !important;
    line-height: 1.4 !important;
    margin-right: 2px !important;
}

/* 特定字体大小重新定义 */
h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

small { font-size: 0.875rem; }

:root {
    /* 主色调 */
    --primary-color: #667eea;
    --primary-dark: #5a67d8;
    --primary-light: #7f8ff4;
    --secondary-color: #764ba2;
    
    /* 中性色 */
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --bg-primary: #ffffff;
    --bg-secondary: #f7fafc;
    --bg-tertiary: #edf2f7;
    --border-color: #e2e8f0;
    
    /* 功能色 */
    --success-color: #48bb78;
    --warning-color: #ed8936;
    --error-color: #f56565;
    --info-color: #4299e1;
    
    /* 阴影 */
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* 过渡 */
    --transition-fast: all 0.2s ease;
    --transition-normal: all 0.3s ease;
    --transition-slow: all 0.5s ease;
    
    /* 圆角 */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, 'Microsoft YaHei', '微软雅黑', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-feature-settings: "kern" 1;
    font-kerning: normal;
    font-variant-ligatures: common-ligatures;
}

/* 头部样式 */
.header {
    background: var(--bg-primary);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.header-container {
    max-width: 1600px; /* 增加最大宽度 */
    margin: 0 auto;
    padding: 1rem 1.5rem; /* 减少左右内边距以获得更多空间 */
    display: flex;
    align-items: center;
    justify-content: space-between; /* 确保空间分布 */
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0; /* 防止logo区域被压缩 */
    margin-right: 2rem; /* 与导航区域保持适当距离 */
}

.logo-icon {
    width: 48px;
    height: 48px;
    filter: drop-shadow(0 2px 4px rgba(102, 126, 234, 0.25));
    transition: var(--transition-normal);
}

.logo-icon:hover {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 4px 8px rgba(102, 126, 234, 0.35));
}

.site-title {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    letter-spacing: -0.5px;
    transition: all 0.3s ease;
    cursor: pointer;
}

/* 站点标题链接样式 */
.logo-section a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    border-radius: 8px;
    padding: 4px 8px;
    margin: -4px -8px;
}

.logo-section a:hover .site-title {
    transform: scale(1.05);
    filter: brightness(1.2);
}

.logo-section a:hover {
    background: rgba(102, 126, 234, 0.1);
}

.site-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
    padding-left: 0.5rem;
    border-left: 1px solid var(--border-color);
}

/* 导航链接 */
.nav-links {
    display: flex;
    gap: 2.5rem;
    margin-left: auto;
    margin-right: 1rem; /* 减少右边距，为用户区域留出更多空间 */
    flex-shrink: 0; /* 防止导航链接被压缩 */
}

/* 弹性空间，确保布局分布合理 */
.header-spacer {
    flex: 1;
    min-width: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    position: relative;
    white-space: nowrap;
    min-width: fit-content;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition-normal);
    transform: translateX(-50%);
}

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

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

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

/* 主内容区域 */
.main-content {
    flex: 1;
    padding: 2rem 0;
}

.content-wrapper {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    height: 36px;
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
    outline: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(102, 126, 234, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.35);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* 表单控件 */
.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    height: 38px;
    font-size: 0.95rem;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 卡片样式 */
.card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
    transition: var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* 节标题 */
.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    position: relative;
    padding-left: 0.75rem;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 2px;
}

.subsection-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    flex-shrink: 0;
}

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

.footer-content {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

.footer-content p {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.875rem;
}

/* 加载动画 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* 脉冲动画 */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* 渐入动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* 滑入动画 */
@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-in {
    animation: slideIn 0.5s ease-out;
}

/* 响应式设计 */
/* 大屏幕优化 */
@media (min-width: 1441px) {
    .header-container {
        max-width: 1800px; /* 超大屏幕进一步扩展 */
        padding: 1rem 3rem;
    }
    
    .user-section {
        min-width: 350px; /* 超大屏幕给用户区域更多空间 */
    }
    
    .user-name {
        max-width: 200px; /* 超大屏幕允许更长的用户名 */
    }
}

@media (max-width: 1024px) {
    .nav-links {
        gap: 1.5rem;
        margin-right: 2rem;
    }
    
    .nav-link {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        margin-left: 0;
        margin-right: 0;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    
    .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .site-subtitle {
        display: none;
    }
    
    .content-wrapper {
        padding: 0 1rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
}

/* 工具类 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.hidden { display: none !important; }
.visible { display: block !important; }

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* 页面专用样式 */
.page-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

.page-container {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
}

.page-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 2px;
}

/* 使用说明页面样式 */
.instructions-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.instruction-section {
    border-left: 4px solid var(--primary-color);
    padding-left: 1.5rem;
}

.instruction-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.instruction-section ol,
.instruction-section ul {
    margin-left: 1rem;
    color: var(--text-secondary);
}

.instruction-section li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.instruction-section li strong {
    color: var(--text-primary);
}

.instruction-section p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1rem;
}

/* 联系我们页面样式 */
.contact-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-section {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
}

.contact-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.contact-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.contact-section p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.contact-info {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.contact-item:last-child {
    margin-bottom: 0;
}

.contact-item strong {
    color: var(--text-primary);
    margin-right: 0.5rem;
    min-width: 80px;
}

.social-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.social-link {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    border: 1px solid var(--border-color);
}

.social-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .page-container {
        padding: 1.5rem;
        margin: 0 1rem;
    }
    
    .page-title {
        font-size: 1.75rem;
    }
    
    .instruction-section,
    .contact-section {
        padding-left: 1rem;
    }
    
    .contact-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .contact-item strong {
        margin-bottom: 0.25rem;
    }
    
    .social-links {
        justify-content: center;
    }
}

/* 防止页面跳转时的闪烁 */
body.unloading * {
    transition: none !important;
    animation: none !important;
}

body.unloading .login-modal-overlay,
body.unloading .auth-notification,
body.unloading .notification {
    display: none !important;
}

/* 隐藏未初始化的Vue内容 */
[v-cloak] {
    display: none !important;
}
