/* ========================================
   漫蛙漫画APP — 清新绿色主题
   ======================================== */

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

:root {
    --bg: #f0faf3;
    --bg-elevated: #ffffff;
    --bg-card: #ffffff;
    --bg-hover: #e8f7ed;

    --green: #16a34a;
    --green-dark: #15803d;
    --green-light: #4ade80;
    --green-dim: rgba(22, 163, 74, 0.12);
    --green-glow: rgba(74, 222, 128, 0.25);

    --accent: #059669;
    --warn: #d97706;
    --warn-dim: rgba(217, 119, 6, 0.1);

    --text: #1a2e22;
    --text-soft: #4b5e52;
    --text-muted: #8a9a90;

    --line: #cce8d4;
    --line-bright: #a7d4b5;

    --font: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    --mono: "Cascadia Code", "Consolas", monospace;
    --ease: 0.2s ease;
    --page-w: 1180px;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg);
    background-image:
        radial-gradient(ellipse at 0% 0%, rgba(74, 222, 128, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 100%, rgba(22, 163, 74, 0.08) 0%, transparent 50%);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
}

.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    z-index: 9999;
    padding: 8px 16px;
    background: var(--green);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 6px;
}

.skip-link:focus {
    top: 12px;
}

/* ---- 顶部导航 ---- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 8px rgba(22, 163, 74, 0.06);
}

.topbar-inner {
    max-width: var(--page-w);
    margin: 0 auto;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar-logo {
    font-size: 20px;
    font-weight: 800;
    color: var(--green-dark);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.topbar-logo span {
    color: var(--green);
    margin-left: 2px;
}

.topbar-nav {
    list-style: none;
    display: flex;
    gap: 4px;
}

.topbar-nav a {
    display: block;
    padding: 6px 14px;
    font-size: 13px;
    color: var(--text-soft);
    text-decoration: none;
    border-radius: 20px;
    transition: color var(--ease), background var(--ease);
}

.topbar-nav a:hover {
    color: var(--green-dark);
    background: var(--green-dim);
}

/* ---- 首屏 Hero ---- */
.hero {
    background: linear-gradient(135deg, #15803d 0%, #16a34a 45%, #22c55e 100%);
    overflow: hidden;
    position: relative;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 10% 80%, rgba(255, 255, 255, 0.08) 0%, transparent 35%);
    pointer-events: none;
}

.hero-inner {
    max-width: var(--page-w);
    margin: 0 auto;
    padding: 48px 24px 40px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: end;
    position: relative;
    z-index: 1;
}

.hero-label {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 14px;
}

.hero-text h1 {
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #fff;
}

.hero-sub {
    margin-top: 12px;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.88);
    letter-spacing: 0.04em;
}

.hero-notice {
    background: rgba(255, 255, 255, 0.95);
    border: 2px dashed var(--green);
    padding: 20px 24px;
    border-radius: 12px;
    transform: rotate(-1deg);
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.hero-notice::before {
    content: "提示";
    position: absolute;
    top: -11px;
    left: 20px;
    background: var(--warn);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 4px;
}

.hero-notice p {
    font-size: 14px;
    line-height: 1.75;
    font-weight: 600;
    color: var(--green-dark);
}

/* ---- 主内容区 ---- */
.page-body {
    max-width: var(--page-w);
    margin: 0 auto;
    padding: 40px 24px 60px;
}

.block {
    margin-bottom: 48px;
}

.block-head {
    margin-bottom: 24px;
    display: flex;
    align-items: baseline;
    gap: 14px;
    flex-wrap: wrap;
}

.block-tag {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: #fff;
    background: var(--green);
    padding: 3px 10px;
    border-radius: 4px;
}

.block-title {
    font-size: clamp(1.25rem, 3vw, 1.65rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--green-dark);
}

/* ---- 下载列表 ---- */
.app-grid {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.app-card {
    border: 1px solid var(--line);
    background: var(--bg-card);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.06);
    transition: border-color var(--ease), box-shadow var(--ease), background var(--ease);
}

.app-card:hover {
    border-color: var(--green-light);
    background: var(--bg-hover);
    box-shadow: 0 4px 16px var(--green-glow);
}

.app-card-link {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    text-decoration: none;
    color: inherit;
}

.app-card-link:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: -2px;
}

.app-card-cover {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--bg);
    border: 2px solid var(--line);
    border-radius: 12px;
    margin: 0;
}

.app-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.app-card-body {
    flex: 1;
    min-width: 0;
    padding: 0;
}

.download-link-text {
    font-size: 14px;
    font-weight: 700;
    color: var(--green-dark);
    line-height: 1.4;
    margin-bottom: 4px;
}

.app-card:hover .download-link-text {
    color: var(--green);
}

.download-desc {
    font-size: 12.5px;
    color: var(--text-soft);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.app-card-btn {
    flex-shrink: 0;
    display: inline-block;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: var(--green);
    border-radius: 20px;
    white-space: nowrap;
    transition: background var(--ease), transform var(--ease);
}

.app-card:hover .app-card-btn {
    background: var(--green-dark);
    transform: scale(1.04);
}

/* ---- 功能四宫格 ---- */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.feature-cell {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 22px 18px;
    transition: border-color var(--ease), box-shadow var(--ease);
}

.feature-cell:hover {
    border-color: var(--green-light);
    box-shadow: 0 4px 12px var(--green-glow);
}

.feature-num {
    display: block;
    font-family: var(--mono);
    font-size: 24px;
    font-weight: 800;
    color: var(--green);
    opacity: 0.6;
    line-height: 1;
    margin-bottom: 10px;
}

.feature-cell .content-text {
    font-size: 13px;
    margin-bottom: 0;
}

/* ---- 双栏 ---- */
.split-row {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 32px;
    margin-bottom: 48px;
}

.split-row .block {
    margin-bottom: 0;
}

.intro-body {
    border-left: 3px solid var(--green);
    padding-left: 20px;
}

.content-text {
    font-size: 14px;
    line-height: 1.85;
    color: var(--text-soft);
    margin-bottom: 14px;
}

.content-text:last-child {
    margin-bottom: 0;
}

/* ---- 评论 ---- */
.comment-stream {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.comment-box {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.comment-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: var(--green-dim);
    border: 2px solid var(--green-light);
    border-radius: 50%;
    color: var(--green-dark);
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.comment-bubble {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: 0 10px 10px 10px;
    padding: 14px 16px;
    box-shadow: 0 1px 4px rgba(22, 163, 74, 0.05);
}

.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.comment-user {
    font-size: 13px;
    font-weight: 700;
    color: var(--green-dark);
}

.comment-time {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-muted);
}

.comment-content {
    font-size: 13.5px;
    color: var(--text-soft);
    line-height: 1.65;
}

/* ---- 免责声明 ---- */
.block-disclaimer {
    border: 1px dashed var(--line-bright);
    border-radius: 10px;
    padding: 28px;
    background: var(--bg-elevated);
}

.block-disclaimer .block-tag {
    background: var(--text-muted);
}

.disclaimer-body {
    columns: 2;
    column-gap: 32px;
}

.disclaimer-body .content-text {
    break-inside: avoid;
    font-size: 13px;
}

/* ---- 页脚 ---- */
.footer {
    border-top: 1px solid var(--line);
    background: var(--green-dark);
    padding: 32px 24px;
}

.footer-grid {
    max-width: var(--page-w);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 32px;
    align-items: center;
}

.footer-name {
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 6px;
}

.footer-copy {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.footer-beian {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.footer a {
    color: var(--green-light);
    text-decoration: none;
}

.footer a:hover {
    color: #fff;
    text-decoration: underline;
}

/* 二维码：PC端右侧悬浮 */
.float-qrcode {
    position: fixed;
    right: 28px;
    bottom: 100px;
    z-index: 999;
    text-align: center;
    transition: transform var(--ease);
}

.float-qrcode:hover {
    transform: translateY(-4px);
}

.float-qrcode img {
    width: 120px;
    height: 120px;
    border: 3px solid var(--green);
    border-radius: 10px;
    background: #fff;
    padding: 4px;
    display: block;
    box-shadow: 0 4px 20px var(--green-glow);
}

.float-qrcode .tip {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--green-dark);
    background: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.12);
}

/* ---- 404 ---- */
.page-404 {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.error-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    position: relative;
}

.error-stage::before {
    content: "404";
    position: absolute;
    font-size: clamp(12rem, 40vw, 28rem);
    font-weight: 900;
    color: rgba(22, 163, 74, 0.06);
    line-height: 1;
    user-select: none;
    pointer-events: none;
}

.error-panel {
    position: relative;
    z-index: 1;
    max-width: 520px;
    width: 100%;
    border: 2px solid var(--green);
    border-radius: 16px;
    background: var(--bg-card);
    padding: 48px 40px;
    text-align: center;
    box-shadow: 0 8px 32px var(--green-glow);
}

.error-num {
    font-family: var(--mono);
    font-size: clamp(4rem, 12vw, 6rem);
    font-weight: 900;
    color: var(--green);
    line-height: 1;
}

.error-desc {
    font-size: 16px;
    color: var(--text-soft);
    margin: 20px 0 32px;
    line-height: 1.7;
}

.home-btn {
    display: inline-block;
    padding: 14px 40px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    background: var(--green);
    text-decoration: none;
    border-radius: 24px;
    transition: background var(--ease), transform var(--ease);
}

.home-btn:hover {
    background: var(--green-dark);
    transform: translateY(-2px);
}

.error-hint {
    margin-top: 24px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ---- 响应式 ---- */
@media (max-width: 900px) {
    .hero-inner {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .hero-notice {
        transform: none;
    }

    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .split-row {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .disclaimer-body {
        columns: 1;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
        justify-items: center;
    }
}

@media (max-width: 640px) {
    .topbar-nav {
        display: none;
    }

    .float-qrcode {
        display: none !important;
    }

    .page-body {
        padding: 28px 16px 40px;
    }

    .app-grid {
        gap: 8px;
    }

    .app-card-link {
        gap: 10px;
        padding: 10px 12px;
    }

    .app-card-cover {
        width: 52px;
        height: 52px;
        border-radius: 10px;
    }

    .download-link-text {
        font-size: 13px;
    }

    .download-desc {
        display: none;
    }

    .app-card-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .hero-inner {
        padding: 32px 16px 28px;
    }

    .error-panel {
        padding: 36px 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
