:root {
    --xl-blue: #1a3768;
    --xl-blue-deep: #10243f;
    --xl-gold: #b08d57;
    --xl-gold-soft: #f4ead8;
    --xl-paper: #fbf8f1;
    --xl-ink: #202b3a;
    --xl-muted: #667085;
    --xl-line: #e4e8ee;
    --xl-green: #207a55;
}

.xuanlin-wenyi-page {
    background: #f5f7fa;
    color: var(--xl-ink);
}

.xl-hero {
    position: relative;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 84% 22%, rgba(176, 141, 87, .28), transparent 24rem),
        linear-gradient(132deg, var(--xl-blue-deep), var(--xl-blue) 62%, #294f83);
}

.xl-hero::before,
.xl-hero::after {
    position: absolute;
    content: "";
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 50%;
}

.xl-hero::before { width: 360px; height: 360px; right: -110px; top: -190px; }
.xl-hero::after { width: 220px; height: 220px; right: 180px; bottom: -170px; }

.xl-hero__inner {
    position: relative;
    z-index: 1;
    min-height: 330px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 48px;
    padding-top: 62px;
    padding-bottom: 62px;
}

.xl-hero__copy { max-width: 800px; }

.xl-eyebrow,
.xl-hero__badges span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.xl-eyebrow {
    margin-bottom: 18px;
    color: #f3dfb8;
    font-weight: 700;
    letter-spacing: .08em;
}

.xl-hero h1 {
    margin: 0 0 16px;
    color: #fff;
    font-size: clamp(2.5rem, 5vw, 4.6rem);
    line-height: 1.05;
    letter-spacing: .06em;
}

.xl-hero p {
    max-width: 740px;
    margin: 0;
    color: rgba(255, 255, 255, .9);
    font-size: 1.12rem;
    line-height: 1.85;
}

.xl-hero__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 25px;
}

.xl-hero__badges span {
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font-size: .9rem;
}

.xl-hero__seal {
    width: 150px;
    height: 150px;
    flex: 0 0 150px;
    display: grid;
    place-content: center;
    border: 2px solid rgba(255, 239, 207, .7);
    border-radius: 28px;
    background: rgba(106, 30, 31, .68);
    box-shadow: inset 0 0 0 8px rgba(255,255,255,.06), 0 20px 60px rgba(0,0,0,.22);
    color: #fff3d5;
    text-align: center;
    transform: rotate(3deg);
}

.xl-hero__seal span { font-size: 2rem; font-weight: 800; letter-spacing: .15em; }
.xl-hero__seal small { margin-top: 4px; font-size: 1.05rem; letter-spacing: .4em; }

.xl-section { padding: 42px 0 68px; }

.xl-service-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 14px 18px;
    border: 1px solid #edc3c3;
    border-radius: 12px;
    background: #fff1f1;
    color: #8b1e1e;
}

.xl-layout {
    display: grid;
    grid-template-columns: minmax(245px, 300px) minmax(0, 1fr);
    grid-template-areas: "sidebar chat";
    gap: 24px;
    align-items: start;
}

.xl-sidebar { display: grid; grid-area: sidebar; gap: 18px; }
.xl-chat-card { grid-area: chat; }
.xl-access-card,
.xl-tier-card,
.xl-conversations-card,
.xl-chat-card,
.xl-privacy-note {
    border: 1px solid var(--xl-line);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 12px 34px rgba(16, 36, 63, .07);
}

.xl-access-card,
.xl-tier-card,
.xl-conversations-card { padding: 22px; }

.xl-access-card {
    position: relative;
    overflow: hidden;
    border-top: 4px solid var(--xl-gold);
}

.xl-access-card::after {
    position: absolute;
    content: "";
    width: 120px;
    height: 120px;
    right: -58px;
    bottom: -58px;
    border-radius: 50%;
    background: var(--xl-gold-soft);
    opacity: .65;
}

.xl-access-card__head,
.xl-conversations-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.xl-kicker {
    color: var(--xl-gold);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.xl-access-card h2,
.xl-tier-card h2,
.xl-conversations-card h2 {
    margin: 4px 0 0;
    color: var(--xl-blue);
    font-size: 1.05rem;
}

.xl-access-card__icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-content: center;
    border-radius: 12px;
    background: var(--xl-gold-soft);
    color: var(--xl-gold);
    font-size: 1.15rem;
}

.xl-quota {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: baseline;
    gap: 9px;
    margin: 20px 0 12px;
}

.xl-quota strong {
    color: var(--xl-blue);
    font-size: 2.65rem;
    line-height: 1;
}

.xl-quota span { color: var(--xl-muted); font-size: .9rem; }
.xl-access-card p { position: relative; z-index: 1; color: var(--xl-muted); line-height: 1.65; font-size: .9rem; }
.xl-access-cta { position: relative; z-index: 1; width: 100%; justify-content: center; margin-top: 6px; }

.xl-login-link {
    position: relative;
    z-index: 1;
    display: block;
    margin-top: 13px;
    color: var(--xl-blue);
    font-size: .88rem;
    font-weight: 700;
    text-align: center;
}

.xl-tier-card h2 { margin-bottom: 14px; }
.xl-tier-card ul { list-style: none; padding: 0; margin: 0; }

.xl-tier-card li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid #edf0f4;
    color: var(--xl-muted);
    font-size: .88rem;
}

.xl-tier-card li:last-child { border-bottom: 0; }
.xl-tier-card strong { color: var(--xl-blue); }
.xl-tier-card small { display: block; margin-top: 12px; color: #7b8491; line-height: 1.55; }

.xl-conversations-card__head { margin-bottom: 13px; }
.xl-icon-button {
    width: 34px;
    height: 34px;
    display: grid;
    place-content: center;
    border: 1px solid var(--xl-line);
    border-radius: 10px;
    background: #fff;
    color: var(--xl-blue);
    cursor: pointer;
}

.xl-icon-button:hover,
.xl-icon-button:focus-visible { border-color: var(--xl-gold); background: var(--xl-gold-soft); }
.xl-conversation-list { display: grid; gap: 6px; max-height: 240px; overflow: auto; }

.xl-conversation-item {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: #f7f8fa;
    color: var(--xl-muted);
    text-align: left;
    cursor: pointer;
}

.xl-conversation-item strong,
.xl-conversation-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xl-conversation-item strong { color: var(--xl-ink); font-size: .86rem; }
.xl-conversation-item small { margin-top: 3px; font-size: .73rem; }
.xl-conversation-item.is-active { border-color: #dcc69f; background: var(--xl-gold-soft); }

.xl-clear-history {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 14px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #8b5360;
    font-size: .8rem;
    cursor: pointer;
}

.xl-chat-card {
    min-height: 720px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.xl-chat-card__header {
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 17px 22px;
    border-bottom: 1px solid var(--xl-line);
    background: linear-gradient(180deg, #fff, #fafbfc);
}

.xl-assistant-identity { display: flex; align-items: center; gap: 12px; }
.xl-avatar {
    width: 46px;
    height: 46px;
    display: grid;
    place-content: center;
    border-radius: 14px;
    background: linear-gradient(145deg, #8f2b2c, #b34942);
    box-shadow: inset 0 0 0 3px rgba(255,255,255,.15);
    color: #fff7df;
    font-size: 1.35rem;
    font-weight: 800;
}

.xl-chat-card__header h2 { margin: 0; color: var(--xl-blue); font-size: 1.08rem; }
.xl-online { display: inline-flex; align-items: center; gap: 6px; color: var(--xl-muted); font-size: .8rem; }
.xl-online i { width: 7px; height: 7px; border-radius: 50%; background: var(--xl-green); box-shadow: 0 0 0 3px rgba(32,122,85,.12); }
.xl-quota-inline { padding: 6px 10px; border-radius: 999px; background: #eef3f9; color: var(--xl-blue); font-size: .8rem; font-weight: 700; }

.xl-messages {
    flex: 1;
    min-height: 320px;
    max-height: 610px;
    overflow-y: auto;
    padding: 26px 24px;
    background:
        linear-gradient(rgba(255,255,255,.91), rgba(255,255,255,.91)),
        radial-gradient(circle at 1px 1px, rgba(26,55,104,.16) 1px, transparent 0);
    background-size: auto, 24px 24px;
    scroll-behavior: smooth;
}

.xl-message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 88%;
    margin-bottom: 20px;
}

.xl-message--user { margin-left: auto; flex-direction: row-reverse; }
.xl-message__avatar {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: grid;
    place-content: center;
    border-radius: 10px;
    background: var(--xl-gold-soft);
    color: #8a6734;
    font-size: .78rem;
    font-weight: 800;
}

.xl-message--user .xl-message__avatar { background: var(--xl-blue); color: #fff; }
.xl-message__content { min-width: 0; }

.xl-message__bubble {
    padding: 13px 15px;
    border: 1px solid #e2e7ed;
    border-radius: 5px 16px 16px 16px;
    background: #fff;
    color: var(--xl-ink);
    line-height: 1.78;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    box-shadow: 0 6px 18px rgba(16,36,63,.05);
}

.xl-message--user .xl-message__bubble {
    border-color: var(--xl-blue);
    border-radius: 16px 5px 16px 16px;
    background: var(--xl-blue);
    color: #fff;
}

.xl-message__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    color: #89919d;
    font-size: .72rem;
}

.xl-message--user .xl-message__meta { justify-content: flex-end; }
.xl-copy {
    padding: 0;
    border: 0;
    background: transparent;
    color: #6e7886;
    cursor: pointer;
}

.xl-copy:hover,
.xl-copy:focus-visible { color: var(--xl-blue); }
.xl-typing { display: inline-flex; align-items: center; gap: 5px; padding: 15px 18px; }
.xl-typing i { width: 7px; height: 7px; border-radius: 50%; background: #8f99a8; animation: xlTyping 1.2s infinite ease-in-out; }
.xl-typing i:nth-child(2) { animation-delay: .15s; }
.xl-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes xlTyping { 0%, 70%, 100% { transform: translateY(0); opacity: .45; } 35% { transform: translateY(-5px); opacity: 1; } }

.xl-starters {
    padding: 0 24px 20px;
    background: #fff;
}

.xl-starters > p { margin: 0 0 10px; color: var(--xl-muted); font-size: .82rem; }
.xl-starter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }

.xl-starter-grid button {
    min-height: 74px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px;
    border: 1px solid var(--xl-line);
    border-radius: 12px;
    background: #fbfcfd;
    color: var(--xl-blue);
    text-align: left;
    line-height: 1.4;
    cursor: pointer;
}

.xl-starter-grid button:hover,
.xl-starter-grid button:focus-visible { border-color: var(--xl-gold); background: var(--xl-gold-soft); }
.xl-starter-grid i { color: var(--xl-gold); }

.xl-conversion {
    margin: 0 24px 14px;
    padding: 13px 15px;
    border: 1px solid #dcc69f;
    border-radius: 12px;
    background: #fff8eb;
    color: #684e28;
    line-height: 1.6;
}

.xl-conversion a { display: inline-block; margin-left: 7px; color: var(--xl-blue); font-weight: 800; }
.xl-composer { margin: 0 18px 18px; padding: 10px 12px 9px; border: 1px solid #d4dbe4; border-radius: 15px; background: #fff; box-shadow: 0 8px 24px rgba(16,36,63,.08); }
.xl-composer:focus-within { border-color: var(--xl-gold); box-shadow: 0 0 0 3px rgba(176,141,87,.14), 0 8px 24px rgba(16,36,63,.08); }

.xl-composer textarea {
    width: 100%;
    min-height: 64px;
    max-height: 170px;
    resize: none;
    padding: 8px 7px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--xl-ink);
    font: inherit;
    line-height: 1.55;
}

.xl-composer textarea::placeholder { color: #98a1ae; }
.xl-composer textarea:disabled { cursor: not-allowed; background: #f6f7f9; }
.xl-composer__footer { display: flex; align-items: center; gap: 12px; color: #89919d; font-size: .75rem; }
.xl-key-hint { margin-left: auto; }
.xl-composer__footer .btn { min-width: 92px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.xl-boundary { margin: 0 22px 19px; color: #737d8b; font-size: .75rem; line-height: 1.55; text-align: center; }
.xl-boundary i { color: var(--xl-gold); }

.xl-privacy-note {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    margin-top: 24px;
    padding: 22px 24px;
    border-left: 5px solid var(--xl-gold);
}

.xl-privacy-note > i { margin-top: 3px; color: var(--xl-gold); font-size: 1.4rem; }
.xl-privacy-note h2 { margin: 0 0 6px; color: var(--xl-blue); font-size: 1rem; }
.xl-privacy-note p { margin: 0; color: var(--xl-muted); line-height: 1.65; font-size: .88rem; }

@media (max-width: 980px) {
    .xl-layout { grid-template-columns: 1fr; grid-template-areas: "chat" "sidebar"; }
    .xl-sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .xl-conversations-card { grid-column: 1 / -1; }
    .xl-chat-card { min-height: 680px; }
}

@media (max-width: 720px) {
    .xl-hero__inner { min-height: 0; padding-top: 42px; padding-bottom: 42px; }
    .xl-hero__seal { display: none; }
    .xl-hero h1 { font-size: 2.6rem; }
    .xl-hero p { font-size: 1rem; line-height: 1.7; }
    .xl-hero__badges span { font-size: .78rem; }
    .xl-section { padding-top: 24px; }
    .xl-sidebar { grid-template-columns: 1fr; }
    .xl-conversations-card { grid-column: auto; }
    .xl-chat-card { min-height: 650px; border-radius: 14px; }
    .xl-chat-card__header { padding: 14px 15px; }
    .xl-quota-inline { font-size: .72rem; }
    .xl-messages { padding: 20px 14px; max-height: 520px; }
    .xl-message { max-width: 96%; }
    .xl-starters { padding: 0 14px 15px; }
    .xl-starter-grid { grid-template-columns: 1fr; }
    .xl-starter-grid button { min-height: 54px; }
    .xl-composer { margin: 0 10px 14px; }
    .xl-composer textarea { font-size: 16px; }
    .xl-key-hint { display: none; }
    .xl-boundary { margin-left: 14px; margin-right: 14px; }
    .xl-privacy-note { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
    .xl-messages { scroll-behavior: auto; }
    .xl-typing i { animation: none; }
}
