/* iseii 个人主页 - 主样式表 */
/* 支持深色模式、响应式设计 */

/* ==================== CSS 变量定义 ==================== */
:root {
    --primary-color: #f97316;
    --primary-hover: #ea580c;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --border-radius: 12px;
    --transition: all 0.3s ease;
    --card-shadow: none;
    --card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

/* 隐藏滚动条但保留滚动功能 */
html, body {
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    transition: var(--transition);
    position: relative;
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* 全屏背景图片 */
.page-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -100;
    overflow: hidden;
    opacity: 0;
    transition: opacity 1s ease;
}

.page-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

/* 背景遮罩 */
.bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.35);
    transition: background 0.3s ease;
}

/* 浅色模式遮罩 - 保留背景细节 */
[data-theme="light"] .bg-overlay {
    background: rgba(0, 0, 0, 0.2);
}

/* 深色模式遮罩 - 突出文字 */
[data-theme="dark"] .bg-overlay {
    background: rgba(0, 0, 0, 0.5);
}

/* 浅色主题 */
[data-theme="light"] {
    --bg-color: rgba(255, 255, 255, 0.92);
    --bg-secondary: rgba(255, 255, 255, 0.95);
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --border-color: rgba(0, 0, 0, 0.1);
    --card-bg: rgba(255, 255, 255, 0.95);
    --nav-bg: rgba(255, 255, 255, 0.95);
}

/* 深色主题 */
[data-theme="dark"] {
    --bg-color: rgba(17, 24, 39, 0.92);
    --bg-secondary: rgba(31, 41, 55, 0.95);
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --border-color: rgba(255, 255, 255, 0.1);
    --card-bg: rgba(31, 41, 55, 0.95);
    --nav-bg: rgba(17, 24, 39, 0.95);
}

/* ==================== 全局样式 ==================== */

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

img {
    max-width: 100%;
    height: auto;
}

/* ==================== 导航栏 ==================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    z-index: 1000;
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    max-width: 100vw;
    overflow: hidden;
}

.navbar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

.navbar-logo-img {
    height: 32px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
}

.navbar-nav {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.nav-link {
    color: #6b7280;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-size: 0.95rem;
}

.nav-link:hover {
    color: #1f2937;
    background: #f3f4f6;
}

.theme-toggle {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    color: #1f2937;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    margin-left: 0.5rem;
}

.theme-toggle .iconfont {
    font-size: 16px;
    font-style: normal;
}

.theme-toggle:hover {
    background: #f97316;
    border-color: #f97316;
    color: #ffffff;
}

/* ==================== 主容器 ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

.main-content {
    padding-top: 80px;
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.main-content::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

/* ==================== 章节通用样式 ==================== */
.section {
    padding: 4rem 0;
}

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

/* ==================== 卡片通用样式 ==================== */
.card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

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

/* ==================== 个人简介 ==================== */
.bio-section {
    text-align: center;
    padding: 5rem 0;
}

.bio-content {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #000000;
}

.bio-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--primary-color);
    margin: 0 auto 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bio-avatar .iconfont {
    font-size: 48px;
    color: #ffffff;
}

/* ==================== 联系方式（带滑块验证） ==================== */
.contact-section {
    background: transparent;
}

.contact-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    width: 100%;
    box-sizing: border-box;
    justify-content: center;
}

.contact-card {
    flex: 1 1 280px;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--card-bg);
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
}

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

.contact-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-icon .iconfont {
    font-size: 22px;
    color: #374151;
}

.contact-icon-img {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

[data-theme="dark"] .contact-icon-img {
    filter: brightness(0) invert(1);
}

.contact-info {
    flex: 1;
}

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

.contact-value {
    color: var(--text-secondary);
    transition: var(--transition);
    user-select: none;
    font-size: 0.9rem;
}

.contact-value.verified {
    color: var(--primary-color);
    font-weight: 500;
    user-select: text;
}

/* 滑块验证器 */
.slider-captcha {
    margin-top: 1rem;
    width: 100%;
    min-height: 40px;
}

.slider-track {
    width: 100%;
    height: 40px;
    background: #f3f4f6;
    border-radius: 20px;
    position: relative;
    border: 2px solid var(--border-color);
    overflow: hidden;
    box-sizing: border-box;
}

.slider-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-secondary);
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 1;
}

.slider-handle {
    width: 50px;
    height: 36px;
    background: var(--primary-color);
    border-radius: 18px;
    position: absolute;
    left: 2px;
    top: 2px;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: left 0.1s;
    z-index: 2;
}

.slider-handle .iconfont {
    font-size: 16px;
    color: #ffffff;
}

.slider-handle:active {
    cursor: grabbing;
}

.slider-handle.success {
    background: var(--success-color);
    cursor: default;
}

.slider-handle.success .iconfont {
    font-size: 18px;
}

.slider-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--primary-color);
    opacity: 0.1;
    z-index: 1;
}

/* ==================== 旗下项目 ==================== */
.projects-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    width: 100%;
    box-sizing: border-box;
    justify-content: center;
}

/* 平板设备 */
@media (max-width: 1200px) {
    .projects-grid {
        gap: 1rem;
    }
}

.project-card {
    flex: 1 1 300px;
    max-width: 450px;
    display: flex;
    flex-direction: column;
}

.project-header {
    margin-bottom: 1rem;
}

.project-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    flex: 1;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f3f4f6;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition);
    font-size: 0.9rem;
}

.project-link:hover {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

/* ==================== 合作伙伴 ==================== */
.partners-section {
    background: transparent;
}

.partners-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    width: 100%;
    box-sizing: border-box;
    justify-content: center;
}

/* 平板设备 */
@media (max-width: 1200px) {
    .partners-grid {
        gap: 1rem;
    }
}

.partner-card {
    flex: 1 1 250px;
    max-width: 350px;
    text-align: center;
    padding: 2rem;
    background: var(--card-bg);
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    border-radius: 16px;
}

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

.partner-logo {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    background: #f3f4f6;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.partner-name {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

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

/* ==================== 页脚 ==================== */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    text-align: center;
    color: var(--text-secondary);
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    .navbar {
        padding: 0 1rem;
        height: 56px;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0.5rem;
    }

    .navbar::-webkit-scrollbar {
        display: none;
    }

    .navbar-brand {
        font-size: 0.95rem;
        white-space: nowrap;
        flex-shrink: 0;
        padding-right: 0.75rem;
        border-right: 1px solid #e5e7eb;
        margin-right: 0.5rem;
        color: #1f2937;
    }

    .navbar-nav {
        display: flex;
        flex-wrap: nowrap;
        gap: 0.25rem;
        align-items: center;
        flex-shrink: 0;
    }

    .nav-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
        white-space: nowrap;
        color: #6b7280;
    }

    .nav-link:hover {
        color: #1f2937;
        background: #f3f4f6;
    }

    .theme-toggle {
        width: 32px;
        height: 32px;
        min-width: 32px;
        flex-shrink: 0;
        border-radius: 6px;
        margin-left: 0.25rem;
        background: #f3f4f6;
        border-color: #e5e7eb;
        color: #1f2937;
    }

    .theme-toggle .iconfont {
        font-size: 14px;
    }
}

[data-theme="dark"] .navbar-brand,
[data-theme="dark"] .theme-toggle {
    color: #ffffff;
}

[data-theme="dark"] .nav-link {
    color: #d1d5db;
}

[data-theme="dark"] .nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .theme-toggle {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .theme-toggle:hover {
    background: #f97316;
    border-color: #f97316;
    color: #ffffff;
}

[data-theme="dark"] .navbar-brand {
    border-right-color: rgba(255, 255, 255, 0.2);
}

@media (max-width: 768px) {
    [data-theme="dark"] .navbar-brand {
        border-right-color: rgba(255, 255, 255, 0.2);
    }

    [data-theme="dark"] .nav-link {
        color: #d1d5db;
    }

    [data-theme="dark"] .nav-link:hover {
        color: #ffffff;
        background: rgba(255, 255, 255, 0.1);
    }

    [data-theme="dark"] .theme-toggle {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.2);
        color: #ffffff;
    }

    [data-theme="dark"] .theme-toggle:hover {
        background: #f97316;
        border-color: #f97316;
    }
}

.main-content {
        padding-top: 56px;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .contact-card {
        flex-direction: column;
        text-align: center;
        padding: 1.25rem;
    }

    .contact-icon {
        width: 48px;
        height: 48px;
    }

    .contact-info {
        width: 100%;
    }

    .slider-captcha {
        width: 100%;
    }

    .slider-track {
        width: 100%;
    }

    .contact-grid,
    .projects-grid,
    .partners-grid {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .section {
        padding: 2.5rem 1rem;
    }

    .bio-avatar {
        width: 100px;
        height: 100px;
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .bio-content {
        font-size: 1rem;
        padding: 0 0.5rem;
    }

    .contact-card {
        flex: none;
        width: 100%;
        max-width: 100%;
        flex-direction: column;
        text-align: center;
        padding: 1.25rem;
    }

    .contact-icon {
        width: 64px;
        height: 64px;
    }

    .contact-icon-img {
        width: 48px;
        height: 48px;
    }

    .contact-label {
        margin-top: 0.75rem;
    }

    .slider-captcha {
        width: 100%;
        margin-top: 1rem;
    }
    
    /* 移动端卡片全宽 */
    .project-card,
    .partner-card {
        flex: none;
        width: 100%;
        max-width: 100%;
    }

    /* 移动端增强背景遮罩 - 避免阳光区域融字 */
    .bg-overlay {
        background: rgba(0, 0, 0, 0.4) !important;
    }

    /* 移动端增强文字阴影 */
    .section-title,
    .bio-content p,
    .contact-label,
    .contact-value,
    .project-title,
    .project-description,
    .partner-name,
    .partner-description {
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 
                     0 1px 6px rgba(0, 0, 0, 0.2);
    }

    /* 移动端卡片增强 */
    .card,
    .contact-card {
        background: rgba(255, 255, 255, 0.4);
        border-radius: 12px;
    }

    [data-theme="dark"] .card,
    [data-theme="dark"] .contact-card {
        background: rgba(31, 41, 55, 0.4);
    }

    .navbar {
        padding: 0.75rem 1rem;
    }

    .navbar-brand {
        font-size: 1rem;
    }

    .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    .project-card,
    .partner-card {
        padding: 1.25rem;
    }

    .footer {
        padding: 1.5rem 1rem;
        font-size: 0.875rem;
    }

    /* 滑块验证移动端优化 */
    .slider-track {
        width: 100%;
        height: 40px;
    }

    .slider-thumb {
        width: 40px;
        height: 40px;
        line-height: 40px;
        font-size: 1.25rem;
    }

    .slider-tip {
        font-size: 0.8rem;
    }
}

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

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

.scale-in {
    animation: scaleIn 0.4s ease forwards;
}

/* 滚动显示动画 */
.section {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.section:nth-child(1) { animation-delay: 0.1s; }
.section:nth-child(2) { animation-delay: 0.2s; }
.section:nth-child(3) { animation-delay: 0.3s; }
.section:nth-child(4) { animation-delay: 0.4s; }
.section:nth-child(5) { animation-delay: 0.5s; }

/* 卡片悬浮效果增强 */
.card,
.contact-card,
.project-card,
.partner-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover,
.contact-card:hover,
.project-card:hover,
.partner-card:hover {
    transform: translateY(-4px);
}

/* 链接悬浮效果 */
a:hover {
    transition: color 0.2s ease;
}

/* 按钮点击效果 */
.btn:active {
    transform: scale(0.98);
}

/* 图片加载占位 */
img {
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
}

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

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

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

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

/* 选中文字样式 */
::selection {
    background: var(--primary-color);
    color: white;
}

/* 焦点样式（无障碍） */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* 打印样式 */
@media print {
    .page-bg,
    .bg-overlay,
    .navbar,
    .theme-toggle,
    .slider-captcha,
    .footer {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .section {
        page-break-inside: avoid;
    }
}
