/* LexiBlocks 小程序全局高保真规范 */
:root {
    --primary: #7c5cff;
    --primary-light: rgba(124, 92, 255, 0.15);
    --prefix: #2de2e6; /* 蓝色-前缀 */
    --root: #38d39f;   /* 绿色-词根 */
    --suffix: #ff8c00; /* 橙色-后缀 */
    --bg: #0b0f1a;
    --card-bg: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.12);
    --text: #ffffff;
    --text-sec: rgba(255, 255, 255, 0.6);
    --safe-bottom: env(safe-area-inset-bottom);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; outline: none; }

body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    /* 星空背景 */
    background-image: 
        radial-gradient(circle at 50% 0%, rgba(124, 92, 255, 0.1) 0%, transparent 70%),
        radial-gradient(circle at 0% 100%, rgba(45, 226, 230, 0.05) 0%, transparent 50%);
}

.page-container {
    padding-bottom: calc(80px + var(--safe-bottom));
    min-height: 100vh;
}

/* 底部 Tabbar */
.tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(65px + var(--safe-bottom));
    background: rgba(15, 20, 35, 0.92);
    backdrop-filter: blur(15px);
    border-top: 0.5px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: var(--safe-bottom);
    z-index: 1000;
}

.tab-item.hidden { display: none !important; }

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-sec);
    text-decoration: none;
    font-size: 11px;
    flex: 1;
    transition: 0.2s;
}

.tab-item.active { color: var(--primary); }
.tab-icon { font-size: 22px; margin-bottom: 4px; }

/* 高保真积木块 */
.block {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: 14px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 15px;
    box-shadow: 0 4px 0 rgba(0,0,0,0.25);
    transition: 0.1s;
}
.block:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,0.25); }

.block-prefix { background: var(--prefix); color: #000; }
.block-root { background: var(--root); color: #000; }
.block-suffix { background: var(--suffix); color: #000; }

/* 学习地图节点 */
.map-node {
    width: 80px; height: 80px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.4);
}
.map-node.locked { filter: grayscale(1); opacity: 0.5; }
.map-node.active { border: 3px solid var(--primary); box-shadow: 0 0 25px var(--primary-light); }

/* 响应式按钮 */
.btn {
    background: var(--primary);
    color: white;
    border: none;
    height: 54px;
    border-radius: 27px;
    font-weight: 700;
    font-size: 17px;
    width: calc(100% - 40px);
    margin: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.btn:active { opacity: 0.8; transform: scale(0.98); }
.btn-outline { background: transparent; border: 1.5px solid var(--border); }

/* 通用列表/卡片 */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 24px;
    margin: 20px;
}

/* 顶部状态栏占位 */
.status-bar { height: 44px; width: 100%; }
.nav-bar {
    height: 44px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    position: sticky;
    top: 0;
    z-index: 100;
}
