:root {
    --bg: #f7f8fa;
    --surface: #fff;
    --text: #111827;
    --muted: #64748b;
    --border: #e5e7eb;
    --accent: #2563eb;
    --accent-dark: #1d4ed8;
    --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--text);
    background: var(--bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.container { width: min(1140px, calc(100% - 40px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.site-header { height: 66px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.96); }
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { overflow: hidden; max-width: min(42vw, 260px); font-family: Georgia, serif; font-size: 1.6rem; font-weight: 700; letter-spacing: -.03em; text-overflow: ellipsis; white-space: nowrap; }
.brand-logo { width: auto; max-width: 180px; height: 38px; object-fit: contain; }
.desktop-navigation { display: flex; align-items: center; gap: 28px; font-size: .92rem; font-weight: 650; }
.desktop-navigation a:hover { color: var(--accent); }
.desktop-navigation a { position: relative; padding: 22px 0 19px; }
.desktop-navigation a.active { color: var(--accent); }
.desktop-navigation a.active::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; border-radius: 2px 2px 0 0; background: var(--accent); content: ""; }
.mobile-navigation { display: none; position: relative; }
.site-footer { margin-top: 80px; padding: 32px 0; border-top: 1px solid var(--border); color: var(--muted); background: var(--surface); font-size: .9rem; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 26px; }
.footer-links, .social-links { display: flex; flex-wrap: wrap; gap: 12px 18px; }
.footer-links a:hover, .social-links a:hover { color: var(--accent); }

.hero { padding: 78px 0 56px; max-width: 760px; text-align: center; }
.eyebrow { margin: 0 0 10px; color: var(--accent); font-size: .76rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.hero h1, .story-intro h1, .chapter-header h1 { margin: 0; letter-spacing: -.045em; line-height: 1.1; }
.hero h1 { font-size: clamp(2.4rem, 5vw, 3.35rem); }
.hero > p:last-child { max-width: 650px; margin: 18px auto 0; color: var(--muted); font-size: 1.12rem; }

.story-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.story-card { display: flex; min-width: 0; flex-direction: column; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); transition: transform .2s, box-shadow .2s; }
.story-card:hover { transform: translateY(-3px); box-shadow: 0 18px 38px rgba(15,23,42,.08); }
.story-card__cover { display: grid; height: 205px; place-items: center; overflow: hidden; background: linear-gradient(135deg, #dbeafe, #ede9fe); color: var(--accent); font-family: Georgia, serif; font-size: 4rem; }
.story-card__cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.story-card:hover .story-card__cover img { transform: scale(1.025); }
.story-card__body { padding: 20px 22px 24px; }
.story-meta { color: var(--muted); font-size: .78rem; font-weight: 650; }
.story-card h2 { margin: 9px 0 0; font-size: 1.45rem; letter-spacing: -.025em; line-height: 1.28; }
.story-card h2 a:hover { color: var(--accent); }
.empty-state { grid-column: 1 / -1; padding: 55px 20px; border: 1px dashed #cbd5e1; border-radius: var(--radius); color: var(--muted); text-align: center; }
.pagination { display: flex; justify-content: space-between; margin-top: 42px; }
.pagination a, .pagination span { padding: 10px 16px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); font-size: .9rem; font-weight: 650; }
.pagination span { color: #94a3b8; }
.pagination a:hover { border-color: #cbd5e1; color: var(--accent); }

.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 52px; padding-top: 54px; }
.story-detail { min-width: 0; }
.back-link { display: inline-block; margin-bottom: 28px; color: var(--muted); font-size: .88rem; font-weight: 650; }
.back-link:hover { color: var(--accent); }
.story-intro { display: grid; grid-template-columns: 220px minmax(0,1fr); align-items: center; gap: 38px; }
.story-cover { width: 220px; aspect-ratio: 4 / 5; border-radius: 14px; object-fit: cover; box-shadow: 0 14px 32px rgba(15,23,42,.12); }
.story-intro h1 { font-size: clamp(2rem, 4vw, 3.15rem); }
.lead { margin: 20px 0 28px; color: #475569; font-size: 1.06rem; line-height: 1.75; white-space: pre-line; }
.button { display: inline-flex; padding: 11px 20px; border-radius: 9px; color: #fff; background: var(--accent); font-size: .9rem; font-weight: 750; }
.button:hover { background: var(--accent-dark); }
.chapter-list { margin-top: 54px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-heading h2 { margin: 0; font-size: 1.5rem; letter-spacing: -.02em; }
.section-heading span { color: var(--muted); font-size: .85rem; }
.chapter-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 4px; border-top: 1px solid var(--border); }
.chapter-row > span { display: flex; min-width: 0; flex-direction: column; }
.chapter-row small { color: var(--accent); font-weight: 700; }
.chapter-row strong { overflow: hidden; margin-top: 2px; text-overflow: ellipsis; white-space: nowrap; }
.chapter-row time { flex: none; color: var(--muted); font-size: .8rem; }
.chapter-row:hover strong { color: var(--accent); }

.reading-layout { position: relative; width: 100%; max-width: none; padding-top: 46px; }
.reader { width: min(860px, calc(100% - 40px)); min-width: 0; margin-inline: auto; }
.chapter-progress-header { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 20px; }
.reader-breadcrumb { display: flex; min-width: 0; align-items: center; gap: 9px; margin: 0; color: var(--muted); font-size: .76rem; font-weight: 750; letter-spacing: .055em; text-transform: uppercase; }
.reader-breadcrumb a { overflow: hidden; max-width: min(65vw, 620px); color: var(--accent); text-overflow: ellipsis; white-space: nowrap; }
.reader-breadcrumb a:hover { color: var(--accent); }
.chapter-progress { height: 4px; margin: 14px 0 34px; overflow: hidden; border-radius: 999px; background: #e7effb; }
.chapter-progress span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.chapter-header { padding-bottom: 28px; border-bottom: 1px solid var(--border); }
.chapter-header h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 700; }
.chapter-header > p:last-child { margin: 12px 0 0; color: var(--muted); }
.chapter-featured { margin: 32px 0 12px; }
.chapter-featured img { width: 100%; height: auto; max-height: 620px; border-radius: 14px; object-fit: contain; background: #eef1f5; }
.chapter-content { padding: 28px 0 10px; color: #202632; font-family: Georgia, "Times New Roman", serif; font-size: 1.18rem; line-height: 1.95; }
.chapter-content > p { margin: 0 0 1.45em; }
.chapter-content h1, .chapter-content h2, .chapter-content h3, .chapter-content h4 { margin: 1.45em 0 .65em; line-height: 1.3; }
.chapter-content ul, .chapter-content ol { margin: 0 0 1.45em; padding-left: 1.5em; }
.chapter-content blockquote { margin: 1.5em 0; padding-left: 20px; border-left: 3px solid var(--accent); color: #475569; }
.chapter-content img { max-width: 100%; height: auto; margin: 1.6em auto; border-radius: 12px; }
.chapter-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 38px; padding-top: 24px; border-top: 1px solid var(--border); }
.chapter-nav a, .chapter-nav > span { display: flex; min-width: 0; flex-direction: column; padding: 15px 16px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); }
.chapter-nav > span { color: #94a3b8; }
.chapter-nav a:hover { border-color: #bfdbfe; color: var(--accent); }
.chapter-nav small { margin-bottom: 3px; color: var(--muted); font-size: .73rem; }
.chapter-nav strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chapter-nav__next { text-align: right; }
.chapter-nav__next--only { grid-column: 2; }
.share-section { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 34px; padding: 16px 20px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); }
.share-section h2 { margin: 0; color: #475569; font-size: .78rem; font-weight: 650; letter-spacing: .16em; }
.share-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.share-link { display: inline-flex; width: 46px; height: 46px; flex: 0 0 46px; align-items: center; justify-content: center; border: 1px solid #dfe3e8; border-radius: 50%; background: #fff; transition: border-color .15s, background-color .15s; }
.share-link svg { width: 21px; height: 21px; fill: currentColor; }
.share-link:hover { border-color: #cbd5e1; background: #f8fafc; }
.share-link--x { color: #111827; }
.share-link--facebook { color: #1877f2; }
.share-link--reddit { color: #ff4500; }
.share-link--linkedin { color: #0a66c2; }
.share-link--whatsapp { color: #25a244; }
.share-link--telegram { color: #229ed9; }
.share-link--email { color: #7c3aed; }
.reader-sidebar { display: none; }
.chapter-toc { overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.chapter-toc--desktop { margin-bottom: 28px; }
.chapter-toc__story { display: flex; min-width: 0; align-items: center; gap: 11px; padding: 17px 16px; border-bottom: 1px solid var(--border); }
.chapter-toc__story svg { width: 19px; flex: none; fill: none; stroke: var(--accent); stroke-width: 1.7; }
.chapter-toc__story a { display: block; overflow: hidden; padding: 0; border: 0; color: #1e3a5f; font-size: .84rem; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.chapter-toc__heading { display: flex; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--border); font-size: .76rem; letter-spacing: .08em; }
.chapter-toc__heading span { color: var(--muted); font-size: .82rem; }
.chapter-toc__list, .chapter-toc--mobile > div { display: grid; max-height: calc(100vh - 230px); overflow-y: auto; }
.chapter-toc__list > a, .chapter-toc--mobile > div > a { display: grid; min-height: 52px; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid #eef2f7; font-size: .84rem; }
.chapter-toc a b { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; color: var(--accent); background: #eff6ff; font-size: .72rem; }
.chapter-toc a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chapter-toc a:hover, .chapter-toc a.active { color: var(--accent); background: #eff6ff; }
.chapter-toc a.active { font-weight: 700; }
.chapter-toc a.active b { color: #fff; background: var(--accent); }
.chapter-toc--mobile { display: block; margin-top: 20px; }
.chapter-toc--mobile summary { display: flex; justify-content: space-between; padding: 13px 16px; cursor: pointer; font-weight: 700; text-transform: uppercase; }
.chapter-toc--mobile > div { border-top: 1px solid var(--border); }
.may-you-like { margin: 36px 0; padding: 24px; border: 1px solid #dbeafe; border-radius: 14px; background: #f8fbff; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.may-you-like h2, .other-posts h2 { margin: 0 0 18px; font-size: 1.18rem; letter-spacing: -.015em; }
.may-you-like__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.may-you-like__grid:has(.internal-ad) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.suggestion-card { display: grid; min-width: 0; grid-template-columns: 112px minmax(0, 1fr); overflow: hidden; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); }
.suggestion-card__image { display: grid; min-height: 112px; place-items: center; overflow: hidden; background: linear-gradient(135deg, #dbeafe, #ede9fe); color: var(--accent); font-family: Georgia, serif; font-size: 2rem; }
.suggestion-card__image img { width: 100%; height: 100%; object-fit: cover; }
.suggestion-card__body { min-width: 0; padding: 14px; }
.suggestion-card__body time { display: block; margin-bottom: 5px; color: var(--muted); font-size: .72rem; }
.suggestion-card h3 { display: -webkit-box; overflow: hidden; margin: 0; font-size: .95rem; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.suggestion-card h3 a:hover { color: var(--accent); }
.may-you-like .suggestion-card { display: flex; flex-direction: column; border-radius: 13px; }
.may-you-like .suggestion-card__image { width: 100%; min-height: 0; aspect-ratio: 16 / 9; }
.may-you-like .suggestion-card__body { padding: 15px 16px 17px; }
.other-posts { margin-top: 64px; padding-top: 30px; border-top: 1px solid var(--border); }
.other-posts__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.other-posts .suggestion-card { display: flex; flex-direction: column; }
.other-posts .suggestion-card__image { min-height: 0; aspect-ratio: 16 / 9; }
.static-page { max-width: 800px; padding-top: 72px; }
.static-page header { padding-bottom: 28px; border-bottom: 1px solid var(--border); }
.static-page h1 { margin: 0; font-size: clamp(2.3rem, 5vw, 3.6rem); letter-spacing: -.045em; line-height: 1.1; }
.static-page__content { padding-top: 30px; color: #334155; font-family: Georgia, "Times New Roman", serif; font-size: 1.1rem; line-height: 1.9; }
.static-page__content p { margin: 0 0 1.4em; }
.static-page__content h2, .static-page__content h3, .static-page__content h4 { margin: 1.4em 0 .65em; line-height: 1.3; }
.static-page__content ul, .static-page__content ol { margin: 0 0 1.4em; padding-left: 1.5em; }
.static-page__content blockquote { margin: 1.4em 0; padding-left: 18px; border-left: 3px solid var(--accent); color: #475569; }
.static-page__content img { width: 100%; margin: 30px 0; border-radius: 12px; }

.internal-ad { width: min(1024px, calc(100% - 40px)); max-width: 100%; margin: 28px auto; text-align: center; }
.internal-ad a { display: inline-block; max-width: 100%; }
.internal-ad img { width: auto; max-width: 100%; height: auto; margin: 0 auto; }
.header-center-ad { width: min(38vw, 468px); flex: 1 1 auto; margin: 0; }
.header-center-ad img { max-height: 48px; }
.story-grid-ad { grid-column: 1 / -1; width: 100%; margin: 0; }
.chapter-content .internal-ad { width: 100%; margin: 34px auto; }
.reader-sidebar .internal-ad { width: 100%; margin: 0; }
.internal-ad-context-desktop { display: none; }
.may-you-like .internal-ad { width: 100%; margin: 0; align-self: stretch; }
.may-you-like .internal-ad a, .may-you-like .internal-ad img { width: 100%; }

@media (max-width: 1200px) {
    .other-posts__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
    .story-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .detail-layout { display: block; max-width: 780px; }
    .other-posts__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1560px) {
    .reader-sidebar { position: fixed; z-index: 10; top: 82px; right: 16px; display: block; width: 350px; max-height: calc(100vh - 98px); overflow-y: auto; }
    .chapter-toc--mobile { display: none; }
    .internal-ad-context-mobile { display: none; }
    .internal-ad-context-desktop { display: block; }
}

@media (max-width: 760px) {
    .desktop-navigation { display: none; }
    .mobile-navigation { display: block; }
    .mobile-navigation summary { padding: 8px 0; cursor: pointer; font-size: .86rem; font-weight: 700; list-style: none; }
    .mobile-navigation summary::-webkit-details-marker { display: none; }
    .mobile-navigation nav { position: absolute; z-index: 20; top: 44px; right: 0; display: grid; width: 220px; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: 0 16px 35px rgba(15,23,42,.13); }
    .mobile-navigation nav a { padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: .85rem; font-weight: 650; }
    .mobile-navigation nav a.active { color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
}

@media (max-width: 620px) {
    .container { width: min(100% - 28px, 1140px); }
    .site-header { height: 60px; }
    .hero { padding: 52px 0 38px; }
    .hero h1 { font-size: 2.25rem; }
    .story-grid { grid-template-columns: 1fr; gap: 20px; }
    .story-card__cover { height: 190px; }
    .story-card__body { padding: 20px; }
    .detail-layout, .reading-layout { padding-top: 34px; }
    .story-intro { display: block; }
    .story-cover { width: 150px; margin-bottom: 26px; }
    .story-intro h1 { font-size: 2rem; }
    .chapter-list { margin-top: 42px; }
    .chapter-row time { display: none; }
    .chapter-header h1 { font-size: 2.15rem; }
    .chapter-featured { margin-top: 24px; }
    .chapter-content { font-size: 1.08rem; line-height: 1.85; }
    .chapter-progress-header { align-items: flex-start; flex-direction: column; gap: 7px; }
    .reader-breadcrumb a { max-width: 58vw; }
    .chapter-progress { margin-top: 12px; }
    .share-section { align-items: flex-start; flex-direction: column; padding: 16px; }
    .share-links { justify-content: flex-start; }
    .may-you-like { padding: 18px; }
    .may-you-like__grid, .may-you-like__grid:has(.internal-ad), .other-posts__grid { grid-template-columns: 1fr; }
    .suggestion-card { grid-template-columns: 100px minmax(0, 1fr); }
    .chapter-nav { grid-template-columns: 1fr; }
    .chapter-nav__next { text-align: left; }
    .chapter-nav__next--only { grid-column: 1; }
    .site-footer { margin-top: 55px; }
    .footer-inner { align-items: flex-start; flex-direction: column; }
    .static-page { padding-top: 46px; }
}
