:root {
    --mobile-shell-max: 560px;
    --mobile-shell-gutter: 8px;
    --mobile-shell-top-gap: 8px;
    --mobile-shell-width: min(var(--mobile-shell-max), calc(100% - var(--mobile-shell-gutter) - var(--mobile-shell-gutter)));
    --mobile-shell-outer: max(var(--mobile-shell-gutter), calc((100% - var(--mobile-shell-width)) / 2));
    --app-bg: #F3F3F3;
    --color-surface: #fffdf8;
    --color-surface-soft: #fbf3e8;
    --color-text: #211914;
    --color-muted: #7d6a55;
    --color-border: rgba(126, 92, 62, 0.16);
    --color-accent: #8d2d28;
    --color-accent-strong: #6f211d;
    --color-accent-soft: rgba(141, 45, 40, 0.035);
    --color-accent-soft-strong: rgba(141, 45, 40, 0.07);
    --bottom-nav-color: #3a3a3a;
    --bottom-nav-active-color: var(--color-accent);
    --bottom-nav-bg: #f5f5f5;
    --shadow-card: none;
    --bottom-nav-height: 70px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    width: 100%;
    overflow-x: hidden;
    background: var(--app-bg);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    font-size: 16px;
}

html.wechat-font-ready body {
    opacity: 1;
}

body {
    width: 100%;
    min-width: 0;
    margin: 0;
    overflow-x: hidden;
    background: var(--app-bg);
    color: var(--color-text);
    font-size: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    line-height: 1.5;
    touch-action: manipulation;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.modal-open {
    overflow: hidden;
}

.dt-picker {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.dt-picker.is-open {
    display: flex;
}

.dt-picker.is-rendering .dt-picker-sheet {
    visibility: hidden;
}

.dt-picker-mask {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.48);
}

.dt-picker-sheet {
    position: relative;
    z-index: 1;
    width: min(100%, var(--mobile-shell-width));
    overflow: hidden;
    border-radius: 22px 22px 0 0;
    background: #fff;
    padding: 24px 18px max(24px, env(safe-area-inset-bottom));
    box-sizing: border-box;
}

.dt-picker-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 46px 72px;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.dt-picker-tabs {
    display: inline-grid;
    grid-template-columns: repeat(2, minmax(54px, auto));
    align-items: center;
    gap: 0;
    min-height: 38px;
    padding: 2px;
    justify-self: start;
    border: 1px solid rgba(48, 72, 64, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.86);
    -webkit-tap-highlight-color: transparent;
}

.dt-picker-spacer {
    min-height: 1px;
}

.dt-picker-tabs button,
.dt-picker-today,
.dt-picker-confirm {
    min-height: 42px;
    border: 0;
    font-size: 16px;
    font-weight: 600;
    touch-action: manipulation;
}

.dt-picker-tabs button {
    min-height: 32px;
    padding: 0 16px;
    border-radius: 999px;
    background: transparent;
    color: #9a9a9a;
    font-size: 14px;
    line-height: 1;
    transition: color 160ms ease, background-color 160ms ease;
    -webkit-tap-highlight-color: transparent;
}

.dt-picker-tabs button.active {
    background: var(--color-accent);
    color: #fff;
    box-shadow: none;
}

.dt-picker-tabs button:active,
.dt-picker-tabs button:focus {
    color: #8a8a8a;
    background: rgba(141, 45, 40, 0.06);
    outline: 0;
}

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

.dt-picker-today {
    border-radius: 999px;
    background: #f2f2f2;
    color: #222;
}

.dt-picker-confirm {
    border-radius: 999px;
    background: var(--color-accent);
    color: #fff;
    font-size: 15px;
}

.dt-picker-labels,
.dt-picker-wheel {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr 0.95fr 0.76fr 0.76fr;
}

.dt-picker-labels {
    padding: 0 0 8px;
    color: #222;
    font-size: 18px;
    font-weight: 500;
    text-align: center;
}

.dt-picker-wheel {
    position: relative;
    padding: 0;
}

.dt-picker-wheel::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 44px;
    height: 48px;
    border-radius: 12px;
    background: transparent;
    pointer-events: none;
    z-index: 0;
}

.dt-picker-wheel::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 56px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff 78%);
    pointer-events: none;
}

.dt-picker-column {
    position: relative;
    z-index: 1;
    display: block;
    height: 136px;
    padding: 44px 0;
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
    justify-items: center;
    scroll-behavior: auto;
    scroll-snap-type: none;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.dt-picker-column::-webkit-scrollbar {
    display: none;
}

.dt-picker-column button {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    border: 0;
    background: transparent;
    color: rgba(50, 50, 50, 0.18);
    font-size: 20px;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
}

.dt-picker-column button.active {
    z-index: 2;
    color: #050505;
    font-size: 26px;
    font-weight: 800;
}

@media (max-width: 390px) {
    .dt-picker-sheet {
        padding-right: 14px;
        padding-left: 14px;
    }

    .dt-picker-toolbar {
        grid-template-columns: minmax(0, 1fr) 42px 68px;
        gap: 8px;
    }

    .dt-picker-tabs button,
    .dt-picker-today,
    .dt-picker-confirm {
        min-height: 40px;
        font-size: 15px;
    }

    .dt-picker-tabs {
        grid-template-columns: repeat(2, minmax(48px, auto));
    }

    .dt-picker-tabs button {
        min-height: 30px;
        padding: 0 12px;
        font-size: 14px;
    }

    .dt-picker-labels {
        font-size: 16px;
    }

    .dt-picker-labels,
    .dt-picker-wheel {
        grid-template-columns: 1.04fr 1fr 1fr 0.72fr 0.72fr;
    }

    .dt-picker-column button {
        font-size: 18px;
    }

    .dt-picker-column button.active {
        font-size: 22px;
    }
}

img,
svg,
video,
canvas {
    max-width: 100%;
}

svg {
    overflow: visible;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: min(1120px, calc(100% - 16px));
    margin-right: auto;
    margin-left: auto;
}

.section {
    padding: 64px 0 48px;
}

.section-title {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.section-title h1,
.section-title h2 {
    margin: 0;
    color: var(--color-text);
    font-size: 26px;
    line-height: 1.25;
}

.section-title p {
    margin: 0;
    color: var(--color-muted);
    font-size: 14px;
    line-height: 1.6;
}

.section-kicker {
    display: none;
    margin: 0 0 6px;
    color: var(--color-muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
}

.back-link {
    color: #9a8268;
    font-size: 14px;
}

.rich-text h2,
.rich-text h3,
.rich-text h4 {
    margin: 22px 0 12px;
    line-height: 1.45;
}

.rich-text p {
    margin: 0 0 14px;
}

.rich-text ul,
.rich-text ol {
    margin: 0 0 16px;
    padding-left: 24px;
}

.rich-text blockquote {
    margin: 18px 0;
    padding: 12px 16px;
    color: #7a5d43;
    background: #f6ead8;
    border-left: 4px solid #c89b4d;
}

.rich-text img {
    max-width: 100%;
    height: auto;
    margin: 12px 0;
    border-radius: 6px;
}

.rich-text a {
    color: var(--color-accent);
    text-decoration: underline;
}

.empty-panel {
    padding: 24px;
    color: var(--color-muted);
    border: 1px solid var(--color-border);
    border-radius: 8px;
}

.member-empty,
.common-empty {
    padding: 14px 16px;
    color: var(--color-muted);
    border: 1px dashed rgba(126, 92, 62, 0.24);
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
}

button,
input,
select,
textarea {
    min-width: 0;
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    cursor: pointer;
}

.app-icon,
.icon-svg {
    display: block;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.entry-home-main,
.content-entry-main,
.tool-detail-shell,
.mall-mobile-shell,
.mall-product-mobile-page .mall-detail-page,
.cart-mobile-shell,
.orders-mobile-shell,
.member-mobile-shell,
.member-archive-shell,
.auth-page,
body > main.container.section {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-right: auto;
    margin-left: auto;
    overflow-x: clip;
}

.entry-home-main,
.content-entry-main,
.tool-detail-shell,
.mall-mobile-shell,
.mall-product-mobile-page .mall-detail-page,
.cart-mobile-shell,
.orders-mobile-shell,
.member-mobile-shell,
.member-archive-shell {
    padding-top: var(--mobile-shell-top-gap);
    padding-right: 0;
    padding-left: 0;
}

.entry-home-page,
.content-entry-page,
.tool-detail-page,
.mall-mobile-page,
.mall-product-mobile-page,
.cart-mobile-page,
.orders-mobile-page,
.member-mobile-page,
.member-mobile-body,
.auth-mobile-page {
    min-width: 0;
    overflow-x: hidden;
    background: var(--app-bg);
}

.site-bottom-spacer {
    height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
    flex: 0 0 auto;
}

.site-bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    display: flex;
    width: 100%;
    max-width: 100%;
    min-height: var(--bottom-nav-height);
    margin: 0;
    padding: 6px 0 max(8px, env(safe-area-inset-bottom));
    border: 0;
    border-top: 1px solid rgba(38, 64, 62, 0.06);
    border-radius: 0;
    background: var(--bottom-nav-bg);
    box-shadow: none;
}

.site-bottom-nav::before,
.site-bottom-nav a::before,
.site-bottom-nav a::after {
    display: none !important;
    content: none !important;
}

.site-bottom-nav a {
    position: relative;
    overflow: visible;
    display: flex;
    flex: 1 1 0;
    min-width: 0;
    min-height: 56px;
    padding: 5px 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--bottom-nav-color);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    transition: color 0.18s ease, opacity 0.18s ease;
}

.site-bottom-nav a:hover,
.site-bottom-nav a:active,
.site-bottom-nav a.is-active {
    border: 0;
    background: transparent;
    box-shadow: none;
    transform: none;
}

.site-bottom-nav a.is-active {
    color: var(--bottom-nav-active-color);
}

.site-bottom-nav-icon,
.site-bottom-nav svg,
.member-icon,
.mall-floating-actions svg,
.mall-buy-bar svg,
.tool-mobile-head svg,
.orders-mobile-head svg,
.member-archive-head svg {
    display: block;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.site-bottom-nav a.is-active .site-bottom-nav-icon,
.site-bottom-nav a:hover .site-bottom-nav-icon {
    transform: none;
    opacity: 1;
}

.site-bottom-nav a span {
    display: block;
    overflow: hidden;
    max-width: 100%;
    color: currentColor;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.entry-home-main > *,
.content-entry-main > *,
.tool-detail-shell > *,
.mall-mobile-shell > *,
.cart-mobile-shell > *,
.orders-mobile-shell > *,
.member-mobile-shell > *,
.member-archive-shell > * {
    min-width: 0;
}

.entry-home-main img,
.content-entry-main img,
.tool-detail-shell img,
.mall-mobile-shell img,
.cart-mobile-shell img,
.orders-mobile-shell img,
.member-mobile-shell img,
.member-archive-shell img {
    height: auto;
}

.entry-home-main button,
.content-entry-main button,
.tool-detail-shell button,
.mall-mobile-shell button,
.cart-mobile-shell button,
.orders-mobile-shell button,
.member-mobile-shell button,
.member-archive-shell button,
.mall-floating-actions button,
.mall-buy-bar button {
    touch-action: manipulation;
}

.entry-home-main a:focus-visible,
.content-entry-main a:focus-visible,
.tool-detail-shell a:focus-visible,
.mall-mobile-shell a:focus-visible,
.cart-mobile-shell a:focus-visible,
.orders-mobile-shell a:focus-visible,
.member-mobile-shell a:focus-visible,
.member-archive-shell a:focus-visible,
.entry-home-main button:focus-visible,
.content-entry-main button:focus-visible,
.tool-detail-shell button:focus-visible,
.mall-mobile-shell button:focus-visible,
.cart-mobile-shell button:focus-visible,
.orders-mobile-shell button:focus-visible,
.member-mobile-shell button:focus-visible,
.member-archive-shell button:focus-visible {
    outline: 2px solid rgba(141, 45, 40, 0.38);
    outline-offset: 2px;
}

.member-archive-head,
.tool-mobile-head,
.orders-mobile-head,
.cart-mobile-head {
    gap: 0;
    padding-left: 0;
}

.member-archive-back,
.tool-page-back,
.orders-mobile-head > a,
.cart-mobile-head > a {
    justify-self: start;
    margin-left: 0;
    padding-left: 0;
}

.mobile-card,
.member-panel,
.member-mobile-card,
.orders-list,
.cart-summary-card {
    border: 1px solid var(--color-border);
    box-shadow: none;
}

@media (min-width: 720px) {
    :root {
        --mobile-shell-max: 760px;
        --mobile-shell-gutter: 8px;
    }
}

@media (max-width: 719px) {
    .container {
        width: var(--mobile-shell-width);
    }

    .section {
        padding: 18px 0 28px;
    }

    .section-title {
        display: grid;
        gap: 6px;
        margin-bottom: 14px;
    }

    .section-title h1,
    .section-title h2 {
        font-size: 22px;
    }
}

@media (min-width: 921px) {
    :root {
        --mobile-shell-max: 1080px;
        --mobile-shell-gutter: 8px;
    }

    .site-bottom-spacer {
        height: calc(104px + env(safe-area-inset-bottom));
    }

    .site-bottom-nav a {
        min-height: 62px;
        font-size: 13px;
    }
}

@media (min-width: 1200px) {
    :root {
        --mobile-shell-max: 1180px;
    }
}

/* Unified mobile-page outer spacing. Keep page gutters aligned with the shared bottom nav. */
.entry-home-main,
.content-entry-main,
.tool-detail-shell,
.mall-mobile-shell,
.mall-product-mobile-page .mall-detail-page,
.cart-mobile-shell,
.orders-mobile-shell,
.member-mobile-shell,
.member-archive-shell,
.auth-page,
body > main.container.section {
    width: 100%;
    max-width: 100%;
    margin-right: auto;
    margin-left: auto;
    padding-top: var(--mobile-shell-top-gap);
    padding-right: 0;
    padding-left: 0;
}

.site-bottom-nav,
.mall-buy-bar,
.cart-action-bar {
    width: 100%;
    max-width: 100%;
    margin-right: auto;
    margin-left: auto;
}

@media (min-width: 720px) {
    .site-bottom-nav {
        width: var(--mobile-shell-width);
        max-width: var(--mobile-shell-width);
        margin-right: auto;
        margin-left: auto;
    }
}

/* Final app shell alignment. Page CSS is loaded after common.css, so this block is
   repeated there only for components that need fixed-position correction. */
.entry-home-main,
.content-entry-main,
.tool-detail-shell,
.mall-mobile-shell,
.mall-product-mobile-page .mall-detail-page,
.cart-mobile-shell,
.orders-mobile-shell,
.member-mobile-shell,
.member-archive-shell,
.auth-page {
    width: var(--mobile-shell-width);
    max-width: var(--mobile-shell-width);
    margin-right: auto;
    margin-left: auto;
    padding-top: var(--mobile-shell-top-gap);
    padding-right: 0;
    padding-left: 0;
}

.entry-home-main > :first-child,
.content-entry-main > :first-child,
.tool-detail-shell > :first-child,
.mall-mobile-shell > :first-child,
.cart-mobile-shell > :first-child,
.orders-mobile-shell > :first-child,
.member-mobile-shell > :first-child,
.member-archive-shell > :first-child {
    margin-top: 0;
}

.entry-home-page .site-bottom-nav,
.content-entry-page .site-bottom-nav,
.tool-detail-page .site-bottom-nav,
.mall-mobile-page .site-bottom-nav,
.mall-product-mobile-page .site-bottom-nav,
.cart-mobile-page .site-bottom-nav,
.orders-mobile-page .site-bottom-nav,
.member-mobile-page .site-bottom-nav,
.member-mobile-body .site-bottom-nav,
.auth-mobile-page .site-bottom-nav {
    width: 100%;
    max-width: 100%;
    right: 0;
    left: 0;
    margin-right: auto;
    margin-left: auto;
}

@media (min-width: 720px) {
    .entry-home-page .site-bottom-nav,
    .content-entry-page .site-bottom-nav,
    .tool-detail-page .site-bottom-nav,
    .mall-mobile-page .site-bottom-nav,
    .mall-product-mobile-page .site-bottom-nav,
    .cart-mobile-page .site-bottom-nav,
    .orders-mobile-page .site-bottom-nav,
    .member-mobile-page .site-bottom-nav,
    .member-mobile-body .site-bottom-nav,
    .auth-mobile-page .site-bottom-nav {
        width: var(--mobile-shell-width);
        max-width: var(--mobile-shell-width);
    }
}

