:root {
    --jh-ink: #05090d;
    --jh-ink-2: #0a1317;
    --jh-panel: rgba(7, 16, 18, 0.84);
    --jh-panel-strong: rgba(8, 16, 18, 0.94);
    --jh-paper: #eadfcb;
    --jh-gold: #9b7954;
    --jh-gold-2: #c0a678;
    --jh-jade: #86d4bf;
    --jh-jade-2: #2e8278;
    --jh-crimson: #9f4f45;
    --jh-wine: #5c2c32;
    --jh-muted: #aebcbd;
    --jh-line: rgba(192, 166, 120, 0.2);
    --jh-line-soft: rgba(255, 255, 255, 0.08);
    --jh-shadow: 0 22px 62px rgba(0, 0, 0, 0.46);
}

html {
    background: var(--jh-ink);
}

body {
    min-height: 100vh;
    background:
        linear-gradient(180deg, rgba(3, 8, 10, 0.18), rgba(3, 8, 10, 0.76)),
        linear-gradient(90deg, rgba(3, 8, 10, 0.68), rgba(3, 8, 10, 0.16) 48%, rgba(3, 8, 10, 0.7)),
        url("../images/ui/jianghu-menu-bg.png") center / cover fixed no-repeat;
    color: #edf2ee;
    font-family: "Noto Serif SC", "Microsoft YaHei", "PingFang SC", serif;
    letter-spacing: 0;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 4px),
        linear-gradient(135deg, rgba(192, 166, 120, 0.045), transparent 38%, rgba(134, 212, 191, 0.055) 70%, transparent);
    mix-blend-mode: screen;
}

#game-container {
    width: min(100%, 1480px);
    max-width: 1480px;
    padding: 18px 28px 32px;
    position: relative;
    isolation: isolate;
}

.game-header {
    position: relative;
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
    align-items: center;
    gap: 22px;
    border: 1px solid var(--jh-line);
    border-radius: 8px;
    margin-bottom: 20px;
    padding: 16px 22px;
    background:
        linear-gradient(180deg, rgba(11, 22, 23, 0.92), rgba(5, 10, 13, 0.86)),
        linear-gradient(90deg, rgba(192, 166, 120, 0.05), rgba(134, 212, 191, 0.055), rgba(86, 44, 50, 0.07));
    box-shadow: var(--jh-shadow);
    backdrop-filter: blur(12px);
}

.game-header::before {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(134, 212, 191, 0.42), rgba(192, 166, 120, 0.34), transparent);
}

.header-wing {
    justify-self: start;
    width: min(24vw, 230px);
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(192, 166, 120, 0.42), rgba(134, 212, 191, 0.16));
}

.header-wing::after {
    content: "";
    display: block;
    width: 34px;
    height: 5px;
    margin-top: -2px;
    border-left: 1px solid rgba(192, 166, 120, 0.36);
    border-right: 1px solid rgba(134, 212, 191, 0.22);
}

.header-title {
    justify-self: center;
    text-align: center;
    min-width: 0;
}

.header-actions {
    justify-self: end;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
}

.game-header h1 {
    margin: 0 0 4px;
    color: var(--jh-paper);
    font-size: clamp(2rem, 3.2vw, 3.15rem);
    font-weight: 800;
    line-height: 1.12;
    text-shadow: 0 2px 18px rgba(134, 212, 191, 0.16);
}

.subtitle {
    color: #bfcdcc;
    font-size: 1rem;
    font-style: normal;
}

.header-user {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--jh-jade);
}

.logout-btn,
.btn,
.tab-btn,
.auth-tab,
.build-path-btn,
.dialogue-choice-btn {
    border-radius: 8px;
    letter-spacing: 0;
}

.logout-btn {
    border-color: rgba(192, 166, 120, 0.26);
    background: rgba(5, 12, 14, 0.68);
    color: #d9caa7;
}

.logout-btn:hover {
    background: linear-gradient(135deg, rgba(46, 130, 120, 0.84), rgba(23, 72, 70, 0.94));
    color: #f4fffb;
}

#login-screen,
#start-screen {
    position: relative;
    min-height: calc(100vh - 164px);
    overflow: hidden;
    border-radius: 8px;
}

#login-screen.screen.active,
#start-screen.screen.active {
    display: grid;
    place-items: center;
}

#start-screen.screen.active {
    padding: clamp(24px, 4vh, 54px) 16px;
}

#login-screen::before,
#start-screen::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(4, 7, 12, 0.24), rgba(4, 7, 12, 0.08) 45%, rgba(4, 7, 12, 0.66)),
        url("../images/ui/jianghu-menu-bg.png") center / cover no-repeat;
    z-index: 0;
}

#start-screen::before {
    background:
        radial-gradient(circle at 50% 45%, rgba(5, 11, 13, 0.14), rgba(5, 11, 13, 0.7) 68%, rgba(5, 11, 13, 0.88)),
        linear-gradient(90deg, rgba(4, 10, 12, 0.72), rgba(4, 10, 12, 0.08) 42%, rgba(4, 10, 12, 0.74)),
        url("../images/ui/jianghu-start-bg-v2.png") center / cover no-repeat;
    transform: scale(1.01);
    filter: saturate(0.9) contrast(1.04) brightness(0.9);
}

#login-screen::after,
#start-screen::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 50% 42%, rgba(134, 212, 191, 0.08), transparent 38%),
        linear-gradient(180deg, rgba(8, 12, 19, 0.04), rgba(8, 12, 19, 0.54)),
        repeating-linear-gradient(90deg, rgba(192, 166, 120, 0.018) 0 1px, transparent 1px 18px);
}

.login-video-bg {
    opacity: 0.28;
    filter: saturate(0.72) contrast(1.05) brightness(0.72);
}

.login-box,
.intro-box {
    position: relative;
    z-index: 1;
    width: min(92vw, 440px);
    margin: 0;
    padding: 34px;
    overflow: hidden;
    border: 1px solid rgba(192, 166, 120, 0.2);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(9, 18, 20, 0.94), rgba(4, 10, 13, 0.92)),
        linear-gradient(135deg, rgba(192, 166, 120, 0.055), rgba(134, 212, 191, 0.045));
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.56);
    backdrop-filter: blur(14px);
}

.intro-box {
    width: min(90vw, 620px);
    padding: clamp(34px, 4.8vw, 56px) clamp(26px, 5vw, 58px) 34px;
    text-align: center;
    background:
        radial-gradient(circle at 50% 0%, rgba(134, 212, 191, 0.11), transparent 34%),
        linear-gradient(180deg, rgba(8, 18, 20, 0.93), rgba(4, 10, 13, 0.91)),
        linear-gradient(135deg, rgba(192, 166, 120, 0.055), rgba(134, 212, 191, 0.03));
    box-shadow:
        0 30px 86px rgba(0, 0, 0, 0.6),
        inset 0 0 0 1px rgba(255, 255, 255, 0.035);
}

.login-box::before,
.intro-box::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.04);
    background:
        linear-gradient(90deg, rgba(192, 166, 120, 0.18), transparent 22%, transparent 78%, rgba(192, 166, 120, 0.18)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 34%);
}

.intro-box::after {
    content: "";
    position: absolute;
    inset: 14px;
    z-index: 0;
    pointer-events: none;
    border: 1px solid rgba(192, 166, 120, 0.12);
    border-radius: 6px;
    background:
        linear-gradient(90deg, transparent calc(50% - 86px), rgba(134, 212, 191, 0.12), transparent calc(50% + 86px)) top center / 100% 1px no-repeat,
        linear-gradient(90deg, transparent calc(50% - 86px), rgba(192, 166, 120, 0.14), transparent calc(50% + 86px)) bottom center / 100% 1px no-repeat;
}

.login-box > *,
.intro-box > * {
    position: relative;
    z-index: 1;
}

.login-box h2,
.intro-box h2,
.screen > h2 {
    display: inline-flex;
    align-items: center;
    min-height: 56px;
    margin: 0 0 16px;
    padding: 10px 18px;
    border: 1px solid rgba(192, 166, 120, 0.16);
    border-radius: 8px;
    background: rgba(9, 14, 23, 0.9);
    position: relative;
    color: var(--jh-paper);
    font-size: clamp(1.65rem, 3vw, 2.15rem);
    text-shadow: 0 10px 32px rgba(134, 212, 191, 0.14);
}

.login-box h2 {
    margin-bottom: 24px;
}

#start-screen .intro-box h2 {
    display: block;
    min-height: 0;
    margin: 16px 0 12px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--jh-paper);
    font-size: clamp(1.9rem, 3.4vw, 2.5rem);
    line-height: 1.18;
    text-shadow: 0 12px 34px rgba(0, 0, 0, 0.48);
}

.intro-mark {
    position: relative;
    width: 64px;
    height: 64px;
    margin: 0 auto 12px;
    border-radius: 10px;
    border: 1px solid rgba(192, 166, 120, 0.3);
    background:
        radial-gradient(circle at 50% 38%, rgba(134, 212, 191, 0.2), transparent 58%),
        linear-gradient(180deg, rgba(8, 18, 20, 0.96), rgba(4, 10, 13, 0.94));
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.04),
        0 12px 24px rgba(0, 0, 0, 0.28);
}

.intro-mark::before,
.intro-mark::after {
    content: "";
    position: absolute;
}

.intro-mark::before {
    inset: 14px;
    border-radius: 8px;
    border: 1px solid rgba(134, 212, 191, 0.26);
}

.intro-mark::after {
    inset: 23px 18px;
    border-top: 1px solid rgba(192, 166, 120, 0.44);
    border-bottom: 1px solid rgba(192, 166, 120, 0.44);
}

#start-screen .intro-lead {
    max-width: 42ch;
    margin: 0 auto 26px;
    color: #d0d8d5;
    font-size: 1.08rem;
    line-height: 1.9;
}

#start-screen .intro-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 4px;
}

#start-screen .intro-actions .btn {
    min-width: 152px;
    margin: 0;
}

#start-screen .start-screen-note {
    margin-top: 18px;
    color: #98a7a8;
    font-size: 0.92rem;
    line-height: 1.7;
}

#start-screen .user-info {
    width: min(100%, 380px);
    margin: 0 auto 14px;
    padding: 12px 18px;
    text-align: center;
    border: 1px solid rgba(192, 166, 120, 0.16);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(5, 12, 14, 0.85), rgba(4, 10, 13, 0.76)),
        linear-gradient(135deg, rgba(134, 212, 191, 0.04), rgba(192, 166, 120, 0.035));
    box-shadow: none;
}

#start-screen .user-info p {
    margin: 4px 0;
}

#start-screen .user-info strong {
    color: var(--jh-paper);
}

#start-screen .user-info-sub {
    color: #90a7a6;
    font-size: 0.9rem;
}

#start-screen .user-info hr {
    display: none;
}

.auth-tabs {
    padding: 4px;
    gap: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
}

.auth-tab {
    border: 0;
    color: #b9c5d4;
    background: transparent;
    box-shadow: none;
}

.auth-tab.active {
    color: #071113;
    background: linear-gradient(135deg, #9adbc9, #4aa79a 54%, #2b6c67);
    box-shadow: 0 10px 24px rgba(134, 212, 191, 0.18);
}

.form-group label,
.login-form label {
    color: #d3cab6;
    font-weight: 700;
}

.form-group input,
.login-form input,
.dialog-input,
.skill-quick-slot select {
    border: 1px solid rgba(192, 166, 120, 0.16);
    border-radius: 8px;
    background: rgba(5, 8, 14, 0.64);
    color: #f3f6fb;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.form-group input:focus,
.login-form input:focus,
.dialog-input:focus {
    border-color: rgba(134, 212, 191, 0.58);
    box-shadow: 0 0 0 3px rgba(134, 212, 191, 0.12);
}

.btn {
    border: 1px solid rgba(192, 166, 120, 0.16);
    min-height: 42px;
    color: #fff8e9;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

.btn-primary,
.btn-confirm,
.tab-btn.active,
.school-founder,
.build-path-btn.active {
    color: #061314;
    background: linear-gradient(135deg, #9adbc9, #4fa898 55%, #2b6b66);
    border-color: rgba(134, 212, 191, 0.42);
}

.btn-secondary,
.btn-cancel,
.tab-btn,
.build-path-btn {
    color: #dce7f5;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.09);
}

.btn-primary:hover,
.btn-confirm:hover:not(:disabled),
.tab-btn:hover,
.school-card:hover,
.build-path-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 36px rgba(134, 212, 191, 0.18);
}

.btn-attack,
.btn-flee,
.btn-auto {
    background: linear-gradient(135deg, #b64b48, #6f2932);
}

.btn-skill {
    background: linear-gradient(135deg, #447aa0, #23445f);
}

.btn-heal {
    color: #08120f;
    background: linear-gradient(135deg, #88d7bd, #4d9d87);
}

.creation-form,
.game-content,
.profile-avatar,
.profile-stats,
.profile-attrs,
.profile-combat,
.profile-info,
.profile-build,
.equipment-character,
.equipment-inventory,
.life-skills-header,
.gathering-skill-card,
.modal-content,
.dialog-box,
.combo-menu-content,
.npc-detail-panel,
.school-card,
.attr-item,
.attr-box,
.user-info {
    border: 1px solid rgba(192, 166, 120, 0.14);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(10, 20, 22, 0.95), rgba(5, 11, 14, 0.95)),
        linear-gradient(135deg, rgba(192, 166, 120, 0.042), rgba(134, 212, 191, 0.04));
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.26);
}

.game-content {
    padding: 20px;
    backdrop-filter: blur(10px);
}

body.trial-player-chrome #game-container {
    width: calc(100vw - 16px);
    max-width: none;
    padding: 10px 14px 18px;
}

body.trial-player-chrome .game-header {
    margin-bottom: 10px;
    padding: 10px 18px;
}

body.trial-player-chrome .game-header h1 {
    font-size: clamp(2rem, 3.2vw, 3.4rem);
}

body.trial-player-chrome .game-header p {
    margin-top: 2px;
}

body.trial-player-chrome .game-content {
    padding: 10px;
}

body.trial-player-chrome .content-tabs {
    width: 132px;
}

body.trial-player-chrome .content-tabs .tab-btn {
    min-height: 38px;
    padding: 8px 12px;
    font-size: 0.92rem;
}

.content-tabs {
    width: 150px;
    border-right: 1px solid rgba(192, 166, 120, 0.12);
}

.tab-btn {
    text-align: left;
    color: #b4c2d2;
    min-height: 42px;
}

.tab-btn.active {
    box-shadow: inset 3px 0 0 rgba(111, 208, 187, 0.55), 0 12px 28px rgba(0, 0, 0, 0.16);
}

.school-selection,
#school-selection {
    position: relative;
}

.schools-grid {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
    padding: 14px 0;
}

.school-card {
    position: relative;
    overflow: hidden;
    min-height: 170px;
    text-align: left;
}

.school-card::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.24;
    background:
        linear-gradient(180deg, rgba(6, 9, 15, 0.02), rgba(6, 9, 15, 0.9)),
        url("../assets/scene-images/mountain_01.png") center / cover no-repeat;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.school-card:nth-child(5n + 1)::before {
    background-image:
        linear-gradient(180deg, rgba(6, 9, 15, 0.02), rgba(6, 9, 15, 0.9)),
        url("../assets/scene-images/temple_01.png");
}

.school-card:nth-child(5n + 2)::before {
    background-image:
        linear-gradient(180deg, rgba(6, 9, 15, 0.02), rgba(6, 9, 15, 0.9)),
        url("../assets/scene-images/forest_01.png");
}

.school-card:nth-child(5n + 3)::before {
    background-image:
        linear-gradient(180deg, rgba(6, 9, 15, 0.02), rgba(6, 9, 15, 0.9)),
        url("../assets/scene-images/water_01.png");
}

.school-card:nth-child(5n + 4)::before {
    background-image:
        linear-gradient(180deg, rgba(6, 9, 15, 0.02), rgba(6, 9, 15, 0.9)),
        url("../assets/scene-images/garden_01.png");
}

.school-card:nth-child(5n + 5)::before {
    background-image:
        linear-gradient(180deg, rgba(6, 9, 15, 0.02), rgba(6, 9, 15, 0.9)),
        url("../assets/scene-images/cave_01.png");
}

.school-card:hover::before {
    opacity: 0.36;
    transform: scale(1.03);
}

.school-card > * {
    position: relative;
    z-index: 1;
}

.school-card h3,
.profile-name h3,
.profile-attrs h4,
.profile-combat h4,
.profile-info h4,
.profile-build h4,
.character-avatar h3,
.modal-content h2,
.combo-title h3 {
    color: var(--jh-paper);
}

.school-card p,
.profile-name p,
.profile-info p,
.profile-build p,
.combat-grid p,
.intro-box p {
    color: #c7d4e3;
}

.avatar {
    border: 2px solid rgba(192, 166, 120, 0.26);
    background:
        linear-gradient(180deg, rgba(192, 166, 120, 0.12), rgba(134, 212, 191, 0.1)),
        rgba(5, 8, 14, 0.72);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.32);
}

.avatar #char-avatar-emoji {
    color: var(--jh-paper);
    text-shadow: 0 8px 24px rgba(134, 212, 191, 0.2);
}

.bar,
.bar-container,
.affection-bar {
    background: rgba(4, 7, 12, 0.68);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.bar-fill.hp,
.hp {
    background: linear-gradient(90deg, #a83d46, #df7d62);
}

.bar-fill.mp,
.mp {
    background: linear-gradient(90deg, #3f80a6, #7cd0c2);
}

.bar-fill.energy {
    background: linear-gradient(90deg, #4d946a, #b6d36b);
}

.attr-value,
.stat-bar.exp-bar span,
.stat-bar.gold-bar span,
.gold-bar label,
.exp-bar label {
    color: #cdbb97;
}

.modal {
    background: rgba(2, 4, 8, 0.78);
    backdrop-filter: blur(8px);
}

.modal-content,
.dialog-box,
.combo-menu-content,
.npc-detail-panel {
    border-color: rgba(192, 166, 120, 0.18);
}

.close,
.combo-close,
.npc-detail-close {
    color: #ead9ab;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 8px;
}

#school-modal .modal-content {
    width: min(92vw, 820px);
    max-width: 820px;
    max-height: 88vh;
    padding: 24px 24px 22px;
}

#school-modal .modal-content h2 {
    margin-bottom: 14px;
}

#school-modal .school-details {
    display: grid;
    gap: 16px;
}

#school-modal #modal-school-desc {
    margin: 0;
    color: #d8e3ef;
    line-height: 1.8;
}

#school-modal .school-modal-hero {
    position: relative;
    display: grid;
    grid-template-columns: clamp(168px, 26%, 224px) minmax(0, 1fr);
    gap: 12px;
    min-height: 286px;
    padding: 8px;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid rgba(192, 166, 120, 0.18);
    background:
        linear-gradient(180deg, rgba(10, 20, 22, 0.96), rgba(5, 10, 13, 0.96)),
        linear-gradient(135deg, rgba(192, 166, 120, 0.05), rgba(134, 212, 191, 0.04));
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.035),
        0 18px 44px rgba(0, 0, 0, 0.28);
}

#school-modal .school-modal-portrait-panel,
#school-modal .school-modal-scene-panel {
    position: relative;
    min-height: 268px;
    overflow: hidden;
    border-radius: 6px;
    border: 1px solid rgba(192, 166, 120, 0.14);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.035);
}

#school-modal .school-modal-portrait-panel {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0 4px;
    background:
        radial-gradient(circle at 50% 18%, rgba(134, 212, 191, 0.14), transparent 48%),
        linear-gradient(180deg, rgba(10, 20, 22, 0.98), rgba(5, 10, 13, 0.96));
}

#school-modal .school-modal-portrait-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 5px),
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 38%);
}

#school-modal .school-modal-portrait-panel img {
    position: relative;
    z-index: 1;
    width: 128%;
    height: 112%;
    max-width: none;
    max-height: none;
    object-fit: contain;
    object-position: center bottom;
    pointer-events: none;
    transform: translateY(3%);
    transform-origin: center bottom;
    filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.52));
}

#school-modal .school-modal-scene-panel {
    background-color: #08111c;
    background-image: var(--school-modal-scene, url("../images/ui/jianghu-menu-bg.png"));
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

#school-modal .school-modal-scene-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(4, 8, 14, 0.08), rgba(4, 8, 14, 0.3)),
        linear-gradient(90deg, rgba(4, 8, 14, 0.18), transparent 34%, rgba(4, 8, 14, 0.12));
}

#school-modal .school-info {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 14px;
}

#school-modal .school-info p {
    margin: 0;
    line-height: 1.55;
}

#school-modal .school-features,
#school-modal .school-skills {
    margin-top: 0;
}

#school-modal .school-features h3,
#school-modal .school-skills h3 {
    margin-bottom: 8px;
}

#school-modal .school-features li,
#school-modal .school-skills li {
    padding: 8px 0;
    line-height: 1.55;
}

.message-box,
.login-message,
.affection-toast-content {
    border: 1px solid rgba(192, 166, 120, 0.18);
    border-radius: 8px;
    background: rgba(9, 13, 21, 0.94);
    color: #fff3d1;
    box-shadow: var(--jh-shadow);
}

.battle-container,
.battle-scene,
.battle-actions-row,
.quick-skill-slot,
.skill-menu,
.combo-selected,
.combo-buffs,
.combo-skill-card,
.combo-slot {
    border-color: rgba(192, 166, 120, 0.12);
    border-radius: 8px;
    background-color: rgba(8, 12, 20, 0.76);
}

.trial-root {
    border: 1px solid rgba(192, 166, 120, 0.16);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(5, 9, 16, 0.84), rgba(5, 8, 14, 0.96)),
        url("../images/ui/jianghu-menu-bg.png") center / cover no-repeat;
    box-shadow: var(--jh-shadow);
}

.trial-root::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(192, 166, 120, 0.05), transparent 28%),
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 5px);
}

.trial-shell,
.trial-run-shell {
    position: relative;
    z-index: 1;
}

.trial-sidebar,
.trial-main,
.trial-panel,
.trial-card,
.trial-card-preview,
.trial-node-btn,
.trial-offer,
.trial-hero-card,
.trial-settlement,
.trial-guide-panel,
.trial-overview-panel,
.trial-note-card,
.trial-info-metric,
.trial-kv-item,
.trial-stat,
.trial-route-preview-floor,
.trial-choice-card,
.trial-event-option {
    border-radius: 8px;
    border-color: rgba(192, 166, 120, 0.12);
    background-color: rgba(9, 14, 23, 0.8);
    box-shadow: 0 14px 42px rgba(0, 0, 0, 0.22);
}

.trial-feature-media,
.trial-card-art,
.trial-stage,
.trial-stage-side,
.trial-battle-info-drawer,
.trial-battle-summary-bar,
.trial-consumable-slot,
.trial-route-preview-node,
.trial-route-preview-current,
.trial-route-preview-resource,
.trial-route-preview-warning,
.node-route-bridge,
.route-choice-feedback,
.reward-choice-feedback,
.event-choice-feedback,
.shop-leave-feedback,
.trial-battle-log-brief {
    border-radius: 8px;
}

.trial-btn,
.trial-tab-btn,
.trial-chip,
.trial-card-tag {
    border-radius: 8px;
}

.trial-feature-media-scrim,
.trial-card-art-overlay {
    background:
        linear-gradient(180deg, rgba(4, 7, 12, 0.03), rgba(4, 7, 12, 0.2) 42%, rgba(4, 7, 12, 0.78)),
        linear-gradient(90deg, rgba(4, 7, 12, 0.44), transparent 54%);
}

@media (max-width: 760px) {
    #game-container {
        padding: 8px;
    }

    .game-header {
        grid-template-columns: 1fr;
        padding: 14px 12px;
        margin-bottom: 12px;
        gap: 8px;
    }

    .header-wing {
        display: none;
    }

    .header-title,
    .header-actions {
        justify-self: center;
    }

    .header-actions {
        flex-wrap: wrap;
        justify-content: center;
    }

    .game-header h1 {
        font-size: 2rem;
    }

    #login-screen,
    #start-screen {
        min-height: calc(100vh - 126px);
    }

    .login-box,
    .intro-box {
        width: min(100%, 420px);
        padding: 24px 18px;
    }

    .intro-box {
        padding: 26px 16px 24px;
    }

    #start-screen .intro-box h2 {
        font-size: 1.7rem;
        margin-top: 12px;
    }

    .intro-mark {
        width: 54px;
        height: 54px;
    }

    #start-screen .intro-lead {
        font-size: 1rem;
        line-height: 1.8;
    }

    #start-screen .intro-actions {
        flex-direction: column;
    }

    #start-screen .intro-actions .btn {
        width: 100%;
        min-width: 0;
    }

    .game-content {
        padding: 12px;
    }

    .content-tabs {
        width: 100%;
        border-right: 0;
    }

    .content-tabs .tab-btn {
        text-align: center;
    }

    .profile-avatar {
        align-items: flex-start;
        gap: 14px;
        padding: 16px;
    }

    .schools-grid {
        grid-template-columns: 1fr;
    }

    #school-modal .modal-content {
        width: 94vw;
        padding: 20px 16px 18px;
    }

    #school-modal .school-modal-hero {
        grid-template-columns: clamp(116px, 34vw, 144px) minmax(0, 1fr);
        gap: 8px;
        min-height: 204px;
        padding: 6px;
    }

    #school-modal .school-modal-portrait-panel,
    #school-modal .school-modal-scene-panel {
        min-height: 192px;
    }

    #school-modal .school-modal-portrait-panel {
        padding: 0 3px;
    }

    #school-modal .school-modal-portrait-panel img {
        width: 124%;
        height: 110%;
        transform: translateY(3%);
    }

    #school-modal .school-info {
        grid-template-columns: 1fr;
    }
}

/* Jianghu Trial interaction performance: keep hover/click feedback cheap. */
#jianghu-trial-root .trial-card-preview,
.trial-immersive-overlay .trial-card-preview {
    contain: layout paint style;
    box-shadow: 0 0 0 1px rgba(192, 166, 120, 0.1) !important;
    transition: border-color 0.12s ease, background-color 0.12s ease, opacity 0.12s ease !important;
}

#jianghu-trial-root .trial-card-preview .trial-card-art,
.trial-immersive-overlay .trial-card-preview .trial-card-art {
    filter: none !important;
}

#jianghu-trial-root .trial-card-preview .trial-card-name,
#jianghu-trial-root .trial-card-preview .trial-card-type,
#jianghu-trial-root .trial-card-preview .trial-card-desc,
.trial-immersive-overlay .trial-card-preview .trial-card-name,
.trial-immersive-overlay .trial-card-preview .trial-card-type,
.trial-immersive-overlay .trial-card-preview .trial-card-desc {
    text-shadow: none !important;
}

#jianghu-trial-root .trial-card-preview .trial-card-cost,
.trial-immersive-overlay .trial-card-preview .trial-card-cost {
    box-shadow: none !important;
}

#jianghu-trial-root[data-mode="battle"] .trial-panel,
#jianghu-trial-root[data-mode="battle"] .trial-battle-stage,
#jianghu-trial-root[data-mode="battle"] .trial-battle-side-rail,
#jianghu-trial-root[data-mode="battle"] .trial-battle-hand-panel,
.trial-immersive-overlay .trial-panel,
.trial-immersive-overlay .trial-battle-stage,
.trial-immersive-overlay .trial-battle-side-rail,
.trial-immersive-overlay .trial-battle-hand-panel {
    contain: layout paint style;
    box-shadow: none !important;
}

#jianghu-trial-root .trial-btn,
.trial-immersive-overlay .trial-btn,
#jianghu-trial-root .trial-game-primary-btn,
.trial-immersive-overlay .trial-game-primary-btn,
#jianghu-trial-root .trial-tower-node,
.trial-immersive-overlay .trial-tower-node,
#jianghu-trial-root .trial-lobby-portal-card,
.trial-immersive-overlay .trial-lobby-portal-card,
#jianghu-trial-root .trial-lobby-card-tab,
.trial-immersive-overlay .trial-lobby-card-tab,
#jianghu-trial-root .trial-node-compact-card .trial-offer-guide.compact.node-recommendation,
.trial-immersive-overlay .trial-node-compact-card .trial-offer-guide.compact.node-recommendation {
    transition: border-color 0.12s ease, background-color 0.12s ease, opacity 0.12s ease !important;
}

#jianghu-trial-root .trial-card-preview.playable:hover,
#jianghu-trial-root .trial-card-preview.trial-card-preview-selectable:hover,
.trial-immersive-overlay .trial-card-preview.playable:hover,
.trial-immersive-overlay .trial-card-preview.trial-card-preview-selectable:hover {
    transform: none !important;
    border-color: rgba(245, 212, 140, 0.52) !important;
    box-shadow: inset 0 0 0 1px rgba(245, 212, 140, 0.42) !important;
}

#jianghu-trial-root .trial-btn:hover:not(:disabled),
.trial-immersive-overlay .trial-btn:hover:not(:disabled),
#jianghu-trial-root .trial-game-primary-btn:hover:not(:disabled),
.trial-immersive-overlay .trial-game-primary-btn:hover:not(:disabled),
#jianghu-trial-root .trial-tower-node.clickable:hover,
.trial-immersive-overlay .trial-tower-node.clickable:hover,
#jianghu-trial-root .trial-lobby-portal-card:hover,
.trial-immersive-overlay .trial-lobby-portal-card:hover,
#jianghu-trial-root .trial-lobby-card-tab:hover,
.trial-immersive-overlay .trial-lobby-card-tab:hover,
#jianghu-trial-root .trial-node-compact-card .trial-offer-guide.compact.node-recommendation:hover,
#jianghu-trial-root .trial-node-compact-card .trial-offer-guide.compact.node-recommendation:focus-visible,
.trial-immersive-overlay .trial-node-compact-card .trial-offer-guide.compact.node-recommendation:hover,
.trial-immersive-overlay .trial-node-compact-card .trial-offer-guide.compact.node-recommendation:focus-visible {
    transform: none !important;
    filter: none !important;
    box-shadow: inset 0 0 0 1px rgba(245, 212, 140, 0.28) !important;
}

#jianghu-trial-root .trial-tower-node.clickable:hover,
.trial-immersive-overlay .trial-tower-node.clickable:hover {
    transform: translateY(var(--tower-node-y, 0px)) !important;
}

#jianghu-trial-root .trial-battle-info-drawer,
#jianghu-trial-root .trial-battle-info-overlay,
#jianghu-trial-root .trial-battle-summary-bar,
.trial-immersive-overlay,
.trial-immersive-overlay .trial-immersive-window,
.trial-immersive-overlay .trial-battle-info-drawer,
.trial-immersive-overlay .trial-battle-summary-bar {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
