/* =====================================================================
 * 符文之树 (Rune Tree) — 主题样式
 * 与主站 (index.php) 同款金色 / 深色 + 紫色魔幻强调
 * ===================================================================== */

:root {
    --rt-bg-0:        #07090f;
    --rt-bg-1:        #0e1322;
    --rt-bg-2:        #1a2336;
    --rt-panel:       rgba(20, 28, 46, 0.78);
    --rt-panel-border:rgba(212, 175, 55, 0.28);
    --rt-panel-border-strong: rgba(212, 175, 55, 0.55);
    --rt-gold:        #d4af37;
    --rt-gold-light:  #f4d03f;
    --rt-gold-bright: #fff5b0;
    --rt-gold-dark:   #8a6310;
    --rt-violet:      #9a4dff;
    --rt-violet-light:#c69cff;
    --rt-emerald:     #6cd99d;
    --rt-rose:        #ff6b9c;
    --rt-text:        #f1f5f9;
    --rt-text-2:      #94a3b8;
    --rt-text-3:      #5b6680;
    --rt-danger:      #ff5b6a;
    --rt-success:     #4ade80;
    --rt-glow-gold:   0 0 30px rgba(212, 175, 55, 0.35);
    --rt-glow-violet: 0 0 36px rgba(154, 77, 255, 0.45);
    --rt-shadow-card: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255,255,255,0.03);
    --rt-radius:      18px;
    --rt-radius-sm:   12px;
}

/* ---------------- Reset & base ---------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
.rt-body {
    min-height: 100vh;
    background:
      radial-gradient(ellipse at 20% 0%,  rgba(212, 175, 55, 0.10) 0%, transparent 55%),
      radial-gradient(ellipse at 90% 30%, rgba(154,  77, 255, 0.12) 0%, transparent 55%),
      radial-gradient(ellipse at 50% 100%,rgba( 96, 165, 250, 0.06) 0%, transparent 60%),
      linear-gradient(180deg, var(--rt-bg-0) 0%, var(--rt-bg-1) 60%, var(--rt-bg-2) 100%);
    color: var(--rt-text);
    font-family: 'Noto Sans SC', 'Inter', 'Microsoft YaHei', sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* Sparkle / star backdrop */
.rt-body::before {
    content: '';
    position: fixed; inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(1px 1px at 23% 18%, rgba(255,255,255,0.7), transparent 60%),
        radial-gradient(1px 1px at 67% 33%, rgba(255,255,255,0.5), transparent 60%),
        radial-gradient(1px 1px at 12% 64%, rgba(255,255,255,0.4), transparent 60%),
        radial-gradient(1px 1px at 80% 80%, rgba(255,255,255,0.5), transparent 60%),
        radial-gradient(1.5px 1.5px at 44% 92%, rgba(255,255,255,0.5), transparent 60%);
    background-size: 100% 100%;
    opacity: 0.55;
    z-index: 0;
}

/* ---------------- Layout ---------------- */
.rt-app {
    position: relative;
    z-index: 1;
    max-width: 1320px;
    margin: 0 auto;
    padding: 24px 28px 80px;
}

.rt-topbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
    padding: 14px 22px;
    background: linear-gradient(135deg, rgba(20,28,46,0.85), rgba(20,28,46,0.55));
    border: 1px solid var(--rt-panel-border);
    border-radius: var(--rt-radius);
    backdrop-filter: blur(14px);
    box-shadow: var(--rt-shadow-card);
}
.rt-brand {
    display: flex; align-items: center; gap: 12px;
    font-family: 'Oswald', sans-serif;
    font-weight: 700; letter-spacing: 2px;
}
.rt-brand-mark {
    width: 38px; height: 38px;
    display: grid; place-items: center;
    background: radial-gradient(circle at 30% 30%, #fff5b0, var(--rt-gold) 55%, #5a3a00);
    color: #1a1408;
    border-radius: 12px;
    font-size: 20px;
    box-shadow: 0 0 18px rgba(212,175,55,0.6);
}
.rt-brand-title {
    background: linear-gradient(90deg, var(--rt-gold-light) 0%, var(--rt-gold) 50%, var(--rt-gold-light) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: rtShimmer 4s linear infinite;
    font-size: 22px;
}
.rt-brand-sub { color: var(--rt-text-2); font-size: 12px; letter-spacing: 4px; }
@keyframes rtShimmer { from { background-position: 0% center; } to { background-position: 200% center; } }

.rt-topbar-right { display: flex; gap: 10px; align-items: center; }
.rt-user-chip {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 12px;
    border: 1px solid var(--rt-panel-border);
    border-radius: 999px;
    color: var(--rt-text-2);
    font-size: 13px;
}
.rt-user-chip strong { color: var(--rt-gold-light); font-weight: 500; }

/* ---------------- Hero / Tree stage ---------------- */
.rt-hero {
    margin-top: 24px;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 24px;
}
@media (max-width: 980px) {
    .rt-hero { grid-template-columns: 1fr; }
}

.rt-stage-card {
    position: relative;
    border: 1px solid var(--rt-panel-border);
    border-radius: var(--rt-radius);
    overflow: hidden;
    background:
        radial-gradient(ellipse at 50% 100%, rgba(212,175,55,0.10), transparent 60%),
        radial-gradient(ellipse at 50% 0%,   rgba(154, 77,255,0.10), transparent 60%),
        linear-gradient(180deg, rgba(15,21,38,0.85), rgba(7,9,15,0.95));
    min-height: 580px;
    box-shadow: var(--rt-shadow-card);
}
.rt-stage-card::before {
    /* 上方光雾 */
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 50% 15%, rgba(255,255,255,0.08), transparent 55%);
    pointer-events: none;
}
.rt-stage-grid {
    /* 后底网格 */
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse at 50% 60%, black 40%, transparent 80%);
    pointer-events: none;
}

.rt-tree-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 420 / 520;
    max-width: 460px;
    margin: 24px auto 0;
    transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.rt-tree-svg {
    position: relative;
    z-index: 2;
    width: 100%; height: 100%;
    display: block;
    filter: drop-shadow(0 14px 24px rgba(0,0,0,0.55));
    transform-origin: 50% 90%;
    animation: rtTreeSway 7s ease-in-out infinite;
}
@keyframes rtTreeSway {
    0%,100% { transform: rotate(-2deg)   translate(-2px, 0); }
    25%     { transform: rotate(-0.8deg) translate(-1px, -2px); }
    50%     { transform: rotate(2deg)    translate(2px, -4px); }
    75%     { transform: rotate(0.8deg)  translate(1px, -2px); }
}

.rt-tree-aura {
    position: absolute; inset: -10% -6% 0 -6%;
    z-index: 0;
    background: radial-gradient(circle at 50% 60%,
                rgba(212,175,55,0.25) 0%,
                rgba(154,77,255,0.18) 28%,
                transparent 65%);
    filter: blur(10px);
    animation: rtAuraPulse 5s ease-in-out infinite;
    pointer-events: none;
}
@keyframes rtAuraPulse {
    0%,100% { opacity: 0.55; transform: scale(1); }
    50%     { opacity: 0.95; transform: scale(1.05); }
}

/* Lv5 强化光环 */
.rt-tree-svg.rt-tree-lv5 ~ .rt-tree-aura,
.rt-tree-stage[data-level="5"] .rt-tree-aura {
    background: radial-gradient(circle at 50% 55%,
                rgba(154, 77, 255, 0.55) 0%,
                rgba(212, 175, 55, 0.35) 30%,
                transparent 65%);
    animation-duration: 3.5s;
}

/* 漂浮粒子 */
.rt-tree-particles {
    position: absolute; inset: 0;
    z-index: 1;
    pointer-events: none;
}
.rt-tree-particles span {
    position: absolute; left: 50%; bottom: 12%;
    width: 4px; height: 4px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff5b0 0%, rgba(212,175,55,0.6) 60%, transparent 80%);
    box-shadow: 0 0 8px rgba(212,175,55,0.7);
    opacity: 0;
    animation: rtParticleRise 6s linear infinite;
}
.rt-tree-particles span:nth-child(1)  { left: 20%; animation-delay:  0s;  animation-duration: 6.5s; }
.rt-tree-particles span:nth-child(2)  { left: 32%; animation-delay:  1s;  animation-duration: 7.2s; }
.rt-tree-particles span:nth-child(3)  { left: 48%; animation-delay:  2s;  animation-duration: 6.0s; }
.rt-tree-particles span:nth-child(4)  { left: 62%; animation-delay:  0.5s;animation-duration: 5.8s; }
.rt-tree-particles span:nth-child(5)  { left: 75%; animation-delay:  1.8s;animation-duration: 7.4s; }
.rt-tree-particles span:nth-child(6)  { left: 26%; animation-delay:  3s;  animation-duration: 6.4s; }
.rt-tree-particles span:nth-child(7)  { left: 40%; animation-delay:  3.6s;animation-duration: 7.0s; }
.rt-tree-particles span:nth-child(8)  { left: 56%; animation-delay:  4.2s;animation-duration: 6.7s; }
.rt-tree-particles span:nth-child(9)  { left: 68%; animation-delay:  2.4s;animation-duration: 7.6s; }
.rt-tree-particles span:nth-child(10) { left: 82%; animation-delay:  4.8s;animation-duration: 6.1s; }
@keyframes rtParticleRise {
    0%   { transform: translateY(0)    scale(0.7); opacity: 0; }
    10%  {                              opacity: 0.95; }
    80%  {                              opacity: 0.7; }
    100% { transform: translateY(-440px) scale(1.1); opacity: 0; }
}

.rt-tree-stage[data-level="5"] .rt-tree-particles span {
    background: radial-gradient(circle, #fff 0%, var(--rt-violet) 50%, transparent 80%);
    box-shadow: 0 0 10px var(--rt-violet-light), 0 0 18px rgba(212,175,55,0.55);
}

/* Stage info badge */
.rt-stage-info {
    position: relative; z-index: 3;
    display: flex; flex-direction: column; align-items: center;
    text-align: center;
    padding: 22px 18px 8px;
}
.rt-level-badge {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 5px 16px;
    background: linear-gradient(135deg, rgba(212,175,55,0.2), rgba(154,77,255,0.18));
    border: 1px solid var(--rt-panel-border-strong);
    border-radius: 999px;
    color: var(--rt-gold-light);
    font-family: 'Oswald', sans-serif; font-weight: 600;
    letter-spacing: 3px;
    font-size: 13px;
}
.rt-level-title {
    margin: 10px 0 4px;
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(90deg, #fff 0%, var(--rt-gold-light) 60%, var(--rt-violet-light) 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* 激活状态徽章 — 让玩家清楚知道当前是否已激活 */
.rt-status-badge {
    display: inline-flex; align-items: center;
    margin-top: 8px;
    padding: 4px 14px;
    border-radius: 999px;
    font-family: 'Oswald', sans-serif; font-weight: 600;
    letter-spacing: 2px;
    font-size: 12px;
    transition: all .25s;
}
.rt-status-badge.rt-status-activated {
    background: linear-gradient(135deg, rgba(80,200,120,0.22), rgba(80,200,120,0.10));
    border: 1px solid rgba(80,200,120,0.55);
    color: #7ee29a;
    box-shadow: 0 0 14px rgba(80,200,120,0.18);
}
.rt-status-badge.rt-status-dormant {
    background: linear-gradient(135deg, rgba(255,160,80,0.20), rgba(255,160,80,0.08));
    border: 1px solid rgba(255,160,80,0.55);
    color: #ffb070;
    box-shadow: 0 0 14px rgba(255,160,80,0.18);
    animation: rtStatusPulse 2.2s ease-in-out infinite;
}
@keyframes rtStatusPulse {
    0%,100% { box-shadow: 0 0 10px rgba(255,160,80,0.18); }
    50%     { box-shadow: 0 0 22px rgba(255,160,80,0.40); }
}
.rt-level-desc { color: var(--rt-text-2); font-size: 13px; max-width: 360px; }

/* Floating rune glyphs (lv5) */
.rt-rune-glyph {
    fill: rgba(255, 245, 176, 0.85);
    font-family: 'Cinzel', 'Oswald', serif;
    font-size: 22px;
    font-weight: 700;
    animation: rtRuneFloat 4s ease-in-out infinite;
    filter: drop-shadow(0 0 6px rgba(212,175,55,0.7));
}
.rt-rune-glyph.rt-rune-sm { font-size: 16px; opacity: 0.7; }
.rt-floating-runes text:nth-child(1) { animation-delay: 0s; }
.rt-floating-runes text:nth-child(2) { animation-delay: 0.6s; }
.rt-floating-runes text:nth-child(3) { animation-delay: 1.2s; }
.rt-floating-runes text:nth-child(4) { animation-delay: 1.8s; }
.rt-floating-runes text:nth-child(5) { animation-delay: 2.4s; }
@keyframes rtRuneFloat {
    0%,100% { transform: translateY(0); opacity: 0.55; }
    50%     { transform: translateY(-6px); opacity: 1; }
}

.rt-rune-ring { transform-origin: 210px 468px; animation: rtRingSpin 20s linear infinite; }
@keyframes rtRingSpin { to { transform: rotate(360deg); } }

.rt-premium-fruit { animation: rtFruitBob 3s ease-in-out infinite; transform-origin: 0 0; }
@keyframes rtFruitBob {
    0%,100% { transform: translate(218px, 86px) scale(1); }
    50%     { transform: translate(218px, 82px) scale(1.06); }
}
.rt-rune-symbol { animation: rtRunePulse 2.5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes rtRunePulse {
    0%,100% { opacity: 0.7; }
    50%     { opacity: 1; }
}

/* ------------- Side panel (stats + actions) ------------- */
.rt-side {
    display: flex; flex-direction: column; gap: 20px;
}
.rt-card {
    background: var(--rt-panel);
    border: 1px solid var(--rt-panel-border);
    border-radius: var(--rt-radius);
    padding: 22px 22px;
    backdrop-filter: blur(14px);
    box-shadow: var(--rt-shadow-card);
}
.rt-card h3 {
    margin: 0 0 14px;
    font-family: 'Oswald', sans-serif;
    font-size: 16px;
    letter-spacing: 3px;
    color: var(--rt-gold-light);
    text-transform: uppercase;
    display: flex; align-items: center; gap: 8px;
}
.rt-card h3::before {
    content: ''; width: 3px; height: 16px; background: linear-gradient(to bottom, var(--rt-gold-light), var(--rt-violet));
    border-radius: 2px;
}

.rt-stat-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
.rt-stat {
    padding: 12px 14px;
    border-radius: var(--rt-radius-sm);
    background: rgba(7, 12, 24, 0.55);
    border: 1px solid rgba(255,255,255,0.05);
    transition: transform .25s, border-color .25s;
}
.rt-stat:hover { transform: translateY(-2px); border-color: var(--rt-panel-border); }
.rt-stat-label { font-size: 11px; color: var(--rt-text-3); letter-spacing: 2px; text-transform: uppercase; }
.rt-stat-value {
    margin-top: 6px;
    font-family: 'Oswald', sans-serif;
    font-size: 22px;
    color: var(--rt-text);
    font-weight: 700;
    display: flex; align-items: baseline; gap: 6px;
}
.rt-stat-value .rt-unit { font-size: 11px; color: var(--rt-text-3); font-weight: 400; }
.rt-stat.rt-stat-gold .rt-stat-value { color: var(--rt-gold-light); text-shadow: 0 0 14px rgba(212,175,55,0.4); }
.rt-stat.rt-stat-violet .rt-stat-value { color: var(--rt-violet-light); }
.rt-stat.rt-stat-emerald .rt-stat-value { color: var(--rt-emerald); }

/* Progress bar */
.rt-progress {
    margin: 8px 0 0;
}
.rt-progress-track {
    height: 14px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(212,175,55,0.18);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}
.rt-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--rt-gold-dark), var(--rt-gold-light) 50%, var(--rt-violet));
    box-shadow: 0 0 14px rgba(212,175,55,0.4);
    border-radius: 999px;
    transition: width .8s cubic-bezier(.2,.8,.2,1);
    position: relative;
}
.rt-progress-fill::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: rtProgShine 2.4s linear infinite;
}
@keyframes rtProgShine {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
.rt-progress-meta {
    display: flex; justify-content: space-between;
    margin-top: 6px;
    font-size: 12px;
    color: var(--rt-text-2);
}
.rt-progress-meta strong { color: var(--rt-gold-light); font-weight: 500; }

/* Buttons */
.rt-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 18px;
    border: 1px solid var(--rt-panel-border);
    border-radius: var(--rt-radius-sm);
    background: rgba(20, 28, 46, 0.65);
    color: var(--rt-text);
    font-size: 14px;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s, border-color .2s, background .2s;
    font-weight: 500;
}
.rt-btn:hover {
    transform: translateY(-2px);
    border-color: var(--rt-panel-border-strong);
    box-shadow: var(--rt-glow-gold);
}
.rt-btn:active { transform: translateY(0); }
.rt-btn[disabled], .rt-btn.is-disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.rt-btn-gold {
    background: linear-gradient(135deg, var(--rt-gold-light) 0%, var(--rt-gold) 50%, var(--rt-gold-dark) 100%);
    color: #1a1408;
    border-color: transparent;
    font-weight: 700;
}
.rt-btn-gold:hover { box-shadow: 0 0 24px rgba(212,175,55,0.55); }
.rt-btn-violet {
    background: linear-gradient(135deg, var(--rt-violet-light), var(--rt-violet) 55%, #4a17a0);
    color: #fff;
    border-color: transparent;
}
.rt-btn-violet:hover { box-shadow: 0 0 24px rgba(154,77,255,0.55); }
.rt-btn-ghost {
    background: transparent;
}
.rt-btn-block { width: 100%; }
.rt-btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* Tabs / sections below hero */
.rt-tabs {
    display: flex; gap: 6px;
    margin: 32px 0 16px;
    padding: 6px;
    background: rgba(7, 12, 24, 0.6);
    border: 1px solid var(--rt-panel-border);
    border-radius: 999px;
    width: max-content;
}
.rt-tab {
    padding: 9px 22px;
    border-radius: 999px;
    color: var(--rt-text-2);
    cursor: pointer;
    border: 0;
    background: transparent;
    font-size: 14px;
    letter-spacing: 1px;
    transition: all 0.25s;
}
.rt-tab.is-active {
    background: linear-gradient(135deg, var(--rt-gold) 0%, var(--rt-gold-dark) 100%);
    color: #1a1408;
    font-weight: 700;
    box-shadow: 0 0 18px rgba(212,175,55,0.35);
}

.rt-section { display: none; }
.rt-section.is-active { display: block; animation: rtFadeIn 0.4s ease; }
@keyframes rtFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ------------- Task list ------------- */
.rt-task-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.rt-task {
    padding: 16px;
    border: 1px solid var(--rt-panel-border);
    border-radius: var(--rt-radius-sm);
    background: linear-gradient(140deg, rgba(20,28,46,0.88), rgba(20,28,46,0.55));
    display: flex; flex-direction: column;
    transition: transform .25s, border-color .25s, box-shadow .25s;
}
.rt-task:hover { transform: translateY(-3px); border-color: var(--rt-panel-border-strong); box-shadow: var(--rt-glow-gold); }
.rt-task-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.rt-task-name { font-weight: 600; font-size: 15px; color: var(--rt-text); }
.rt-task-type {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(212,175,55,0.12);
    color: var(--rt-gold-light);
    letter-spacing: 1px;
    flex-shrink: 0;
}
.rt-task-type.is-daily   { background: rgba(96,165,250,0.16); color: #93c5fd; }
.rt-task-type.is-weekly  { background: rgba(154,77,255,0.16); color: var(--rt-violet-light); }
.rt-task-type.is-perma   { background: rgba(108,217,157,0.18); color: var(--rt-emerald); }
.rt-task-desc { color: var(--rt-text-2); font-size: 13px; margin: 8px 0 12px; line-height: 1.5; }
.rt-task-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.rt-task-reward { color: var(--rt-gold-light); font-weight: 600; }
.rt-task-reward::before { content: '🧪 +'; }

/* ------------- Shop ------------- */
.rt-shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.rt-shop-item {
    position: relative;
    padding: 14px;
    border: 1px solid var(--rt-panel-border);
    border-radius: var(--rt-radius-sm);
    background: linear-gradient(140deg, rgba(15,21,38,0.92), rgba(15,21,38,0.55));
    transition: transform .25s, border-color .25s, box-shadow .25s;
    display: flex; flex-direction: column; gap: 10px;
}
.rt-shop-item:hover {
    transform: translateY(-4px);
    border-color: var(--rt-panel-border-strong);
    box-shadow: var(--rt-glow-gold);
}
.rt-shop-icon {
    width: 100%; aspect-ratio: 1; border-radius: var(--rt-radius-sm);
    background: radial-gradient(circle at 30% 30%, rgba(212,175,55,0.18), rgba(7,12,24,0.6));
    display: grid; place-items: center;
    border: 1px solid rgba(212,175,55,0.18);
    overflow: hidden;
}
.rt-shop-icon img { max-width: 80%; max-height: 80%; }
.rt-shop-icon .rt-shop-fallback { font-size: 44px; }
.rt-shop-name { font-weight: 600; font-size: 15px; }
.rt-shop-desc { font-size: 12px; color: var(--rt-text-2); line-height: 1.5; min-height: 36px; }
.rt-shop-price {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 10px; border-top: 1px dashed rgba(212,175,55,0.18);
}
.rt-shop-price-amount {
    font-family: 'Oswald', sans-serif; font-size: 18px;
    color: var(--rt-gold-light);
}
.rt-shop-price-amount.is-premium { color: var(--rt-violet-light); }
.rt-rarity-common    { color: #94a3b8; }
.rt-rarity-uncommon  { color: var(--rt-emerald); }
.rt-rarity-rare      { color: #60a5fa; }
.rt-rarity-epic      { color: var(--rt-violet-light); }
.rt-rarity-legendary { color: var(--rt-gold-light); text-shadow: 0 0 12px rgba(212,175,55,0.5); }

/* ------------- Toast ------------- */
.rt-toast-stack {
    position: fixed; bottom: 28px; right: 28px;
    display: flex; flex-direction: column; gap: 10px;
    z-index: 9999;
}
.rt-toast {
    min-width: 280px;
    padding: 14px 18px;
    border-radius: var(--rt-radius-sm);
    background: linear-gradient(135deg, rgba(20,28,46,0.95), rgba(20,28,46,0.75));
    border: 1px solid var(--rt-panel-border-strong);
    box-shadow: var(--rt-shadow-card);
    backdrop-filter: blur(14px);
    color: var(--rt-text);
    font-size: 14px;
    animation: rtToastIn .35s cubic-bezier(.2,.8,.2,1);
}
.rt-toast.is-error   { border-color: rgba(255,91,106,0.5); }
.rt-toast.is-success { border-color: rgba(74,222,128,0.5); }
@keyframes rtToastIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ------------- Modal ------------- */
.rt-modal-mask {
    position: fixed; inset: 0;
    background: rgba(2, 4, 10, 0.78);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center; justify-content: center;
    z-index: 1000;
    animation: rtFadeIn .25s ease;
}
.rt-modal-mask.is-open { display: flex; }
.rt-modal {
    width: min(480px, 92vw);
    background: linear-gradient(160deg, rgba(20,28,46,0.96), rgba(7,12,24,0.96));
    border: 1px solid var(--rt-panel-border-strong);
    border-radius: var(--rt-radius);
    padding: 24px;
    box-shadow: var(--rt-shadow-card);
}
.rt-modal h4 { margin: 0 0 14px; font-size: 18px; color: var(--rt-gold-light); }
.rt-modal-body { color: var(--rt-text-2); font-size: 14px; line-height: 1.6; }
.rt-modal-actions { margin-top: 20px; display: flex; justify-content: flex-end; gap: 10px; }

/* ------------- Forbidden page ------------- */
.rt-forbidden { min-height: 100vh; display: grid; place-items: center; padding: 40px 20px; }
.rt-forbidden-card {
    max-width: 460px; text-align: center;
    padding: 40px 30px;
    background: var(--rt-panel);
    border: 1px solid var(--rt-panel-border);
    border-radius: var(--rt-radius);
}
.rt-forbidden-icon { font-size: 64px; }
.rt-forbidden h1 { margin: 12px 0 8px; color: var(--rt-gold-light); }
.rt-forbidden p  { color: var(--rt-text-2); margin: 6px 0; }
.rt-muted { color: var(--rt-text-3); font-size: 13px; }

/* ------------- Select / inputs ------------- */
.rt-select, .rt-input {
    width: 100%;
    background: rgba(7,12,24,0.6);
    border: 1px solid var(--rt-panel-border);
    color: var(--rt-text);
    padding: 10px 14px;
    border-radius: var(--rt-radius-sm);
    font-size: 14px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.rt-select:focus, .rt-input:focus {
    border-color: var(--rt-panel-border-strong);
    box-shadow: 0 0 0 3px rgba(212,175,55,0.18);
}

/* ------------- Login page ------------- */
.rt-login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 40px 20px; }
.rt-login-card {
    width: min(420px, 92vw);
    padding: 32px 28px;
    background: var(--rt-panel);
    border: 1px solid var(--rt-panel-border);
    border-radius: var(--rt-radius);
    box-shadow: var(--rt-shadow-card);
}
.rt-login-card h1 {
    margin: 0 0 4px;
    font-family: 'Oswald', sans-serif;
    background: linear-gradient(90deg, var(--rt-gold-light), var(--rt-violet-light));
    -webkit-background-clip: text; background-clip: text; color: transparent;
    text-align: center;
    letter-spacing: 4px;
}
.rt-login-card p { color: var(--rt-text-2); text-align: center; margin: 0 0 22px; font-size: 13px; }
.rt-form-group { margin-bottom: 14px; }
.rt-form-group label { display: block; margin-bottom: 6px; font-size: 12px; letter-spacing: 1.5px; color: var(--rt-text-3); text-transform: uppercase; }
.rt-form-error { color: var(--rt-danger); font-size: 13px; margin-bottom: 10px; }

/* ------------- Admin tweaks ------------- */
.rt-admin-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(7, 12, 24, 0.55);
    border-radius: var(--rt-radius-sm);
    overflow: hidden;
}
.rt-admin-table th, .rt-admin-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 14px;
}
.rt-admin-table thead th {
    background: rgba(212,175,55,0.08);
    color: var(--rt-gold-light);
    letter-spacing: 1.5px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
}
.rt-admin-table tr:hover td { background: rgba(255,255,255,0.02); }

/* ============== Fix #8: 金币/果实掉落 ============== */
.rt-falling-rewards {
    position: absolute; inset: 0;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}
.rt-falling {
    position: absolute;
    top: 18%;
    width: 12px; height: 12px;
    border-radius: 50%;
    opacity: 0;
    animation: rtFallSlow 9s linear infinite;
    will-change: transform, opacity;
}
.rt-falling-coin {
    background: radial-gradient(circle at 30% 28%, #fff8d6 0%, var(--rt-gold-light) 45%, var(--rt-gold-dark) 100%);
    box-shadow: 0 0 8px rgba(212,175,55,0.55), inset 0 -2px 3px rgba(0,0,0,0.3);
    width: 13px; height: 13px;
}
.rt-falling-fruit {
    background: radial-gradient(circle at 32% 28%, #ffe89a 0%, #ff7a40 50%, #6b0c00 100%);
    box-shadow: 0 0 6px rgba(255,122,64,0.5), inset 0 -2px 3px rgba(0,0,0,0.25);
    width: 12px; height: 14px;
}
.rt-falling-fruit-violet {
    background: radial-gradient(circle at 32% 28%, #fff0b0 0%, var(--rt-violet) 50%, #2a0540 100%) !important;
    box-shadow: 0 0 8px rgba(154,77,255,0.6), inset 0 -2px 3px rgba(0,0,0,0.25) !important;
}
.rt-falling-fruit-premium {
    background: radial-gradient(circle at 30% 25%, #ffffff 0%, #fff5a0 30%, var(--rt-gold) 70%, #4a3300 100%);
    box-shadow: 0 0 14px rgba(255,235,150,0.8), inset 0 -2px 3px rgba(80,50,0,0.3);
    width: 16px; height: 16px;
}
@keyframes rtFallSlow {
    0%   { transform: translateY(-10px) rotate(0deg);   opacity: 0; }
    8%   {                                              opacity: 0.85; }
    50%  {                                              opacity: 0.85; }
    90%  {                                              opacity: 0.6; }
    100% { transform: translateY(300px) rotate(180deg); opacity: 0; }
}

/* ============== Fix #2: 激活遮罩 ============== */
.rt-tree-stage.is-dormant .rt-tree-svg,
.rt-tree-stage.is-dormant .rt-tree-aura,
.rt-tree-stage.is-dormant .rt-falling-rewards,
.rt-tree-stage.is-dormant .rt-tree-particles {
    filter: grayscale(0.7) brightness(0.55);
    opacity: 0.7;
}
.rt-activate-overlay {
    position: absolute;
    left: 50%; bottom: 12%;
    transform: translateX(-50%);
    z-index: 20;
    text-align: center;
    padding: 22px 28px;
    background: linear-gradient(160deg, rgba(20,28,46,0.95), rgba(7,12,24,0.95));
    border: 1px solid var(--rt-panel-border-strong);
    border-radius: var(--rt-radius);
    box-shadow: 0 24px 60px rgba(0,0,0,0.6), 0 0 40px rgba(212,175,55,0.25);
    min-width: 320px;
    animation: rtActivatePulse 3s ease-in-out infinite;
}
@keyframes rtActivatePulse {
    0%,100% { box-shadow: 0 24px 60px rgba(0,0,0,0.6), 0 0 40px rgba(212,175,55,0.25); }
    50%     { box-shadow: 0 24px 60px rgba(0,0,0,0.6), 0 0 60px rgba(212,175,55,0.6); }
}
.rt-activate-overlay h3 {
    margin: 0 0 6px; color: var(--rt-gold-light);
    font-family: 'Oswald', sans-serif; letter-spacing: 3px;
}
.rt-activate-overlay p { color: var(--rt-text-2); font-size: 13px; margin: 4px 0 14px; }
.rt-activate-overlay .rt-btn { font-size: 16px; padding: 12px 28px; letter-spacing: 2px; }

/* ============== Fix #3: 玩法说明 模态 ============== */
.rt-guide-modal { width: min(640px, 92vw); max-height: 80vh; overflow-y: auto; }
.rt-guide-modal h4 {
    font-size: 22px; letter-spacing: 4px; margin: 0 0 16px;
    background: linear-gradient(90deg, var(--rt-gold-light), var(--rt-violet-light));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.rt-guide-section { margin-bottom: 14px; }
.rt-guide-section h5 {
    margin: 0 0 6px; color: var(--rt-gold-light);
    font-size: 14px; letter-spacing: 2px;
    font-family: 'Oswald', sans-serif;
}
.rt-guide-section p { margin: 0; line-height: 1.7; color: var(--rt-text-2); font-size: 13px; }

/* ============== Fix #6: 当前绑定角色 ============== */
.rt-bound-line {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px;
    margin-bottom: 10px;
    background: rgba(108, 217, 157, 0.08);
    border: 1px solid rgba(108, 217, 157, 0.3);
    border-radius: var(--rt-radius-sm);
    font-size: 13px;
}
.rt-bound-line.is-empty {
    background: rgba(148, 163, 184, 0.08);
    border-color: rgba(148, 163, 184, 0.2);
    color: var(--rt-text-3);
}
.rt-bound-line strong { color: var(--rt-emerald); font-weight: 600; }

/* ============== Fix #4: 语言切换器 ============== */
.rt-lang-switch {
    display: inline-flex;
    border: 1px solid var(--rt-panel-border);
    border-radius: 999px;
    overflow: hidden;
    background: rgba(7, 12, 24, 0.55);
    font-size: 12px;
}
.rt-lang-switch a {
    padding: 6px 12px;
    color: var(--rt-text-3);
    transition: all .2s;
}
.rt-lang-switch a:hover { color: var(--rt-text); }
.rt-lang-switch a.is-active {
    background: linear-gradient(135deg, var(--rt-gold-light), var(--rt-gold-dark));
    color: #1a1408;
    font-weight: 700;
}

/* 树形态切换 + 升级闪光 */
.rt-tree-variant { animation: rtTreeFadeIn .55s cubic-bezier(.2,.8,.2,1); }
@keyframes rtTreeFadeIn {
    from { opacity: 0; transform: scale(0.94); }
    to   { opacity: 1; transform: scale(1); }
}
#rt-tree-wrap.rt-level-up-flash::after {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(circle at 50% 60%,
                rgba(255, 245, 176, 0.55) 0%,
                rgba(212, 175, 55, 0.25) 35%,
                transparent 70%);
    pointer-events: none;
    animation: rtLevelFlash 1.4s ease-out;
    z-index: 10;
    border-radius: var(--rt-radius);
}
@keyframes rtLevelFlash {
    0%   { opacity: 0; transform: scale(0.5); }
    25%  { opacity: 1; transform: scale(1.1); }
    100% { opacity: 0; transform: scale(1.6); }
}
#rt-tree-wrap { position: relative; }

/* responsive */
@media (max-width: 720px) {
    .rt-app { padding: 16px; }
    .rt-stat-grid { grid-template-columns: 1fr 1fr; }
    .rt-tabs { width: 100%; justify-content: center; }
}
