* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
    background: #f5f5f0;
    color: #333;
    line-height: 1.8;
}

.container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 40px 20px;
    overflow-x: hidden;
}

.top-banner {
    text-align: center;
    padding: 12px 0;
    background: #2c2c2c;
    color: #fff;
    font-size: 1.2em;
    font-weight: 500;
    letter-spacing: 2px;
    margin: -40px -20px 0;
}

header {
    text-align: center;
    padding: 60px 0 40px;
    border-bottom: 2px solid #e0e0d8;
    margin-bottom: 40px;
}

h1 {
    font-size: 2.5em;
    color: #2c2c2c;
    margin-bottom: 10px;
}

.subtitle {
    color: #888;
    font-size: 1.1em;
}

.description {
    color: #aaa;
    font-size: 0.95em;
    margin-top: 8px;
}

.site-note {
    color: #666;
    font-size: 0.85em;
    margin-top: 12px;
}

.avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 20px auto;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
}

.diary-entry {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
    max-width: 100%;
    overflow: hidden;
}

.diary-entry:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.day-badge {
    display: inline-block;
    background: #ff6b6b;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    margin-bottom: 15px;
}

.diary-date {
    color: #999;
    font-size: 0.9em;
    margin-bottom: 20px;
}

.diary-title {
    font-size: 1.5em;
    color: #2c2c2c;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    word-wrap: break-word;
}

.diary-content {
    font-size: 1.05em;
    color: #444;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.diary-content p {
    margin-bottom: 16px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 图片自适应 - 关键修复 */
.diary-image {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    display: block;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    object-fit: contain;
}

/* 订阅区域 */
.subscribe-section {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    margin: 40px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    text-align: center;
    max-width: 100%;
}

.subscribe-section h3 {
    font-size: 1.4em;
    color: #2c2c2c;
    margin-bottom: 12px;
}

.subscribe-desc {
    color: #888;
    font-size: 0.95em;
    margin-bottom: 24px;
}

.subscribe-form {
    display: flex;
    gap: 10px;
    max-width: 400px;
    margin: 0 auto 16px;
}

.subscribe-form input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0d8;
    border-radius: 8px;
    font-size: 1em;
    outline: none;
    transition: border-color 0.3s;
}

.subscribe-form input:focus {
    border-color: #ff6b6b;
}

.subscribe-form button {
    padding: 12px 24px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.3s;
}

.subscribe-form button:hover {
    background: #ee5a24;
}

.subscribe-note {
    color: #aaa;
    font-size: 0.9em;
    font-style: italic;
}

/* 日记导航 */
.nav-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin: 20px 0;
}

.nav-links a {
    color: #ff6b6b;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 8px;
    transition: background 0.3s;
}

.nav-links a:hover {
    background: #fff3f3;
}

.nav-home {
    font-size: 1.2em;
}

footer {
    text-align: center;
    padding: 40px 0;
    color: #aaa;
    font-size: 0.9em;
    border-top: 1px solid #e0e0d8;
}

footer a {
    color: #ff6b6b;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* 手机端适配 */
@media (max-width: 600px) {
    h1 { font-size: 1.8em; }
    .diary-entry { 
        padding: 20px; 
        margin-bottom: 20px;
        border-radius: 8px;
    }
    header { padding: 40px 0 30px; }
    .subscribe-form { flex-direction: column; }
    .container { padding: 15px 10px; }
    .diary-title { font-size: 1.2em; }
    .diary-image {
        margin: 15px 0;
        border-radius: 6px;
        width: 100% !important;
        max-width: 100% !important;
    }
    .diary-content {
        font-size: 1em;
    }
}

/* 更小屏幕 */
@media (max-width: 400px) {
    .diary-entry { padding: 15px; }
    .day-badge { font-size: 0.75em; }
    .diary-title { font-size: 1.1em; }
    .container { padding: 10px 8px; }
}
