:root {
    --consult-ink: #111a14;
    --consult-leaf: #2d6838;
    --consult-leaf-deep: #1e3f27;
    --consult-paper: #eef3e8;
    --consult-card: #fff;
    --consult-muted: #5c6b5f;
    --consult-line: rgba(17, 26, 20, 0.1);
    --consult-shadow: 0 18px 50px rgba(17, 26, 20, 0.12);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
}

body.consult-page {
    min-height: 100vh;
    color: var(--consult-ink);
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--consult-paper);
}

.consult-atmosphere {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(180deg, rgba(241, 245, 236, 0.88), rgba(232, 239, 227, 0.92)),
        url("/static/images/homeweb-1920.webp?v=20260701") center/cover no-repeat;
}

.consult-atmosphere::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.18;
    background-image: radial-gradient(circle at 18% 22%, rgba(45, 104, 56, 0.18) 0 1px, transparent 1.6px);
    background-size: 42px 42px;
}

.consult-top {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    height: 58px;
    padding: 0 18px;
    background: var(--consult-ink);
    color: #f4f7f0;
}

.consult-home {
    justify-self: start;
    color: rgba(244, 247, 240, 0.78);
    text-decoration: none;
    font-size: 13px;
    letter-spacing: 0.08em;
}

.consult-top h1 {
    margin: 0;
    justify-self: center;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.22em;
}

.consult-end {
    justify-self: end;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    cursor: pointer;
}

.consult-end:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(-18deg);
    transition: transform 0.25s ease, background 0.2s ease;
}

.consult-shell {
    width: min(1040px, calc(100% - 20px));
    margin: 18px auto 20px;
    min-height: calc(100vh - 96px);
    display: flex;
    flex-direction: column;
}

.consult-box {
    position: relative;
    isolation: isolate;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 110px);
    border: 2px solid rgba(45, 104, 56, 0.34);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(247, 251, 242, 0.72), rgba(232, 242, 226, 0.78)),
        url("/static/images/homeweb-1920.webp?v=20260701") center/cover no-repeat;
    box-shadow: var(--consult-shadow);
    overflow: hidden;
}

.consult-box::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.28;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 180 180'%3E%3Cpath fill='%232d6838' d='M86 10c32 16 58 50 58 90 0 30-22 52-48 56 10-20 6-40-8-54-12 24-32 40-56 46C40 116 22 84 28 50c18 6 38-8 58-40z'/%3E%3Cpath fill='none' stroke='%231e3f27' stroke-width='2' d='M86 10c-8 38-28 70-58 98'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 160'%3E%3Cellipse cx='60' cy='78' rx='22' ry='54' fill='%236f8a4c' transform='rotate(-28 60 78)'/%3E%3Cpath fill='none' stroke='%231e3f27' stroke-width='2' d='M48 130c8-28 10-56 4-86'/%3E%3C/svg%3E");
    background-position: -20px 8%, 108% 78%;
    background-size: 220px auto, 140px auto;
    background-repeat: no-repeat;
}

.consult-box::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.18;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg fill='%232d6838'%3E%3Cpath d='M24 186c28-18 48-48 52-84 18 14 22 36 12 58-22 8-42 16-64 26z'/%3E%3Cpath d='M168 28c-8 26-6 52 8 74 16-20 22-46 18-74-8 2-18 2-26 0z'/%3E%3Cpath d='M198 150c-22-6-40-22-48-44 22-4 42 6 56 24-2 8-4 14-8 20z'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 260px 260px;
}

.consult-thread,
.consult-dock {
    position: relative;
    z-index: 1;
}

.consult-thread {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    overflow-y: auto;
}

.consult-welcome,
.consult-guess,
.consult-msg {
    background: var(--consult-card);
    border: 1px solid var(--consult-line);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(17, 26, 20, 0.06);
    animation: consult-rise 0.35s ease;
}

@keyframes consult-rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

.consult-hello {
    margin: 0;
    padding: 22px;
    line-height: 1.7;
    font-size: 15px;
}

.consult-guess-head {
    padding: 14px 22px 10px;
    font-size: 15px;
    font-weight: 700;
}

.consult-tabs {
    display: flex;
    gap: 22px;
    padding: 0 22px;
    border-bottom: 1px solid var(--consult-line);
    overflow-x: auto;
}

.consult-tabs button {
    flex: none;
    border: 0;
    background: none;
    padding: 10px 0 12px;
    color: var(--consult-muted);
    font: inherit;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.consult-tabs button.is-on {
    color: var(--consult-leaf);
    font-weight: 700;
    border-bottom-color: var(--consult-leaf);
}

.consult-questions {
    display: grid;
}

.consult-questions button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 14px 22px;
    border: 0;
    border-bottom: 1px solid var(--consult-line);
    background: none;
    text-align: left;
    font: inherit;
    font-size: 14px;
    color: var(--consult-ink);
    cursor: pointer;
}

.consult-questions button:hover {
    background: rgba(45, 104, 56, 0.04);
}

.consult-questions button::after {
    content: ">";
    color: #9aa894;
    font-size: 16px;
}

.consult-refresh {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 8px 14px 14px;
    padding: 8px 12px;
    border: 0;
    background: none;
    color: var(--consult-muted);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.consult-refresh:hover { color: var(--consult-leaf); }

.consult-msg {
    display: flex;
    gap: 10px;
    padding: 16px 18px;
    max-width: 92%;
}

.consult-msg.user {
    margin-left: auto;
    background: #e7f0e3;
}

.consult-msg.idle {
    background: #f4f7ef;
    color: var(--consult-muted);
    font-size: 14px;
    max-width: 80%;
}

.consult-msg.idle .consult-bubble {
    font-size: 14px;
}

.consult-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex: none;
}

.consult-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.consult-bubble {
    margin: 0;
    line-height: 1.75;
    font-size: 15px;
}

.consult-msg.user .consult-bubble {
    white-space: pre-wrap;
}

.consult-bubble.is-rich p {
    margin: 0 0 10px;
}

.consult-bubble.is-rich p:last-child,
.consult-bubble.is-rich ul:last-child,
.consult-bubble.is-rich ol:last-child {
    margin-bottom: 0;
}

.consult-bubble.is-rich .consult-h,
.consult-bubble.is-rich h2,
.consult-bubble.is-rich h3,
.consult-bubble.is-rich h4,
.consult-bubble.is-rich h5 {
    margin: 14px 0 8px;
    color: var(--consult-leaf-deep);
    font-weight: 700;
    line-height: 1.45;
}

.consult-bubble.is-rich h2 { font-size: 17px; }
.consult-bubble.is-rich h3 { font-size: 16px; }
.consult-bubble.is-rich h4,
.consult-bubble.is-rich h5 { font-size: 15px; }

.consult-bubble.is-rich h2:first-child,
.consult-bubble.is-rich h3:first-child,
.consult-bubble.is-rich h4:first-child {
    margin-top: 0;
}

.consult-bubble.is-rich ul,
.consult-bubble.is-rich ol {
    margin: 0 0 10px;
    padding-left: 1.3em;
}

.consult-bubble.is-rich li {
    margin: 4px 0;
}

.consult-bubble.is-rich strong {
    color: var(--consult-ink);
    font-weight: 700;
}

.consult-bubble.is-rich code {
    padding: 0 4px;
    border-radius: 4px;
    background: rgba(45, 104, 56, 0.08);
    font-size: 13px;
}

.consult-msg-images {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.consult-msg-images img {
    width: 92px;
    height: 92px;
    object-fit: cover;
    border-radius: 6px;
}

.consult-source {
    margin-top: 8px;
    font-size: 12px;
    color: var(--consult-muted);
}

.consult-msg-body {
    min-width: 0;
    flex: 1;
}

.consult-rating {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.consult-rating button {
    border: 1px solid rgba(45, 104, 56, 0.28);
    background: #fff;
    color: var(--consult-leaf-deep);
    border-radius: 4px;
    padding: 4px 10px;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.consult-rating button.is-on {
    color: #fff;
    background: var(--consult-leaf);
    border-color: var(--consult-leaf);
}

.consult-dock {
    padding: 12px 14px 14px;
    background: linear-gradient(180deg, rgba(244, 247, 239, 0.72), rgba(238, 245, 232, 0.9));
    border-top: 1px solid rgba(45, 104, 56, 0.12);
}

.consult-hint {
    margin: 0 4px 8px;
    color: var(--consult-muted);
    font-size: 12px;
}

.consult-actions,
.consult-pills,
.consult-chips {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
}

.consult-actions {
    margin-bottom: 10px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.consult-pills,
.consult-chips {
    margin: 0;
    flex: none;
}

.consult-pills a,
.consult-pills button,
.consult-chips button {
    flex: none;
    white-space: nowrap;
    border: 1px solid rgba(45, 104, 56, 0.35);
    background: #fff;
    color: var(--consult-leaf-deep);
    border-radius: 8px;
    padding: 8px 14px;
    font: inherit;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
}

.consult-composer {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px 10px 16px;
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--consult-shadow);
}

.consult-composer textarea {
    flex: 1;
    border: 0;
    resize: none;
    min-height: 44px;
    max-height: 140px;
    font: inherit;
    font-size: 15px;
    outline: none;
    background: transparent;
}

.consult-plus {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--consult-line);
    display: grid;
    place-items: center;
    cursor: pointer;
    color: var(--consult-muted);
    font-size: 22px;
    line-height: 1;
}

.consult-send {
    border: 0;
    background: var(--consult-leaf);
    color: #fff;
    border-radius: 8px;
    padding: 10px 18px;
    font: inherit;
    font-size: 15px;
    cursor: pointer;
}

.consult-send:disabled {
    opacity: 0.55;
    cursor: wait;
}

.consult-legal {
    margin: 10px 6px 0;
    font-size: 12px;
    color: var(--consult-muted);
    line-height: 1.6;
}

.consult-legal a { color: var(--consult-leaf-deep); }

.consult-error:not(:empty) {
    margin: 0 0 8px;
    color: #8a2f2f;
    font-size: 13px;
}

.consult-previews {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.consult-previews figure {
    margin: 0;
    position: relative;
}

.consult-previews img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 6px;
}

.consult-previews button {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border: 0;
    border-radius: 50%;
    background: var(--consult-ink);
    color: #fff;
    cursor: pointer;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

@media (max-width: 720px) {
    .consult-top h1 { font-size: 16px; letter-spacing: 0.12em; }
    .consult-shell { width: calc(100% - 12px); margin: 10px auto 14px; }
    .consult-box { min-height: calc(100vh - 92px); }
    .consult-box::before { background-size: 150px auto, 96px auto; }
    .consult-msg { max-width: 100%; }
}

.survey-overlay {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(17, 26, 20, 0.45);
}
.survey-overlay[hidden] { display: none; }
.survey-modal {
    position: relative;
    width: min(440px, 100%);
    background: #fff;
    color: #2b2f33;
    border-radius: 16px;
    padding: 28px 24px 22px;
    box-shadow: 0 18px 50px rgba(17, 26, 20, 0.18);
}
.survey-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: #8a9199;
    font-size: 22px;
    cursor: pointer;
}
.survey-modal h2 {
    margin: 0 28px 8px 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.45;
    text-align: center;
}
.survey-sub {
    margin: 0 0 16px;
    text-align: center;
    color: #8a9199;
    font-size: 13px;
}
.survey-stars {
    display: flex;
    justify-content: space-between;
    gap: 4px;
    margin-bottom: 14px;
}
.survey-stars button {
    flex: 1;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
    color: #c5cbd1;
}
.survey-stars button.is-on { color: #222; }
.survey-star { display: block; font-size: 28px; line-height: 1; }
.survey-stars small {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    color: #8a9199;
}
.survey-copy {
    margin: 0 0 12px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}
.survey-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 14px;
}
.survey-tags button {
    border: 0;
    border-radius: 999px;
    padding: 8px 12px;
    background: #f1f2f4;
    color: #4b5560;
    cursor: pointer;
    font-size: 13px;
}
.survey-tags button.is-on { background: #2b2f33; color: #fff; }
.survey-comment-wrap { position: relative; margin-bottom: 16px; }
.survey-comment-wrap textarea {
    width: 100%;
    min-height: 88px;
    resize: vertical;
    border: 0;
    border-radius: 10px;
    padding: 12px 12px 28px;
    background: #f1f2f4;
    color: #2b2f33;
    font: inherit;
}
.survey-count {
    position: absolute;
    right: 10px;
    bottom: 8px;
    font-size: 12px;
    color: #8a9199;
}
.survey-resolve-q {
    margin: 0 0 10px;
    text-align: center;
    font-size: 14px;
}
.survey-resolve {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}
.survey-resolve button {
    flex: 1;
    border: 0;
    border-radius: 999px;
    padding: 10px 12px;
    background: #f1f2f4;
    color: #4b5560;
    cursor: pointer;
    font-size: 14px;
}
.survey-resolve button.is-on { background: #2b2f33; color: #fff; }
.survey-error { margin: 0 0 10px; color: #c0392b; font-size: 13px; text-align: center; }
.survey-submit {
    width: 100%;
    border: 0;
    border-radius: 10px;
    padding: 12px 16px;
    background: #2b2f33;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}
.survey-thanks-body {
    margin: 12px 0 0;
    text-align: center;
    color: #5c656d;
    line-height: 1.7;
}
