/* ==================== 基础 ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(ellipse at 25% 15%, rgba(100,45,170,0.15) 0%, transparent 60%),
        linear-gradient(165deg, rgba(30,8,60,0.88) 0%, rgba(14,3,38,0.93) 50%, rgba(6,1,18,0.96) 100%),
        url('../images/bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    min-height: 100vh;
    color: #fff;
}

.container {
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 60px;
    padding: 80px 20px 60px;
}

/* ==================== 头部 ==================== */
header {
    text-align: center;
    width: 100%;
    padding-top: 20px;
}

header h1 {
    font-size: 2.2rem;
    font-weight: 200;
    letter-spacing: 8px;
    color: rgba(255,255,255,0.9);
    margin-bottom: 16px;
}

.subtitle {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.5);
    letter-spacing: 4px;
    font-weight: 300;
    margin-bottom: 6px;
}

/* ==================== 倒计时 ==================== */
.countdown-section {
    width: 100%;
    text-align: center;
    padding: 0;
    background: none;
    backdrop-filter: none;
    border: none;
    border-radius: 0;
    margin: 0;
}

.countdown-label {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.35);
    letter-spacing: 4px;
    font-weight: 300;
    margin-bottom: 28px;
    text-transform: uppercase;
}

.countdown-timer {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-bottom: 36px;
}

.time-unit { text-align: center; }

.time-value {
    font-size: 3.5rem;
    font-weight: 200;
    line-height: 1;
    margin-bottom: 12px;
    color: rgba(255,255,255,0.95);
    font-variant-numeric: tabular-nums;
    letter-spacing: -1px;
}

.time-label {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.35);
    letter-spacing: 3px;
    font-weight: 300;
}

.target-date {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.3);
    letter-spacing: 2px;
    margin-top: 0;
}

/* ==================== 进度条 ==================== */
.progress-section {
    width: 100%;
    max-width: 240px;
    text-align: center;
    margin: 0 auto;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.35);
    letter-spacing: 2px;
    font-weight: 300;
    margin-bottom: 10px;
}

.progress-bar {
    height: 2px;
    background: rgba(255,255,255,0.08);
    border-radius: 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: rgba(255,255,255,0.7);
    transition: width 0.5s ease;
}

/* ==================== 日记区域 ==================== */
.diary-section {
    width: 100%;
    margin: 0;
}

.section-title {
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.3);
    letter-spacing: 4px;
    font-weight: 300;
    margin-bottom: 32px;
}

.diary-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
    padding: 0;
}

.diary-card-wrapper { position: relative; }

.diary-card {
    display: block;
    background: rgba(20,10,40,0.6);
    text-decoration: none;
    color: inherit;
    padding: 20px 24px;
    transition: background 0.25s;
    cursor: pointer;
}

.diary-card:hover {
    background: rgba(255,255,255,0.03);
}

.diary-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.diary-date {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.35);
    letter-spacing: 1px;
    font-weight: 300;
    white-space: nowrap;
}

.diary-author-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.diary-author-avatar svg { display: block; }

.diary-day-count {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.25);
    letter-spacing: 1px;
    font-weight: 300;
    white-space: nowrap;
    margin-left: auto;
}

.diary-title {
    font-size: 1rem;
    font-weight: 300;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.8);
    margin-bottom: 6px;
}

.diary-excerpt {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.4);
    line-height: 1.7;
    font-weight: 300;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.diary-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 0;
    border-top: none;
}

.diary-tags { display: flex; gap: 8px; flex-wrap: wrap; }

.tag {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.25);
    letter-spacing: 1px;
    font-weight: 300;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    padding: 3px 10px;
}

.read-more {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.25);
    letter-spacing: 1px;
    font-weight: 300;
}

.diary-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.diary-images img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.diary-images img:hover { opacity: 1; }

/* ==================== 添加按钮 ==================== */
.add-entry { text-align: center; margin: 0; }

.add-btn {
    display: inline-block;
    color: rgba(255,255,255,0.4);
    text-decoration: none;
    font-size: 0.95rem;
    letter-spacing: 3px;
    font-weight: 300;
    transition: color 0.3s;
    position: relative;
}

.add-btn::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    width: 0;
    height: 1px;
    background: rgba(255,255,255,0.3);
    transition: width 0.3s;
    transform: translateX(-50%);
}

.add-btn:hover { color: rgba(255,255,255,0.8); }
.add-btn:hover::after { width: 100%; }

/* ==================== 页脚 ==================== */
footer {
    text-align: center;
    padding: 0;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.15);
    letter-spacing: 1px;
    font-weight: 300;
    position: relative;
    top: -20px;
}

/* ==================== 删除按钮 ==================== */
.del {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.2);
    font-size: 13px;
    cursor: pointer;
    z-index: 5;
    transition: color 0.2s, background 0.2s;
    opacity: 0;
}

.diary-card-wrapper:hover .del { opacity: 1; }
.del:hover { color: rgba(255,255,255,0.8); background: rgba(220,53,69,0.7); }

/* ==================== 图片模态框 ==================== */
.image-modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.image-modal.active { display: flex; }

.image-modal img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 4px;
}

/* ==================== 日记详情页作者标签 ==================== */
.diary-author-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 2px 10px;
    color: rgba(255,255,255,0.5);
    font-size: 0.75rem;
    font-weight: 300;
    letter-spacing: 1px;
    margin-left: 10px;
}

.diary-author-tag svg { display: block; width: 16px; height: 16px; }

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .container { gap: 48px; padding: 50px 16px 40px; }
    header h1 { font-size: 1.8rem; letter-spacing: 5px; }
    .countdown-timer { gap: 28px; }
    .time-value { font-size: 2.5rem; }
    .diary-card { padding: 16px 18px; }
}
