/* ============================================
   AI云营 Mobile UI Styles
   App-like mobile-first design
   ============================================ */

:root {
    --primary: #6C5CE7;
    --primary-dark: #5A4BD1;
    --primary-light: #A29BFE;
    --secondary: #00CEC9;
    --accent: #FD79A8;
    --success: #00B894;
    --warning: #FDCB6E;
    --danger: #E17055;
    --gradient: linear-gradient(135deg, #6C5CE7, #00CEC9);
    --gradient-warm: linear-gradient(135deg, #FD79A8, #6C5CE7);
    --bg: #F5F6FA;
    --bg-card: #FFFFFF;
    --bg-card-hover: #F0F1F5;
    --bg-elevated: #FFFFFF;
    --text: #1A1A2E;
    --text-secondary: #5A5A7A;
    --text-muted: #9A9ABF;
    --border: rgba(108, 92, 231, 0.15);
    --border-light: rgba(0,0,0,0.06);
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-glow: 0 2px 16px rgba(108, 92, 231, 0.15);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 8px;
    --nav-height: 64px;
    --status-height: 52px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    user-select: none;
}

/* ============================================
   SPLASH SCREEN
   ============================================ */
.splash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.splash.hide {
    opacity: 0;
    transform: scale(1.1);
    pointer-events: none;
}

.splash-logo {
    font-size: 4rem;
    animation: splashPulse 1.5s ease infinite;
}

@keyframes splashPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.splash-text {
    font-size: 1.8rem;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.splash-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 2px;
}

.splash-loader {
    width: 40px;
    height: 3px;
    background: var(--border);
    border-radius: 3px;
    margin-top: 20px;
    overflow: hidden;
    position: relative;
}

.splash-loader::after {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 50%;
    height: 100%;
    background: var(--gradient);
    border-radius: 3px;
    animation: splashLoad 1s ease infinite;
}

@keyframes splashLoad {
    0% { left: -50%; }
    100% { left: 100%; }
}

/* ============================================
   APP CONTAINER
   ============================================ */
.app {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.app.show { opacity: 1; }

/* ============================================
   STATUS BAR
   ============================================ */
.status-bar {
    height: var(--status-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
    z-index: 10;
}

.status-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-logo { font-size: 1.3rem; }

.status-title {
    font-size: 1rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.back-home {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
    padding: 4px 10px;
    background: rgba(108, 92, 231, 0.08);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.back-home:hover {
    background: rgba(108, 92, 231, 0.15);
}

.status-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 6px rgba(0, 184, 148, 0.5);
    animation: dotPulse 2s ease infinite;
}

@keyframes dotPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-text {
    font-size: 0.75rem;
    color: var(--success);
    font-weight: 500;
}

/* ============================================
   PAGES
   ============================================ */
.pages {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.page {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    overflow: hidden;
}

.page.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.page-scroll {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 16px 0;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.page-scroll::-webkit-scrollbar { width: 0; }

.page-bottom-space { height: 24px; }

/* ============================================
   BOTTOM NAVIGATION
   ============================================ */
.bottom-nav {
    display: flex;
    align-items: stretch;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-light);
    padding-bottom: var(--safe-bottom);
    flex-shrink: 0;
    z-index: 100;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 0;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 24px;
    height: 2px;
    background: var(--gradient);
    border-radius: 0 0 2px 2px;
    transition: transform 0.3s ease;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active::before {
    transform: translateX(-50%) scaleX(1);
}

.nav-icon {
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.nav-item.active .nav-icon {
    transform: scale(1.15);
}

.nav-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* ============================================
   HERO CARD
   ============================================ */
.hero-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 20px;
    text-align: center;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.hero-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(108, 92, 231, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.hero-badge {
    display: inline-block;
    padding: 5px 14px;
    background: rgba(108, 92, 231, 0.12);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.7rem;
    color: var(--primary-light);
    margin-bottom: 16px;
    letter-spacing: 1.5px;
    font-weight: 600;
    position: relative;
}

.hero-card h1 {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 12px;
    position: relative;
}

.hero-card h1 br + span,
.hero-card h1 .gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
    position: relative;
}

.hero-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    position: relative;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
    padding: 11px 28px;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

.btn-primary:active {
    transform: scale(0.96);
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.3);
}

.btn-ghost {
    padding: 11px 28px;
    background: rgba(255,255,255,0.04);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ghost:active {
    transform: scale(0.96);
    background: rgba(0,0,0,0.04);
}

.full-width { width: 100%; }

/* ============================================
   STATS GRID
   ============================================ */
.section-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 12px;
    padding-left: 2px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 12px;
    text-align: center;
    transition: all 0.2s;
}

.stat-card:active {
    transform: scale(0.97);
    border-color: var(--primary);
    background: var(--bg-card-hover);
}

.stat-icon {
    font-size: 1.4rem;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.stat-name {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
    font-weight: 500;
}

/* ============================================
   AGENT LIST
   ============================================ */
.agent-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 24px;
}

/* Agent Department Sections */
.agent-dept {
    margin-bottom: 8px;
}

.dept-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.dept-header:active {
    transform: scale(0.98);
    background: var(--bg-card-hover);
}

.dept-icon {
    font-size: 1.1rem;
}

.dept-name {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 700;
}

.dept-toggle {
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.dept-header.expanded .dept-toggle {
    transform: rotate(180deg);
}

.dept-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 0;
    overflow: hidden;
    max-height: 2000px;
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
    opacity: 1;
    padding-left: 8px;
}

.dept-list.collapsed {
    max-height: 0;
    opacity: 0;
    padding: 0;
    overflow: hidden;
}

.dept-list .agent-row {
    padding: 10px 12px;
    background: rgba(245, 246, 250, 0.6);
    border-color: rgba(108, 92, 231, 0.08);
}

.dept-list .agent-avatar {
    width: 34px;
    height: 34px;
    font-size: 1.1rem;
}

.dept-list .agent-name {
    font-size: 0.8rem;
}

.dept-list .agent-role {
    font-size: 0.65rem;
}

.agent-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.agent-row:active {
    transform: scale(0.98);
    border-color: var(--primary);
    background: var(--bg-card-hover);
}

.agent-avatar {
    font-size: 1.3rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(108, 92, 231, 0.08);
    border-radius: var(--radius-xs);
    flex-shrink: 0;
}

.agent-info { flex: 1; min-width: 0; }

.agent-name {
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agent-role {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agent-status {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-muted);
    flex-shrink: 0;
}

.agent-status.online {
    background: var(--success);
    box-shadow: 0 0 4px rgba(0, 184, 148, 0.4);
}

/* ============================================
   CYCLE CARD
   ============================================ */
.cycle-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 16px;
    margin-bottom: 24px;
}

.cycle-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-bottom: 14px;
    overflow-x: auto;
    padding: 4px 0;
}

.cycle-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 48px;
    padding: 8px 4px;
    border-radius: var(--radius-xs);
    background: rgba(108, 92, 231, 0.04);
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.cycle-step.active {
    background: rgba(108, 92, 231, 0.1);
    border-color: var(--primary);
}

.step-num {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--primary-light);
}

.step-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.cycle-arrow {
    font-size: 0.7rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.cycle-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.6;
}

/* ============================================
   TAB BAR
   ============================================ */
.tab-bar {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding: 4px 0;
    -webkit-overflow-scrolling: touch;
}

.tab-bar::-webkit-scrollbar { display: none; }

.tab {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    flex-shrink: 0;
}

.tab:active { transform: scale(0.95); }

.tab.active {
    background: var(--gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(108, 92, 231, 0.25);
}

/* ============================================
   TAB CONTENT
   ============================================ */
.tab-content {
    display: none;
    animation: fadeInUp 0.3s ease;
}

.tab-content.active { display: block; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.content-header {
    margin-bottom: 16px;
}

.content-header h2 {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.content-header p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ============================================
   FEATURE CARD
   ============================================ */
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 16px;
    margin-bottom: 12px;
    transition: all 0.2s;
}

.feature-card:active {
    transform: scale(0.98);
    background: var(--bg-card-hover);
}

.feature-icon {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.feature-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.feature-methods {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.method-tag {
    padding: 3px 10px;
    background: rgba(108, 92, 231, 0.06);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.65rem;
    color: var(--primary);
    font-weight: 500;
}

.feature-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.feature-list li {
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding-left: 16px;
    position: relative;
    line-height: 1.5;
}

.feature-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--secondary);
    font-weight: 700;
    font-size: 0.75rem;
}

/* ============================================
   MODULE GRID
   ============================================ */
.module-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.module-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 12px;
    text-align: center;
    transition: all 0.2s;
}

.module-card:active {
    transform: scale(0.96);
    border-color: var(--primary);
    background: var(--bg-card-hover);
}

.module-icon {
    font-size: 1.6rem;
    margin-bottom: 6px;
}

.module-name {
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.module-desc {
    font-size: 0.65rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ============================================
   WORKFLOW VISUAL
   ============================================ */
.workflow-visual {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    padding: 16px 0;
    margin-bottom: 20px;
    -webkit-overflow-scrolling: touch;
}

.workflow-visual::-webkit-scrollbar { display: none; }

.wf-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    min-width: 72px;
    text-align: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.wf-node:active {
    transform: scale(0.95);
    background: var(--bg-card-hover);
}

.wf-node.trigger { border-color: rgba(0, 206, 201, 0.3); }
.wf-node.agent { border-color: rgba(108, 92, 231, 0.3); }
.wf-node.condition { border-color: rgba(253, 121, 168, 0.3); }
.wf-node.action { border-color: rgba(9, 132, 227, 0.3); }
.wf-node.output { border-color: rgba(0, 184, 148, 0.3); }

.wf-icon { font-size: 1.2rem; }

.wf-label {
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.wf-arrow {
    font-size: 0.7rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ============================================
   NODE CATEGORIES
   ============================================ */
.node-categories {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.node-cat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
}

.cat-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.cat-icon { font-size: 1.1rem; }

.cat-name {
    font-size: 0.85rem;
    font-weight: 700;
    flex: 1;
}

.cat-count {
    font-size: 0.75rem;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cat-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    padding-left: 30px;
}

/* ============================================
   AI GEN CARD
   ============================================ */
.ai-gen-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 18px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.ai-gen-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(108, 92, 231, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.ai-gen-icon {
    font-size: 2rem;
    margin-bottom: 10px;
    position: relative;
}

.ai-gen-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 8px;
    position: relative;
}

.ai-gen-card p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 14px;
    line-height: 1.6;
    position: relative;
}

.ai-gen-features {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    position: relative;
}

.ai-gen-features span {
    padding: 4px 12px;
    background: rgba(108, 92, 231, 0.06);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.65rem;
    color: var(--primary);
    font-weight: 500;
}

/* ============================================
   LLM GRID
   ============================================ */
.llm-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 24px;
}

.llm-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 8px;
    text-align: center;
}

.llm-icon {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.llm-name {
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ============================================
   ARCH LIST
   ============================================ */
.arch-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.arch-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.arch-item:active {
    transform: scale(0.98);
    border-color: var(--primary);
    background: var(--bg-card-hover);
}

.arch-icon {
    font-size: 1.3rem;
    width: 36px;
    text-align: center;
    flex-shrink: 0;
}

.arch-info { flex: 1; min-width: 0; }

.arch-name {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.arch-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ============================================
   EXTRA MODULES
   ============================================ */
.extra-modules {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 24px;
}

.extra-tag {
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    background: var(--bg-card);
    border-radius: var(--radius) var(--radius) 0 0;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.show .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 18px 14px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
}

.modal-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.06);
    border: none;
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
}

.modal-body {
    padding: 18px;
    overflow-y: auto;
    max-height: calc(85vh - 130px);
}

.modal-footer {
    padding: 14px 18px;
    padding-bottom: calc(14px + var(--safe-bottom));
    border-top: 1px solid var(--border);
}

.onboarding-step {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-light);
}

.onboarding-step:last-child { border-bottom: none; }

.step-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient);
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 800;
    flex-shrink: 0;
}

.step-content h4 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 3px;
}

.step-content p {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ============================================
   RESPONSIVE (Tablet)
   ============================================ */
@media (min-width: 768px) {
    .page-scroll { padding: 24px 32px 0; }
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
    .module-grid { grid-template-columns: repeat(3, 1fr); }
    .llm-grid { grid-template-columns: repeat(4, 1fr); }
    .hero-card h1 { font-size: 2rem; }
    .bottom-nav { max-width: 480px; margin: 0 auto; }
    .modal { border-radius: var(--radius); margin-bottom: 20px; }
    .modal-overlay { align-items: center; }
    .modal { transform: translateY(30px) scale(0.95); }
    .modal-overlay.show .modal { transform: translateY(0) scale(1); }
}
