:root {
    --primary: #1A237E;
    --secondary: #5C6BC0;
    --accent: #FF6F00;
    --background: #F5F7FA;
    --text: #1F2937;
    --lightText: #6B7280;
    --white: #FFFFFF;
    --cardBg: #FFFFFF;
    --border: #E5E7EB;
    --success: #4CAF50;
    --warning: #EF5350;
}

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

body {
    font-family: 'Liter', 'MiSans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.nav-bar {
    background: var(--primary);
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    gap: 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.nav-bar a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
    padding: 4px 8px;
    border-radius: 4px;
}

.nav-bar a:hover {
    color: var(--white);
    background: rgba(255,255,255,0.1);
}

.nav-brand {
    font-size: 18px !important;
    font-weight: bold;
    color: var(--white) !important;
    margin-right: 20px;
}

.nav-sep {
    color: rgba(255,255,255,0.25);
    font-size: 16px;
    margin: 0 2px;
    pointer-events: none;
    user-select: none;
}

.nav-v2 {
    position: relative;
    font-weight: 500 !important;
}
.nav-v2::after {
    content: 'NEW';
    position: absolute;
    top: -6px;
    right: -12px;
    font-size: 9px;
    background: #ef4444;
    color: white;
    padding: 1px 4px;
    border-radius: 3px;
    line-height: 1;
}

.nav-showcase {
    font-weight: 600 !important;
    color: #fbbf24 !important;
    background: rgba(251,191,36,0.1);
    padding: 4px 12px !important;
    border-radius: 6px;
    border: 1px solid rgba(251,191,36,0.25);
    transition: all 0.2s;
}
.nav-showcase:hover {
    background: rgba(251,191,36,0.2) !important;
    color: #fcd34d !important;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.page-header {
    text-align: center;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 28px;
    color: var(--primary);
    margin-bottom: 8px;
}

.page-header .subtitle {
    color: var(--lightText);
    font-size: 16px;
}

.card {
    background: var(--cardBg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid var(--border);
}

.card h3 {
    font-size: 16px;
    color: var(--primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover { background: #0D1B60; }

.btn-accent {
    background: var(--accent);
    color: var(--white);
}

.btn-accent:hover { background: #E65100; }

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover { background: rgba(26,35,126,0.05); }

.btn-sm { padding: 6px 14px; font-size: 12px; }

.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .nav-bar { flex-wrap: wrap; height: auto; padding: 8px; gap: 8px; }
}

.console {
    background: #1e1e1e;
    color: #00ff00;
    font-family: 'Consolas', monospace;
    font-size: 12px;
    padding: 12px;
    border-radius: 8px;
    height: 120px;
    overflow-y: auto;
    margin-top: 12px;
}

.console-line {
    border-bottom: 1px solid #333;
    padding: 2px 0;
}

.robot-stage {
    background: linear-gradient(135deg, #E8EAF6 0%, #F5F7FA 100%);
    border-radius: 12px;
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 1px solid var(--border);
}

.speech-bubble {
    position: absolute;
    top: 20px;
    right: 20px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    max-width: 200px;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    opacity: 0;
    transition: opacity 0.3s;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 20px;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white;
}

.block-palette {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px;
    background: #f0f0f0;
    border-radius: 8px;
    margin-bottom: 12px;
}

.block {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: grab;
    user-select: none;
    transition: transform 0.1s;
    border: 2px solid transparent;
}

.block:hover { transform: scale(1.05); }

.block-move { background: #E3F2FD; border-color: #1976D2; color: #1565C0; }
.block-turn { background: #FFF3E0; border-color: #FF6F00; color: #E65100; }
.block-action { background: #E8F5E9; border-color: #4CAF50; color: #2E7D32; }
.block-wait { background: #F3E5F5; border-color: #9C27B0; color: #7B1FA2; }

.sequence-area {
    min-height: 60px;
    background: #fafafa;
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.sequence-area .block { cursor: pointer; }

.param-slider {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.param-slider label {
    font-size: 13px;
    color: var(--lightText);
    min-width: 80px;
}

.param-slider input[type="range"] {
    flex: 1;
    height: 6px;
}

.param-slider .value {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    min-width: 40px;
    text-align: right;
}

.code-editor {
    background: #1e1e1e;
    color: #d4d4d4;
    font-family: 'Consolas', monospace;
    font-size: 13px;
    padding: 16px;
    border-radius: 8px;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre-wrap;
}

.code-editor .keyword { color: #569cd6; }
.code-editor .string { color: #ce9178; }
.code-editor .number { color: #b5cea8; }
.code-editor .comment { color: #6a9955; }
.code-editor .func { color: #dcdcaa; }

.status-bar {
    display: flex;
    gap: 16px;
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    font-size: 12px;
    border-radius: 6px;
    margin-top: 12px;
}

.status-bar span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online { background: #4CAF50; }
.status-dot.offline { background: #EF5350; }

.hero-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    padding: 40px 0;
}

.hero-card {
    background: var(--cardBg);
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.hero-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.hero-card .icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.hero-card h2 {
    font-size: 20px;
    color: var(--primary);
    margin-bottom: 8px;
}

.hero-card p {
    font-size: 14px;
    color: var(--lightText);
}

.hero-card .tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    margin-top: 12px;
}

.tag-low { background: #E8F5E9; color: #2E7D32; }
.tag-mid { background: #E3F2FD; color: #1565C0; }
.tag-high { background: #FFF3E0; color: #E65100; }

canvas { display: block; border-radius: 8px; }

.water-cannon {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 20px;
    background: #999;
    border-radius: 4px;
}

.water-drop {
    position: absolute;
    width: 6px;
    height: 10px;
    background: #4FC3F7;
    border-radius: 50%;
    animation: drop-fall 0.5s linear forwards;
}

@keyframes drop-fall {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(60px); opacity: 0; }
}

.face-indicator {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 3px solid #4CAF50;
    border-radius: 50%;
    animation: pulse 1s infinite;
    pointer-events: none;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

.color-card {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: transform 0.2s, border-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.color-card:hover { transform: scale(1.1); }
.color-card.active { border-color: var(--accent); transform: scale(1.15); }

.mic-button {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(26,35,126,0.3);
}

.mic-button:hover { background: var(--secondary); transform: scale(1.05); }
.mic-button.recording {
    background: var(--warning);
    animation: mic-pulse 1s infinite;
}

@keyframes mic-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,83,80,0.4); }
    50% { box-shadow: 0 0 0 12px rgba(239,83,80,0); }
}

.chat-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    margin-bottom: 8px;
    animation: fadeIn 0.3s ease;
}

.chat-bubble.user {
    background: var(--primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-bubble.ai {
    background: #E8EAF6;
    color: var(--text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

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

.chat-area {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 12px;
    background: #fafafa;
    border-radius: 8px;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--lightText);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}
