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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    background: #fff;
    color: #333;
    line-height: 1.6;
    min-height: 100dvh;
    padding-bottom: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

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

a,
button {
    -webkit-tap-highlight-color: transparent;
}

button {
    font: inherit;
}

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

:focus-visible {
    outline: 3px solid #6b4a2b;
    outline-offset: 3px;
}

.header-actions svg:focus-visible,
.carousel-dot:focus-visible {
    outline-offset: 2px;
}

/* ===== Header ===== */
.header {
    position: sticky;
    top: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 50px;
    padding: 0 15px;
    background: #fff;
    border-top: 3px solid #a67c52;
    border-bottom: 1px solid #eee;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    width: 34px;
    height: 34px;
}

.logo-text {
    font-size: 21px;
    font-weight: bold;
    color: #a67c52;
    letter-spacing: 2px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.header-actions svg {
    width: 24px;
    height: 24px;
    fill: #a67c52;
    cursor: pointer;
}

/* ===== Side Menu ===== */
.menu-overlay {
    display: none;
    position: fixed;
    top: 50px;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 300;
    background: rgba(0, 0, 0, 0.4);
}

.menu-overlay.active {
    display: block;
}

.side-menu {
    position: fixed;
    top: 50px;
    right: -280px;
    width: 280px;
    height: calc(100dvh - 50px);
    z-index: 301;
    background: #a67c52;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.side-menu.active {
    right: 0;
}

.side-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    color: #fff;
    font-size: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
}

.side-menu-item:hover,
.side-menu-item:active {
    background: rgba(0, 0, 0, 0.1);
}

.side-menu-item[role="button"] {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    font-family: inherit;
}

.side-menu-item svg {
    width: 16px;
    height: 16px;
    fill: #fff;
}

.side-menu-sub {
    background: rgba(0, 0, 0, 0.1);
    display: none;
}

.side-menu-sub.active {
    display: block;
}

.side-menu-sub a {
    display: block;
    padding: 14px 20px 14px 36px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* ===== Page Banner ===== */
.page-banner {
    position: relative;
    width: 100%;
    height: 350px;
    overflow: hidden;
}

.page-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.page-banner-label {
    position: absolute;
    left: 0;
    bottom: 10px;
    padding: 8px 45px 8px 15px;
    background: rgba(0, 0, 0, 0.1);
    color: #333;
    font-size: 16px;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
    padding: 10px 15px;
    background: #f5f5f5;
    font-size: 12px;
    color: #888;
}

.breadcrumb a {
    color: #888;
}

.breadcrumb a:hover {
    color: #a67c52;
}

/* ===== Action Bar ===== */
.action-bar {
    display: flex;
    width: 100%;
    min-width: 0;
    height: calc(55px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: #2d2d2d;
}

.action-item {
    flex: 0 0 33%;
    max-width: 33%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    min-height: 55px;
    font-size: 11px;
    gap: 4px;
    cursor: pointer;
    transition: background 0.2s;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.action-item:last-child {
    border-right: none;
}

.action-item:active,
.action-item.active {
    background: rgba(255, 255, 255, 0.1);
}

.action-item svg {
    width: 20px;
    height: 20px;
    fill: #fff;
}

.action-item span {
    white-space: nowrap;
}

/* ===== Footer Menu ===== */
.footer-menu {
    background: linear-gradient(135deg, #fafafa 0%, #e9e9e9 100%);
    padding: 15px 0 48px;
}

.footer-item {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    font-size: 14px;
    color: #555;
    border-bottom: 2px dotted #bbb;
    cursor: pointer;
}

.footer-item:active {
    background: #eee;
}

.footer-sub {
    display: flex;
    gap: 20px;
    margin-left: 12px;
    font-size: 13px;
    color: #888;
}

.footer-sub a:hover {
    color: #a67c52;
}

/* ===== Responsive ===== */
@media (min-width: 768px) {
    body {
        max-width: 720px;
        margin: 0 auto;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    }

    .action-bar {
        max-width: 720px;
    }

    .side-menu {
        top: 50px;
        right: calc(50% - 680px);
        width: 320px;
    }

    .side-menu.active {
        right: calc(50% - 360px);
    }

    .menu-overlay {
        top: 50px;
    }
}

@media (min-width: 1024px) {
    body {
        max-width: none;
        margin: 0;
        box-shadow: none;
        background: #fff;
    }

    .header {
        height: 82px;
        padding: 0 clamp(32px, calc((100vw - 1200px) / 2), 96px);
    }

    .logo-icon {
        width: 42px;
        height: 42px;
    }

    .logo-text {
        font-size: 26px;
    }

    .header-actions {
        gap: 0;
    }

    .header-actions svg {
        width: 28px;
        height: 28px;
    }

    #menuBtn {
        display: none;
    }

    .menu-overlay {
        display: none !important;
    }

    .side-menu,
    .side-menu.active {
        position: relative;
        top: auto;
        right: auto;
        display: flex;
        align-items: stretch;
        width: min(100% - 64px, 1200px);
        height: 58px;
        min-height: 0;
        margin: 0 auto;
        overflow: visible;
        background: #fff;
        border-bottom: 1px solid #e8dfd5;
        transition: none;
        z-index: 150;
    }

    .side-menu-item,
    .side-menu-item[role="button"] {
        position: relative;
        justify-content: center;
        width: auto;
        padding: 0 24px;
        color: #5d5043;
        font-size: 15px;
        white-space: nowrap;
        border: 0;
    }

    .side-menu-item:hover,
    .side-menu-item:focus-visible,
    .side-menu-item[role="button"]:hover,
    .side-menu-item[role="button"]:focus-visible {
        background: #f5eee7;
        color: #a67c52;
    }

    .side-menu-item svg {
        width: 14px;
        height: 14px;
        margin-left: 6px;
        fill: currentColor;
    }

    .side-menu-sub,
    .side-menu-sub.active {
        position: absolute;
        top: 58px;
        left: 0;
        z-index: 2;
        min-width: 150px;
        background: #a67c52;
        box-shadow: 0 10px 20px rgba(74, 51, 28, 0.18);
    }

    .side-menu-sub {
        display: none;
    }

    .side-menu-sub.active {
        display: block;
    }

    .side-menu-sub a {
        padding: 12px 18px;
        color: #fff;
        font-size: 14px;
    }

    .action-bar {
        width: min(100% - 64px, 1200px);
        max-width: 1200px;
        height: 86px;
        margin: 58px auto 0;
        border-radius: 4px 4px 0 0;
    }

    .action-item {
        min-height: 86px;
        font-size: 14px;
    }

    .action-item svg {
        width: 24px;
        height: 24px;
    }

    .footer-menu {
        display: grid;
        grid-template-columns: 1.6fr repeat(5, 1fr);
        gap: 0;
        padding: 36px max(32px, calc((100vw - 1200px) / 2)) 48px;
    }

    .footer-item {
        min-height: 54px;
        justify-content: center;
        padding: 12px 16px;
        border-right: 1px dotted #bbb;
        border-bottom: 0;
    }

    .footer-item:first-child {
        align-items: flex-start;
        justify-content: center;
        flex-direction: column;
    }

    .footer-item:last-child {
        border-right: 0;
    }

    .footer-sub {
        gap: 14px;
        margin: 4px 0 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
