:root {
    --page-bg: #f5efe5;
    --paper: #fffdf8;
    --paper-soft: rgba(255, 253, 248, 0.84);
    --primary: #2f6b45;
    --primary-deep: #213c31;
    --primary-soft: #e8f0e7;
    --sage: #7c8d6a;
    --gold: #c79b45;
    --gold-soft: #fbf4df;
    --line: #dfd5c5;
    --line-green: #c7d7c3;
    --text: #25362f;
    --muted: #7c756b;
    --shadow: 0 20px 55px rgba(51, 56, 42, 0.11);
}

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

html {
    min-width: 320px;
}

body {
    min-height: 100vh;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.65;
    background:
        radial-gradient(circle at 76% 5%, rgba(200, 155, 80, 0.18), transparent 25%),
        radial-gradient(circle at 4% 88%, rgba(47, 107, 69, 0.12), transparent 26%),
        linear-gradient(120deg, #fbf7ee 0%, #f7f1e7 46%, #f1e7d9 100%);
}

body::before,
body::after {
    position: fixed;
    z-index: 0;
    pointer-events: none;
    content: "";
}

body::before {
    top: -46px;
    right: 16px;
    width: min(520px, 36vw);
    height: 260px;
    opacity: 0.6;
    background:
        linear-gradient(105deg, transparent 0 45%, rgba(71, 92, 57, 0.24) 46% 47%, transparent 48%),
        radial-gradient(ellipse at 80% 30%, rgba(78, 101, 58, 0.3) 0 8%, transparent 9%),
        radial-gradient(ellipse at 66% 23%, rgba(78, 101, 58, 0.24) 0 7%, transparent 8%),
        radial-gradient(ellipse at 56% 42%, rgba(78, 101, 58, 0.2) 0 7%, transparent 8%);
    filter: blur(1px);
    transform: rotate(-10deg);
}

body::after {
    left: -38px;
    bottom: -12px;
    width: 190px;
    height: 360px;
    opacity: 0.68;
    background:
        linear-gradient(72deg, transparent 0 50%, rgba(84, 108, 67, 0.42) 51% 52%, transparent 53%),
        radial-gradient(ellipse at 58% 22%, rgba(92, 116, 76, 0.32) 0 8%, transparent 9%),
        radial-gradient(ellipse at 46% 37%, rgba(92, 116, 76, 0.28) 0 8%, transparent 9%),
        radial-gradient(ellipse at 55% 54%, rgba(92, 116, 76, 0.24) 0 8%, transparent 9%),
        radial-gradient(ellipse at 38% 68%, rgba(92, 116, 76, 0.2) 0 8%, transparent 9%);
}

.page {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 176px minmax(0, 1fr) 280px;
    gap: 26px;
    width: min(1500px, 100%);
    min-height: 100vh;
    margin: 0 auto;
    padding: 32px 36px 28px;
}

.sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 60px;
    min-height: calc(100vh - 60px);
    padding: 16px 18px 24px;
    border-right: 1px solid rgba(57, 71, 60, 0.1);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 82px;
    height: 82px;
    margin-top: 2px;
}

.brand-mark span,
.brand-mark span::before,
.brand-mark span::after {
    position: absolute;
    display: block;
    border: 3px solid transparent;
    border-bottom-color: var(--primary);
    border-left-color: var(--gold);
    border-radius: 58% 42% 54% 46%;
    content: "";
    transform: rotate(45deg);
}

.brand-mark span {
    width: 58px;
    height: 58px;
}

.brand-mark span::before {
    inset: 9px;
    border-bottom-color: #4f8a65;
    border-left-color: #d9b761;
}

.brand-mark span::after {
    inset: 19px;
    border-bottom-color: #8aa17e;
    border-left-color: #eedda6;
}

.nav-list {
    display: grid;
    gap: 12px;
    width: 100%;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 54px;
    padding: 0 18px;
    color: #47534d;
    font-size: 16px;
    text-decoration: none;
    border-radius: 14px;
}

.nav-item.active {
    color: var(--primary-deep);
    background: #e8eee3;
    font-weight: 700;
}

.nav-icon {
    display: grid;
    place-items: center;
    width: 24px;
    color: var(--primary);
    font-size: 24px;
    line-height: 1;
}

.main-area {
    min-width: 0;
    padding-top: 2px;
}

.hero {
    position: relative;
    min-height: 170px;
    padding: 8px 0 26px 30px;
}

.hero::after {
    position: absolute;
    top: 24px;
    right: -10px;
    width: min(460px, 42%);
    height: 136px;
    border-radius: 34px;
    background:
        linear-gradient(176deg, transparent 0 30%, rgba(183, 143, 85, 0.24) 31% 43%, transparent 44%),
        linear-gradient(0deg, rgba(134, 101, 61, 0.16), rgba(255, 255, 255, 0.12));
    content: "";
    opacity: 0.65;
}

.header-badge {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 17px;
    color: #31463c;
    font-size: 16px;
    background: #edf3eb;
    border: 1px solid #bfccba;
    border-radius: 14px;
}

.hero h1 {
    margin-top: 18px;
    color: var(--primary-deep);
    font-family: "STKaiti", "KaiTi", "Songti SC", serif;
    font-size: clamp(42px, 4.2vw, 58px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0;
}

.hero p {
    margin-top: 10px;
    color: #4f5c54;
    font-size: 20px;
}

.mode-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin-bottom: 28px;
}

.mode-tab {
    position: relative;
    display: grid;
    grid-template-columns: 112px 1fr;
    align-items: center;
    gap: 22px;
    min-height: 176px;
    padding: 26px;
    text-align: left;
    background: var(--paper-soft);
    border: 1px solid rgba(77, 82, 69, 0.14);
    border-radius: 16px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.mode-tab:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 58px rgba(51, 56, 42, 0.14);
}

.mode-tab.active {
    border: 2px solid var(--primary);
    box-shadow: 0 24px 62px rgba(47, 107, 69, 0.16);
}

.tab-check {
    position: absolute;
    top: 18px;
    right: 20px;
    display: none;
    place-items: center;
    width: 28px;
    height: 28px;
    color: #fff;
    font-size: 18px;
    background: var(--primary);
    border-radius: 999px;
}

.mode-tab.active .tab-check {
    display: grid;
}

.tab-art {
    position: relative;
    display: block;
    width: 108px;
    height: 108px;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, rgba(255, 255, 255, 0.95) 0 18%, transparent 19%),
        repeating-radial-gradient(circle at center, rgba(77, 116, 73, 0.18) 0 6px, transparent 7px 16px),
        #e7efdf;
}

.tab-art::before,
.tab-art::after {
    position: absolute;
    content: "";
}

.self-art::before {
    left: 39px;
    top: 32px;
    width: 30px;
    height: 30px;
    background: var(--primary);
    border-radius: 50%;
}

.self-art::after {
    left: 31px;
    top: 60px;
    width: 46px;
    height: 40px;
    background: var(--primary);
    border-radius: 48% 48% 42% 42%;
}

.case-art {
    background: #eee5d5;
}

.case-art::before {
    left: 34px;
    top: 24px;
    width: 42px;
    height: 56px;
    background: #fffaf0;
    border: 4px solid #a37b45;
    border-radius: 6px;
}

.case-art::after {
    right: 24px;
    bottom: 27px;
    width: 28px;
    height: 28px;
    border: 5px solid #5a4f41;
    border-radius: 50%;
    box-shadow: 17px 17px 0 -11px #5a4f41;
}

.teaching-art {
    background: #eee5d5;
}

.teaching-art::before {
    left: 28px;
    top: 30px;
    width: 54px;
    height: 42px;
    background: #536c4a;
    border: 6px solid #b99254;
    border-radius: 5px;
}

.teaching-art::after {
    left: 44px;
    bottom: 21px;
    width: 24px;
    height: 20px;
    border-left: 5px solid #b99254;
    border-right: 5px solid #b99254;
    border-bottom: 5px solid #b99254;
}

.tab-copy {
    display: grid;
    gap: 8px;
}

.tab-title {
    color: #1d2f27;
    font-family: "STKaiti", "KaiTi", "Songti SC", serif;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.15;
}

.tab-desc {
    color: #53615a;
    font-size: 16px;
    line-height: 1.65;
}

.practice-hint {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 64px;
    margin-bottom: 18px;
    padding: 14px 24px;
    color: #6c5326;
    font-size: 16px;
    background: rgba(255, 249, 231, 0.8);
    border: 1px solid #dec98e;
    border-radius: 14px;
}

.practice-hint strong {
    color: var(--primary);
    font-size: 20px;
    font-weight: 700;
}

.hint-icon {
    color: #b07725;
    font-size: 28px;
    line-height: 1;
}

.workbench {
    min-height: 410px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(77, 82, 69, 0.11);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.chat-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    color: #22362d;
    font-size: 17px;
}

.chat-icon {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 50%;
}

.chat-box {
    min-height: 320px;
    max-height: 48vh;
    overflow-y: auto;
    padding: 0;
    scrollbar-color: rgba(47, 107, 69, 0.35) transparent;
}

.chat-row {
    display: flex;
    width: 100%;
    margin-bottom: 22px;
    animation: fadeSlideIn 0.35s ease;
}

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

.user-row {
    justify-content: flex-end;
    align-items: flex-start;
}

.assistant-row {
    justify-content: flex-start;
    align-items: flex-start;
    gap: 14px;
}

.chat-avatar {
    display: grid;
    flex: 0 0 42px;
    place-items: center;
    width: 42px;
    height: 42px;
    margin-top: 3px;
    color: #fff;
    font-family: "STKaiti", "KaiTi", serif;
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(145deg, #3e8a5a, #275d3c);
    border-radius: 50%;
}

.chat-bubble {
    display: block;
    box-sizing: border-box;
    overflow-wrap: anywhere;
    line-height: 1.85;
    white-space: normal;
    word-break: normal;
}

.assistant-bubble {
    width: min(720px, calc(100% - 60px));
    max-width: calc(100% - 60px);
    min-width: 220px;
    padding: 18px 22px;
    color: var(--text);
    background: rgba(255, 253, 248, 0.9);
    border: 1px solid #e4d9ca;
    border-radius: 16px;
    border-top-left-radius: 6px;
}

.user-bubble {
    max-width: min(520px, 76%);
    min-width: 72px;
    padding: 13px 18px;
    color: #1f3028;
    background: #e8f0e7;
    border: 1px solid #d3dfd1;
    border-radius: 16px;
    border-top-right-radius: 6px;
}

.answer-content {
    width: 100%;
    color: var(--text);
    font-size: 16px;
    line-height: 1.9;
    overflow-wrap: break-word;
    word-break: break-word;
}

.message-meta {
    margin-top: 8px;
    color: #b5aca0;
    font-size: 12px;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

.input-area {
    display: flex;
    gap: 18px;
    align-items: flex-end;
    margin-top: 20px;
    padding: 0;
}

.input-area textarea {
    flex: 1;
    min-height: 80px;
    max-height: 150px;
    padding: 24px 28px;
    color: var(--text);
    font: inherit;
    font-size: 17px;
    line-height: 1.55;
    resize: none;
    background: rgba(255, 255, 255, 0.78);
    border: 1.5px solid var(--primary);
    border-radius: 16px;
    box-shadow: 0 12px 34px rgba(47, 107, 69, 0.08);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-area textarea:focus {
    outline: none;
    border-color: #2f7a4a;
    box-shadow: 0 0 0 4px rgba(47, 107, 69, 0.12);
}

.send-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 168px;
    height: 64px;
    padding: 0 24px;
    color: #fff;
    font-size: 19px;
    font-weight: 700;
    white-space: nowrap;
    background: linear-gradient(145deg, #3d8758, #2f6b45);
    border: 0;
    border-radius: 16px;
    box-shadow: 0 18px 36px rgba(47, 107, 69, 0.24);
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

.send-btn:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

.send-btn:active {
    transform: translateY(0);
}

.send-btn:disabled {
    cursor: not-allowed;
    opacity: 0.48;
    transform: none;
}

.welcome-card {
    max-width: 760px;
    margin: 8px auto 0;
    padding: 30px 28px;
    color: var(--muted);
    text-align: left;
    background: rgba(255, 253, 248, 0.76);
    border: 1px solid #e4d9ca;
    border-radius: 16px;
}

.welcome-card .wc-icon {
    display: none;
}

.welcome-card .wc-title {
    margin-bottom: 10px;
    color: var(--primary);
    font-family: "STKaiti", "KaiTi", "Songti SC", serif;
    font-size: 28px;
    font-weight: 700;
}

.welcome-card .wc-desc {
    margin-bottom: 18px;
    color: #4f5c54;
    font-size: 17px;
}

.welcome-card .wc-questions {
    margin-bottom: 18px;
    padding: 16px 20px;
    text-align: left;
    background: #fbf7ef;
    border: 1px solid #e6dcca;
    border-radius: 14px;
}

.welcome-card .wc-questions p {
    margin: 0 0 8px;
    color: #5e615b;
    font-size: 15px;
}

.welcome-card .wc-questions p:last-child {
    margin-bottom: 0;
}

.welcome-card .wc-starters-label {
    margin-bottom: 10px;
    color: #9a9288;
    font-size: 13px;
}

.welcome-card .wc-starter-item {
    display: inline-block;
    margin: 4px 4px 4px 0;
    padding: 7px 14px;
    color: #6b5828;
    font-size: 13px;
    line-height: 1.4;
    background: var(--gold-soft);
    border: 1px solid #e6d5a9;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease;
}

.welcome-card .wc-starter-item:hover {
    background: #f5e9c8;
    transform: translateY(-1px);
}

.guide-card {
    align-self: end;
    min-height: 560px;
    margin-bottom: 10px;
    padding: 26px 24px 22px;
    background: rgba(255, 253, 248, 0.82);
    border: 1px solid rgba(77, 82, 69, 0.13);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.guide-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    color: #2d4639;
    font-size: 17px;
    font-weight: 700;
}

.guide-card h2 {
    margin-bottom: 12px;
    color: var(--primary-deep);
    font-family: "STKaiti", "KaiTi", "Songti SC", serif;
    font-size: 25px;
}

.guide-card p {
    margin-bottom: 28px;
    color: #515b54;
    font-size: 15px;
}

.guide-section-title {
    margin-bottom: 14px;
    color: #2f3a33;
    font-size: 16px;
    font-weight: 700;
}

.guide-list {
    display: grid;
    gap: 12px;
    list-style: none;
}

.guide-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #5b625e;
    font-size: 14px;
}

.guide-list span {
    display: grid;
    place-items: center;
    width: 22px;
    color: var(--primary);
    font-size: 18px;
}

.still-life {
    position: relative;
    height: 170px;
    margin-top: 42px;
}

.book {
    position: absolute;
    right: 22px;
    bottom: 22px;
    width: 152px;
    height: 42px;
    background: #9aa580;
    border: 1px solid #7f896d;
    border-radius: 8px 10px 10px 8px;
    box-shadow: 0 18px 28px rgba(75, 70, 54, 0.16);
    transform: rotate(-6deg);
}

.book::before {
    position: absolute;
    inset: 8px 10px auto;
    height: 2px;
    background: rgba(255, 255, 255, 0.38);
    content: "";
}

.book-back {
    right: 36px;
    bottom: 3px;
    background: #d8c9aa;
    transform: rotate(5deg);
}

.cup {
    position: absolute;
    right: 54px;
    bottom: 62px;
    width: 76px;
    height: 56px;
    background: linear-gradient(180deg, #8e9a75, #717d61);
    border-radius: 8px 8px 24px 24px;
    box-shadow: inset 0 10px 0 rgba(40, 42, 32, 0.16);
}

.cup::after {
    position: absolute;
    right: -22px;
    top: 13px;
    width: 28px;
    height: 26px;
    border: 7px solid #778367;
    border-left: 0;
    border-radius: 0 20px 20px 0;
    content: "";
}

.steam {
    position: absolute;
    right: 82px;
    bottom: 126px;
    width: 34px;
    height: 36px;
    border-left: 2px solid rgba(88, 99, 71, 0.22);
    border-radius: 50%;
}

@media (max-width: 1220px) {
    .page {
        grid-template-columns: 110px minmax(0, 1fr);
    }

    .sidebar {
        padding-inline: 10px;
    }

    .nav-item {
        justify-content: center;
        padding: 0;
    }

    .nav-item span:last-child {
        display: none;
    }

    .guide-card {
        grid-column: 2;
        min-height: 0;
        margin-bottom: 0;
    }
}

@media (max-width: 920px) {
    body::before,
    body::after {
        opacity: 0.32;
    }

    .page {
        display: block;
        padding: 18px 14px 28px;
    }

    .sidebar {
        position: static;
        flex-direction: row;
        justify-content: space-between;
        gap: 14px;
        min-height: 0;
        margin-bottom: 18px;
        padding: 0;
        border-right: 0;
    }

    .brand-mark {
        width: 56px;
        height: 56px;
        flex: 0 0 56px;
    }

    .brand-mark span {
        width: 42px;
        height: 42px;
    }

    .nav-list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
    }

    .nav-item {
        min-height: 46px;
        padding: 0 10px;
        border-radius: 12px;
    }

    .hero {
        min-height: auto;
        padding: 4px 0 20px;
    }

    .hero::after {
        display: none;
    }

    .hero h1 {
        font-size: 38px;
    }

    .hero p {
        font-size: 16px;
    }

    .mode-tabs {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .mode-tab {
        grid-template-columns: 70px 1fr;
        min-height: 112px;
        padding: 18px;
    }

    .tab-art {
        width: 66px;
        height: 66px;
    }

    .self-art::before {
        left: 24px;
        top: 18px;
        width: 18px;
        height: 18px;
    }

    .self-art::after {
        left: 18px;
        top: 36px;
        width: 30px;
        height: 24px;
    }

    .case-art::before {
        left: 21px;
        top: 14px;
        width: 25px;
        height: 34px;
        border-width: 3px;
    }

    .case-art::after {
        right: 14px;
        bottom: 16px;
        width: 17px;
        height: 17px;
        border-width: 3px;
        box-shadow: 11px 11px 0 -7px #5a4f41;
    }

    .teaching-art::before {
        left: 16px;
        top: 18px;
        width: 34px;
        height: 26px;
        border-width: 4px;
    }

    .teaching-art::after {
        left: 27px;
        bottom: 12px;
        width: 14px;
        height: 12px;
        border-width: 3px;
    }

    .tab-title {
        font-size: 24px;
    }

    .practice-hint {
        align-items: flex-start;
        font-size: 14px;
    }

    .input-area {
        display: grid;
        gap: 12px;
    }

    .input-area textarea {
        min-height: 68px;
        padding: 18px;
        font-size: 15px;
    }

    .send-btn {
        width: 100%;
        min-width: 0;
    }

    .guide-card {
        margin-top: 18px;
    }
}

@media (max-width: 560px) {
    .sidebar {
        align-items: center;
    }

    .brand-mark {
        display: none;
    }

    .nav-list {
        width: 100%;
    }

    .nav-icon {
        font-size: 20px;
    }

    .header-badge {
        min-height: 36px;
        font-size: 14px;
    }

    .hero h1 {
        font-size: 34px;
    }

    .mode-tab {
        grid-template-columns: 58px 1fr;
        gap: 14px;
        padding: 14px;
    }

    .tab-art {
        width: 56px;
        height: 56px;
    }

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

    .tab-desc {
        font-size: 13px;
    }

    .workbench {
        padding: 16px;
    }

    .chat-box {
        min-height: 300px;
        max-height: 54vh;
    }

    .assistant-bubble {
        min-width: 0;
        width: calc(100% - 50px);
        max-width: calc(100% - 50px);
        padding: 14px 16px;
    }

    .user-bubble {
        max-width: 84%;
    }

    .welcome-card {
        padding: 20px 16px;
    }
}
