/* ============================================================
   种田掌门人 前台样式
   国风暖色 · 响应式 · 无框架依赖
   ============================================================ */
:root {
    --bg: #f7f1e1;
    --bg-deep: #efe4cb;
    --card: #fffdf6;
    --ink: #4a3b28;
    --ink-soft: #7a6a52;
    --primary: #c98a3d;
    --primary-deep: #a86d28;
    --red: #b5453a;
    --green: #8aa87a;
    --pink: #e6b3a8;
    --line: #e3d7bd;
    --shadow: 0 8px 24px rgba(120, 92, 48, .10);
    --radius: 14px;
    --kai: "STKaiti", "KaiTi", "楷体", "Kaiti SC", serif;
    --hei: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--hei);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.75;
    font-size: 16px;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary-deep); text-decoration: none; transition: color .2s; }
a:hover { color: var(--red); }
h1, h2, h3 { font-family: var(--kai); color: var(--ink); line-height: 1.35; }
p { margin: .6em 0; }
ul { padding-left: 1.2em; }
.skip-link {
    position: absolute; left: -999px; top: 0; z-index: 999;
    background: var(--primary); color: #fff; padding: 8px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; color: #fff; }

/* ---------------- 按钮 ---------------- */
.btn {
    display: inline-block;
    padding: 11px 26px;
    border-radius: 999px;
    font-weight: bold;
    font-size: 15px;
    color: #fff;
    box-shadow: 0 6px 14px rgba(168, 109, 40, .25);
    border: 1px solid transparent;
}
.btn:hover { color: #fff; transform: translateY(-2px); }
.btn-android { background: linear-gradient(135deg, #7fa86b, #5f8a4e); }
.btn-ios { background: linear-gradient(135deg, #d9a35c, #b57d34); }
.btn-tap { background: linear-gradient(135deg, #e08a7d, #c06558); }

/* ---------------- 头部 ---------------- */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(247, 241, 225, .92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid transparent;
    transition: border-color .25s, box-shadow .25s;
}
.site-header.scrolled { border-bottom-color: var(--line); box-shadow: 0 4px 16px rgba(120, 92, 48, .08); }
.header-inner {
    max-width: 1200px; margin: 0 auto;
    display: flex; align-items: center; gap: 24px;
    padding: 10px 22px;
}
.brand img { width: 150px; height: 44px; object-fit: contain; }
.brand-text { font-family: var(--kai); font-size: 26px; font-weight: bold; color: var(--primary-deep); }
.site-nav { margin-left: auto; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.site-nav a {
    display: block; padding: 8px 14px; border-radius: 8px;
    color: var(--ink); font-size: 15px; font-weight: 600;
}
.site-nav a:hover, .site-nav a.active { color: var(--red); background: rgba(201, 138, 61, .12); }
.header-download {
    padding: 9px 22px; border-radius: 999px;
    background: var(--primary); color: #fff !important; font-weight: bold; font-size: 14px;
}
.header-download:hover { background: var(--primary-deep); }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px 0; border-radius: 2px; }

/* ---------------- 首屏 ---------------- */
.hero { position: relative; overflow: hidden; }
.hero-bg {
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse at 75% 30%, rgba(255, 240, 200, .9), transparent 55%),
        linear-gradient(180deg, #f3e8cd 0%, #eef0d8 55%, #e6edd6 100%);
}
.hero-bg::after {
    content: ""; position: absolute; inset: 0;
    background: url("../images/hero-bg.webp") center/cover no-repeat;
    opacity: .9;
}
.hero-inner {
    position: relative;
    max-width: 1200px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between; gap: 30px;
    padding: 70px 22px 90px;
}
.hero-slogan {
    font-size: 52px; margin: 0 0 14px;
    color: var(--ink);
    text-shadow: 2px 2px 0 rgba(255, 255, 255, .6);
}
.hero-sub { font-size: 19px; color: var(--ink-soft); margin: 0 0 30px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 22px; }
.hero-rating { font-size: 13px; color: var(--ink-soft); }
.hero-qr {
    flex: none; text-align: center;
    background: var(--card); padding: 16px; border-radius: var(--radius); box-shadow: var(--shadow);
}
.hero-qr img { width: 150px; height: 150px; border-radius: 8px; }
.hero-qr span { display: block; margin-top: 8px; font-size: 14px; color: var(--ink-soft); }

/* ---------------- 通用板块 ---------------- */
.section { max-width: 1200px; margin: 0 auto; padding: 56px 22px; }
.section-head { text-align: center; margin-bottom: 36px; position: relative; }
.section-head h2 {
    display: inline-block; font-size: 34px; margin: 0;
    color: var(--primary-deep);
    padding: 0 26px; position: relative;
}
.section-head h2::before, .section-head h2::after {
    content: ""; position: absolute; top: 50%; width: 70px; height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary));
}
.section-head h2::before { right: 100%; }
.section-head h2::after { left: 100%; transform: scaleX(-1); }
.section-pinyin { margin: 4px 0 0; font-size: 13px; letter-spacing: 6px; color: var(--ink-soft); }

/* ---------------- 名士风采（角色切换器） ---------------- */
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.character-section {
    background-image: url('../images/heroes/bg.jpg');
    background-size: cover; background-position: center;
    border-radius: var(--radius);
}
.character-stage {
    display: flex; align-items: center; justify-content: center;
    gap: 28px; max-width: 1080px; margin: 0 auto;
}
.character-view {
    position: relative; flex: 1 1 auto; min-width: 0;
    aspect-ratio: 1029 / 551; max-width: 800px;
}
.char-view-img {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: contain; opacity: 0; transition: opacity .35s ease;
}
.char-view-img.is-active { opacity: 1; }
.character-list {
    list-style: none; padding: 0; margin: 0; flex: 0 0 auto;
    display: flex; flex-direction: column; gap: 10px;
}
.char-thumb {
    position: relative; width: 70px; height: 70px; padding: 0;
    background: none; border: 0; cursor: pointer;
}
.char-thumb img {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: contain; transition: opacity .25s ease;
}
.thumb-active { opacity: 0; }
.char-thumb.is-active .thumb-normal { opacity: 0; }
.char-thumb.is-active .thumb-active { opacity: 1; }
.char-thumb:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.more-link { text-align: center; margin-top: 30px; font-weight: bold; }

/* ---------------- 游戏特色轮播 ---------------- */
.feature-slider { position: relative; width: 100%; max-width: 860px; margin: 0 auto; overflow: hidden; border-radius: var(--radius); min-width: 0; }
.feature-track { display: flex; transition: transform .5s ease; }
.feature-slide { flex: 0 0 100%; margin: 0; position: relative; min-width: 0; }
.feature-slide img { width: 100%; height: 420px; object-fit: cover; }
.feature-slide figcaption {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 40px 24px 18px;
    background: linear-gradient(transparent, rgba(60, 42, 20, .78));
    color: #fff;
}
.feature-slide figcaption strong { display: block; font-family: var(--kai); font-size: 26px; }
.feature-slide figcaption span { font-size: 14px; opacity: .9; }
.slider-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 44px; height: 44px; border-radius: 50%;
    border: 0; background: rgba(255, 255, 255, .85);
    font-size: 26px; color: var(--primary-deep); cursor: pointer; line-height: 1;
}
.slider-arrow:hover { background: #fff; }
.slider-arrow.prev { left: 14px; }
.slider-arrow.next { right: 14px; }
.slider-dots { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; }
.slider-dots button {
    width: 9px; height: 9px; padding: 0; border: 0; border-radius: 50%;
    background: rgba(255, 255, 255, .55); cursor: pointer;
}
.slider-dots button.active { background: #fff; }

/* ---------------- 首页新闻 ---------------- */
.news-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.news-col { min-width: 0; }
.news-col {
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 24px 26px; box-shadow: var(--shadow);
}
.col-head {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 22px; margin: 0 0 14px; padding-bottom: 10px; border-bottom: 2px solid var(--primary);
}
.col-head a { font-size: 13px; font-weight: normal; }
.news-list { list-style: none; padding: 0; margin: 0; }
.news-list li {
    display: flex; justify-content: space-between; gap: 12px; align-items: baseline;
    padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 15px;
}
.news-list a {
    color: var(--ink); flex: 1;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.news-list a:hover { color: var(--red); }
.news-list time { flex: none; font-size: 13px; color: var(--ink-soft); }

/* ---------------- 面包屑 ---------------- */
.breadcrumb-wrap { max-width: 1200px; margin: 18px auto 0; padding: 0 22px; }
.breadcrumb { font-size: 13px; color: var(--ink-soft); }
.breadcrumb span { margin: 0 6px; }
.breadcrumb strong { color: var(--ink); font-weight: 600; }

/* ---------------- 内页容器 ---------------- */
.page-wrap { max-width: 1000px; margin: 0 auto; padding: 26px 22px 60px; }
.page-head { margin-bottom: 26px; }
.page-head h1 { font-size: 34px; margin: 0 0 8px; }
.page-intro { color: var(--ink-soft); }

/* 文章卡片列表 */
.article-list { display: flex; flex-direction: column; gap: 20px; }
.article-card {
    display: flex; gap: 22px;
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.card-cover { flex: none; width: 220px; height: 150px; border-radius: 10px; overflow: hidden; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-fallback {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%; background: var(--bg-deep);
    font-family: var(--kai); font-size: 44px; color: var(--primary);
}
.card-body { min-width: 0; }
.card-body h2 { font-size: 21px; margin: 0 0 8px; }
.card-body h2 a { color: var(--ink); }
.card-body h2 a:hover { color: var(--red); }
.card-summary {
    color: var(--ink-soft); font-size: 14px; margin: 0 0 10px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { font-size: 13px; color: var(--ink-soft); margin: 0; display: flex; gap: 14px; flex-wrap: wrap; }

/* 分页 */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 38px; flex-wrap: wrap; }
.pagination a, .pagination strong {
    min-width: 38px; padding: 7px 12px; text-align: center;
    border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink);
}
.pagination strong { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination a:hover { border-color: var(--primary); color: var(--red); }

/* ---------------- 文章详情 ---------------- */
.article-detail {
    max-width: 860px; margin: 0 auto; padding: 26px 22px 40px;
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow);
}
.article-head h1 { font-size: 32px; margin: 0 0 12px; }
.article-meta { font-size: 13px; color: var(--ink-soft); display: flex; gap: 16px; flex-wrap: wrap; margin: 0 0 20px; }
.article-cover { margin: 0 0 24px; border-radius: 10px; overflow: hidden; }
.article-content { font-size: 16px; }
.article-content h2, .article-content h3 { color: var(--primary-deep); margin-top: 1.6em; }
.article-content h3 { font-size: 20px; }
.article-content img { border-radius: 10px; margin: 18px auto; }
.article-content ul li { margin: 5px 0; }
.article-tags { margin-top: 28px; display: flex; gap: 10px; flex-wrap: wrap; }
.article-tags a {
    font-size: 13px; padding: 4px 14px; border-radius: 999px;
    background: var(--bg-deep); color: var(--ink-soft);
}
.article-tags a:hover { background: var(--primary); color: #fff; }
.prev-next {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
    margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line);
}
.prev-next a, .prev-next span {
    font-size: 14px; color: var(--ink);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.prev-next span span, .prev-next a span { display: block; font-size: 12px; color: var(--ink-soft); }
.pn-next { text-align: right; }
.disabled { color: var(--ink-soft); opacity: .6; }

/* 相关推荐 */
.related { max-width: 860px; margin: 30px auto 0; padding: 0 22px; }
.related h2 { font-size: 22px; }
.related ul { list-style: none; padding: 0; }
.related li {
    display: flex; justify-content: space-between; gap: 12px;
    padding: 10px 0; border-bottom: 1px dashed var(--line);
}
.related time { font-size: 13px; color: var(--ink-soft); flex: none; }

/* 单页 */
.single-page { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); margin-top: 20px; }
.page-updated { font-size: 13px; color: var(--ink-soft); margin-top: 30px; }

/* 搜索 */
.search-form { display: flex; gap: 12px; margin-bottom: 26px; }
.search-form input {
    flex: 1; padding: 12px 16px; border: 1px solid var(--line);
    border-radius: 10px; font-size: 15px; background: var(--card);
}
.search-form button {
    padding: 12px 30px; border: 0; border-radius: 10px;
    background: var(--primary); color: #fff; font-weight: bold; cursor: pointer;
}
.search-result-tip { color: var(--ink-soft); }
.search-empty { color: var(--ink-soft); }

/* 404 */
.error-page { text-align: center; padding: 90px 22px; }
.error-page h1 { font-size: 90px; color: var(--primary); margin: 0; }
.error-text { color: var(--ink-soft); margin-bottom: 30px; }
.error-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ---------------- 底部 ---------------- */
.site-footer {
    margin-top: 40px;
    background: #6b6a45;
    color: #e8e2d0;
}
.footer-inner {
    max-width: 1200px; margin: 0 auto;
    display: flex; gap: 36px; padding: 44px 22px;
}
.footer-qr { flex: none; text-align: center; }
.footer-qr img { width: 110px; height: 110px; border-radius: 8px; background: #fff; padding: 6px; }
.footer-qr span { font-size: 13px; opacity: .8; }
.footer-slogan { font-family: var(--kai); font-size: 20px; margin: 0 0 12px; color: #f2e6c8; }
.footer-nav a { color: #e8e2d0; font-size: 14px; }
.footer-nav a:hover { color: #fff; }
.footer-nav i { margin: 0 10px; opacity: .5; font-style: normal; }
.friend-links { font-size: 13px; opacity: .85; margin-top: 10px; display: flex; flex-wrap: wrap; gap: 10px; }
.friend-links span { opacity: .8; }
.friend-links a { color: #e8e2d0; }
.friend-links a:hover { color: #fff; }
.footer-meta { margin: 14px 0 4px; font-size: 13px; }
.footer-meta a { color: #e8e2d0; opacity: .9; }
.footer-meta a:hover { color: #fff; }
.footer-copy { font-size: 13px; opacity: .7; margin: 0; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1024px) {
    .character-stage { gap: 18px; }
    .char-thumb { width: 58px; height: 58px; }
    .hero-slogan { font-size: 42px; }
}
@media (max-width: 768px) {
    .nav-toggle { display: block; margin-left: auto; }
    .header-download { display: none; }
    .site-nav {
        display: none; position: absolute; top: 100%; left: 0; right: 0;
        background: var(--bg); border-bottom: 1px solid var(--line);
        box-shadow: 0 10px 20px rgba(120, 92, 48, .12);
    }
    .site-nav.open { display: block; }
    .site-nav ul { flex-direction: column; padding: 10px 18px; }
    .hero-inner { flex-direction: column-reverse; text-align: center; padding: 36px 20px 48px; gap: 22px; }
    .hero-text { width: 100%; min-width: 0; }
    .hero-actions { justify-content: center; gap: 10px; }
    .hero-actions .btn { flex: 1 1 0; min-width: 0; padding: 10px 6px; font-size: 13px; text-align: center; }
    .hero-slogan { font-size: 28px; margin-bottom: 8px; }
    .hero-sub { font-size: 15px; }
    .hero-qr { padding: 12px; }
    .hero-qr img { width: 116px; height: 116px; }
    body { overflow-x: hidden; }
    .news-cols { grid-template-columns: 1fr; }
    .article-card { flex-direction: column; }
    .card-cover { width: 100%; height: 180px; }
    .prev-next { grid-template-columns: 1fr; }
    .pn-next { text-align: left; }
    .feature-slide img { height: 260px; }
    .footer-inner { flex-direction: column; align-items: center; text-align: center; }
    .friend-links { justify-content: center; }
    .character-stage { flex-direction: column; gap: 16px; }
    .character-list { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 8px; }
    .char-thumb { width: 52px; height: 52px; }
}
@media (max-width: 420px) {
    .section-head h2 { font-size: 28px; }
    .hero-slogan { font-size: 30px; }
}
