/* 
 * 编程学习之家 - 民宿ins风定制样式
 * 米白 + 原木色 + 浅绿配色方案
 * 对角斜线分割非对称布局
 */

/* ========== CSS变量定义 ========== */
:root {
    --color-cream: #f5f0e8;
    --color-cream-light: #faf6ef;
    --color-wood: #8b7355;
    --color-wood-dark: #6d5a42;
    --color-wood-light: #a8947a;
    --color-green: #a8c4a0;
    --color-green-dark: #8ba882;
    --color-green-light: #c4d8c0;
    --color-sand: #e8dcc8;
    --color-tan: #d4c4a8;
    --color-beige: #c9b896;
    
    --font-primary: 'Helvetica Neue', Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --font-heading: Georgia, 'Times New Roman', serif;
    
    --shadow-soft: 0 4px 20px rgba(139, 115, 85, 0.1);
    --shadow-medium: 0 8px 30px rgba(139, 115, 85, 0.15);
    --shadow-hover: 0 12px 40px rgba(139, 115, 85, 0.2);
    
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ========== 基础重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-cream-light);
    color: var(--color-wood);
    line-height: 1.7;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-smooth);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ========== 导航栏 ========== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: transparent;
    transition: var(--transition-smooth);
    padding: 20px 0;
}

.site-header.scrolled {
    background: rgba(245, 240, 232, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-soft);
    padding: 15px 0;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo img {
    height: 50px;
    width: auto;
}

.logo-text {
    font-size: 24px;
    font-weight: bold;
    color: var(--color-wood);
    font-family: var(--font-heading);
}

.nav-menu {
    display: flex;
    gap: 35px;
}

.nav-menu a {
    font-size: 15px;
    font-weight: 500;
    color: var(--color-wood);
    position: relative;
    padding: 8px 0;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-green);
    transition: var(--transition-smooth);
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

.nav-menu a:hover {
    color: var(--color-wood-dark);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 10px;
}

.hamburger span {
    width: 25px;
    height: 2px;
    background: var(--color-wood);
    transition: var(--transition-smooth);
}

/* ========== 通用页面结构 ========== */
.page-wrapper {
    min-height: 100vh;
    padding-top: 90px;
}

/* ========== 对角斜线布局核心 ========== */
.diagonal-section {
    position: relative;
    padding: 100px 0;
    overflow: hidden;
}

.diagonal-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--color-cream) 0%, var(--color-sand) 100%);
    clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
    z-index: -1;
}

.diagonal-section.reverse::before {
    background: linear-gradient(135deg, var(--color-sand) 0%, var(--color-cream) 100%);
    clip-path: polygon(0 15%, 100% 0, 100% 100%, 0 100%);
}

.section-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

/* ========== 首页 Banner ========== */
.hero-banner {
    position: relative;
    height: 100vh;
    min-height: 700px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(135deg, var(--color-cream-light) 0%, var(--color-sand) 50%, var(--color-cream) 100%);
}

.hero-bg-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.shape-circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.3;
}

.shape-circle:nth-child(1) {
    width: 400px;
    height: 400px;
    background: var(--color-green-light);
    top: 10%;
    left: 5%;
    animation: float 8s ease-in-out infinite;
}

.shape-circle:nth-child(2) {
    width: 300px;
    height: 300px;
    background: var(--color-tan);
    bottom: 15%;
    right: 10%;
    animation: float 10s ease-in-out infinite reverse;
}

.shape-circle:nth-child(3) {
    width: 200px;
    height: 200px;
    background: var(--color-beige);
    top: 50%;
    right: 20%;
    animation: float 12s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-30px) rotate(10deg); }
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 900px;
    padding: 0 20px;
}

.hero-title {
    font-size: clamp(42px, 5vw, 72px);
    font-family: var(--font-heading);
    color: var(--color-wood-dark);
    margin-bottom: 25px;
    line-height: 1.2;
    opacity: 0;
    animation: fadeInUp 1s ease forwards 0.3s;
}

.hero-subtitle {
    font-size: clamp(18px, 2vw, 24px);
    color: var(--color-wood);
    margin-bottom: 40px;
    opacity: 0;
    animation: fadeInUp 1s ease forwards 0.6s;
}

.hero-btns {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeInUp 1s ease forwards 0.9s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== 按钮样式 ========== */
.btn {
    display: inline-block;
    padding: 15px 35px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
    text-align: center;
}

.btn-primary {
    background: var(--color-wood);
    color: #fff;
}

.btn-primary:hover {
    background: var(--color-wood-dark);
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background: transparent;
    color: var(--color-wood);
    border: 2px solid var(--color-wood);
}

.btn-secondary:hover {
    background: var(--color-wood);
    color: #fff;
    transform: translateY(-3px);
}

/* ========== 卡片样式 ========== */
.card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-smooth);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.card-content {
    padding: 25px;
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-wood-dark);
    margin-bottom: 12px;
    font-family: var(--font-heading);
}

.card-text {
    font-size: 15px;
    color: var(--color-wood);
    line-height: 1.7;
    margin-bottom: 15px;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--color-wood-light);
}

/* ========== 网格布局 ========== */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 35px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

/* ========== 特性板块 ========== */
.features-section {
    padding: 120px 0;
    background: linear-gradient(180deg, var(--color-cream) 0%, var(--color-cream-light) 100%);
}

.feature-card {
    background: #fff;
    padding: 40px 30px;
    border-radius: 25px;
    text-align: center;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-bounce);
}

.feature-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: var(--shadow-hover);
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 25px;
    background: var(--color-green-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-icon img {
    width: 45px;
    height: 45px;
}

.feature-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--color-wood-dark);
    margin-bottom: 15px;
    font-family: var(--font-heading);
}

.feature-desc {
    font-size: 15px;
    color: var(--color-wood);
    line-height: 1.8;
}

/* ========== 资讯列表 ========== */
.news-section {
    padding: 100px 0;
    background: var(--color-cream-light);
}

.section-title {
    font-size: 42px;
    font-family: var(--font-heading);
    color: var(--color-wood-dark);
    text-align: center;
    margin-bottom: 60px;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--color-green);
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 35px;
}

/* ========== 页脚 ========== */
.site-footer {
    background: linear-gradient(135deg, var(--color-wood) 0%, var(--color-wood-dark) 100%);
    color: #fff;
    padding: 80px 0 40px;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 50px;
    margin-bottom: 60px;
}

.footer-logo {
    font-size: 28px;
    font-family: var(--font-heading);
    margin-bottom: 20px;
}

.footer-desc {
    font-size: 15px;
    line-height: 1.8;
    opacity: 0.9;
    margin-bottom: 25px;
}

.footer-social {
    display: flex;
    gap: 15px;
}

.footer-social a {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.footer-social a:hover {
    background: var(--color-green);
    transform: translateY(-3px);
}

.footer-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 25px;
    font-family: var(--font-heading);
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    font-size: 15px;
    opacity: 0.9;
}

.footer-links a:hover {
    opacity: 1;
    color: var(--color-green-light);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 30px;
    text-align: center;
    font-size: 14px;
    opacity: 0.8;
}

/* ========== 内页 Banner ========== */
.page-banner {
    position: relative;
    height: 50vh;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-sand) 0%, var(--color-cream) 100%);
    clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
}

.page-banner-title {
    font-size: clamp(36px, 4vw, 56px);
    font-family: var(--font-heading);
    color: var(--color-wood-dark);
    text-align: center;
}

/* ========== 内容区域 ========== */
.content-section {
    padding: 80px 0;
}

/* ========== 关于页面 ========== */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-image {
    border-radius: 30px;
    overflow: hidden;
    box-shadow: var(--shadow-medium);
}

.about-content h3 {
    font-size: 32px;
    font-family: var(--font-heading);
    color: var(--color-wood-dark);
    margin-bottom: 25px;
}

.about-content p {
    font-size: 16px;
    line-height: 1.9;
    margin-bottom: 20px;
}

/* ========== 服务页面 ========== */
.services-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
}

.service-item {
    background: #fff;
    padding: 40px;
    border-radius: 25px;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-smooth);
    display: flex;
    gap: 25px;
    align-items: flex-start;
}

.service-item:hover {
    transform: translateX(10px);
    box-shadow: var(--shadow-hover);
}

.service-item-icon {
    width: 70px;
    height: 70px;
    background: var(--color-green-light);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.service-item-icon img {
    width: 40px;
    height: 40px;
}

.service-item-content h4 {
    font-size: 22px;
    font-family: var(--font-heading);
    color: var(--color-wood-dark);
    margin-bottom: 12px;
}

.service-item-content p {
    font-size: 15px;
    line-height: 1.7;
    color: var(--color-wood);
}

/* ========== 教程页面 ========== */
.tutorials-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 35px;
}

/* ========== 团队页面 ========== */
.team-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 35px;
}

.team-card {
    text-align: center;
}

.team-photo {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 20px;
    margin-bottom: 20px;
}

.team-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-wood-dark);
    margin-bottom: 8px;
}

.team-role {
    font-size: 14px;
    color: var(--color-wood-light);
}

/* ========== 联系页面 ========== */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
}

.contact-info {
    background: #fff;
    padding: 50px;
    border-radius: 25px;
    box-shadow: var(--shadow-soft);
}

.contact-info h3 {
    font-size: 28px;
    font-family: var(--font-heading);
    color: var(--color-wood-dark);
    margin-bottom: 30px;
}

.contact-item {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}

.contact-item-icon {
    width: 50px;
    height: 50px;
    background: var(--color-green-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-form {
    background: #fff;
    padding: 50px;
    border-radius: 25px;
    box-shadow: var(--shadow-soft);
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-size: 15px;
    font-weight: 500;
    color: var(--color-wood);
    margin-bottom: 10px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid var(--color-sand);
    border-radius: 12px;
    font-size: 15px;
    font-family: var(--font-primary);
    transition: var(--transition-smooth);
    background: var(--color-cream-light);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-green);
    background: #fff;
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

/* ========== 新闻详情页面 ========== */
.article-detail {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 0;
}

.article-header {
    margin-bottom: 40px;
}

.article-title {
    font-size: 42px;
    font-family: var(--font-heading);
    color: var(--color-wood-dark);
    line-height: 1.3;
    margin-bottom: 20px;
}

.article-meta {
    display: flex;
    gap: 30px;
    color: var(--color-wood-light);
    font-size: 15px;
}

.article-cover {
    width: 100%;
    height: 500px;
    object-fit: cover;
    border-radius: 25px;
    margin-bottom: 40px;
}

.article-body {
    font-size: 17px;
    line-height: 2;
    color: var(--color-wood);
}

.article-body p {
    margin-bottom: 25px;
}

.article-body img {
    width: 100%;
    border-radius: 15px;
    margin: 30px 0;
}

/* ========== 相关新闻 ========== */
.related-news {
    margin-top: 80px;
    padding-top: 60px;
    border-top: 2px solid var(--color-sand);
}

.related-news h3 {
    font-size: 28px;
    font-family: var(--font-heading);
    color: var(--color-wood-dark);
    margin-bottom: 40px;
}

/* ========== 滚动动画 ========== */
.fade-in {
    opacity: 0;
    transform: translateY(50px);
    transition: var(--transition-smooth);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========== 响应式设计 ========== */
@media (max-width: 1200px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-2,
    .about-grid,
    .contact-wrapper {
        grid-template-columns: 1fr;
    }
    
    .services-list {
        grid-template-columns: 1fr;
    }
    
    .hero-title {
        font-size: 48px;
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 0 20px;
    }
    
    .nav-menu {
        position: fixed;
        top: 80px;
        left: 0;
        width: 100%;
        background: var(--color-cream);
        flex-direction: column;
        padding: 30px;
        gap: 20px;
        transform: translateY(-150%);
        opacity: 0;
        transition: var(--transition-smooth);
        box-shadow: var(--shadow-medium);
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
    }
    
    .hamburger {
        display: flex;
    }
    
    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    .section-container {
        padding: 0 20px;
    }
    
    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .hero-title {
        font-size: 36px;
    }
    
    .hero-subtitle {
        font-size: 18px;
    }
    
    .section-title {
        font-size: 32px;
    }
    
    .article-title {
        font-size: 28px;
    }
    
    .article-cover {
        height: 300px;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 12px 25px;
        font-size: 14px;
    }
    
    .card-content {
        padding: 20px;
    }
    
    .feature-card {
        padding: 30px 20px;
    }
}
