/* 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; }
*::before,
*::after { box-sizing: border-box; }

html, body {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: none;
}

/* 减少移动端点击延迟 */
button, a, [role="button"] { touch-action: manipulation; }

/* 极致流畅模式（通过 body.perf-lite 开启） */
.perf-lite,
.perf-lite * {
    animation: none !important;
    transition: none !important;
    box-shadow: none !important;
}
.perf-lite body {
    background-image: none;
}
.perf-lite .tabbar,
.perf-lite .nav-bar,
.perf-lite .sheet {
    backdrop-filter: none !important;
}
.perf-lite .card,
.perf-lite .kpi,
.perf-lite .mode-card,
.perf-lite .list-item {
    background: rgba(15, 20, 35, 0.96) !important;
}

/* 移动端性能优化 */
@media (max-width: 768px) {
  body {
    background-image: none;
    background-color: var(--bg);
  }
  .tabbar {
    backdrop-filter: none;
    background: rgba(11, 15, 26, 0.98);
  }
  .nav-bar {
    backdrop-filter: none;
    background: rgba(11, 15, 26, 0.98);
  }
  .page-container {
    transform: translateZ(0);
  }
}

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(10px);
    border-top: 0.5px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: var(--safe-bottom);
    z-index: 1000;
    will-change: transform;
}

.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: color 0.15s;
}

.tab-item.active { color: var(--primary); }
.tab-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 18px;
    margin-bottom: 2px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* 通用动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 高保真积木块 */
.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: transform 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 4px 12px rgba(0,0,0,0.3);
}
.map-node.locked { opacity: 0.4; }
.map-node.active { border: 3px solid var(--primary); }

/* 响应式按钮 */
.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: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(11, 15, 26, 0.92);
    backdrop-filter: blur(15px);
    border-bottom: 0.5px solid var(--border);
}
