@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700&family=Noto+Serif+SC:wght@500;700&display=swap");

:root {
    --fog: #eef3f6;
    --mist: #f7fafc;
    --panel: rgba(255, 255, 255, 0.72);
    --panel-solid: #ffffff;
    --ink: #1a2332;
    --ink-soft: #5a6a7a;
    --line: rgba(26, 35, 50, 0.12);
    --accent: #0b6e6e;
    --accent-soft: #d8efef;
    --gold: #b8872b;
    --gold-soft: #f4e8cc;
    --danger: #c45c5c;
    --shadow: 0 12px 40px rgba(26, 35, 50, 0.08);
    --radius: 18px;
    --radius-sm: 12px;
    --font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    --font-display: "Noto Serif SC", "Songti SC", serif;
    --max: 1120px;
    --reader: 760px;
    --nav-h: 70px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    line-height: 1.75;
    min-height: 100vh;
    background:
        radial-gradient(ellipse 80% 50% at 10% -10%, rgba(184, 135, 43, 0.18), transparent 55%),
        radial-gradient(ellipse 70% 45% at 95% 5%, rgba(11, 110, 110, 0.14), transparent 50%),
        radial-gradient(ellipse 60% 40% at 50% 100%, rgba(11, 110, 110, 0.08), transparent 55%),
        linear-gradient(180deg, #f4f7f9 0%, var(--fog) 40%, #e8eef2 100%);
    background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; }

/* Brand strip */
.topbar {
    background: transparent;
    color: var(--ink-soft);
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.28em;
    padding: 10px 16px 0;
}

.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(16px);
    background: rgba(247, 250, 252, 0.78);
    border-bottom: 1px solid var(--line);
}

.navbar-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 24px;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    gap: 32px;
}

.logo {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.04em;
    transition: opacity .25s ease;
}

.logo:hover { opacity: 0.75; }

.logo-badge {
    display: none;
}

.logo-text {
    position: relative;
}

.logo-text::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--gold), transparent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .35s ease;
}

.logo:hover .logo-text::after { transform: scaleX(1); }

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-links a {
    position: relative;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink-soft);
    transition: color .2s ease;
}

.nav-links a::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 2px;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transition: transform .25s ease;
}

.nav-links a:hover {
    color: var(--ink);
}

.nav-links a:hover::after { transform: scaleX(1); }

.nav-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wallet {
    padding: 8px 14px;
    background: var(--gold-soft);
    color: #7a5a18;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid rgba(184, 135, 43, 0.28);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 22px;
    font-size: 14px;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
    text-decoration: none;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-teal {
    background: linear-gradient(135deg, #0d7a7a, #085959);
    color: #fff;
    box-shadow: 0 8px 24px rgba(11, 110, 110, 0.28);
}

.btn-teal:hover { background: linear-gradient(135deg, #0f8888, #0a6363); }

.btn-paper {
    background: rgba(255, 255, 255, 0.7);
    color: var(--ink);
    border: 1px solid var(--line);
    box-shadow: none;
}

.btn-paper:hover { background: #fff; }

.btn-corn {
    background: var(--gold-soft);
    color: #6d4e12;
    border: 1px solid rgba(184, 135, 43, 0.35);
}

.btn-corn:hover { background: #efe0b8; }

.btn-sm { padding: 8px 16px; font-size: 13px; }

/* Main */
.page {
    max-width: var(--max);
    margin: 0 auto;
    padding: 28px 24px 80px;
}

body.mode-reader .page {
    max-width: var(--reader);
    padding-bottom: 100px;
}

/* Footer */
.site-foot {
    margin-top: auto;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(10px);
    padding: 40px 24px 48px;
}

.foot-inner { max-width: var(--max); margin: 0 auto; }

.foot-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    margin-bottom: 18px;
}

.foot-links a {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-soft);
    transition: color .2s;
}

.foot-links a:hover { color: var(--accent); }

.foot-copy {
    font-size: 12px;
    color: var(--ink-soft);
    line-height: 1.9;
}

.foot-copy a {
    color: var(--accent);
    border-bottom: 1px solid transparent;
}

.foot-copy a:hover { border-bottom-color: var(--accent); }

/* Homepage hero — full-bleed composition */
.home-hero {
    position: relative;
    margin: -28px -24px 56px;
    min-height: min(88vh, 720px);
    display: grid;
    align-items: end;
    overflow: hidden;
    border-radius: 0 0 28px 28px;
    animation: heroRise .8s ease both;
}

.home-hero-media {
    position: absolute;
    inset: 0;
}

.home-hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.04);
    animation: heroZoom 12s ease-out both;
}

.home-hero-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(15, 28, 40, 0.15) 0%, rgba(15, 28, 40, 0.25) 40%, rgba(15, 28, 40, 0.78) 100%);
}

.home-hero-copy {
    position: relative;
    z-index: 1;
    max-width: var(--max);
    width: 100%;
    margin: 0 auto;
    padding: 48px 28px 56px;
    color: #f7fafc;
}

.home-brand {
    font-family: var(--font-display);
    font-size: clamp(28px, 5vw, 44px);
    font-weight: 700;
    letter-spacing: 0.12em;
    margin: 0 0 18px;
    animation: fadeUp .7s .1s ease both;
}

.home-hero-copy h1 {
    font-family: var(--font-display);
    font-size: clamp(36px, 7vw, 64px);
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 14px;
    animation: fadeUp .7s .2s ease both;
}

.home-hero-copy p {
    max-width: 36em;
    margin: 0 0 28px;
    font-size: 16px;
    color: rgba(247, 250, 252, 0.86);
    animation: fadeUp .7s .3s ease both;
}

.home-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    animation: fadeUp .7s .4s ease both;
}

.home-cta .btn-teal {
    background: #f4e8cc;
    color: #3d2e0e;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}

.home-cta .btn-teal:hover { background: #ffeecf; }

.home-cta .btn-paper {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.45);
}

.home-cta .btn-paper:hover {
    background: rgba(255, 255, 255, 0.12);
}

.home-section {
    margin-bottom: 40px;
}

.section-label {
    display: block;
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--ink);
    margin: 0 0 20px;
    letter-spacing: 0.04em;
}

.home-meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 48px;
}

.meta-item {
    padding: 22px 24px;
    border-radius: var(--radius);
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.meta-item h3 {
    margin: 0 0 8px;
    font-size: 15px;
    font-family: var(--font-display);
    color: var(--accent);
}

.meta-item p {
    margin: 0;
    font-size: 14px;
    color: var(--ink-soft);
}

/* Legacy homepage helpers kept for compatibility */
.bento,
.bento-main,
.bento-side,
.side-card,
.tag-row,
.tag { display: contents; }

.comic-list { display: grid; gap: 16px; }

.comic-row {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 22px;
    align-items: center;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
    transition: transform .25s ease, box-shadow .25s ease;
}

.comic-row:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 48px rgba(26, 35, 50, 0.12);
}

.comic-thumb {
    aspect-ratio: 3/4;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.comic-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}

.comic-row:hover .comic-thumb img { transform: scale(1.05); }

.comic-row h3 {
    margin: 0 0 8px;
    font-family: var(--font-display);
    font-size: 22px;
}

.comic-row p {
    margin: 0;
    font-size: 14px;
    color: var(--ink-soft);
}

/* Reader */
.reader-bar {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px 26px;
    margin-bottom: 28px;
}

.reader-bar h1 {
    font-family: var(--font-display);
    font-size: 28px;
    margin: 0 0 6px;
}

.reader-meta {
    font-size: 13px;
    color: var(--ink-soft);
    font-weight: 500;
}

.reader-progress {
    width: 100%;
    height: 4px;
    background: rgba(26, 35, 50, 0.08);
    border-radius: 4px;
    margin-top: 14px;
    overflow: hidden;
}

.reader-progress i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), #1aa0a0);
    transition: width .4s ease;
}

.manga-flow { display: flex; flex-direction: column; gap: 24px; }

.manga-sheet {
    background: var(--panel-solid);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: linear-gradient(90deg, var(--accent-soft), transparent);
    border-bottom: 1px solid var(--line);
    font-size: 13px;
    font-weight: 700;
}

.sheet-free {
    background: var(--accent);
    color: #fff;
    padding: 3px 10px;
    font-size: 11px;
    border-radius: 6px;
    letter-spacing: 0.06em;
}

.manga-sheet img { width: 100%; display: block; }

.paywall {
    padding: 64px 28px;
    text-align: center;
    background:
        radial-gradient(circle at 50% 0%, rgba(184, 135, 43, 0.12), transparent 55%),
        linear-gradient(180deg, #f8fafb, #eef4f5);
}

.paywall-icon { display: none; }

.paywall h3 {
    margin: 0 0 8px;
    font-family: var(--font-display);
    font-size: 22px;
}

.paywall p {
    margin: 0 0 16px;
    color: var(--ink-soft);
    font-size: 14px;
}

.paywall-price {
    font-family: var(--font-display);
    font-size: 40px;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 22px;
}

.paywall-btns {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.paywall-msg { font-size: 13px; margin-top: 14px; min-height: 20px; }
.paywall-msg.ok { color: var(--accent); font-weight: 700; }
.paywall-msg.err { color: var(--danger); font-weight: 700; }

.reader-note {
    margin-top: 28px;
    padding: 16px 20px;
    background: var(--accent-soft);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: #245656;
}

.reader-note a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Content */
.article {
    max-width: 720px;
    margin: 0 auto;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px 42px;
}

.article h1 {
    font-family: var(--font-display);
    font-size: 30px;
    margin: 0 0 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.article p { margin: 0 0 16px; color: var(--ink-soft); }

/* Member */
.auth-box {
    max-width: 440px;
    margin: 0 auto;
}

.box {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 36px 38px;
    margin-bottom: 20px;
    backdrop-filter: blur(8px);
}

.box-title {
    font-family: var(--font-display);
    font-size: 30px;
    margin: 0 0 24px;
}

.field { margin-bottom: 18px; }

.field label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--ink-soft);
}

.field input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.85);
    font-size: 15px;
    font-family: inherit;
    transition: border-color .2s, box-shadow .2s;
}

.field input:focus {
    outline: none;
    border-color: rgba(11, 110, 110, 0.45);
    box-shadow: 0 0 0 4px rgba(11, 110, 110, 0.1);
}

.box-link {
    margin-top: 16px;
    font-size: 14px;
    color: var(--ink-soft);
}

.box-link a {
    color: var(--accent);
    font-weight: 700;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.stat-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--ink-soft);
    margin-bottom: 4px;
}

.stat-val { font-size: 16px; font-weight: 700; }
.stat-balance {
    font-family: var(--font-display);
    font-size: 30px;
    color: var(--accent);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table th,
.table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.table th {
    font-size: 12px;
    color: var(--ink-soft);
}

.pill {
    display: inline-block;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 6px;
}

.pill-pending { background: var(--gold-soft); color: #7a5a18; }
.pill-completed { background: var(--accent-soft); color: var(--accent); }
.pill-cancelled { background: #f6dede; color: var(--danger); }

.empty { text-align: center; padding: 32px; color: var(--ink-soft); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }

.chip {
    padding: 8px 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel-solid);
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}

.chip.on, .chip:hover {
    background: var(--accent-soft);
    border-color: rgba(11, 110, 110, 0.3);
}

.split { display: flex; flex-wrap: wrap; gap: 32px; }
.split-main { flex: 1; min-width: 260px; }
.split-side { flex: 0 0 260px; text-align: center; }

.recharge-pack {
    padding: 28px;
    border-radius: var(--radius);
    background:
        radial-gradient(circle at 20% 0%, rgba(184, 135, 43, 0.25), transparent 50%),
        linear-gradient(160deg, #0d5f5f, #0a4545);
    color: #f7fafc;
    text-align: center;
    box-shadow: 0 16px 40px rgba(10, 70, 70, 0.25);
}

.recharge-pack .hint { color: rgba(247, 250, 252, 0.75); }

.recharge-pack-price {
    font-family: var(--font-display);
    font-size: 42px;
    font-weight: 700;
    line-height: 1;
    color: var(--gold-soft);
}

.recharge-pack-tickets {
    margin-top: 10px;
    font-size: 20px;
    font-weight: 700;
}

.hint { font-size: 13px; color: var(--ink-soft); }
.flash.ok { color: var(--accent); font-weight: 700; }
.flash.err { color: var(--danger); font-weight: 700; }

/* Modal leftovers */
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 28, 40, 0.45);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.overlay.show { display: flex; }

.dialog {
    background: var(--panel-solid);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 400px;
    padding: 28px 32px;
    position: relative;
}

.dialog-x {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    font-weight: 700;
}

.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--line);
}

.tabs button {
    flex: 1;
    padding: 10px;
    border: none;
    background: var(--mist);
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}

.tabs button.active {
    background: var(--accent);
    color: #fff;
}

.tab-pane { display: none; }
.tab-pane.active { display: block; }
.tab-flash { margin-top: 10px; font-size: 13px; }
.tab-flash.err { color: var(--danger); font-weight: 700; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes heroRise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes heroZoom {
    from { transform: scale(1.08); }
    to { transform: scale(1.02); }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .home-hero {
        margin: -28px -16px 40px;
        min-height: 72vh;
        border-radius: 0 0 22px 22px;
    }
    .page { padding: 28px 16px 72px; }
    .home-meta { grid-template-columns: 1fr; }
    .profile-grid { grid-template-columns: 1fr; }
    .comic-row { grid-template-columns: 84px 1fr; }
    .article { padding: 28px 22px; }
    .box { padding: 28px 24px; }
}
