:root {
    --support-bg: #160c07;
    --support-panel: rgba(58, 29, 12, 0.72);
    --support-panel-strong: rgba(72, 36, 15, 0.88);
    --support-line: rgba(244, 215, 154, 0.22);
    --support-line-strong: rgba(244, 215, 154, 0.36);
    --support-text: #fff4df;
    --support-muted: rgba(255, 239, 210, 0.68);
    --support-gold: #f4d79a;
    --support-gold-strong: #e8bb5f;
    --support-warm: #8c4c20;
    --support-red: #ff6b65;
    --support-green: #31d37a;
    --support-shadow: 0 30px 70px rgba(0, 0, 0, 0.38);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    height: 100%;
    scroll-behavior: smooth;
    overflow: hidden;
}

body {
    height: 100%;
    margin: 0;
    color: var(--support-text);
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(circle at 12% 8%, rgba(255, 225, 170, 0.16), transparent 24%),
        radial-gradient(circle at 88% 14%, rgba(255, 151, 93, 0.14), transparent 24%),
        radial-gradient(circle at 50% 100%, rgba(244, 215, 154, 0.11), transparent 28%),
        linear-gradient(180deg, #251209 0%, #130905 100%);
    overflow: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
    background-size: 34px 34px;
    opacity: 0.26;
    pointer-events: none;
}

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

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

.support-page {
    position: relative;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 14px;
    height: 100dvh;
    overflow: hidden;
    padding: 24px;
}

.support-stars {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.star {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 244, 215, 0.98), rgba(248, 202, 111, 0.34) 58%, transparent 70%);
    box-shadow: 0 0 18px rgba(255, 214, 138, 0.5);
    animation: supportStarFloat 9s linear infinite;
    opacity: 0;
}

.s1 { left: 8%; animation-delay: -1s; }
.s2 { left: 16%; animation-delay: -4s; }
.s3 { left: 23%; animation-delay: -7s; }
.s4 { left: 31%; animation-delay: -2s; }
.s5 { left: 38%; animation-delay: -5s; }
.s6 { left: 46%; animation-delay: -8s; }
.s7 { left: 54%; animation-delay: -3s; }
.s8 { left: 61%; animation-delay: -6s; }
.s9 { left: 68%; animation-delay: -1.5s; }
.s10 { left: 74%; animation-delay: -4.5s; }
.s11 { left: 80%; animation-delay: -7.5s; }
.s12 { left: 88%; animation-delay: -2.5s; }
.s13 { left: 94%; animation-delay: -5.5s; }
.s14 { left: 4%; animation-delay: -8.5s; }
.s15 { left: 42%; animation-delay: -6.5s; }
.s16 { left: 72%; animation-delay: -9s; }

.support-topbar,
.support-shell {
    position: relative;
    z-index: 1;
    width: min(1440px, 100%);
    margin: 0 auto;
}

.support-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 22px;
    border: 1px solid var(--support-line);
    border-radius: 28px;
    background: rgba(43, 19, 9, 0.78);
    box-shadow: var(--support-shadow);
    backdrop-filter: blur(18px);
}

.support-brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: inherit;
    text-decoration: none;
}

.support-brand img {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 22px rgba(0, 0, 0, 0.24);
}

.support-brand strong,
.support-brand em {
    display: block;
    font-style: normal;
}

.support-brand strong {
    font-size: 26px;
    letter-spacing: 0.04em;
}

.support-brand em {
    margin-top: 2px;
    color: var(--support-muted);
    font-size: 13px;
}

.support-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.support-nav a,
.support-nav button,
.support-new,
.support-create-card > button[type="submit"] {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid rgba(244, 215, 154, 0.18);
    border-radius: 999px;
    color: var(--support-text);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.support-nav a::before,
.support-nav button::before,
.support-new::before,
.support-create-card > button[type="submit"]::before {
    content: "";
    position: absolute;
    inset: -35%;
    background: linear-gradient(115deg, transparent 28%, rgba(255, 255, 255, 0.2) 47%, transparent 66%);
    transform: translateX(-120%);
    transition: transform 0.72s ease;
}

.support-nav a:hover,
.support-nav button:hover,
.support-new:hover,
.support-create-card > button[type="submit"]:hover {
    transform: translateY(-2px);
    border-color: var(--support-line-strong);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 14px 26px rgba(0, 0, 0, 0.22);
}

.support-nav a:hover::before,
.support-nav button:hover::before,
.support-new:hover::before,
.support-create-card > button[type="submit"]:hover::before {
    transform: translateX(120%);
}

.support-shell {
    display: grid;
    min-height: 0;
    gap: 0;
}

.support-workspace {
    border: 1px solid var(--support-line);
    border-radius: 34px;
    background: linear-gradient(180deg, rgba(89, 45, 20, 0.64), rgba(38, 18, 8, 0.78));
    box-shadow: var(--support-shadow);
}

.support-workspace::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 16% 0%, rgba(255, 225, 170, 0.18), transparent 30%),
        radial-gradient(circle at 92% 18%, rgba(255, 118, 92, 0.12), transparent 28%);
    pointer-events: none;
}

.support-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 13px;
    border: 1px solid rgba(244, 215, 154, 0.24);
    border-radius: 999px;
    color: var(--support-gold);
    background: rgba(255, 255, 255, 0.05);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.14em;
}

.support-create-card h2 {
    margin: 12px 0 10px;
    font-size: clamp(34px, 5vw, 66px);
    line-height: 1.05;
    letter-spacing: 0.03em;
}

.support-create-card p,
.support-tips p {
    margin: 0;
    color: var(--support-muted);
    line-height: 1.8;
}

.support-create-card {
    display: grid;
    gap: 14px;
}

.support-create-card label {
    display: grid;
    gap: 8px;
    color: var(--support-muted);
}

.support-create-card input,
.support-create-card select,
.support-create-card textarea {
    width: 100%;
    border: 1px solid rgba(244, 215, 154, 0.18);
    border-radius: 18px;
    background: rgba(255, 247, 232, 0.95);
    color: #4f2b11;
    outline: none;
}

.support-create-card input,
.support-create-card select {
    min-height: 52px;
    padding: 0 15px;
}

.support-create-card textarea {
    padding: 14px 15px;
    resize: vertical;
}

.support-create-card > button[type="submit"] {
    border-color: rgba(244, 215, 154, 0.36);
    color: #4b280d;
    background: linear-gradient(180deg, #ffe7b7, #e7b85a);
    font-weight: 800;
}

.support-workspace {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr) 290px;
    gap: 0;
    height: 100%;
    min-height: 0;
}

.support-sidebar,
.support-chat,
.support-context {
    position: relative;
    z-index: 1;
    min-height: 0;
}

.support-sidebar,
.support-context {
    padding: 18px;
    background: rgba(31, 14, 7, 0.24);
}

.support-sidebar {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 14px;
    border-right: 1px solid rgba(244, 215, 154, 0.1);
}

.support-new {
    width: 100%;
    min-height: 58px;
    border-radius: 20px;
    border-color: rgba(244, 215, 154, 0.34);
    color: #4b280d;
    background: linear-gradient(180deg, #ffe7b7, #e7b85a);
    font-weight: 900;
}

.support-new span {
    margin-right: 8px;
    font-size: 22px;
}

.support-new:disabled,
.support-input-row button:disabled,
.support-input-row textarea:disabled {
    cursor: not-allowed;
    opacity: 0.56;
}

.support-conversation-list {
    display: grid;
    align-content: start;
    gap: 12px;
    min-height: 0;
    overflow: auto;
    padding: 6px 4px 4px 0;
    overscroll-behavior: contain;
}

.support-thread {
    position: relative;
    display: grid;
    gap: 7px;
    width: 100%;
    padding: 16px;
    border: 1px solid rgba(244, 215, 154, 0.13);
    border-radius: 20px;
    background: rgba(45, 20, 8, 0.48);
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.support-thread:hover {
    transform: translateY(-2px);
}

.support-thread:hover,
.support-thread.is-active {
    border-color: rgba(244, 215, 154, 0.36);
    background: linear-gradient(180deg, rgba(255, 236, 207, 0.14), rgba(255, 236, 207, 0.06));
}

.support-thread span,
.support-thread small,
.support-thread em {
    color: var(--support-muted);
    font-size: 12px;
    font-style: normal;
    line-height: 1.45;
}

.support-thread strong {
    padding-right: 40px;
    font-size: 17px;
    line-height: 1.35;
}

.support-thread b {
    position: absolute;
    top: 14px;
    right: 14px;
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: linear-gradient(180deg, #ff756d, #cc3b32);
    color: #fff;
    font-size: 12px;
    animation: supportPulse 1.5s ease-in-out infinite;
}

.support-list-empty,
.support-empty {
    padding: 22px;
    border-radius: 22px;
    color: var(--support-muted);
    background: rgba(255, 255, 255, 0.05);
    line-height: 1.7;
}

.support-chat {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
}

.support-chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(244, 215, 154, 0.1);
}

.support-chat-head span {
    display: block;
    margin-bottom: 5px;
    color: var(--support-muted);
    font-size: 13px;
}

.support-chat-head h2 {
    margin: 0;
    font-size: 22px;
    line-height: 1.3;
}

.support-chat-head em {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(49, 211, 122, 0.12);
    color: #80f2b0;
    font-style: normal;
    white-space: nowrap;
}

.support-mobile-list {
    display: none;
}

.support-messages {
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-height: 0;
    padding: 22px;
    overflow: auto;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
}

.support-message {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 8px;
    max-width: min(78%, 720px);
    animation: supportMessageIn 0.26s ease both;
}

.support-message.is-mine {
    align-self: flex-end;
    grid-template-columns: minmax(0, 1fr) 42px;
}

.support-message img {
    grid-row: 1 / 3;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.18);
}

.support-message.is-mine img {
    grid-column: 2;
}

.support-message-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--support-muted);
    font-size: 13px;
}

.support-message.is-mine .support-message-meta {
    grid-column: 1;
    justify-content: flex-end;
}

.support-message p {
    grid-column: 2;
    width: fit-content;
    max-width: 100%;
    margin: 0;
    padding: 14px 17px;
    border-radius: 20px;
    border-top-left-radius: 7px;
    background: rgba(255, 236, 207, 0.1);
    color: rgba(255, 246, 232, 0.98);
    line-height: 1.75;
    word-break: break-word;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
}

.support-message.is-mine p {
    grid-column: 1;
    justify-self: end;
    border-radius: 20px;
    border-top-right-radius: 7px;
    background: linear-gradient(180deg, #ffe5ad, #e8ba5b);
    color: #4f2b11;
}

.support-empty {
    align-self: center;
    display: grid;
    gap: 8px;
    max-width: 420px;
    text-align: center;
}

.support-empty strong {
    color: var(--support-text);
    font-size: 22px;
}

.support-reply {
    display: grid;
    gap: 12px;
    padding: 16px;
    border-top: 1px solid rgba(244, 215, 154, 0.1);
    background: linear-gradient(180deg, rgba(33, 15, 7, 0.1), rgba(33, 15, 7, 0.34));
}

.support-quick {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.support-quick button {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid rgba(244, 215, 154, 0.2);
    border-radius: 999px;
    color: var(--support-gold);
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
}

.support-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 60px;
    gap: 12px;
    align-items: end;
}

.support-input-row textarea {
    min-height: 58px;
    max-height: 130px;
    padding: 17px 18px;
    border: 1px solid rgba(244, 215, 154, 0.18);
    border-radius: 22px;
    outline: none;
    resize: none;
    color: #4f2b11;
    background: rgba(255, 248, 236, 0.96);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.support-input-row textarea:focus {
    border-color: rgba(244, 215, 154, 0.5);
    box-shadow: 0 0 0 4px rgba(244, 215, 154, 0.12);
}

.support-input-row button {
    position: relative;
    display: grid;
    place-items: center;
    width: 60px;
    height: 60px;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #f2c46a, #ff7c57);
    cursor: pointer;
    box-shadow: 0 16px 32px rgba(255, 126, 83, 0.28);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.support-input-row button:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(255, 126, 83, 0.36);
}

.support-input-row button span {
    width: 25px;
    height: 25px;
    margin-left: 3px;
    background: #fff;
    clip-path: polygon(14% 8%, 92% 50%, 14% 92%, 28% 56%, 28% 44%);
}

.support-context {
    display: grid;
    align-content: start;
    gap: 14px;
    border-left: 1px solid rgba(244, 215, 154, 0.1);
}

.support-profile,
.support-info-grid > div,
.support-tips {
    border: 1px solid rgba(244, 215, 154, 0.12);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.05);
}

.support-profile {
    display: grid;
    justify-items: center;
    gap: 7px;
    padding: 18px;
    text-align: center;
}

.support-profile img {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    object-fit: cover;
}

.support-profile span,
.support-info-grid span {
    color: var(--support-muted);
    font-size: 13px;
}

.support-profile strong {
    font-size: 20px;
}

.support-info-grid {
    display: grid;
    gap: 10px;
}

.support-info-grid > div {
    display: grid;
    gap: 5px;
    padding: 14px;
}

.support-info-grid strong {
    font-size: 16px;
}

.support-tips {
    padding: 18px;
}

.support-tips h3 {
    margin: 0 0 8px;
    font-size: 18px;
}

.support-create {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    padding: 20px;
}

.support-create[hidden] {
    display: none;
}

.support-create-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 4, 2, 0.72);
    backdrop-filter: blur(8px);
}

.support-create-card {
    position: relative;
    z-index: 1;
    width: min(520px, 100%);
    padding: 26px;
    border: 1px solid var(--support-line);
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(72, 36, 15, 0.98), rgba(39, 18, 8, 0.98));
    box-shadow: var(--support-shadow);
    animation: supportModalIn 0.24s ease both;
}

.support-create-close {
    position: absolute;
    top: 16px;
    right: 16px;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(244, 215, 154, 0.16);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--support-text);
    font-size: 28px;
    cursor: pointer;
}

.support-create-card h2 {
    font-size: 34px;
}

.support-create-card p:empty {
    display: none;
}

.support-resolution-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin: 12px 0 4px;
    padding: 14px;
    border: 1px solid var(--support-line);
    border-radius: 16px;
    background: rgba(91, 48, 22, 0.36);
    color: var(--support-text);
}

.support-resolution-actions strong {
    flex-basis: 100%;
}

.support-resolution-actions button {
    min-height: 38px;
    padding: 0 16px;
    border: 1px solid rgba(255, 218, 143, 0.55);
    border-radius: 999px;
    background: linear-gradient(135deg, var(--support-gold), var(--support-gold-strong));
    color: #3d1f0a;
    font-weight: 800;
    cursor: pointer;
}

.support-resolution-actions button + button {
    background: rgba(255, 255, 255, 0.08);
    color: var(--support-text);
}

@keyframes supportStarFloat {
    0% { transform: translate3d(0, 105vh, 0) scale(0.7); opacity: 0; }
    12% { opacity: 0.9; }
    78% { opacity: 0.76; }
    100% { transform: translate3d(18px, -12vh, 0) scale(1.16); opacity: 0; }
}

@keyframes supportPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 107, 101, 0.34); }
    50% { transform: scale(1.08); box-shadow: 0 0 0 7px rgba(255, 107, 101, 0); }
}

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

@keyframes supportModalIn {
    from { opacity: 0; transform: translateY(14px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 1180px) {
    .support-workspace {
        grid-template-columns: 300px minmax(0, 1fr);
    }

    .support-context {
        display: none;
    }
}

@media (max-width: 820px) {
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
    select,
    textarea {
        font-size: 16px !important;
    }

    .support-page {
        padding: 10px;
    }

    .support-topbar {
        border-radius: 22px;
    }

    .support-brand img {
        width: 48px;
        height: 48px;
        border-radius: 15px;
    }

    .support-brand strong {
        font-size: 22px;
    }

    .support-nav a {
        display: none;
    }

    .support-workspace {
        grid-template-columns: 1fr;
        height: 100%;
        min-height: 0;
        border-radius: 26px;
    }

    .support-sidebar {
        position: absolute;
        inset: 0 auto 0 0;
        z-index: 4;
        width: min(86vw, 330px);
        transform: translateX(-105%);
        transition: transform 0.25s ease;
        border-right: 1px solid var(--support-line);
        background: rgba(36, 16, 7, 0.96);
        box-shadow: 24px 0 45px rgba(0, 0, 0, 0.28);
    }

    .support-sidebar.is-mobile-open {
        transform: translateX(0);
    }

    .support-mobile-list {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 38px;
        padding: 0 12px;
        border: 1px solid rgba(244, 215, 154, 0.18);
        border-radius: 999px;
        color: var(--support-gold);
        background: rgba(255, 255, 255, 0.05);
    }

    .support-chat-head {
        padding: 14px;
    }

    .support-chat-head h2 {
        font-size: 18px;
    }

    .support-messages {
        padding: 16px 14px;
    }

    .support-message {
        max-width: 92%;
    }

    .support-reply {
        padding: 12px;
    }

    .support-input-row {
        grid-template-columns: minmax(0, 1fr) 54px;
    }

    .support-input-row button {
        width: 54px;
        height: 54px;
    }
}

@media (max-width: 520px) {
    .support-page {
        padding: 0;
    }

    .support-topbar {
        margin: 8px;
        padding: 12px;
    }

    .support-shell {
        gap: 10px;
        padding: 0 8px 8px;
    }

    .support-workspace {
        height: 100%;
        min-height: 0;
    }

    .support-message-meta time {
        display: none;
    }

    .support-message p {
        padding: 12px 14px;
        line-height: 1.65;
    }

    .support-create {
        place-items: center;
        padding: 14px;
    }

    .support-create-card {
        width: min(520px, 100%);
        max-height: calc(100dvh - 28px);
        overflow: auto;
        border-radius: 28px;
    }
}

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

    .star,
    .support-thread b,
    .support-message,
    .support-create-card {
        animation: none;
    }

    *,
    *::before,
    *::after {
        transition: none !important;
    }
}
