@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Poppins:wght@600;700&display=swap');

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f8f9fa;
    min-height: 100vh;
    font-size: 14px;
    color: #333;
}

.site-header {
    background: linear-gradient(135deg, #667eea 0%, #ff6b9d 100%);
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.site-header h1 {
    color: white;
    font-family: 'Poppins', sans-serif;
    font-size: 1.5em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-header h1 img { height: 40px; }

.nav { display: flex; gap: 25px; align-items: center; }
.nav a { color: white; text-decoration: none; font-weight: 500; font-size: 0.9em; transition: opacity 0.3s; }
.nav a:hover { opacity: 0.8; }

.container {
    display: grid;
    grid-template-columns: 220px 1fr 220px;
    gap: 20px;
    padding: 20px;
    max-width: 1480px;
    margin: 0 auto;
}

.sidebar { display: flex; flex-direction: column; gap: 15px; }

.panel {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8e8e8;
}

.panel-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 12px 15px;
    font-weight: 600;
    font-size: 13px;
    color: white;
}

.panel-content { padding: 0; }

.menu-item, .tool-item {
    padding: 10px 15px;
    color: #555;
    text-decoration: none;
    display: block;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    transition: all 0.2s ease;
}

.menu-item:last-child, .tool-item:last-child { border-bottom: none; }
.menu-item:hover, .tool-item:hover { background: #f8f9fa; color: #667eea; padding-left: 20px; }
.menu-item.active {
    background: linear-gradient(135deg, #667eea 0%, #ff6b9d 100%);
    color: white;
    font-weight: 600;
}

.guide-note {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    color: #606b79;
    font-size: 12px;
    line-height: 1.55;
}

.guide-note:last-child { border-bottom: none; }

.status-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 15px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}

.status-row:last-child { border-bottom: none; }
.status-label { color: #888; }
.status-value { color: #333; font-weight: 600; text-align: right; }

.main-content {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8e8e8;
    min-height: 600px;
}

.content-header {
    border-bottom: 2px solid #667eea;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.content-header h2 {
    color: #333;
    font-family: 'Poppins', sans-serif;
    font-size: 1.6rem;
    margin-bottom: 5px;
}

.content-header .date { color: #888; font-size: 12px; }

.article-content { line-height: 1.8; color: #444; }
.article-content p { margin-bottom: 1.2em; }

.info-box {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(255, 107, 157, 0.08) 100%);
    border-left: 4px solid #667eea;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
}

.info-box-title {
    color: #667eea;
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 14px;
}

.info-box-content { color: #555; font-size: 13px; line-height: 1.6; }

.builder-shell {
    display: grid;
    grid-template-columns: minmax(340px, 420px) 1fr;
    gap: 20px;
    align-items: start;
}

.builder-stage-card, .builder-controls {
    border: 1px solid #e8e8e8;
    border-radius: 14px;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.builder-stage-card {
    position: sticky;
    top: 20px;
    padding: 18px;
}

.builder-toolbar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 18px;
}

.toolbar-group { display: flex; flex-direction: column; gap: 8px; }

.toolbar-label {
    color: #606b79;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.choice-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.choice-button, .source-button, .export-button {
    border: 1px solid #dde3ec;
    background: #fbfcfe;
    color: #4d5663;
    border-radius: 999px;
    padding: 9px 13px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.choice-button:hover, .source-button:hover, .export-button:hover {
    border-color: #c7d4ec;
    color: #667eea;
}

.choice-button.active, .source-button.active {
    border-color: transparent;
    background: linear-gradient(135deg, #667eea 0%, #ff6b9d 100%);
    color: white;
}

.export-button {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.12) 0%, rgba(255, 107, 157, 0.12) 100%);
    color: #667eea;
}

.builder-stage-wrap {
    border: 1px solid #e5ebf2;
    border-radius: 14px;
    background: linear-gradient(180deg, #f7fbff 0%, #edf3f8 100%);
    padding: 18px;
}

.builder-canvas-shell {
    position: relative;
    border-radius: 14px;
    border: 1px solid #dbe4ee;
    overflow: hidden;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.85), transparent 38%),
        linear-gradient(180deg, #edf4fb 0%, #dfe7f0 100%);
    min-height: 560px;
    display: grid;
    place-items: center;
}

.builder-canvas-shell::after {
    content: '';
    position: absolute;
    inset: auto 18% 18px 18%;
    height: 14px;
    border-radius: 999px;
    background: rgba(96, 122, 149, 0.18);
    filter: blur(12px);
}

#sim-preview-canvas {
    width: 336px;
    height: 560px;
    max-width: 100%;
    image-rendering: auto;
    position: relative;
    z-index: 1;
}

.selection-summary {
    margin-top: 14px;
    display: grid;
    gap: 8px;
}

.summary-chip {
    padding: 9px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(215, 224, 236, 0.8);
    color: #4d5663;
    font-size: 12px;
    line-height: 1.45;
}

.summary-chip strong { color: #1f2937; }

.builder-controls {
    padding: 18px;
    display: grid;
    gap: 16px;
}

.slot-card {
    border: 1px solid #e8edf3;
    border-radius: 14px;
    background: #fbfcfe;
    padding: 16px;
}

.slot-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.slot-title {
    color: #1f2937;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
}

.slot-subtitle { color: #7b8795; font-size: 12px; }

.slot-search, .slot-select {
    width: 100%;
    border: 1px solid #dce4ee;
    background: white;
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
    color: #3d4652;
    margin-bottom: 12px;
}

.slot-search:focus, .slot-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

.source-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
    gap: 10px;
    max-height: 360px;
    overflow-y: auto;
    padding-right: 4px;
}

.accessory-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.item-card {
    border: 1px solid #dde3ec;
    background: white;
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    min-height: 144px;
}

.item-card:hover {
    transform: translateY(-1px);
    border-color: #c7d4ec;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.10);
}

.item-card.active {
    border-color: transparent;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.12) 0%, rgba(255, 107, 157, 0.12) 100%);
    box-shadow: 0 10px 22px rgba(102, 126, 234, 0.10);
}

.item-thumb {
    height: 78px;
    border-radius: 10px;
    border: 1px solid #e6ecf2;
    background: linear-gradient(180deg, #f2f7fb 0%, #e8eef5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.item-thumb img {
    max-width: 100%;
    max-height: 70px;
    image-rendering: pixelated;
}

.item-fallback {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #667eea 0%, #ff6b9d 100%);
    color: white;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.06em;
}

.item-name {
    color: #243040;
    font-size: 12px;
    line-height: 1.35;
    font-weight: 600;
}

.item-meta {
    color: #7b8795;
    font-size: 11px;
    line-height: 1.35;
}

.empty-state {
    border: 1px dashed #d6deea;
    border-radius: 12px;
    padding: 18px;
    text-align: center;
    color: #7b8795;
    font-size: 13px;
    background: white;
}

.selection-list {
    padding: 14px 15px;
    display: grid;
    gap: 10px;
}

.selection-line {
    border-bottom: 1px solid #f0f2f5;
    padding-bottom: 10px;
}

.selection-line:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.selection-line strong {
    display: block;
    color: #1f2937;
    font-size: 12px;
    margin-bottom: 3px;
}

.selection-line span {
    color: #6a7280;
    font-size: 12px;
    line-height: 1.45;
}

.did-you-know {
    padding: 15px;
    color: #666;
    font-size: 12px;
    line-height: 1.6;
    font-style: italic;
}

.footer {
    background: white;
    padding: 20px;
    text-align: center;
    margin-top: 20px;
    border-top: 1px solid #e8e8e8;
}

.footer p { color: #888; font-size: 12px; }

@media (max-width: 1200px) {
    .container { grid-template-columns: 220px 1fr; }
    .sidebar-right { display: none; }
}

@media (max-width: 960px) {
    .builder-shell { grid-template-columns: 1fr; }
    .builder-stage-card { position: static; }
}

@media (max-width: 768px) {
    .container { grid-template-columns: 1fr; padding: 15px; }
    .sidebar-left { display: none; }
    .site-header { flex-direction: column; gap: 15px; padding: 15px; }
    .nav { flex-wrap: wrap; justify-content: center; }
    .accessory-grid { grid-template-columns: 1fr; }
    .item-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
