:root {
    --mx-bg: #f7f4ed;
    --mx-surface: rgba(255, 252, 247, 0.92);
    --mx-surface-strong: rgba(255, 255, 255, 0.96);
    --mx-border: rgba(107, 129, 118, 0.16);
    --mx-text: #2d3c39;
    --mx-muted: #6d7b77;
    --mx-jade: #70887d;
    --mx-jade-deep: #4c655d;
    --mx-gold: #b8956b;
    --mx-shadow: 0 24px 62px rgba(43, 28, 12, 0.1);
    --mx-radius: 24px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--mx-text);
    background: var(--module-page-bg, linear-gradient(180deg, #fffcf7 0%, #f1f5f2 100%));
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: var(--module-page-overlay, radial-gradient(circle at 12% 8%, rgba(255,255,255,0.56), transparent 24%));
    pointer-events: none;
    z-index: -1;
}

a {
    color: inherit;
}

button,
input,
textarea,
select {
    font: inherit;
}

.module-shell {
    width: min(1180px, calc(100vw - 32px));
    margin: 0 auto;
    padding: 34px 0 58px;
}

.formal-page-head {
    text-align: center;
    margin: 36px auto 34px;
}

.formal-page-head h1 {
    margin-bottom: 14px;
}

.formal-page-lead {
    max-width: min(820px, 100%);
    margin: 0 auto;
    color: var(--mx-muted);
    font-size: 1rem;
    line-height: 1.95;
}

.formal-page-head .module-manifesto {
    max-width: min(820px, 100%);
    margin: 18px auto 0;
    color: var(--module-manifesto-color, #8A673E);
    text-align: left;
}

.module-maintenance-notice {
    margin: 0 auto 22px;
    padding: 14px 18px;
    border: 1px solid rgba(184, 149, 107, 0.2);
    border-radius: 18px;
    background: rgba(255, 248, 237, 0.88);
    color: var(--mx-jade-deep);
    line-height: 1.75;
    text-align: center;
}

.module-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.module-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--mx-jade-deep);
    font-weight: 700;
    letter-spacing: 0.12em;
}

.module-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--mx-gold);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 700;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.module-back-link:hover {
    color: var(--mx-jade-deep);
    opacity: 0.9;
}

.module-back-link svg {
    width: 18px;
    height: 18px;
    color: inherit;
}

.module-brand img {
    width: 38px;
    height: 38px;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    object-fit: contain;
}

.module-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.module-nav a,
.ghost-btn,
.primary-btn,
.mini-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(112, 136, 125, 0.2);
    background: rgba(255,255,255,0.68);
    color: var(--mx-jade-deep);
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.module-nav a:hover,
.ghost-btn:hover,
.primary-btn:hover,
.mini-btn:hover {
    transform: translateY(-1px);
    background: rgba(255,255,255,0.95);
    border-color: rgba(76, 101, 93, 0.36);
}

.primary-btn {
    min-height: 44px;
    padding: 0 20px;
    border-color: rgba(76, 101, 93, 0.28);
    background: linear-gradient(135deg, rgba(105, 130, 120, 0.98), rgba(75, 101, 93, 0.94));
    color: #fffaf4;
    box-shadow: 0 16px 34px rgba(75, 101, 93, 0.16);
}

.mini-btn {
    min-height: 32px;
    padding: 0 12px;
    font-size: 0.86rem;
}

.module-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
    gap: 20px;
    align-items: stretch;
    margin-bottom: 20px;
}

.hero-copy,
.tool-panel,
.side-panel,
.history-panel {
    border: 1px solid var(--mx-border);
    border-radius: var(--mx-radius);
    background:
        linear-gradient(160deg, rgba(255,252,248,0.95), rgba(247,241,232,0.9) 52%, rgba(236,240,236,0.88) 100%);
    box-shadow: var(--mx-shadow);
}

.hero-copy {
    min-height: 288px;
    padding: 34px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.hero-kicker,
.panel-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 28px;
    padding: 0 12px;
    margin-bottom: 14px;
    border-radius: 999px;
    border: 1px solid rgba(184, 149, 107, 0.18);
    background: rgba(255,255,255,0.58);
    color: var(--mx-gold);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

h1,
h2,
h3 {
    font-family: "Noto Serif SC", serif;
    color: #31443f;
    letter-spacing: 0.06em;
}

h1 {
    margin: 0 0 16px;
    font-size: clamp(2.1rem, 5vw, 4.2rem);
    line-height: 1.12;
}

.hero-copy p {
    max-width: 48em;
    margin: 0;
    color: rgba(45, 60, 57, 0.88);
    font-size: 1.02rem;
    line-height: 1.9;
}

.hero-visual {
    min-height: 288px;
    border-radius: var(--mx-radius);
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255,255,255,0.54);
    box-shadow: var(--mx-shadow);
    background:
        linear-gradient(145deg, rgba(49, 68, 63, 0.34), rgba(184, 149, 107, 0.12)),
        var(--module-image) center/cover;
}

.hero-visual::after {
    content: attr(data-label);
    position: absolute;
    left: 24px;
    bottom: 20px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.72);
    color: var(--mx-jade-deep);
    font-size: 0.88rem;
    font-weight: 700;
}

.module-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 20px;
    align-items: start;
}

.tool-panel,
.side-panel,
.history-panel {
    padding: 24px;
}

.tool-panel h2,
.side-panel h2,
.history-panel h2 {
    margin: 0 0 14px;
    font-size: 1.45rem;
}

.field-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}

.field-grid label {
    display: grid;
    gap: 7px;
    color: var(--mx-muted);
    font-size: 0.92rem;
}

.soft-input,
.soft-textarea,
.soft-select {
    width: 100%;
    border: 1px solid rgba(112, 136, 125, 0.2);
    border-radius: 14px;
    background: rgba(255,255,255,0.72);
    color: var(--mx-text);
    padding: 12px 14px;
    outline: none;
}

.soft-textarea {
    min-height: 112px;
    resize: vertical;
    line-height: 1.7;
}

.action-row,
.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.chip {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(112, 136, 125, 0.18);
    background: rgba(255,255,255,0.58);
    color: var(--mx-jade-deep);
    cursor: pointer;
}

.chip.active {
    background: rgba(112, 136, 125, 0.15);
    border-color: rgba(76, 101, 93, 0.3);
    color: #31443f;
    font-weight: 700;
}

.result-grid,
.item-grid {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.result-card,
.item-card,
.session-card {
    border: 1px solid rgba(112, 136, 125, 0.14);
    border-radius: 18px;
    background: rgba(255,255,255,0.58);
    padding: 16px;
}

.result-card strong,
.item-card strong,
.session-card strong {
    display: block;
    margin-bottom: 8px;
    color: #31443f;
}

.result-card p,
.item-card p,
.session-card p,
.side-panel p {
    margin: 0;
    color: var(--mx-muted);
    line-height: 1.75;
}

.history-list {
    display: grid;
    gap: 10px;
    max-height: 520px;
    overflow: auto;
}

.empty-note {
    color: var(--mx-muted);
    line-height: 1.8;
}

.module-manifesto {
    margin-top: 18px;
    color: var(--module-manifesto-color, #8A673E);
    font-family: "Ma Shan Zheng", "Noto Serif SC", "KaiTi", "STKaiti", serif;
    font-size: clamp(1.08rem, 2.2vw, 1.42rem);
    font-weight: 400;
    line-height: 1.8;
    letter-spacing: 0.04em;
    text-wrap: balance;
    word-break: keep-all;
    overflow-wrap: normal;
}

.section-band {
    margin-top: 20px;
    padding: 24px;
    border: 1px solid var(--mx-border);
    border-radius: var(--mx-radius);
    background:
        linear-gradient(160deg, rgba(255,252,248,0.92), rgba(241,244,239,0.88));
    box-shadow: var(--mx-shadow);
}

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

.section-title-row h2 {
    margin: 0;
    font-size: 1.45rem;
}

.section-title-row p {
    max-width: 44em;
    margin: 0;
    color: var(--mx-muted);
    line-height: 1.7;
}

.metric-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.metric {
    padding: 14px;
    border: 1px solid rgba(112, 136, 125, 0.14);
    border-radius: 16px;
    background: rgba(255,255,255,0.58);
}

.metric strong {
    display: block;
    color: #31443f;
    font-size: 1.15rem;
}

.metric span {
    display: block;
    margin-top: 4px;
    color: var(--mx-muted);
    font-size: 0.88rem;
}

.split-uneven {
    display: grid;
    grid-template-columns: minmax(0, 0.74fr) minmax(280px, 0.26fr);
    gap: 18px;
    align-items: start;
}

.commerce-layout {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr) 320px;
    gap: 18px;
    align-items: start;
}

.plain-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.plain-list li {
    padding: 12px 0;
    border-bottom: 1px solid rgba(112, 136, 125, 0.12);
    color: var(--mx-muted);
    line-height: 1.65;
}

.plain-list li:last-child {
    border-bottom: 0;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(184, 149, 107, 0.13);
    color: var(--mx-gold);
    font-size: 0.82rem;
    font-weight: 700;
}

@media (max-width: 920px) {
    .module-hero,
    .module-layout,
    .split-uneven,
    .commerce-layout {
        grid-template-columns: 1fr;
    }

    .side-panel {
        order: -1;
    }
}

@media (max-width: 640px) {
    .module-shell {
        width: min(100vw - 28px, 1180px);
        padding-top: 22px;
    }

    .module-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .module-nav {
        justify-content: flex-start;
    }

    .hero-copy,
    .tool-panel,
    .side-panel,
    .history-panel {
        padding: 20px;
        border-radius: 20px;
    }

    .hero-visual {
        min-height: 210px;
    }

    .section-title-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .metric-strip {
        grid-template-columns: 1fr;
    }

    .module-manifesto,
    .formal-page-head .module-manifesto {
        max-width: 100%;
        letter-spacing: 0.02em;
        text-wrap: pretty;
        white-space: normal !important;
        word-break: normal !important;
        overflow-wrap: anywhere !important;
    }
}
