/* ================= 全局重置 ================= */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    color: #1a2a25;
    background: #f9fafb;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    display: block;
}

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

button {
    font: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

ul {
    list-style: none;
}

/* ================= 通用容器 ================= */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ================= 导航栏 ================= */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid #e8f0ec;
    box-shadow: 0 2px 12px rgba(19, 42, 34, .04);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
}

.logo {
    font-size: 18px;
    font-weight: 800;
    color: #0b8a5e;
    letter-spacing: .5px;
    line-height: 1.2;
    display: flex;
    flex-direction: column;
}

.logo .sub {
    font-size: 11px;
    font-weight: 500;
    color: #9ca3af;
    letter-spacing: 2px;
    margin-top: 2px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-links a {
    display: block;
    padding: 8px 16px;
    font-size: 15px;
    font-weight: 600;
    color: #4b5563;
    border-radius: 10px;
    transition: color .2s, background .2s;
}

.nav-links a:hover {
    color: #0b8a5e;
    background: #f0fdf6;
}

.nav-links .nav-cta {
    background: linear-gradient(135deg, #0b8a5e, #14a973);
    color: #fff !important;
    padding: 8px 22px;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(11, 138, 94, .25);
}

.nav-links .nav-cta:hover {
    background: linear-gradient(135deg, #0a7a52, #119a67);
    box-shadow: 0 6px 18px rgba(11, 138, 94, .35);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    padding: 8px;
    transition: background .2s;
}

.menu-toggle:hover {
    background: #f0fdf6;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 2.5px;
    border-radius: 4px;
    background: #1a2a25;
    transition: transform .3s, opacity .3s;
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
}

/* ================= 404 主体 ================= */
.page-404 {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at 12% 8%, #e6f5ef 0%, transparent 52%),
        radial-gradient(circle at 88% 92%, #eef7f2 0%, transparent 48%),
        #f9fafb;
}

.err-main {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 60px 0 80px;
}

.err-inner {
    text-align: center;
    max-width: 760px;
    margin: 0 auto;
}

/* ---- 麻将牌 404 ---- */
.err-tiles {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 44px;
}

.err-tiles::before {
    content: "";
    position: absolute;
    inset: -70px -50px -50px;
    background: radial-gradient(circle, rgba(11, 138, 94, .16), transparent 68%);
    z-index: 0;
    pointer-events: none;
}

.mj-tile {
    position: relative;
    z-index: 1;
    width: 96px;
    height: 122px;
    border-radius: 14px;
    background: linear-gradient(165deg, #ffffff 0%, #f7f2e7 58%, #eee6d5 100%);
    border: 1px solid #e4dccb;
    box-shadow:
        0 8px 0 #ddd3bd,
        0 18px 30px rgba(19, 42, 34, .14);
    display: grid;
    place-items: center;
    font-size: 56px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -2px;
    animation: mjFloat 3.6s ease-in-out infinite;
}

.mj-tile::after {
    content: "";
    position: absolute;
    inset: 9px;
    border-radius: 8px;
    border: 1px dashed rgba(11, 138, 94, .16);
    pointer-events: none;
}

.mj-tile--green { color: #0b8a5e; }
.mj-tile--red   { color: #d93a2b; }

.mj-tile:nth-child(2) {
    margin-top: -20px;
    animation-delay: .35s;
}
.mj-tile:nth-child(3) { animation-delay: .7s; }

@keyframes mjFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-12px); }
}

/* ---- 文案 ---- */
.err-title {
    font-size: 30px;
    font-weight: 800;
    color: #1a2a25;
    margin-bottom: 16px;
    letter-spacing: .5px;
}

.err-title span { color: #0b8a5e; }

.err-desc {
    font-size: 16px;
    line-height: 1.9;
    color: #4b5563;
    margin-bottom: 34px;
}

.err-desc strong { color: #0b8a5e; }

/* ---- 按钮组 ---- */
.err-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    margin-bottom: 40px;
}

.err-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 32px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
}

.err-btn--primary {
    background: linear-gradient(135deg, #0b8a5e, #14a973);
    color: #fff;
    box-shadow: 0 8px 22px rgba(11, 138, 94, .3);
}

.err-btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(11, 138, 94, .38);
}

/* ---- 底部小提示 ---- */
.err-tip {
    margin-top: 34px;
    font-size: 13px;
    color: #9ca3af;
    line-height: 1.9;
}

.err-tip .dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #0b8a5e;
    vertical-align: middle;
    margin: 0 8px 2px;
    opacity: .6;
}

/* ================= 模态框 ================= */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15, 26, 22, .55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
    animation: fadeIn .25s ease;
}

.modal-overlay.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-container {
    position: relative;
    width: 100%;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .22);
    padding: 32px 28px 28px;
    animation: slideUp .3s ease;
    max-height: 92vh;
    overflow-y: auto;
}

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

.modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 18px;
    color: #6b7f76;
    background: #f3f7f5;
    transition: background .2s, color .2s;
}

.modal-close:hover {
    background: #e6f0eb;
    color: #1a2a25;
}

.modal-header {
    margin-bottom: 8px;
}

.modal-body {
    padding-top: 6px;
}

.modal-tag {
    display: inline-block;
    background: #e6f5ef;
    color: #0b8a5e;
    font-weight: 600;
    padding: 6px 18px;
    border-radius: 30px;
    font-size: 14px;
}

.modal-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 14px 0 12px;
}

.modal-divider span:first-child,
.modal-divider span:last-child {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, #d1d5db);
}

.modal-divider span:last-child {
    background: linear-gradient(to left, transparent, #d1d5db);
}

.modal-divider .txt {
    font-size: 13px;
    color: #9ca3af;
    font-weight: 500;
    white-space: nowrap;
}

.qr-box {
    background: #f8fafc;
    padding: 16px;
    border-radius: 20px;
    border: 2px solid #e8f0ec;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .04);
    display: inline-block;
}

.qr-box img {
    width: 160px;
    height: 160px;
    border-radius: 12px;
}

.modal-phone {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 800;
    color: #0b8a5e;
    background: #f0fdf6;
    padding: 10px 32px;
    border-radius: 60px;
    border: 2px solid #0b8a5e;
    transition: all .2s;
    box-shadow: 0 4px 12px rgba(11, 138, 94, .15);
}

.modal-phone:hover {
    background: #e0f5ec;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(11, 138, 94, .25);
}

/* ================= 响应式 ================= */
@media (max-width: 900px) {
    .navbar .container {
        height: 60px;
    }

    .logo {
        font-size: 16px;
    }

    .logo .sub {
        font-size: 10px;
        letter-spacing: 1.5px;
    }

    .menu-toggle {
        display: flex;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        background: rgba(255, 255, 255, .98);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        padding: 12px 16px 18px;
        border-bottom: 1px solid #e8f0ec;
        box-shadow: 0 16px 32px rgba(19, 42, 34, .08);
        transform: translateY(-8px);
        opacity: 0;
        pointer-events: none;
        transition: transform .25s ease, opacity .25s ease;
    }

    .nav-links.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-links a {
        padding: 12px 16px;
        font-size: 15px;
        border-radius: 12px;
    }

    .nav-links .nav-cta {
        text-align: center;
        margin-top: 4px;
    }

    .err-main {
        padding: 40px 0 60px;
    }

    .err-tiles {
        gap: 12px;
        margin-bottom: 34px;
    }

    .mj-tile {
        width: 66px;
        height: 84px;
        border-radius: 10px;
        font-size: 38px;
        box-shadow: 0 6px 0 #ddd3bd, 0 12px 20px rgba(19, 42, 34, .12);
    }

    .mj-tile::after {
        inset: 6px;
        border-radius: 6px;
    }

    .mj-tile:nth-child(2) {
        margin-top: -14px;
    }

    .err-title {
        font-size: 22px;
    }

    .err-desc {
        font-size: 14.5px;
    }

    .err-actions {
        gap: 10px;
    }

    .err-btn {
        padding: 11px 22px;
        font-size: 14px;
        flex: 1 1 44%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .modal-container {
        padding: 26px 18px 22px;
        border-radius: 20px;
    }

    .modal-close {
        top: 10px;
        right: 12px;
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .qr-box img {
        width: 140px;
        height: 140px;
    }

    .modal-phone {
        font-size: 18px;
        padding: 8px 20px;
    }

    .modal-phone span:first-child {
        font-size: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mj-tile {
        animation: none;
    }
    .modal-container,
    .modal-overlay {
        animation: none;
    }
}