/* ==========================================================================
   飘流幻境新世界 - 炼金合成模拟器样式表 (style.css)
   ========================================================================== */

/* --- Core variables & Theme --- */
:root {
    --bg-dark: #0f141c;
    --card-bg: rgba(22, 28, 38, 0.85);
    --border-color: rgba(255, 215, 0, 0.2);
    --gold: #ffd700;
    --gold-glow: rgba(255, 215, 0, 0.3);
    --violet: #8e44ad;
    --violet-glow: rgba(142, 68, 173, 0.4);
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --success: #a3be8c;
    --danger: #bf616a;
    --blue: #5e81ac;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Outfit', 'Noto Serif SC', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* --- Animated Starry Background --- */
.stars-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(white, rgba(255,255,255,.2) 2px, transparent 40px),
        radial-gradient(white, rgba(255,255,255,.15) 1px, transparent 30px),
        radial-gradient(white, rgba(255,255,255,.1) 2px, transparent 40px);
    background-size: 550px 550px, 350px 350px, 250px 250px;
    background-position: 0 0, 40px 60px, 130px 270px;
    opacity: 0.25;
    z-index: -3;
    animation: backgroundMove 120s linear infinite;
}

@keyframes backgroundMove {
    from { background-position: 0 0, 40px 60px, 130px 270px; }
    to { background-position: 550px 1100px, 40px 1110px, 130px 1170px; }
}

.glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -2;
    opacity: 0.3;
    pointer-events: none;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--violet-glow) 0%, transparent 70%);
    top: -100px;
    left: -100px;
}

.orb-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(94, 129, 172, 0.3) 0%, transparent 70%);
    bottom: -200px;
    right: -100px;
}

/* --- Application Container --- */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Header --- */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.alchemy-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 0 10px var(--violet));
    animation: pulse 2.5s ease-in-out infinite alternate;
}

@keyframes pulse {
    0% { transform: scale(1); filter: drop-shadow(0 0 5px var(--violet)); }
    100% { transform: scale(1.08); filter: drop-shadow(0 0 15px var(--gold)); }
}

.app-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #ffffff 40%, #eed8a1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.app-header h1 span {
    font-size: 1.1rem;
    font-weight: 300;
    display: block;
    color: var(--text-muted);
}

.app-header .subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    max-width: 550px;
    line-height: 1.4;
}

.nav-back-btn {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.nav-back-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--gold);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

/* --- Main Layout --- */
.app-main {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 30px;
    flex-grow: 1;
    align-items: start;
}

.mobile-edge-tab,
.mobile-panel-backdrop {
    display: none;
}

@media (max-width: 1024px) {
    .app-main {
        grid-template-columns: 1fr;
        position: relative;
    }
    .app-main > .panel-right {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(400px, 92vw);
        z-index: 120;
        overflow-y: auto;
        padding: 14px;
        background: #141a24;
        border-left: 1px solid rgba(255, 215, 0, 0.15);
        box-shadow: -8px 0 28px rgba(0, 0, 0, 0.35);
        transform: translateX(105%);
        transition: transform 0.25s ease;
        gap: 1rem;
    }
    .app-main.result-open > .panel-right {
        transform: translateX(0);
    }
    .app-main > .panel-left {
        width: 100%;
        min-width: 0;
    }
    .mobile-edge-tab {
        display: flex;
        position: fixed;
        top: 50%;
        right: 0;
        z-index: 115;
        transform: translateY(-50%);
        writing-mode: vertical-rl;
        text-orientation: mixed;
        align-items: center;
        justify-content: center;
        min-height: 110px;
        padding: 12px 7px;
        border: 1px solid rgba(255, 215, 0, 0.35);
        border-right: none;
        border-radius: 10px 0 0 10px;
        background: var(--gold);
        color: #0f141c;
        font-size: 13px;
        font-weight: 700;
        letter-spacing: 0.1em;
        cursor: pointer;
        box-shadow: -2px 2px 12px rgba(0, 0, 0, 0.25);
        font-family: inherit;
    }
    .app-main.result-open > .mobile-edge-tab {
        right: min(400px, 92vw);
    }
    .mobile-panel-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 110;
        background: rgba(0, 0, 0, 0.5);
        border: none;
        padding: 0;
        cursor: pointer;
    }
    .app-main.result-open > .mobile-panel-backdrop {
        display: block;
    }
    .prediction-list-wrap,
    .modal-items-list-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* --- Panels & Cards --- */
.panel-left, .panel-right {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

/* --- Left Side: Simulator Card --- */
.simulator-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 600px;
    border-color: var(--border-color);
}

.simulator-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--violet), var(--gold), var(--violet));
}

/* --- Angel Guide Badge --- */
.guide-badge {
    position: absolute;
    left: 20px;
    top: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 6px 14px;
    border-radius: 30px;
}

.angel-avatar {
    font-size: 1.5rem;
}

.guide-info {
    display: flex;
    flex-direction: column;
}

.guide-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gold);
}

.guide-next {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: 'Outfit', sans-serif;
}

/* --- Alchemy Magic Circle Arena --- */
.alchemy-arena {
    width: min(400px, 92vw);
    height: min(400px, 92vw);
    position: relative;
    margin-top: 20px;
    margin-bottom: 20px;
}

.pentagram-svg {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
}

.circle-outer {
    fill: none;
    stroke: var(--border-color);
    stroke-width: 1.5;
}

.circle-inner {
    fill: none;
    stroke: rgba(255, 215, 0, 0.4);
    stroke-width: 1.5;
    stroke-dasharray: 4, 4;
}

.star-lines {
    fill: none;
    stroke: rgba(255, 215, 0, 0.15);
    stroke-width: 2.5;
    stroke-linejoin: round;
    transition: all 0.5s ease;
}

/* Magic glow active state */
.alchemy-arena.animating .star-lines {
    stroke: var(--gold);
    filter: url(#gold-glow);
    animation: pulseStar 1.5s ease-in-out infinite alternate;
}

@keyframes pulseStar {
    0% { opacity: 0.6; }
    100% { opacity: 1; stroke: #ff9f43; }
}

.runes-overlay {
    position: absolute;
    top: 12.5%;
    left: 12.5%;
    width: 75%;
    height: 75%;
    border-radius: 50%;
    background-image: radial-gradient(transparent 65%, rgba(255, 215, 0, 0.05) 66%, rgba(255, 215, 0, 0.05) 70%, transparent 71%);
    border: 1px dashed rgba(255, 215, 0, 0.15);
    pointer-events: none;
    z-index: 1;
    animation: rotateRunes 40s linear infinite;
}

.alchemy-arena.animating .runes-overlay {
    animation: rotateRunes 4s linear infinite;
    border-color: var(--gold);
    opacity: 0.8;
}

@keyframes rotateRunes {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* --- slots positioning on pentagram vertices --- */
.slots-container {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 2;
}

.slot-btn {
    position: absolute;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: rgba(17, 24, 39, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.slot-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
}

.slot-label {
    position: absolute;
    bottom: -35px;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.6);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    white-space: nowrap;
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.3s ease;
}

.slot-btn:hover .slot-label {
    opacity: 1;
    transform: translateY(0);
    bottom: -22px;
}

.slot-symbol {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--text-muted);
}

.slot-btn.empty:hover {
    border-color: var(--gold);
    box-shadow: 0 0 15px var(--gold-glow);
    background: rgba(22, 28, 38, 1);
}

/* Vertex positions (percent of arena so they scale on small screens) */
.slot-1 { left: 50%; top: 15%; transform: translate(-50%, -50%); } /* Top */
.slot-2 { left: 83.275%; top: 39.175%; transform: translate(-50%, -50%); } /* Right-Top */
.slot-3 { left: 70.575%; top: 78.325%; transform: translate(-50%, -50%); } /* Right-Bottom */
.slot-4 { left: 29.425%; top: 78.325%; transform: translate(-50%, -50%); } /* Left-Bottom */
.slot-5 { left: 16.725%; top: 39.175%; transform: translate(-50%, -50%); } /* Left-Top */

/* Filled slot styling */
.slot-btn.filled {
    border-color: var(--gold);
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.15);
}

.slot-btn.book-filled {
    border-color: #8b5cf6;
    background: linear-gradient(135deg, #312e81 0%, #1e1b4b 100%);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.28);
}

.slot-btn.book-filled:hover {
    border-color: #c4b5fd;
    box-shadow: 0 0 20px rgba(167, 139, 250, 0.48);
}

.slot-item-level {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--gold);
    font-family: 'Outfit', sans-serif;
    margin-bottom: 2px;
}

.slot-item-name {
    font-size: 0.62rem;
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    color: var(--text-main);
}

.slot-btn.filled:hover {
    transform: translate(-50%, -50%) scale(1.1);
    border-color: #ff9f43;
    box-shadow: 0 0 20px rgba(255, 159, 67, 0.4);
}

/* --- Bubbling Cauldron (炼金釜) --- */
.cauldron-container {
    width: 260px;
    height: 110px;
    position: relative;
    margin-top: 10px;
}

.cauldron {
    width: 140px;
    height: 90px;
    background: radial-gradient(ellipse at top, #2e3b4e 0%, #11141a 70%);
    border-radius: 50% 50% 40% 40% / 30% 30% 70% 70%;
    border: 3px solid #3c4c62;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5), inset 0 8px 10px rgba(255,255,255,0.05);
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    overflow: hidden;
}

.cauldron-rim {
    width: 116px;
    height: 18px;
    background: #3e5066;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    border: 2px solid #232c38;
}

.cauldron-liquid {
    width: 108px;
    height: 14px;
    background: rgba(142, 68, 173, 0.85); /* Purple default */
    border-radius: 50%;
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 10px rgba(142, 68, 173, 0.6);
    overflow: hidden;
    transition: all 0.5s ease;
}

.alchemy-arena.animating ~ .cauldron-container .cauldron-liquid {
    background: rgba(255, 215, 0, 0.9);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.9);
}

/* Bubbles in liquid */
.bubble {
    position: absolute;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    bottom: -10px;
    animation: floatBubble 1.8s infinite ease-in;
}

.bubble-1 { width: 6px; height: 6px; left: 20%; animation-delay: 0.1s; animation-duration: 1.5s; }
.bubble-2 { width: 8px; height: 8px; left: 45%; animation-delay: 0.5s; animation-duration: 2s; }
.bubble-3 { width: 5px; height: 5px; left: 70%; animation-delay: 0.8s; animation-duration: 1.2s; }
.bubble-4 { width: 7px; height: 7px; left: 80%; animation-delay: 0.3s; animation-duration: 1.7s; }

@keyframes floatBubble {
    0% { transform: translateY(0) scale(1); opacity: 0.8; }
    80% { opacity: 0.4; }
    100% { transform: translateY(-25px) scale(0.2); opacity: 0; }
}

/* Cauldron Steam */
.steam-container {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 60px;
    display: flex;
    justify-content: space-around;
    pointer-events: none;
}

.steam {
    width: 6px;
    height: 35px;
    background: rgba(255, 255, 255, 0.1);
    filter: blur(5px);
    border-radius: 50%;
    animation: riseSteam 3s infinite ease-out;
}

.steam-1 { animation-delay: 0.2s; animation-duration: 2.5s; }
.steam-2 { animation-delay: 0.8s; animation-duration: 3.2s; }
.steam-3 { animation-delay: 1.4s; animation-duration: 2.8s; }

.alchemy-arena.animating ~ .cauldron-container .steam {
    background: rgba(255, 215, 0, 0.3);
    animation: riseSteamActive 1s infinite ease-out;
}

@keyframes riseSteam {
    0% { transform: translateY(30px) scaleX(1); opacity: 0; }
    50% { opacity: 0.3; }
    100% { transform: translateY(-10px) scaleX(2.5); opacity: 0; }
}

@keyframes riseSteamActive {
    0% { transform: translateY(20px) scaleX(1); opacity: 0; filter: blur(3px); }
    50% { opacity: 0.7; }
    100% { transform: translateY(-25px) scaleX(3.5); opacity: 0; filter: blur(7px); }
}

/* --- Book Quick Select --- */
.book-quick-panel {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    margin: 2px 0 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 215, 0, 0.16);
    border-radius: 12px;
}

.book-quick-title {
    color: var(--gold);
    font-size: 0.86rem;
    font-weight: 700;
    white-space: nowrap;
}

.book-slot-select {
    min-height: 36px;
    min-width: 11rem;
    padding: 0 8px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-main);
    font: inherit;
}

.book-slot-select:focus {
    outline: 2px solid rgba(255, 215, 0, 0.25);
    border-color: var(--gold);
}

.book-segment {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
}

.book-segment-btn {
    min-height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.book-segment-btn:hover {
    color: var(--text-main);
    border-color: rgba(255, 215, 0, 0.35);
    background: rgba(255, 215, 0, 0.08);
}

.book-segment-btn.active {
    color: #14120a;
    background: var(--gold);
    border-color: rgba(255, 215, 0, 0.7);
    box-shadow: 0 4px 14px rgba(255, 215, 0, 0.18);
}

.book-segment-btn:disabled,
.book-segment-btn.book-unavailable {
    cursor: not-allowed;
    opacity: 0.45;
}

/* --- Action Controls --- */
.action-controls {
    width: 100%;
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.checkbox-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Checkbox design */
.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 28px;
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--text-muted);
    user-select: none;
    transition: color 0.3s ease;
}

.checkbox-container:hover {
    color: var(--text-main);
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    height: 18px;
    width: 18px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.checkbox-container:hover input ~ .checkmark {
    border-color: var(--gold);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--gold);
    border-color: var(--gold);
    box-shadow: 0 0 8px var(--gold-glow);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid #0f141c;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.btn-clear-slots {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-clear-slots:hover {
    color: var(--danger);
}

/* Synthesis Button */
.btn-synthesize {
    background: linear-gradient(135deg, var(--gold) 0%, #ff9f43 100%);
    border: none;
    border-radius: 12px;
    color: #0f141c;
    padding: 14px;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.btn-synthesize:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.35);
}

.btn-synthesize:active {
    transform: translateY(0);
}

.btn-synthesize.disabled {
    background: #2e3846;
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-synthesize.disabled:hover {
    transform: none;
    box-shadow: none;
}

/* --- Right Side Panel --- */
.quick-panel-card {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
}

.panel-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.panel-tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
}

.panel-tab-btn.active {
    color: #0f141c;
    background: var(--gold);
    box-shadow: 0 4px 10px rgba(255, 215, 0, 0.15);
}

.right-panel-content {
    min-height: 480px;
    display: flex;
    flex-direction: column;
}

.right-panel-content h2, .stats-card h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.right-panel-content h2 .icon, .stats-card h2 .icon {
    font-size: 1.3rem;
}

/* Predict metadata box */
.predict-meta-box {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    gap: 15px;
    margin-bottom: 20px;
}

@media (max-width: 900px) {
    .predict-meta-box {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.meta-item span {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
}

.meta-item strong {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
}

/* Predictions List Wrap */
.prediction-list-wrap {
    flex-grow: 1;
    overflow-y: auto;
    max-height: 350px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    position: relative;
}

.prediction-empty-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    width: 80%;
    text-align: center;
}

.prediction-empty-state .empty-icon {
    font-size: 2.2rem;
    opacity: 0.5;
}

.prediction-empty-state p {
    font-size: 0.85rem;
}

/* Prediction Table */
.prediction-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

.prediction-table th {
    background: rgba(0, 0, 0, 0.5);
    padding: 12px 15px;
    color: var(--text-muted);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.prediction-table td {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
}

.prediction-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.pred-level-badge {
    background: rgba(255, 215, 0, 0.1);
    color: var(--gold);
    border: 1px solid rgba(255, 215, 0, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

.pred-name {
    font-weight: 600;
}

.pred-stats {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: 'Outfit', sans-serif;
}

.pred-rate-cell {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 0.95rem;
}

.success-high { color: var(--success); }
.success-medium { color: var(--gold); }
.success-low { color: #d08770; }
.success-verylow { color: var(--danger); }

/* --- Continuous Simulator Panel --- */
.stats-card {
    border-color: rgba(94, 129, 172, 0.3);
}

.continuous-config-row {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.config-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.config-item label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

.config-item select {
    background: #19202c;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-main);
    padding: 10px;
    font-size: 0.88rem;
    cursor: pointer;
    width: 100%;
}

.config-item select:focus {
    border-color: var(--gold);
    outline: none;
    box-shadow: 0 0 5px var(--gold-glow);
}

.continuous-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

@media (max-width: 600px) {
    .book-quick-panel {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .book-segment {
        gap: 5px;
    }

    .book-segment-btn {
        min-height: 34px;
        font-size: 0.8rem;
    }

    .book-slot-select {
        width: 100%;
        min-width: 0;
    }

    .continuous-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.stat-box, .stat-boxHighlight {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-boxHighlight {
    border-color: rgba(163, 190, 140, 0.4);
    background: rgba(163, 190, 140, 0.05);
}

.stat-box span, .stat-boxHighlight span {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.stat-box strong {
    font-size: 1.1rem;
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
}

.stat-boxHighlight strong {
    font-size: 1.1rem;
    font-family: 'Outfit', sans-serif;
    color: var(--success);
}

.btn-run-continuous {
    background: linear-gradient(135deg, #5e81ac 0%, #81a1c1 100%);
    border: none;
    border-radius: 10px;
    color: #ffffff;
    padding: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 4px 10px rgba(94, 129, 172, 0.15);
}

.btn-run-continuous:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #6c91bf 0%, #91b1d1 100%);
    box-shadow: 0 6px 15px rgba(94, 129, 172, 0.3);
}

/* --- Console Panel --- */
.console-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.console-header h2 {
    margin-bottom: 0;
}

.btn-clear-console {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-clear-console:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.console-body {
    flex-grow: 1;
    background: #080c12;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    overflow-y: auto;
    max-height: 380px;
    font-family: 'Outfit', Consolas, Monaco, monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.log-line {
    padding-bottom: 6px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.02);
}

.log-line.system { color: #88c0d0; }
.log-line.action { color: #d8dee9; }
.log-line.success { color: var(--success); }
.log-line.fail { color: var(--danger); }
.log-line.timestamp { color: var(--text-muted); font-size: 0.75rem; }

/* --- Drawers System --- */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 99;
}

.drawer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.drawer {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    height: 100%;
    background: #141a24;
    border-left: 1px solid rgba(255, 215, 0, 0.15);
    box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    z-index: 100;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.drawer.active {
    right: 0;
}

@media (max-width: 480px) {
    .drawer {
        width: 100%;
        right: -100%;
    }
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.drawer-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.drawer-close-btn {
    background: transparent;
    border: none;
    font-size: 1.8rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.drawer-close-btn:hover {
    color: var(--text-main);
}

.drawer-body {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
}

.drawer-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 25px;
}

.drawer-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
}

.drawer-group select {
    background: #1c2533;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: var(--text-main);
    padding: 10px;
    font-size: 0.88rem;
    cursor: pointer;
}

.drawer-tip {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.static-info {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 0.88rem;
    font-family: 'Outfit', sans-serif;
    color: var(--gold);
    font-weight: 600;
}

.drawer-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* History list styles */
.drawer-actions {
    margin-bottom: 15px;
    display: flex;
    justify-content: flex-end;
}

.btn-danger-small {
    background: transparent;
    border: 1px solid rgba(191, 97, 106, 0.3);
    color: var(--danger);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.75rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-danger-small:hover {
    background: rgba(191, 97, 106, 0.1);
    border-color: var(--danger);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-empty {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
    padding: 40px 0;
}

.history-item {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.history-item-materials {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
    word-break: break-all;
}

.history-item-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dashed rgba(255, 255, 255, 0.04);
    padding-top: 8px;
}

.history-result-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
}

.history-result-level {
    background: rgba(255, 215, 0, 0.08);
    border: 1px solid rgba(255, 215, 0, 0.15);
    color: var(--gold);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
}

/* --- Modals --- */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-backdrop:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #141a24;
    border: 1px solid rgba(255, 215, 0, 0.25);
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    border-radius: 16px;
    width: 650px;
    max-width: 95%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-backdrop:not(.hidden) .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gold);
}

.modal-close-btn {
    background: transparent;
    border: none;
    font-size: 1.8rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.modal-close-btn:hover {
    color: var(--text-main);
}

.modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow: hidden;
}

/* Modal filters */
.modal-filters-panel {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-row {
    position: relative;
    display: flex;
    align-items: center;
}

.search-row input {
    background: #1c2533;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-main);
    padding: 10px 35px 10px 15px;
    font-size: 0.88rem;
    width: 100%;
}

.search-row input:focus {
    border-color: var(--gold);
    outline: none;
}

.modal-clear-search-btn {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.filter-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-col label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.filter-col select {
    background: #1c2533;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: var(--text-main);
    padding: 8px;
    font-size: 0.82rem;
}

/* Result summary bar */
.modal-result-summary {
    background: rgba(255, 215, 0, 0.05);
    border: 1px dashed rgba(255, 215, 0, 0.2);
    border-radius: 8px;
    padding: 10px 15px;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.selected-details-empty {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.selected-item-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.selected-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-confirm-selection {
    background: var(--gold);
    border: none;
    border-radius: 6px;
    color: #0f141c;
    padding: 6px 14px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-confirm-selection:hover {
    background: #ffea70;
    box-shadow: 0 0 10px var(--gold-glow);
}

/* Items list table inside modal */
.modal-items-list-wrap {
    overflow-y: auto;
    max-height: 300px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.modal-items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.modal-items-table th {
    background: rgba(0, 0, 0, 0.4);
    padding: 10px 12px;
    color: var(--text-muted);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 5;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-align: left;
}

.modal-items-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    cursor: pointer;
}

.modal-items-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.modal-items-table tr.selected {
    background: rgba(255, 215, 0, 0.08) !important;
}

/* Reveal Result Modal specific */
.reveal-content {
    background: radial-gradient(circle at center, #1b263b 0%, #0d131f 100%);
    border: 2px solid var(--gold);
    border-radius: 20px;
    width: 380px;
    padding: 30px;
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1001;
}

.modal-backdrop:not(.hidden) .reveal-content {
    transform: scale(1);
}

.reveal-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 20px;
    letter-spacing: 2px;
    text-shadow: 0 0 10px var(--gold-glow);
}

.reveal-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    width: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.reveal-level {
    background: var(--gold);
    color: #0f141c;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 3px 8px;
    font-family: 'Outfit', sans-serif;
}

.reveal-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
}

.reveal-table {
    width: 100%;
    font-size: 0.82rem;
}

.reveal-table th {
    text-align: left;
    color: var(--text-muted);
    padding: 6px 0;
    font-weight: 500;
    width: 35%;
}

.reveal-table td {
    text-align: right;
    color: var(--text-main);
    padding: 6px 0;
    font-weight: 600;
}

.btn-reveal-close {
    background: linear-gradient(135deg, var(--gold) 0%, #ff9f43 100%);
    border: none;
    border-radius: 8px;
    color: #0f141c;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 10px 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2);
}

.btn-reveal-close:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

/* Helper hidden class */
.hidden {
    display: none !important;
}

/* --- Footer --- */
.app-footer {
    text-align: center;
    padding-top: 30px;
    padding-bottom: 10px;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 35px;
}

.visit-stats-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem 1.25rem;
    margin-top: 0.75rem;
    padding: 0.5rem 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.visit-stats-bar .stat-item {
    opacity: 0.9;
}

.sim-rank-select,
.sim-skill-level-input {
    width: 100%;
    min-height: 36px;
    padding: 0 10px;
    border: 1px solid rgba(255, 215, 0, 0.28);
    border-radius: 6px;
    background: #211f2a;
    color: var(--text-main);
    font-size: 0.86rem;
}

.sim-rank-select:focus-visible,
.sim-skill-level-input:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

.guide-info[hidden],
.book-quick-panel > [hidden] {
    display: none !important;
}

.footer-icp {
    margin-top: 0.35rem;
    font-size: 0.75rem;
    opacity: 0.72;
}

.footer-icp a {
    color: inherit;
    text-decoration: none;
}

.footer-icp a:hover {
    color: var(--gold);
}

/* Probability disclaimer modal */
#probability-disclaimer-modal {
    z-index: 1200;
}

.disclaimer-modal-content {
    width: 420px;
    max-width: 92%;
    max-height: none;
}

.disclaimer-modal-body {
    gap: 14px;
}

.disclaimer-text {
    margin: 0;
    line-height: 1.65;
    color: var(--text-main);
    font-size: 0.95rem;
}

.disclaimer-text.muted {
    color: var(--text-muted);
    font-size: 0.88rem;
}

.disclaimer-checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 215, 0, 0.12);
    color: var(--text-main);
    font-size: 0.92rem;
    cursor: pointer;
    user-select: none;
}

.disclaimer-checkbox-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--gold);
    cursor: pointer;
    flex-shrink: 0;
}

.disclaimer-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

.disclaimer-confirm-btn {
    min-width: 108px;
    padding: 10px 20px;
    border-radius: 10px;
    border: 1px solid rgba(255, 215, 0, 0.45);
    background: linear-gradient(180deg, rgba(255, 215, 0, 0.22), rgba(255, 215, 0, 0.08));
    color: var(--gold);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.disclaimer-confirm-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(255, 215, 0, 0.12);
    background: linear-gradient(180deg, rgba(255, 215, 0, 0.3), rgba(255, 215, 0, 0.12));
}

.node-alternatives {
    color: var(--text-muted, #8b8b8b);
    font-size: 0.85em;
    margin-left: 2px;
}

/* --- Modern Refined Micro-Capsules (Option 1 - Strictly Scoped to Recipe Tree Only) --- */
.tree-container .tree-node-content,
.tree-node .tree-node-content {
    background: var(--control-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.35rem 0.75rem;
    margin-bottom: 0.35rem;
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.55rem;
    cursor: pointer;
    transition: var(--transition-quick);
    font-size: 0.85rem;
    max-width: 100%;
}

.tree-container .tree-node-content:hover,
.tree-node .tree-node-content:hover {
    background: var(--control-bg-hover);
    border-color: var(--border-color-hover);
}

.tree-node .node-name {
    font-weight: 600;
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
}

.tree-node .node-alternatives {
    font-size: 0.76rem;
    color: var(--text-main);
    font-weight: 400;
    margin-left: 0.3rem;
}

.tree-node .node-meta-badge {
    font-size: 0.72rem;
    background: rgba(148, 163, 184, 0.16);
    color: var(--text-main);
    border: none;
    border-radius: 9999px;
    padding: 0.1rem 0.55rem;
    font-weight: 550;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.tree-node .node-level,
.tree-node .node-material {
    font-size: 0.72rem;
    background: rgba(148, 163, 184, 0.16);
    color: var(--text-main);
    border: none;
    border-radius: 9999px;
    padding: 0.1rem 0.55rem;
    font-weight: 550;
    white-space: nowrap;
}

.tree-node .node-req-level {
    font-size: 0.7rem;
    background: rgba(148, 163, 184, 0.14);
    color: var(--text-main);
    border: none;
    border-radius: 9999px;
    padding: 0.08rem 0.45rem;
    font-weight: 550;
    white-space: nowrap;
}

.tree-node .node-action {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: var(--text-main);
}

.tree-node .node-action span.book-label {
    font-size: 0.72rem;
    background: rgba(245, 158, 11, 0.14);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.24);
    border-radius: 9999px;
    padding: 0.08rem 0.55rem;
    font-weight: 600;
    white-space: nowrap;
}

[data-theme="dark"] .tree-node .node-action span.book-label {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.32);
}

.tree-node .node-action span.craft-label {
    font-size: 0.72rem;
    background: rgba(148, 163, 184, 0.16);
    color: var(--text-main);
    border: none;
    border-radius: 9999px;
    padding: 0.08rem 0.55rem;
    font-weight: 550;
    white-space: nowrap;
}

.tree-node .node-action span.shop-label,
.tree-node .node-action span.mine-label,
.tree-node .node-action span.drop-label {
    font-size: 0.72rem;
    background: rgba(148, 163, 184, 0.16);
    color: var(--text-main);
    border: none;
    border-radius: 9999px;
    padding: 0.08rem 0.55rem;
    font-weight: 550;
    white-space: nowrap;
}

.tree-node .tree-outcome-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    white-space: nowrap;
}

.tree-node .rate-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.08rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.3;
}

.tree-node .rate-pill.rate-high {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.22);
}

[data-theme="dark"] .tree-node .rate-pill.rate-high {
    background: rgba(16, 185, 129, 0.18);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.3);
}

.tree-node .rate-pill.rate-mid {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.24);
}

[data-theme="dark"] .tree-node .rate-pill.rate-mid {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.32);
}

.tree-node .rate-pill.rate-low {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.24);
}

[data-theme="dark"] .tree-node .rate-pill.rate-low {
    background: rgba(239, 68, 68, 0.18);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.32);
}

.tree-node .rate-side-text {
    color: var(--text-main);
    font-size: 0.74rem;
    font-weight: 500;
}

.tree-node .node-base-toggle-btn,
.tree-node .alchemy-note-save-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.02);
    color: var(--text-main);
    cursor: pointer;
    font-size: 0.7rem;
    padding: 0.08rem 0.5rem;
    opacity: 0.9;
    transition: var(--transition-quick);
}

.tree-node .node-base-toggle-btn:hover,
.tree-node .alchemy-note-save-step:hover {
    opacity: 1;
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: var(--control-bg-hover);
}
