/* ═══════════════════════════════════════════════
   电学智能解析引擎 — 液态玻璃 (Liquid Glass) 风格
   匹配 tlipoca.wiki 主站设计系统
   ═══════════════════════════════════════════════ */

/* ---------- 0. CSS 变量 ---------- */
:root {
    --glass-bg: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-blur: 18px;
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --color-bg: #0a0a1a;
    --color-surface: rgba(17, 17, 39, 0.7);
    --color-primary: #a855f7;
    --color-primary-glow: rgba(168, 85, 247, 0.35);
    --color-accent: #ff6b6b;
    --color-success: #3fb950;
    --color-warning: #d29922;
    --color-danger: #f85149;
    --color-text: #e8e8f0;
    --color-text-muted: #9a9ab0;
    --color-text-bright: #fff;
    --font-sans: 'Microsoft YaHei', 'PingFang SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --radius: 14px;
    --radius-sm: 8px;
}

/* ---------- 1. 基础重置 ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #4c1d95 var(--color-bg);
}
html::-webkit-scrollbar { width: 6px; height: 6px; }
html::-webkit-scrollbar-track { background: transparent; }
html::-webkit-scrollbar-thumb { background: #4c1d95; border-radius: 3px; }
html::-webkit-scrollbar-thumb:hover { background: var(--color-primary); }

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    background-image:
        linear-gradient(170deg, rgba(168,85,247,0.03) 0%, transparent 40%),
        linear-gradient(350deg, rgba(255,107,107,0.02) 0%, transparent 35%);
    color: var(--color-text);
    line-height: 1.7;
    min-height: 100vh;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@supports (height: 100dvh) {
    body {
        min-height: 100dvh;
        height: 100dvh;
    }
}

/* 动态背景光晕 */
body::before {
    content: '';
    position: fixed;
    top: -30%;
    left: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(ellipse, rgba(168, 85, 247, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}
body::after {
    content: '';
    position: fixed;
    bottom: -20%;
    right: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(ellipse, rgba(255, 107, 107, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

a { color: inherit; text-decoration: none; }

/* ---------- 2. 液态玻璃 (Liquid Glass) ---------- */
.glass {
    position: relative;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border: 1px double rgba(255, 255, 255, 0.08);
    box-shadow:
        inset 2px -2px 1px -1px rgba(255, 255, 255, 0.8),
        inset -2px 2px 1px -1px rgba(255, 255, 255, 0.8),
        inset 6px -6px 1px -6px rgba(255, 255, 255, 0.45),
        inset -6px 6px 1px -6px rgba(255, 255, 255, 0.45),
        inset 0 0 2px rgba(0, 0, 0, 0.6),
        0 4px 12px rgba(0, 0, 0, 0.25);
    filter: brightness(0.92);
}

.glass::before {
    content: '';
    position: absolute;
    z-index: 1;
    top: 35%;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 16px);
    height: calc(100% - 16px);
    border-radius: inherit;
    border: 1px solid rgba(0, 0, 0, 0.7);
    filter: blur(8px);
    pointer-events: none;
}

.glass::after {
    content: '';
    position: absolute;
    z-index: 2;
    inset: 0;
    border-radius: inherit;
    filter: blur(3px);
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.6) 0%,
        transparent 25%,
        transparent 75%,
        rgba(255, 255, 255, 0.6) 100%
    );
    pointer-events: none;
}

/* ---------- 3. 导航栏 ---------- */
.glass-nav {
    position: relative;
    z-index: 100;
    background: linear-gradient(90deg, rgba(10,10,26,0.8) 0%, rgba(22,19,42,0.75) 50%, rgba(10,10,26,0.8) 100%);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding: 0 20px;
    gap: 16px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.logo-icon {
    font-size: 20px;
}
.logo-text {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text-bright);
    white-space: nowrap;
}
.logo-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(168, 85, 247, 0.2);
    color: var(--color-primary);
    border: 1px solid rgba(168, 85, 247, 0.3);
    font-weight: 600;
    letter-spacing: 1px;
}

.nav-controls {
    display: flex;
    gap: 20px;
    align-items: center;
}
.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
}
.control-group label {
    font-size: 13px;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.nav-back-btn {
    padding: 6px 16px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.25s var(--transition-smooth);
    white-space: nowrap;
}
.nav-back-btn:hover {
    color: var(--color-text-bright);
    border-color: var(--color-primary);
    background: rgba(168, 85, 247, 0.1);
}

/* ---------- 4. 通用控件 ---------- */
select, input[type="range"] {
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-text);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.3s;
}
select { min-width: 160px; cursor: pointer; }
select:focus { border-color: var(--color-primary); }
input[type="range"] {
    width: 100px;
    cursor: pointer;
    -webkit-appearance: none;
    background: transparent;
    border: none;
}
input[type="range"]::-webkit-slider-track {
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.12);
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-primary);
    margin-top: -5px;
    box-shadow: 0 0 8px var(--color-primary-glow);
    cursor: pointer;
}
.conf-display {
    font-size: 13px;
    color: var(--color-primary);
    min-width: 32px;
    text-align: center;
    font-weight: 600;
}

.btn {
    padding: 5px 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-text);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.25s var(--transition-smooth);
    white-space: nowrap;
    font-family: var(--font-sans);
}
.btn:hover { border-color: rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.1); }
.btn:disabled { opacity: .35; cursor: not-allowed; }

.btn-glow {
    background: rgba(168, 85, 247, 0.15);
    color: var(--color-primary);
    border-color: rgba(168, 85, 247, 0.3);
}
.btn-glow:hover:not(:disabled) {
    background: rgba(168, 85, 247, 0.3);
    box-shadow: 0 0 16px var(--color-primary-glow);
}

/* 导入图片时未加载模型的提示状态 */
.btn-remind {
    animation: remind-pulse 1s ease-in-out infinite alternate;
    border-color: var(--color-warning) !important;
    color: var(--color-warning) !important;
    box-shadow: 0 0 14px rgba(210, 153, 34, 0.5) !important;
}
@keyframes remind-pulse {
    from { box-shadow: 0 0 6px rgba(210, 153, 34, 0.4); }
    to   { box-shadow: 0 0 18px rgba(210, 153, 34, 0.8); }
}
.btn-accent {
    background: linear-gradient(135deg, var(--color-primary) 0%, #7c3aed 100%);
    color: #fff;
    border: none;
    box-shadow: 0 2px 12px var(--color-primary-glow);
}
.btn-accent:hover:not(:disabled) {
    filter: brightness(1.15);
    box-shadow: 0 4px 20px var(--color-primary-glow);
}

.btn-ghost {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--color-text-muted);
}
.btn-ghost:hover { color: var(--color-text); border-color: rgba(255, 255, 255, 0.2); }

.btn-small { padding: 3px 10px; font-size: 12px; }

/* ---------- 5. 主内容区 ---------- */
.workspace {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    gap: 0;
    overflow: hidden;
    min-height: 0;
}

.panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}
.panel-image {
    flex: 1 1 55%;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0;
}
/* Override glass pseudo-elements on full-width panels */
.panel-image::before, .panel-image::after,
.result-card::before, .result-card::after,
.status-bar::before, .status-bar::after { display: none; }

.panel-results {
    flex: 1 1 45%;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
}
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: linear-gradient(135deg, rgba(17,17,39,0.75) 0%, rgba(22,19,42,0.65) 100%);
    flex-shrink: 0;
}
.panel-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-bright);
}
.panel-actions { display: flex; gap: 8px; }
.panel-body {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: rgba(10, 10, 26, 0.5);
}

/* ---------- 6. 上传区 ---------- */
.upload-area {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.upload-placeholder {
    text-align: center;
    cursor: pointer;
    padding: 40px;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    margin: 20px;
    transition: all 0.3s var(--transition-smooth);
}
.upload-placeholder:hover {
    border-color: var(--color-primary);
    background: rgba(168, 85, 247, 0.05);
}
.upload-icon { font-size: 48px; margin-bottom: 12px; }
.upload-placeholder p { font-size: 14px; color: var(--color-text-muted); margin-top: 4px; }
.upload-placeholder .hint { font-size: 12px; opacity: .5; }
.upload-area.dragover .upload-placeholder {
    border-color: var(--color-primary);
    background: rgba(168, 85, 247, 0.1);
    box-shadow: inset 0 0 40px rgba(168, 85, 247, 0.08);
}

.detect-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ---------- 7. 结果卡片 ---------- */
.result-card {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: linear-gradient(135deg, rgba(17,17,39,0.75) 0%, rgba(22,19,42,0.6) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.card-header h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-bright);
}
.card-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.header-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.header-hint {
    font-size: 11px;
    color: var(--color-text-muted);
}
.count-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(168, 85, 247, 0.15);
    color: var(--color-primary);
    border: 1px solid rgba(168, 85, 247, 0.25);
}
.card-body {
    padding: 12px 16px;
    max-height: 240px;
    overflow-y: auto;
}
.canvas-body {
    padding: 8px;
    display: flex;
}

.inspector-card {
    flex: 0 0 auto;
    overflow: hidden;
}
.inspector-card.is-collapsed {
    border-bottom-color: rgba(255, 255, 255, 0.04);
}
.inspector-card.is-collapsed .inspector-content {
    display: none;
}
.inspector-content {
    display: flex;
    flex-direction: column;
}
.result-section + .result-section {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.section-header h4 {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-bright);
}
.section-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ---------- 8. 检测结果表格 ---------- */
.result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.result-table th {
    text-align: left;
    padding: 6px 8px;
    color: var(--color-text-muted);
    font-weight: 500;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    background: rgba(17, 17, 39, 0.95);
}
.result-table td {
    padding: 5px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.result-table tr:hover td { background: rgba(168, 85, 247, 0.06); }
.empty-row td { text-align: center; color: var(--color-text-muted); padding: 20px; }

/* ---------- 9. JSON 显示 ---------- */
.json-display {
    font-family: "Cascadia Code", "Fira Code", "Consolas", monospace;
    font-size: 12px;
    line-height: 1.5;
    background: rgba(10, 10, 26, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    padding: 12px;
    white-space: pre-wrap;
    word-break: break-all;
    color: var(--color-success);
    max-height: 220px;
    overflow-y: auto;
}
.json-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: none;
}
.json-editor {
    width: 100%;
    min-height: 220px;
    max-height: min(42vh, 420px);
    resize: vertical;
    white-space: pre;
    word-break: normal;
    outline: none;
    caret-color: var(--color-primary);
}
.json-editor:focus {
    border-color: rgba(168, 85, 247, 0.35);
    box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.18);
}
.json-status {
    font-size: 11px;
    line-height: 1.4;
    color: var(--color-text-muted);
}
.json-status.ok { color: var(--color-success); }
.json-status.error { color: var(--color-danger); }
.json-status.info { color: var(--color-text-muted); }

/* ---------- 10. 电路编辑器画布 ---------- */
.canvas-shell {
    flex: 1;
    min-height: 280px;
    height: 100%;
    position: relative;
}
.circuit-canvas {
    width: 100%;
    height: 100%;
    min-height: 0;
    background: #ffffff;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(0, 0, 0, 0.1);
    display: block;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.06);
    position: relative;   /* 建立堆叠上下文 */
    z-index: 10;          /* 高于 .glass::after (z-index:2)，避免玻璃覆盖画布内容 */
}
.editor-card { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.editor-body { flex: 1; min-height: 0; max-height: none !important; padding: 4px; overflow: hidden; display: flex; }
.editor-card .card-header { flex-wrap: wrap; gap: 8px; position: relative; z-index: 10; }

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
}
.mode-group {
    display: flex;
    gap: 2px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 6px;
    padding: 2px;
}
.btn-mode {
    padding: 3px 10px;
    font-size: 12px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-sans);
    white-space: nowrap;
}
.btn-mode:hover { color: var(--color-text); background: rgba(255, 255, 255, 0.06); }
.btn-mode.active {
    color: var(--color-primary);
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.3);
}

.component-palette {
    display: flex;
    gap: 4px;
    padding: 6px 16px;
    overflow-x: auto;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    position: relative;  /* 确保元件面板按钮在 glass 覆盖层之上 */
    z-index: 10;
}
.component-palette::-webkit-scrollbar { height: 3px; }
.component-palette::-webkit-scrollbar-thumb { background: rgba(168, 85, 247, 0.3); border-radius: 2px; }

.btn-comp {
    padding: 3px 8px;
    font-size: 11px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-sans);
    white-space: nowrap;
    flex-shrink: 0;
}
.btn-comp:hover {
    color: var(--color-primary);
    border-color: rgba(168, 85, 247, 0.3);
    background: rgba(168, 85, 247, 0.1);
}

/* ---------- 11. 底部状态栏 ---------- */
.status-bar {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 30px;
    background: linear-gradient(90deg, rgba(10,10,26,0.8) 0%, rgba(17,17,39,0.75) 50%, rgba(10,10,26,0.8) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 12px;
    flex-shrink: 0;
    border-radius: 0;
}
.status-left, .status-right { display: flex; align-items: center; gap: 8px; }
.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.status-dot.idle  { background: var(--color-text-muted); }
.status-dot.ok    { background: var(--color-success); box-shadow: 0 0 8px rgba(63, 185, 80, 0.4); }
.status-dot.busy  { background: var(--color-warning); animation: pulse .8s infinite alternate; }
.status-dot.error { background: var(--color-danger); box-shadow: 0 0 8px rgba(248, 81, 73, 0.4); }
@keyframes pulse { to { opacity: .4; } }
.sep { color: rgba(255, 255, 255, 0.15); }
.status-right span { color: var(--color-text-muted); }

/* ---------- 12. 站点页脚 ---------- */
.site-footer {
    position: relative;
    z-index: 10;
    flex-shrink: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: linear-gradient(90deg, rgba(10,10,26,0.85) 0%, rgba(17,17,39,0.8) 50%, rgba(10,10,26,0.85) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 10px 20px;
}
.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
}
.footer-links {
    display: flex;
    align-items: center;
    gap: 10px;
}
.footer-links a {
    color: rgba(168, 85, 247, 0.65);
    text-decoration: none;
    transition: color 0.2s;
}
.footer-links a:hover { color: var(--color-primary); }
.footer-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}
.footer-copy {
    white-space: nowrap;
}
.footer-copy a {
    color: rgba(168, 85, 247, 0.5);
    text-decoration: none;
    transition: color 0.2s;
}
.footer-copy a:hover { color: var(--color-primary); }
.footer-note {
    margin-left: 8px;
    padding-left: 8px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.25);
}

@media (max-width: 700px) {
    .footer-inner { flex-direction: column; gap: 4px; text-align: center; }
    .footer-note { display: none; }
}

/* ---------- 13. 加载遮罩 ---------- */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 26, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}
.loading-card {
    border-radius: 18px;
    padding: 36px 44px;
    text-align: center;
    min-width: 320px;
}
.spinner {
    width: 38px; height: 38px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin .8s linear infinite;
    margin: 0 auto 16px;
    box-shadow: 0 0 16px var(--color-primary-glow);
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-card p { font-size: 14px; margin-bottom: 16px; color: var(--color-text-muted); }
.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), #7c3aed);
    border-radius: 3px;
    transition: width .15s;
    box-shadow: 0 0 10px var(--color-primary-glow);
}
#progress-text { font-size: 12px; color: var(--color-text-muted); }

/* ---------- 14. 响应式 ---------- */
@media (max-width: 900px) {
    body {
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
        overflow-x: hidden;
    }

    @supports (height: 100dvh) {
        body {
            min-height: 100dvh;
        }
    }

    .workspace {
        flex: 0 0 auto;
        flex-direction: column;
        overflow: visible;
        min-height: auto;
    }
    .panel {
        overflow: visible;
    }
    .panel-image {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        flex: 0 0 min(40vh, 320px);
        min-height: 180px;
    }
    .panel-results {
        flex: 0 0 auto;
        min-height: auto;
        overflow: visible;
    }
    .nav-controls { display: none; }
    .nav-inner { height: 48px; }
    .card-body {
        max-height: none;
        overflow: visible;
    }
    .editor-card {
        min-height: 260px;
        flex: 0 0 auto;
    }
    .editor-body {
        min-height: 220px;
    }
    .canvas-shell {
        min-height: 220px;
    }
    .status-bar {
        height: auto;
        min-height: 30px;
        padding: 6px 12px;
        justify-content: flex-start;
        gap: 6px 12px;
        flex-wrap: wrap;
    }
    .status-left, .status-right {
        flex-wrap: wrap;
        row-gap: 4px;
    }
    .site-footer {
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    }
}

@media (max-width: 600px) {
    .nav-inner { padding: 0 12px; gap: 8px; }
    .logo-text { font-size: 13px; }
    .panel-header { padding: 8px 12px; }
    .card-body { padding: 8px 12px; }
    .nav-back-btn { padding: 4px 10px; font-size: 11px; }
    .section-header,
    .card-header { padding: 8px 12px; }
    .header-hint { display: none; }
    .panel-image {
        flex-basis: min(36vh, 280px);
    }
    .status-bar {
        font-size: 11px;
    }
    .status-right .sep {
        display: none;
    }
    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    .footer-copy {
        white-space: normal;
        text-align: center;
    }
}
