/* ========================================
   三亩地 - 编程学习日记 | 全局样式
   复古港风风格：墨黑 + 米黄 + 暗红
   ======================================== */

/* CSS Reset & 基础设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f0e6;
    color: #1a1a1a;
    line-height: 1.8;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul, ol {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 颜色变量 */
:root {
    --ink-black: #1a1a1a;
    --beige: #f5f0e6;
    --dark-red: #8b2e2e;
    --light-beige: #faf6ed;
    --gray-text: #666666;
    --border-color: #d4c9b5;
}

/* ========================================
   顶部导航栏
   ======================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    transition: all 0.4s ease;
    padding: 15px 0;
}

.header.scrolled {
    background: rgba(26, 26, 26, 1);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 28px;
    font-weight: bold;
    color: #f5f0e6;
    letter-spacing: 2px;
}

.logo span {
    color: #8b2e2e;
}

.nav-menu {
    display: flex;
    gap: 35px;
}

.nav-menu a {
    color: #f5f0e6;
    font-size: 15px;
    font-weight: 500;
    position: relative;
    padding: 8px 0;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #8b2e2e;
    transition: width 0.3s ease;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

.nav-menu a:hover {
    color: #8b2e2e;
}

/* 汉堡菜单 */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: #f5f0e6;
    transition: all 0.3s ease;
}

.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, -7px);
}

/* ========================================
   页脚
   ======================================== */
.footer {
    background: #1a1a1a;
    color: #f5f0e6;
    padding: 60px 0 30px;
    margin-top: 100px;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 50px;
    margin-bottom: 40px;
}

.footer-section h3 {
    color: #8b2e2e;
    font-size: 18px;
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.footer-section p,
.footer-section a {
    color: #cccccc;
    font-size: 14px;
    line-height: 2.2;
}

.footer-section a:hover {
    color: #8b2e2e;
}

.footer-bottom {
    border-top: 1px solid #333;
    padding-top: 30px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

/* ========================================
   通用组件
   ======================================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h2 {
    font-size: 36px;
    color: #1a1a1a;
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: #8b2e2e;
}

.section-title p {
    color: #666;
    font-size: 16px;
    margin-top: 20px;
}

.btn {
    display: inline-block;
    padding: 14px 35px;
    background: #8b2e2e;
    color: #f5f0e6;
    border: none;
    border-radius: 3px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover {
    background: #6b2222;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(139, 46, 46, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid #8b2e2e;
    color: #8b2e2e;
}

.btn-outline:hover {
    background: #8b2e2e;
    color: #f5f0e6;
}

/* ========================================
   动画效果
   ======================================== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 992px) {
    .nav-menu {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 280px;
        height: calc(100vh - 70px);
        background: #1a1a1a;
        flex-direction: column;
        padding: 40px;
        gap: 25px;
        transition: right 0.4s ease;
    }

    .nav-menu.active {
        right: 0;
    }

    .hamburger {
        display: flex;
    }

    .container,
    .nav-container {
        padding: 0 20px;
    }

    .section-title h2 {
        font-size: 30px;
    }
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .section-title h2 {
        font-size: 26px;
    }
}
