/* ===================================
   DLsite官方中文平台 - 样式表
   符合2025年SEO和性能优化标准
   =================================== */

/* CSS变量定义 */
:root {
    --primary-color: #0066cc;
    --secondary-color: #0052a3;
    --accent-color: #3399ff;
    --text-color: #333333;
    --text-light: #666666;
    --bg-color: #ffffff;
    --bg-light: #f5f5f5;
    --bg-dark: #000000;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
    --border-radius: 8px;
    --max-width: 1200px;
    --header-height: 70px;
}

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

/* 基础样式 */
html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    overflow-x: hidden;
}

/* 可访问性 */
a:focus,
button:focus,
input:focus,
textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* 图片优化 */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

picture {
    display: block;
}

/* 链接样式 */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

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

/* 容器 */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ===================================
   Header 导航栏
   =================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: var(--bg-color);
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: var(--transition);
}

.header.scrolled {
    box-shadow: var(--shadow-hover);
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.logo img {
    width: 120px;
    height: 40px;
    object-fit: contain;
}

.logo-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    white-space: nowrap;
}

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

.nav-menu a {
    font-weight: 500;
    color: var(--text-color);
    padding: 8px 12px;
    border-radius: 4px;
    transition: var(--transition);
}

.nav-menu a:hover {
    background-color: var(--bg-light);
    color: var(--primary-color);
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    transition: var(--transition);
    border-radius: 2px;
}

/* ===================================
   Hero Section 首屏
   =================================== */
.hero {
    position: relative;
    margin-top: var(--header-height);
    height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--secondary-color) 100%);
}

.hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.4;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--bg-color);
    padding: 20px;
    max-width: 800px;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 0.8s ease-out;
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 30px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    transition: var(--transition);
    cursor: pointer;
    border: none;
    text-align: center;
}

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

.btn-primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

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

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

/* ===================================
   Main Content 主内容区
   =================================== */
.main-content {
    min-height: 100vh;
}

.section {
    padding: 80px 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-color);
    position: relative;
    padding-bottom: 20px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 2px;
}

.section-description {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 50px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* ===================================
   About Section 关于我们
   =================================== */
.about-section {
    background-color: var(--bg-light);
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
    margin-top: 50px;
}

.content-text h3 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.content-text p {
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 20px;
    color: var(--text-color);
}

.timeline {
    margin: 30px 0;
}

.timeline-item {
    padding: 20px;
    margin-bottom: 20px;
    background-color: var(--bg-color);
    border-left: 4px solid var(--primary-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.timeline-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-hover);
}

.timeline-year {
    display: inline-block;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.timeline-item p {
    margin: 0;
    color: var(--text-color);
}

.highlight-text {
    background-color: var(--bg-color);
    padding: 20px;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--accent-color);
    font-weight: 500;
    margin-top: 30px;
}

.content-image {
    position: sticky;
    top: calc(var(--header-height) + 20px);
}

.content-image img {
    width: 100%;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-hover);
}

/* ===================================
   Features Section 特色功能
   =================================== */
.features-section {
    background-color: var(--bg-color);
}

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

.feature-card {
    background-color: var(--bg-color);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

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

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

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

.feature-card p {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-color);
    margin-bottom: 0;
}

/* ===================================
   Works Section 作品展示
   =================================== */
.works-section {
    background-color: var(--bg-light);
}

.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.work-item {
    background-color: var(--bg-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.work-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.work-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.work-info {
    padding: 20px;
}

.work-info h3 {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.work-info p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 12px;
}

.work-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.work-rating .stars {
    display: flex;
    gap: 2px;
}

.work-rating .star {
    color: #ddd;
    font-size: 1.1rem;
    transition: var(--transition);
}

.work-rating .star.filled {
    color: #ffc107;
}

.work-rating .star.half {
    background: linear-gradient(90deg, #ffc107 50%, #ddd 50%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.work-rating .rating-value {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.work-rating .rating-count {
    color: var(--text-light);
    font-size: 0.85rem;
}

.work-image-wrapper {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.work-image-wrapper img {
    transition: transform 0.3s ease;
}

.work-image-wrapper:hover img {
    transform: scale(1.05);
}

/* ===================================
   FAQ Section 常见问题
   =================================== */
.faq-section {
    background-color: var(--bg-color);
}

.faq-container {
    max-width: 900px;
    margin: 50px auto 0;
}

.faq-item {
    background-color: var(--bg-light);
    padding: 25px;
    margin-bottom: 20px;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
    transition: var(--transition);
}

.faq-item:hover {
    box-shadow: var(--shadow);
}

.faq-question {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    font-weight: 600;
}

.faq-answer p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-color);
}

/* ===================================
   CTA Section 行动号召
   =================================== */
.cta-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--bg-color);
    text-align: center;
}

.cta-section h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.cta-section p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-section .btn-primary {
    background-color: var(--bg-color);
    color: var(--primary-color);
}

.cta-section .btn-primary:hover {
    background-color: var(--bg-light);
}

.cta-section .btn-secondary {
    border-color: var(--bg-color);
    color: var(--bg-color);
}

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

/* ===================================
   Footer 页脚
   =================================== */
.footer {
    background-color: var(--bg-dark);
    color: var(--bg-color);
    padding: 60px 0 20px;
}

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

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

.footer-section p {
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.8);
}

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

.footer-section ul li {
    margin-bottom: 12px;
}

.footer-section ul li a {
    color: rgba(255, 255, 255, 0.8);
    transition: var(--transition);
}

.footer-section ul li a:hover {
    color: var(--accent-color);
    padding-left: 5px;
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    color: rgba(255, 255, 255, 0.9);
    transition: var(--transition);
    font-size: 0.95rem;
}

.social-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--accent-color);
    transform: translateY(-2px);
}

.social-link svg {
    width: 20px;
    height: 20px;
}

.share-section {
    margin-top: 20px;
}

.share-section h4 {
    font-size: 1rem;
    margin-bottom: 15px;
}

.share-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background-color: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: var(--transition);
}

.share-btn:hover {
    background-color: var(--primary-color);
    color: var(--bg-color);
    transform: translateY(-3px);
}

.share-btn svg {
    width: 20px;
    height: 20px;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

/* ===================================
   Back to Top Button 返回顶部
   =================================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: var(--bg-color);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-hover);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
}

/* ===================================
   动画效果
   =================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ===================================
   响应式设计 - 平板
   =================================== */
@media (max-width: 992px) {
    :root {
        --header-height: 60px;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .content-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .content-image {
        position: static;
    }

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

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

/* ===================================
   响应式设计 - 手机
   =================================== */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: var(--header-height);
        left: -100%;
        width: 100%;
        height: calc(100vh - var(--header-height));
        background-color: var(--bg-color);
        flex-direction: column;
        padding: 40px 20px;
        gap: 20px;
        box-shadow: var(--shadow);
        transition: left 0.3s ease;
        overflow-y: auto;
    }

    .nav-menu.active {
        left: 0;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(7px, 7px);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    .hero {
        height: 500px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 300px;
    }

    .section {
        padding: 60px 0;
    }

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

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

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

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }

    .logo-text {
        display: none;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .container {
        padding: 0 15px;
    }

    .hero {
        height: 400px;
    }

    .section {
        padding: 40px 0;
    }
}

/* ===================================
   性能优化 - 减少重绘
   =================================== */
.hero-image,
.feature-card,
.work-item,
.back-to-top {
    will-change: transform;
}

/* ===================================
   打印样式
   =================================== */
@media print {
    .header,
    .hero,
    .back-to-top,
    .mobile-menu-toggle,
    .cta-section {
        display: none;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    .section {
        page-break-inside: avoid;
    }
}

/* ===================================
   暗色模式支持
   =================================== */
@media (prefers-color-scheme: dark) {
    :root {
        --text-color: #e0e0e0;
        --text-light: #b0b0b0;
        --bg-color: #1a1a1a;
        --bg-light: #2a2a2a;
        --border-color: #404040;
    }

    .header {
        background-color: var(--bg-color);
    }

    .feature-card,
    .work-item,
    .timeline-item,
    .highlight-text {
        background-color: var(--bg-light);
    }
}

/* ===================================
   可访问性增强
   =================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0052cc;
        --text-color: #000000;
        --border-color: #000000;
    }
}