/* 仙途 - 剪纸皮影国风美术风格 */

:root {
    /* 海报级配色 */
    --ink: #080c14;
    --ink-light: #101828;
    --paper: #f5f0e6;
    --paper-dim: rgba(245, 240, 230, 0.08);
    --vermilion: #c41e2b;
    --vermilion-dark: #8a1520;
    --vermilion-glow: rgba(196, 30, 43, 0.35);
    --gold: #d4af37;
    --gold-light: #f0d878;
    --gold-dark: #8f7924;
    --lotus: #e89ab5;
    --lotus-soft: rgba(232, 154, 181, 0.18);
    --jade: #2a9d8f;
    --jade-soft: rgba(42, 157, 143, 0.18);
    --cloud: #3d5a80;
    --cloud-soft: rgba(61, 90, 128, 0.2);

    /* 五行色 */
    --metal: #b8c5d6;
    --wood: #5a9a5e;
    --water: #4a90a4;
    --fire: #c94c4c;
    --earth: #c9a45c;
    --chaos: #9b6bc7;

    --text-color: var(--paper);
    --text-muted: #9a8f7a;
    --panel-bg: rgba(16, 24, 40, 0.92);
    --panel-border: rgba(212, 175, 55, 0.25);

    --shadow-cut: 0 4px 0 rgba(0, 0, 0, 0.4);
    --shadow-lift: 0 8px 24px rgba(0, 0, 0, 0.5);
    --glow-gold: 0 0 24px rgba(212, 175, 55, 0.25);
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
    background: var(--ink);
    color: var(--text-color);
    min-height: 100vh;
}

/* 竖屏锁定提示 */
#orientation-lock {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background:
        radial-gradient(circle at 30% 70%, var(--vermilion-glow), transparent 50%),
        radial-gradient(circle at 70% 30%, var(--lotus-soft), transparent 45%),
        var(--ink);
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
}

#orientation-lock .rotate-icon {
    font-size: 80px;
    margin-bottom: 24px;
    animation: rotatePhone 2s ease-in-out infinite;
    filter: drop-shadow(0 0 20px var(--gold));
}

#orientation-lock h2 {
    font-family: "ZCOOL XiaoWei", "Noto Serif SC", serif;
    font-size: 42px;
    color: var(--gold);
    letter-spacing: 12px;
    margin-bottom: 16px;
}

#orientation-lock p {
    font-size: 18px;
    color: var(--text-muted);
    letter-spacing: 4px;
    margin-bottom: 32px;
}

#orientation-lock .big-btn {
    font-size: 16px;
}

@keyframes rotatePhone {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(90deg); }
}

@media (orientation: portrait) {
    #orientation-lock { display: flex; }
    #game-container { display: none !important; }
}

/* 游戏容器 */
#game-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    background:
        radial-gradient(circle at 15% 85%, var(--vermilion-glow), transparent 35%),
        radial-gradient(circle at 85% 15%, var(--lotus-soft), transparent 35%),
        radial-gradient(circle at 50% 50%, var(--cloud-soft), transparent 55%),
        var(--ink);
}

/* 宣纸纹理叠加 */
#game-container::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0.06;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

#main-panel {
    flex: 1;
    position: relative;
    z-index: 2;
    min-height: 0;
}

.screen {
    display: none;
    width: 100%;
    height: 100%;
    position: relative;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

/* 顶部信息栏 - 剪纸条带 */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 32px;
    background: linear-gradient(180deg, rgba(8, 12, 20, 0.98), rgba(16, 24, 40, 0.92));
    border-bottom: 2px solid var(--vermilion);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    z-index: 100;
    position: relative;
    clip-path: polygon(0 0, 100% 0, 100% 92%, 98% 100%, 2% 100%, 0 92%);
}

.game-header::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 2%;
    right: 2%;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0.6;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.header-left h1 {
    font-family: "ZCOOL XiaoWei", "Noto Serif SC", serif;
    color: var(--gold);
    font-size: 28px;
    letter-spacing: 10px;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
}

#mode-display, #level-display {
    color: var(--text-muted);
    font-size: 13px;
    padding: 4px 12px;
    border: 1px solid var(--panel-border);
    background: var(--paper-dim);
    clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 100%);
}

.header-center {
    display: flex;
    gap: 28px;
    color: var(--gold);
    font-size: 14px;
    letter-spacing: 1px;
}

.header-right {
    display: flex;
    gap: 10px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: 2px solid var(--vermilion-dark);
    background: linear-gradient(180deg, rgba(196, 30, 43, 0.15), rgba(138, 21, 32, 0.25));
    color: var(--gold);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    clip-path: polygon(20% 0, 100% 0, 100% 80%, 80% 100%, 0 100%, 0 20%);
    box-shadow: var(--shadow-cut);
}

.icon-btn:hover {
    background: linear-gradient(180deg, rgba(196, 30, 43, 0.3), rgba(138, 21, 32, 0.4));
    border-color: var(--gold);
    transform: translateY(-2px);
    box-shadow: var(--glow-gold);
}

.icon-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* 通用按钮 */
.big-btn {
    padding: 14px 36px;
    border: 2px solid var(--vermilion-dark);
    background: linear-gradient(180deg, rgba(196, 30, 43, 0.2), rgba(138, 21, 32, 0.3));
    color: var(--paper);
    cursor: pointer;
    font-family: inherit;
    font-size: 16px;
    letter-spacing: 4px;
    transition: all 0.2s;
    clip-path: polygon(10% 0, 100% 0, 100% 75%, 90% 100%, 0 100%, 0 25%);
    box-shadow: var(--shadow-cut);
}

.big-btn:hover {
    border-color: var(--gold);
    background: linear-gradient(180deg, rgba(196, 30, 43, 0.35), rgba(138, 21, 32, 0.45));
    transform: translateY(-2px);
    box-shadow: var(--glow-gold);
}

.big-btn.primary {
    border-color: var(--gold);
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.2), rgba(143, 121, 36, 0.35));
    color: var(--gold-light);
}

.big-btn.primary:hover {
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.35), rgba(143, 121, 36, 0.5));
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
}

.big-btn.danger {
    border-color: var(--vermilion);
    background: linear-gradient(180deg, rgba(196, 30, 43, 0.25), rgba(138, 21, 32, 0.4));
    color: #ffb8b8;
}

.big-btn.danger:hover {
    background: linear-gradient(180deg, rgba(196, 30, 43, 0.4), rgba(138, 21, 32, 0.55));
    box-shadow: 0 0 20px var(--vermilion-glow);
}

.big-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* 模式选择 - 横屏海报构图 */
.mode-screen {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8vw;
    position: relative;
    overflow: hidden;
}

.mode-bg-decoration {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

/* 剪纸莲花 */
.lotus-glow {
    position: absolute;
    top: 50%;
    right: 15%;
    width: 55vh;
    height: 55vh;
    transform: translate(30%, -50%);
    background:
        radial-gradient(circle, var(--lotus-soft) 0%, transparent 50%),
        radial-gradient(circle at 45% 45%, rgba(212, 175, 55, 0.12) 0%, transparent 40%);
    border-radius: 50%;
    animation: lotusBreathe 8s ease-in-out infinite;
}

.lotus-glow::before,
.lotus-glow::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(212, 175, 55, 0.12);
}

.lotus-glow::before {
    inset: 12%;
}

.lotus-glow::after {
    inset: 22%;
    border-color: rgba(232, 154, 181, 0.1);
}

@keyframes lotusBreathe {
    0%, 100% { transform: translate(30%, -50%) scale(1); opacity: 0.8; }
    50% { transform: translate(30%, -50%) scale(1.1); opacity: 1; }
}

/* 祥云 */
.cloud {
    position: absolute;
    background: var(--cloud-soft);
    border-radius: 50%;
    filter: blur(18px);
    animation: cloudDrift 25s ease-in-out infinite alternate;
}

.cloud::before,
.cloud::after {
    content: '';
    position: absolute;
    background: inherit;
    border-radius: 50%;
}

.cloud-1 {
    width: 35vh;
    height: 12vh;
    top: 12%;
    left: -5%;
}

.cloud-1::before { width: 18vh; height: 10vh; top: -4vh; left: 6vh; }
.cloud-1::after { width: 15vh; height: 9vh; top: -1vh; right: 5vh; }

.cloud-2 {
    width: 28vh;
    height: 9vh;
    bottom: 30%;
    left: 10%;
    animation-delay: -10s;
}

.cloud-2::before { width: 15vh; height: 8vh; top: -3vh; left: 4vh; }
.cloud-2::after { width: 12vh; height: 7vh; top: -1vh; right: 4vh; }

.cloud-3 {
    width: 22vh;
    height: 8vh;
    top: 10%;
    right: 25%;
    animation-delay: -18s;
}

.cloud-3::before { width: 12vh; height: 7vh; top: -2.5vh; left: 3vh; }
.cloud-3::after { width: 10vh; height: 6vh; top: -0.5vh; right: 3vh; }

@keyframes cloudDrift {
    0% { transform: translateX(0); }
    100% { transform: translateX(4vh); }
}

/* 左侧菜单 */
.mode-menu {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 4vh;
}

.mode-menu-item {
    display: flex;
    align-items: center;
    gap: 18px;
    background: transparent;
    border: none;
    color: var(--paper);
    font-family: "ZCOOL XiaoWei", "Noto Serif SC", serif;
    font-size: 5vh;
    letter-spacing: 1.2vh;
    cursor: pointer;
    padding: 1vh 0;
    transition: all 0.3s ease;
    text-shadow: 0 2px 12px rgba(0,0,0,0.6);
    opacity: 0.9;
}

.mode-menu-item:hover:not(:disabled) {
    opacity: 1;
    color: var(--gold-light);
    transform: translateX(1.5vh);
}

.mode-menu-item:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.mode-menu-item:disabled .menu-text {
    text-decoration: line-through;
    text-decoration-color: var(--text-muted);
}

.menu-dot {
    width: 1vh;
    height: 1vh;
    background: var(--vermilion);
    transform: rotate(45deg);
    box-shadow: 0 0 12px var(--vermilion-glow);
    transition: all 0.3s ease;
}

.mode-menu-item:hover:not(:disabled) .menu-dot {
    transform: rotate(45deg) scale(1.6);
    background: var(--gold);
    box-shadow: 0 0 20px var(--gold);
}

.menu-text {
    position: relative;
}

.menu-text::after {
    content: '';
    position: absolute;
    bottom: -0.8vh;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--gold), transparent);
    transition: width 0.3s ease;
}

.mode-menu-item:hover:not(:disabled) .menu-text::after {
    width: 100%;
}

/* 右侧标题 */
.mode-title-vertical {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2vh;
}

.title-main {
    font-family: "ZCOOL XiaoWei", "Noto Serif SC", serif;
    font-size: 22vh;
    font-weight: 900;
    color: var(--gold);
    letter-spacing: 2vh;
    text-shadow:
        0 0 40px rgba(212, 175, 55, 0.35),
        0 0 80px rgba(212, 175, 55, 0.15);
    background: linear-gradient(180deg, var(--gold-light), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 4px 0 rgba(143, 121, 36, 0.3));
    animation: titleGlow 4s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    0% { filter: drop-shadow(0 4px 0 rgba(143, 121, 36, 0.3)) drop-shadow(0 0 30px rgba(212, 175, 55, 0.3)); }
    100% { filter: drop-shadow(0 4px 0 rgba(143, 121, 36, 0.3)) drop-shadow(0 0 60px rgba(212, 175, 55, 0.5)); }
}

.title-sub {
    font-family: "Noto Serif SC", serif;
    font-size: 1.6vh;
    letter-spacing: 1vh;
    color: var(--text-muted);
    opacity: 0.5;
}

/* 角色创建 */
.create-screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 3vh 4vw;
    gap: 2vh;
}

.create-screen > h2 {
    font-family: "ZCOOL XiaoWei", "Noto Serif SC", serif;
    font-size: 5vh;
    color: var(--gold);
    letter-spacing: 1.5vh;
    text-align: center;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

.create-layout {
    flex: 1;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 3vw;
    min-height: 0;
}

.create-section {
    background: var(--panel-bg);
    border: 2px solid var(--panel-border);
    border-radius: 4px;
    padding: 2.5vh 2vw;
    overflow-y: auto;
    position: relative;
    clip-path: polygon(0 0, 100% 0, 100% 96%, 98% 100%, 2% 100%, 0 96%);
}

.create-section::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border: 1px solid rgba(212, 175, 55, 0.08);
    pointer-events: none;
}

.create-section h3 {
    font-family: "ZCOOL XiaoWei", "Noto Serif SC", serif;
    font-size: 2.8vh;
    color: var(--vermilion);
    margin-bottom: 2vh;
    letter-spacing: 0.6vh;
    padding-bottom: 1vh;
    border-bottom: 1px solid var(--panel-border);
}

.points-remain {
    float: right;
    color: var(--gold);
    font-size: 0.85em;
}

.sect-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1.5vh;
    margin-bottom: 2vh;
}

.sect-card {
    padding: 1.5vh 1vw;
    border: 2px solid var(--panel-border);
    background: var(--paper-dim);
    color: var(--paper);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    clip-path: polygon(8% 0, 100% 0, 100% 85%, 92% 100%, 0 100%, 0 15%);
}

.sect-card:hover,
.sect-card.selected {
    border-color: var(--vermilion);
    background: rgba(196, 30, 43, 0.15);
    box-shadow: 0 0 20px var(--vermilion-glow);
}

.sect-card.locked {
    opacity: 0.4;
    cursor: not-allowed;
}

.sect-card h4 {
    font-size: 2vh;
    color: var(--gold);
    margin-bottom: 0.5vh;
    font-family: "ZCOOL XiaoWei", "Noto Serif SC", serif;
}

.sect-card .element {
    font-size: 1.4vh;
    color: var(--text-muted);
    margin-bottom: 0.5vh;
}

.sect-card .desc {
    font-size: 1.3vh;
    color: var(--text-muted);
    line-height: 1.5;
}

.sect-preview {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--panel-border);
    padding: 1.5vh;
    border-radius: 4px;
    font-size: 1.6vh;
    line-height: 1.7;
    color: var(--text-muted);
}

.sect-preview h4 {
    color: var(--gold);
    margin-bottom: 1vh;
    font-size: 1.8vh;
}

.attr-editor {
    display: flex;
    flex-direction: column;
    gap: 1.5vh;
    margin-bottom: 2vh;
}

.attr-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2vh 1vw;
    background: var(--paper-dim);
    border: 1px solid var(--panel-border);
    clip-path: polygon(4% 0, 100% 0, 96% 100%, 0 100%);
}

.attr-row label {
    color: var(--gold);
    font-size: 1.7vh;
    width: 60px;
}

.attr-value {
    font-size: 2.2vh;
    color: var(--paper);
    min-width: 40px;
    text-align: center;
}

.attr-controls {
    display: flex;
    gap: 8px;
}

.attr-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--vermilion-dark);
    background: rgba(196, 30, 43, 0.2);
    color: var(--paper);
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    clip-path: polygon(20% 0, 100% 0, 100% 80%, 80% 100%, 0 100%, 0 20%);
}

.attr-btn:hover {
    background: rgba(196, 30, 43, 0.35);
    border-color: var(--gold);
}

.attr-desc {
    font-size: 1.4vh;
    line-height: 1.8;
    color: var(--text-muted);
}

.attr-desc b {
    color: var(--gold);
    font-weight: normal;
}

.create-actions {
    display: flex;
    justify-content: center;
    gap: 3vw;
    padding-bottom: 1vh;
}

/* 战斗界面 */
.combat-arena {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 2vh 3vw;
    gap: 1.5vh;
}

.battlefield {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 28vw 1fr;
    gap: 2vw;
    align-items: center;
    min-height: 0;
}

.actor-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5vh;
    position: relative;
}

.player-side {
    align-items: flex-start;
    padding-left: 3vw;
}

.enemy-side {
    align-items: flex-end;
    padding-right: 3vw;
}

.actor-model {
    width: 22vh;
    height: 26vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.actor-info {
    min-width: 180px;
    background: rgba(8, 12, 20, 0.8);
    border: 1px solid var(--panel-border);
    padding: 1.2vh 1vw;
    border-radius: 4px;
    clip-path: polygon(0 0, 100% 0, 100% 88%, 92% 100%, 8% 100%, 0 88%);
}

.player-side .actor-info {
    align-self: flex-start;
}

.enemy-side .actor-info {
    align-self: flex-end;
    text-align: right;
}

.actor-name {
    font-family: "ZCOOL XiaoWei", "Noto Serif SC", serif;
    font-size: 2.2vh;
    color: var(--gold);
    letter-spacing: 0.4vh;
    margin-bottom: 0.6vh;
}

.element-badge {
    display: inline-block;
    padding: 0.3vh 1vh;
    font-size: 1.4vh;
    border: 1px solid var(--panel-border);
    margin-bottom: 0.8vh;
    clip-path: polygon(15% 0, 100% 0, 85% 100%, 0 100%);
}

.element-badge.enemy {
    background: rgba(196, 30, 43, 0.15);
    color: var(--vermilion);
}

.element-metal { color: var(--metal); border-color: var(--metal); }
.element-wood { color: var(--wood); border-color: var(--wood); }
.element-water { color: var(--water); border-color: var(--water); }
.element-fire { color: var(--fire); border-color: var(--fire); }
.element-earth { color: var(--earth); border-color: var(--earth); }
.element-chaos { color: var(--chaos); border-color: var(--chaos); }

.hp-bar, .mp-bar {
    width: 100%;
    height: 1.4vh;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 0.4vh;
    position: relative;
    overflow: hidden;
    clip-path: polygon(0 0, 100% 0, 98% 100%, 2% 100%);
}

.hp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--vermilion-dark), var(--vermilion));
    transition: width 0.4s ease;
    box-shadow: 0 0 10px var(--vermilion-glow);
}

.hp-fill.enemy {
    background: linear-gradient(90deg, #5a1a2a, var(--vermilion));
}

.mp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--cloud), var(--jade));
    transition: width 0.4s ease;
}

.hp-text, .mp-text {
    font-size: 1.3vh;
    color: var(--text-muted);
    margin-bottom: 0.4vh;
}

.battle-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2vh;
    height: 100%;
}

.round-info {
    font-family: "ZCOOL XiaoWei", "Noto Serif SC", serif;
    font-size: 2.2vh;
    color: var(--gold);
    letter-spacing: 0.5vh;
    padding: 1vh 2vw;
    border: 1px solid var(--panel-border);
    background: var(--paper-dim);
    clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%);
}

.vs-mark {
    font-family: "ZCOOL XiaoWei", "Noto Serif SC", serif;
    font-size: 8vh;
    color: var(--vermilion);
    text-shadow: 0 0 30px var(--vermilion-glow);
    font-weight: 900;
    letter-spacing: 1vh;
}

.combat-log {
    width: 100%;
    height: 22vh;
    background: rgba(8, 12, 20, 0.85);
    border: 1px solid var(--panel-border);
    border-radius: 4px;
    padding: 1.5vh 1vw;
    overflow-y: auto;
    font-size: 1.5vh;
    line-height: 1.7;
    color: var(--text-muted);
    clip-path: polygon(0 0, 100% 0, 100% 95%, 95% 100%, 5% 100%, 0 95%);
}

.combat-log .log-info { color: var(--text-muted); }
.combat-log .log-damage { color: #ff8a8a; }
.combat-log .log-critical { color: var(--gold-light); text-shadow: 0 0 8px rgba(240, 216, 120, 0.4); }
.combat-log .log-heal { color: var(--jade); }

/* 技能栏 */
.skill-bar {
    display: flex;
    justify-content: center;
    gap: 1.2vw;
    padding: 1.5vh 0;
    flex-wrap: wrap;
}

.skill-btn {
    min-width: 140px;
    padding: 1.5vh 1.2vw;
    background: linear-gradient(180deg, rgba(196, 30, 43, 0.18), rgba(138, 21, 32, 0.28));
    border: 2px solid var(--vermilion-dark);
    color: var(--paper);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    clip-path: polygon(8% 0, 100% 0, 100% 80%, 92% 100%, 0 100%, 0 20%);
    box-shadow: var(--shadow-cut);
    position: relative;
    overflow: hidden;
}

.skill-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    transition: left 0.4s;
}

.skill-btn:hover::before {
    left: 100%;
}

.skill-btn:hover {
    border-color: var(--gold);
    transform: translateY(-3px);
    box-shadow: var(--glow-gold);
}

.skill-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    filter: grayscale(0.6);
}

.skill-btn .skill-name {
    font-family: "ZCOOL XiaoWei", "Noto Serif SC", serif;
    font-size: 1.8vh;
    color: var(--gold);
    letter-spacing: 0.2vh;
    margin-bottom: 0.4vh;
}

.skill-btn .skill-cost {
    font-size: 1.2vh;
    color: var(--jade);
    margin-bottom: 0.3vh;
}

.skill-btn .skill-desc {
    font-size: 1.2vh;
    color: var(--text-muted);
    line-height: 1.4;
}

.skill-btn .skill-cd {
    position: absolute;
    top: 0.5vh;
    right: 0.5vw;
    width: 2.2vh;
    height: 2.2vh;
    background: var(--vermilion);
    color: var(--paper);
    font-size: 1.2vh;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* 皮影风格角色模型 */
.cultivator {
    position: relative;
    width: 14vh;
    height: 22vh;
    filter: drop-shadow(0 8px 0 rgba(0,0,0,0.4));
    transition: transform 0.3s;
}

.cultivator .body {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 8vh;
    height: 13vh;
    background: linear-gradient(180deg, #3a6a7a, #1f3a45);
    clip-path: polygon(20% 0, 80% 0, 100% 30%, 90% 100%, 10% 100%, 0 30%);
    border: 2px solid rgba(212, 175, 55, 0.4);
}

.cultivator .head {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 5vh;
    height: 6vh;
    background: #f5d0a8;
    clip-path: polygon(30% 0, 70% 0, 100% 40%, 85% 100%, 15% 100%, 0 40%);
    border: 2px solid rgba(0,0,0,0.3);
}

.cultivator .hair {
    position: absolute;
    top: -1vh;
    left: 50%;
    transform: translateX(-50%);
    width: 7vh;
    height: 6vh;
    background: #1a1a1a;
    clip-path: polygon(20% 30%, 50% 0, 80% 30%, 100% 60%, 85% 100%, 15% 100%, 0 60%);
}

.cultivator .weapon {
    position: absolute;
    top: 2vh;
    right: -2vh;
    width: 1.2vh;
    height: 16vh;
    background: linear-gradient(180deg, var(--gold), var(--gold-dark));
    transform: rotate(15deg);
    clip-path: polygon(40% 0, 60% 0, 70% 85%, 100% 90%, 0 90%, 30% 85%);
}

.cultivator .aura {
    position: absolute;
    inset: -2vh;
    border: 2px dashed rgba(212, 175, 55, 0.3);
    border-radius: 50%;
    animation: auraSpin 8s linear infinite;
}

.cultivator.attack {
    animation: playerAttack 0.4s ease-in-out;
}

.cultivator.hit {
    animation: playerHit 0.3s ease-in-out;
}

@keyframes auraSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes playerAttack {
    0% { transform: translateX(0); }
    50% { transform: translateX(8vh) scale(1.05); }
    100% { transform: translateX(0); }
}

@keyframes playerHit {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-1.5vh) rotate(-3deg); }
    75% { transform: translateX(1.5vh) rotate(3deg); }
}

/* 敌人模型 - 妖兽皮影 */
.monster {
    position: relative;
    width: 16vh;
    height: 20vh;
    filter: drop-shadow(0 8px 0 rgba(0,0,0,0.4));
    transition: transform 0.3s;
}

.monster .m-body {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 11vh;
    height: 15vh;
    background: linear-gradient(180deg, #4a2a3a, #2a151f);
    clip-path: polygon(50% 0, 100% 35%, 90% 100%, 10% 100%, 0 35%);
    border: 2px solid rgba(196, 30, 43, 0.4);
}

.monster .m-eyes {
    position: absolute;
    top: 5vh;
    left: 50%;
    transform: translateX(-50%);
    width: 7vh;
    height: 2vh;
}

.monster .m-eyes::before,
.monster .m-eyes::after {
    content: '';
    position: absolute;
    top: 0;
    width: 2vh;
    height: 2vh;
    background: var(--vermilion);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--vermilion-glow);
}

.monster .m-eyes::before { left: 0; }
.monster .m-eyes::after { right: 0; }

.monster .m-aura {
    position: absolute;
    inset: -2vh;
    border: 2px dashed rgba(196, 30, 43, 0.3);
    border-radius: 50%;
    animation: auraSpin 8s linear infinite reverse;
}

.monster.attack {
    animation: enemyAttack 0.4s ease-in-out;
}

.monster.hit {
    animation: enemyHit 0.3s ease-in-out;
}

@keyframes enemyAttack {
    0% { transform: translateX(0); }
    50% { transform: translateX(-8vh) scale(1.05); }
    100% { transform: translateX(0); }
}

@keyframes enemyHit {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(1.5vh) rotate(3deg); }
    75% { transform: translateX(-1.5vh) rotate(-3deg); }
}

/* 游戏结束 */
.gameover-screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3vh;
}

.gameover-screen h2 {
    font-family: "ZCOOL XiaoWei", "Noto Serif SC", serif;
    font-size: 8vh;
    letter-spacing: 2vh;
}

.gameover-screen.win h2 { color: var(--gold); text-shadow: 0 0 40px rgba(212, 175, 55, 0.4); }
.gameover-screen.lose h2 { color: var(--vermilion); text-shadow: 0 0 40px var(--vermilion-glow); }

#gameover-desc {
    font-size: 2.2vh;
    color: var(--text-muted);
    letter-spacing: 0.5vh;
}

#gameover-stats {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    padding: 2vh 3vw;
    border-radius: 4px;
    font-size: 1.6vh;
    line-height: 2;
    color: var(--text-muted);
    clip-path: polygon(0 0, 100% 0, 100% 92%, 96% 100%, 4% 100%, 0 92%);
}

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(8, 12, 20, 0.88);
    backdrop-filter: blur(6px);
    z-index: 500;
    align-items: center;
    justify-content: center;
    padding: 2vh 2vw;
}

.modal.active {
    display: flex;
}

.modal-content {
    width: 520px;
    max-width: 90vw;
    max-height: 86vh;
    background: var(--panel-bg);
    border: 2px solid var(--panel-border);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lift), 0 0 0 1px rgba(212, 175, 55, 0.08);
    clip-path: polygon(0 0, 100% 0, 100% 96%, 98% 100%, 2% 100%, 0 96%);
}

.modal-content.wide {
    width: 820px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.8vh 1.5vw;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid var(--vermilion-dark);
}

.modal-header h2 {
    font-family: "ZCOOL XiaoWei", "Noto Serif SC", serif;
    color: var(--gold);
    font-size: 3vh;
    letter-spacing: 0.6vh;
}

.close-btn {
    width: 36px;
    height: 36px;
    background: rgba(196, 30, 43, 0.15);
    border: 1px solid var(--vermilion-dark);
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    clip-path: polygon(20% 0, 100% 0, 100% 80%, 80% 100%, 0 100%, 0 20%);
}

.close-btn:hover {
    color: var(--vermilion);
    border-color: var(--vermilion);
    background: rgba(196, 30, 43, 0.25);
}

.modal-body {
    padding: 2.5vh 1.5vw;
    overflow-y: auto;
    flex: 1;
}

/* 背包 */
.bag-section {
    margin-bottom: 2vh;
}

.bag-section h3 {
    font-family: "ZCOOL XiaoWei", "Noto Serif SC", serif;
    color: var(--vermilion);
    font-size: 2vh;
    margin-bottom: 1.2vh;
    letter-spacing: 0.3vh;
    padding-bottom: 0.6vh;
    border-bottom: 1px solid var(--panel-border);
}

.bag-grid, .shop-grid, .reward-grid, .skill-slot-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1.2vh;
}

.bag-item, .shop-item, .reward-card, .skill-slot-btn, .pool-card {
    padding: 1.5vh 1vw;
    background: var(--paper-dim);
    border: 1px solid var(--panel-border);
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    clip-path: polygon(6% 0, 100% 0, 100% 90%, 94% 100%, 0 100%, 0 10%);
}

.bag-item:hover, .shop-item:hover, .reward-card:hover, .skill-slot-btn:hover, .pool-card:hover {
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.08);
    transform: translateY(-2px);
}

.bag-item .name, .shop-item .name, .reward-card h4, .pool-card h4 {
    font-size: 1.5vh;
    color: var(--gold);
    margin-bottom: 0.4vh;
    font-family: "ZCOOL XiaoWei", "Noto Serif SC", serif;
}

.rarity-common { color: #b8c5d6; }
.rarity-uncommon { color: #7db87d; }
.rarity-rare { color: #6bb5d6; }
.rarity-epic { color: #c78ad6; }
.rarity-legendary { color: var(--gold); }
.rarity-mythic { color: #ff7f7f; }

.bag-item .desc, .shop-item .desc, .reward-card .desc, .reward-card .rarity {
    font-size: 1.2vh;
    color: var(--text-muted);
    line-height: 1.4;
}

.shop-item .price {
    font-size: 1.3vh;
    color: var(--gold);
    margin-top: 0.5vh;
}

.shop-money {
    color: var(--gold);
    font-size: 1.6vh;
    margin-bottom: 1.5vh;
    letter-spacing: 0.2vh;
}

.shop-actions, .reward-actions {
    margin-top: 2vh;
    display: flex;
    justify-content: center;
    gap: 1.5vw;
}

.gacha-pools {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2vh;
    margin-bottom: 2vh;
}

.pool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1vh;
}

.pool-card h4 {
    font-size: 2.2vh;
    margin-bottom: 0.5vh;
}

.pool-card p {
    color: var(--text-muted);
    font-size: 1.3vh;
    line-height: 1.5;
}

.gacha-result {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1vh;
}

.reward-card {
    display: flex;
    flex-direction: column;
    gap: 0.5vh;
}

.reward-card.selected {
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.15);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}

.reward-card .rarity {
    font-size: 1.1vh;
    margin-top: 0.3vh;
}

.skill-slot-btn {
    display: flex;
    flex-direction: column;
    gap: 0.5vh;
    width: 100%;
    background: var(--paper-dim);
    color: var(--paper);
    font-family: inherit;
}

.skill-slot-btn .slot-num {
    font-size: 1.3vh;
    color: var(--gold);
}

.skill-slot-btn .slot-skill {
    font-size: 1.4vh;
    color: var(--text-muted);
}

@keyframes cardFlip {
    0% { transform: rotateY(90deg); opacity: 0; }
    100% { transform: rotateY(0); opacity: 1; }
}

/* 设置 */
.settings-group {
    margin-bottom: 2vh;
}

.settings-group h3 {
    font-family: "ZCOOL XiaoWei", "Noto Serif SC", serif;
    color: var(--vermilion);
    font-size: 2vh;
    margin-bottom: 1.5vh;
    letter-spacing: 0.3vh;
}

.settings-hint {
    color: var(--text-muted);
    font-size: 1.3vh;
    margin-top: 1.2vh;
}

/* 特效层 */
#effects-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 400;
}

.skill-effect {
    position: absolute;
    pointer-events: none;
    z-index: 401;
}

.effect-slash {
    width: 120px;
    height: 120px;
    background: conic-gradient(from 0deg, transparent, var(--gold), transparent);
    clip-path: polygon(30% 0, 70% 0, 100% 50%, 70% 100%, 30% 100%, 0 50%);
    animation: slashSpin 0.5s ease-out forwards;
}

@keyframes slashSpin {
    0% { transform: scale(0) rotate(0deg); opacity: 1; }
    100% { transform: scale(2) rotate(180deg); opacity: 0; }
}

.effect-fire {
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, var(--vermilion-glow), transparent 70%);
    clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    animation: fireEffect 0.6s ease-out forwards;
}

@keyframes fireEffect {
    0% { transform: scale(0); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.85; }
    100% { transform: scale(2.5); opacity: 0; }
}

.effect-water, .effect-ice {
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(74, 144, 164, 0.7), transparent 70%);
    clip-path: polygon(50% 0, 100% 30%, 80% 100%, 20% 100%, 0 30%);
    animation: waterEffect 0.7s ease-out forwards;
}

@keyframes waterEffect {
    0% { transform: scale(0) rotate(0deg); opacity: 1; }
    100% { transform: scale(2.2) rotate(120deg); opacity: 0; }
}

.effect-wood {
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(90, 154, 94, 0.7), transparent 70%);
    clip-path: polygon(50% 0, 100% 40%, 80% 100%, 20% 100%, 0 40%);
    animation: woodEffect 0.7s ease-out forwards;
}

@keyframes woodEffect {
    0% { transform: scale(0) rotate(0deg); opacity: 1; }
    100% { transform: scale(2) rotate(-90deg); opacity: 0; }
}

.effect-metal {
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(184, 197, 214, 0.7), transparent 70%);
    clip-path: polygon(20% 0, 80% 0, 100% 50%, 80% 100%, 20% 100%, 0 50%);
    animation: metalEffect 0.5s ease-out forwards;
}

@keyframes metalEffect {
    0% { transform: scale(0); opacity: 1; }
    50% { transform: scale(1.8); opacity: 0.9; }
    100% { transform: scale(2.2); opacity: 0; }
}

.effect-earth {
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(201, 164, 92, 0.7), transparent 70%);
    clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
    animation: earthEffect 0.6s ease-out forwards;
}

@keyframes earthEffect {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

.effect-chaos {
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(155, 107, 199, 0.6), transparent 70%);
    clip-path: polygon(50% 0, 80% 10%, 100% 35%, 100% 70%, 80% 90%, 50% 100%, 20% 90%, 0 70%, 0 35%, 20% 10%);
    animation: chaosEffect 0.8s ease-out forwards;
}

@keyframes chaosEffect {
    0% { transform: scale(0) rotate(0deg); opacity: 1; }
    100% { transform: scale(2.2) rotate(180deg); opacity: 0; }
}

/* 飘字 */
.damage-number, .heal-number {
    position: absolute;
    font-family: "ZCOOL XiaoWei", "Noto Serif SC", serif;
    font-size: 32px;
    font-weight: 900;
    pointer-events: none;
    z-index: 402;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
    animation: floatUp 1s ease-out forwards;
}

.damage-number { color: #ff7a7a; }
.damage-number.crit { color: var(--gold-light); font-size: 44px; text-shadow: 0 0 20px rgba(240, 216, 120, 0.6); }
.heal-number { color: var(--jade); }

@keyframes floatUp {
    0% { transform: translateY(0) scale(0.8); opacity: 1; }
    100% { transform: translateY(-80px) scale(1.1); opacity: 0; }
}

/* 消息提示 */
.message {
    position: fixed;
    top: 12vh;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(8, 12, 20, 0.95);
    border: 2px solid var(--vermilion-dark);
    color: var(--gold);
    padding: 1.5vh 3vw;
    border-radius: 4px;
    z-index: 1000;
    font-size: 1.6vh;
    letter-spacing: 0.2vh;
    animation: messageIn 0.3s ease, messageOut 0.3s ease 2.7s forwards;
    box-shadow: var(--shadow-lift);
    clip-path: polygon(5% 0, 100% 0, 95% 100%, 0 100%);
}

@keyframes messageIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes messageOut {
    from { opacity: 1; transform: translateX(-50%) translateY(0); }
    to { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

/* 响应式 */
@media (max-width: 1100px) {
    .battlefield {
        grid-template-columns: 1fr 24vw 1fr;
    }

    .actor-model {
        width: 18vh;
        height: 22vh;
    }

    .skill-btn {
        min-width: 120px;
    }
}

@media (max-width: 768px) {
    .game-header {
        padding: 8px 16px;
    }

    .header-left h1 {
        font-size: 20px;
        letter-spacing: 6px;
    }

    .header-center {
        gap: 12px;
        font-size: 12px;
    }

    .icon-btn {
        width: 34px;
        height: 34px;
        font-size: 16px;
    }

    .title-main {
        font-size: 16vh;
    }

    .mode-menu-item {
        font-size: 4vh;
    }

    .create-layout {
        grid-template-columns: 1fr;
    }

    .battlefield {
        grid-template-columns: 1fr 18vw 1fr;
    }

    .combat-log {
        height: 16vh;
    }

    .skill-bar {
        gap: 1vh;
    }

    .skill-btn {
        min-width: 100px;
        padding: 1.2vh 1vw;
    }
}
