/* ===== Hero 首屏（票据02） ===== */
.hero {
    height: 100vh;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: flex-end;
}
.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.05) 55%, rgba(0,0,0,0.55));
}
.hero-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 0 48px 48px;
    color: #fff;
    text-shadow: 0 1px 6px rgba(0,0,0,0.6);
    text-align: left;
}
.hero-title { font-size: 44px; margin: 0 0 8px; }
.hero-description { font-size: 18px; margin: 0 0 20px; opacity: 0.9; }
.hero-scroll {
    display: inline-block;
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    opacity: 0.85;
    animation: bob 2s ease-in-out infinite;
}
@keyframes bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

:root {
    --bg: #f5f5f7;
    --card-bg: rgba(255, 255, 255, 0.9);
    --text: #1d1d1f;
    --accent: #0066cc;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
}

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    background: var(--card-bg);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(8px);
}

.site-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
}

.search-form { display: flex; gap: 8px; }
.search-form input {
    padding: 6px 12px;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    min-width: 200px;
}
.search-form button {
    padding: 6px 16px;
    border: none;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
}

/* 内容区：自适应宽度，最大 1920，宽屏靠 padding 收缩视觉边距 */
.article-list {
    max-width: 1920px;
    margin: 32px auto;
    padding: 32px clamp(16px, 4vw, 96px);
    background: var(--card-bg);
    border-radius: 12px;
}

.article-card { padding: 20px 0; border-bottom: 1px solid #e5e5ea; }
.article-card:last-child { border-bottom: none; }
.article-title { margin: 0 0 8px; }
.article-title a { color: var(--text); text-decoration: none; }
.article-title a:hover { color: var(--accent); }
.article-excerpt { margin: 0 0 12px; color: #424245; }
.read-more { color: var(--accent); text-decoration: none; font-size: 14px; }
.empty { text-align: center; color: #86868b; }

.article-detail {
    max-width: 1920px;
    margin: 32px auto;
    padding: 40px clamp(16px, 4vw, 96px);
    background: var(--card-bg);
    border-radius: 12px;
}
/* 正文行宽上限（避免超宽屏上一行文字过长难以阅读），
   宽屏下所有详情页子元素（标题/正文/评论区）居中保持视觉平衡；
   列表卡片不限制，靠容器 padding 收缩 */
.article-detail > * {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}
.detail-title { margin-top: 0; }
.detail-content h1 { font-size: 26px; }
.detail-content pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    max-width: 100%;
}
.detail-content code { font-family: Consolas, "JetBrains Mono", monospace; }
/* 正文防溢出：长词/行内代码/图片在窄屏可断行或收缩 */
.detail-content { overflow-wrap: anywhere; }
.detail-content img { max-width: 100%; height: auto; }

/* ===== 详情页顶部 banner（随机图池，定高裁切） ===== */
.detail-banner {
    display: block;
    height: 240px;
    overflow: hidden;
    background: #d2d2d7;
}
.detail-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ===== 评论区 ===== */
.comments { margin-top: 48px; border-top: 1px solid #e5e5ea; padding-top: 24px; }
.comments h2 { margin: 0 0 16px; font-size: 22px; }
.comments h3 { margin: 32px 0 12px; font-size: 17px; }

.comment { padding: 14px 0; border-bottom: 1px solid #e5e5ea; }
.comment:last-of-type { border-bottom: none; }
.comment-meta { margin: 0 0 6px; font-size: 13px; color: #86868b; }
.comment-meta strong { color: var(--text); font-size: 14px; }
.comment-content { margin: 0; white-space: pre-wrap; word-break: break-word; }

.comment-form { display: flex; flex-direction: column; gap: 10px; }
.comment-form input,
.comment-form textarea {
    padding: 8px 12px;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    font: inherit;
    color: var(--text);
    background: #fff;
}
.comment-form textarea { min-height: 96px; resize: vertical; }
.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--accent);
}
.comment-form button {
    align-self: flex-start;
    padding: 8px 20px;
    border: none;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    cursor: pointer;
}
.comment-form button:hover { opacity: 0.9; }
.comment-hint { margin: 10px 0 0; font-size: 12px; color: #86868b; }

/* ===== 页脚（备案信息） ===== */
.site-footer {
    padding: 4px 16px 40px;
    text-align: center;
}
.site-footer a {
    display: inline-block;
    padding: 5px 16px;
    font-size: 12px;
    letter-spacing: 0.5px;
    color: #86868b;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 999px;
    backdrop-filter: blur(4px);
    transition: color 0.2s, border-color 0.2s;
}
.site-footer a:hover {
    color: var(--accent);
    border-color: rgba(0, 102, 204, 0.35);
}

/* ===== 移动端适配 ===== */
@media (max-width: 768px) {
    /* 顶栏：标题与搜索框纵向堆叠 */
    .site-header {
        flex-direction: column;
        gap: 12px;
        padding: 12px 16px;
    }
    .search-form { width: 100%; }
    .search-form input { flex: 1; min-width: 0; }

    /* Hero 首屏 */
    .hero-inner { padding: 0 20px 32px; }
    .hero-title { font-size: 30px; }
    .hero-description { font-size: 15px; }

    /* 内容区 */
    .article-list,
    .article-detail {
        margin: 16px 12px;
        padding: 20px 16px;
    }
    .article-detail > * { max-width: none; }

    /* 评论表单 */
    .comment-form button { align-self: stretch; }
}

/* 桌面窄窗口 / 平板：容器边距适当收紧 */
@media (min-width: 769px) and (max-width: 1200px) {
    .article-list,
    .article-detail { padding: 32px 40px; }
}
