/* Reset & Base */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.7;
    color: #334155; /* 深灰蓝，比纯黑更柔和 */
    background-color: #f8fafc; /* 极浅蓝灰背景 */
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 40px auto;
    background: #ffffff;
    padding: 50px;
    border-radius: 20px;
    /* 更柔和的多层阴影 */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06), 0 20px 25px -5px rgba(0, 0, 0, 0.05);
}

/* Header */
header {
    text-align: center;
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e2e8f0;
}

.logo {
    height: 80px;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.brand-title {
    font-size: 1.2rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
}

h1 {
    font-size: 2.8rem;
    text-align: center;
    margin-bottom: 30px;
    color: #0f172a; /* 极深蓝 */
    letter-spacing: -0.025em;
}

h2 {
    font-size: 1.8rem;
    margin: 50px 0 20px;
    color: #1e293b;
    padding-bottom: 12px;
    position: relative;
}

/* 使用伪元素制作更时尚的下划线 */
h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: #4f46e5;
    border-radius: 2px;
}

h3 {
    font-size: 1.4rem;
    margin: 30px 0 15px;
    color: #334155;
}

p {
    margin-bottom: 20px;
    text-align: justify;
    color: #475569;
}

/* TOC 目录区 - 极简卡片化 */
ul.toc {
    list-style: none;
    background: #f1f5f9;
    padding: 30px;
    border-radius: 12px;
    margin: 40px 0;
}

ul.toc li {
    margin: 14px 0;
}

ul.toc a {
    text-decoration: none;
    color: #475569;
    font-weight: 500;
    transition: all 0.2s ease;
}

ul.toc a:hover {
    color: #4f46e5;
    padding-left: 5px;
}

/* Images */
.section-image {
    text-align: center;
    margin: 40px 0;
    padding: 0 10%; /* 给图片两侧留出更多空白 */
}

.section-image img {
    /* 核心调整：限制宽度 */
    max-width: 90%;      /* 图片最大占据 section 的 80% */
    height: auto;
    
    /* 视觉优化 */
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05); /* 极淡的边框，增加精致感 */
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1); /* 更柔和的深邃阴影 */
    
    /* 交互：鼠标悬停稍微放大 */
    transition: transform 0.3s ease;
}

.section-image img:hover {
    transform: scale(1.02); /* 悬停时轻微放大 */
}

/* 针对手机端的适配：在小屏幕上允许占满，以保证看清内容 */
@media (max-width: 768px) {
    .section-image {
        padding: 0; 
    }
    .section-image img {
        max-width: 100%;
        border-radius: 8px;
    }
}

/* 隔行变色优化 */
section:nth-child(even) {
    background: #f8fafc;
    padding: 40px;
    border-radius: 16px;
    margin: 30px -20px; /* 稍微溢出容器创造层次感 */
}

/* Reviews */
.reviews {
    margin-top: 60px;
}

.review {
    background: #ffffff;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    border: 1px solid #e2e8f0;
    border-left: 6px solid #4f46e5;
    transition: transform 0.3s ease;
}

.review:hover {
    transform: translateY(-5px);
}

.review strong {
    display: block;
    margin-bottom: 8px;
    color: #4f46e5;
    font-size: 1.1rem;
}

/* Comment Form - 现代输入框 */
.comment-form {
    margin-top: 50px;
    padding: 40px;
    background: #f1f5f9;
    border-radius: 16px;
}

.comment-form input, .comment-form textarea {
    width: 100%;
    padding: 14px;
    margin: 12px 0;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.comment-form input:focus, .comment-form textarea:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.comment-form button {
    background: #4f46e5;
    color: #fff;
    padding: 14px 32px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.2);
}

.comment-form button:hover {
    background: #4338ca;
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(79, 70, 229, 0.3);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 40px;
    border-radius: 24px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    animation: modalFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-btn {
    margin-top: 24px;
    padding: 12px 35px;
    background: #4f46e5;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
}

/* Footer */
footer {
    text-align: center;
    padding: 40px 10px;
    margin-top: 60px;
    color: #94a3b8;
    font-size: 0.9rem;
    border-top: 1px solid #e2e8f0;
}

/* Keyframes */
@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .container {
        padding: 25px 20px;
        margin: 10px auto;
    }
    h1 { font-size: 2rem; }
    section:nth-child(even) {
        margin: 20px 0;
        padding: 20px;
    }
    p {
        text-align: left; /* Or 'start' for better RTL support if needed */
    }
}
