/* ============================================================
   boardflow.css — 白板绘图专属样式
   依赖 common.css 的基础变量与组件。
   顶栏在白板中略矮。
   ============================================================ */
:root { --header-height: 52px; --status-height: 26px; }

/* ===== 工具面板 ===== */
.tool-panel {
    width: 240px; min-width: 180px;
    display: flex; flex-direction: column;
    border-right: 1px solid var(--border);
    background: var(--surface);
}

.panel-body {
    flex: 1; overflow-y: auto; padding: 14px;
    display: flex; flex-direction: column; gap: 16px;
}
.panel-body::-webkit-scrollbar { width: 5px; }
.panel-body::-webkit-scrollbar-track { background: transparent; }
.panel-body::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 3px; }

.section-label {
    font-size: 11px; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 8px;
}

/* 工具网格 */
.tool-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.tool-btn {
    aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
    border-radius: 8px; border: 1px solid transparent; background: transparent;
    color: var(--text-muted); font-size: 15px; cursor: pointer; transition: all 0.2s;
    position: relative;
}
.tool-btn:hover { color: var(--text); background: var(--surface-2); border-color: var(--border); }
.tool-btn.active { color: var(--accent); background: var(--accent-glow); border-color: rgba(0, 229, 160, 0.25); }
.tool-btn .tool-tip {
    display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
    background: var(--surface-3); color: var(--text); font-size: 10px; font-weight: 500;
    padding: 3px 8px; border-radius: 4px; white-space: nowrap; pointer-events: none;
    border: 1px solid var(--border-hover);
}
.tool-btn:hover .tool-tip { display: block; }

/* 颜色行 */
.color-row { display: flex; align-items: center; gap: 8px; }
.color-row label { font-size: 12px; color: var(--text-muted); min-width: 36px; }
input[type="color"] {
    -webkit-appearance: none; appearance: none;
    width: 32px; height: 32px; border: 2px solid var(--border); border-radius: 6px;
    cursor: pointer; padding: 2px; background: var(--surface-2); transition: border-color 0.2s;
}
input[type="color"]:hover { border-color: var(--border-hover); }
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 3px; }
input[type="color"]::-moz-color-swatch { border: none; border-radius: 3px; }

.fill-toggle {
    padding: 3px 8px; font-size: 11px; border-radius: 4px; cursor: pointer;
    border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted);
    transition: all 0.2s; font-family: inherit;
}
.fill-toggle.active { color: var(--accent); border-color: rgba(0, 229, 160, 0.3); background: var(--accent-glow); }

/* 色板 */
.swatch-grid { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.swatch {
    width: 22px; height: 22px; border-radius: 5px; cursor: pointer; border: 2px solid transparent;
    transition: all 0.15s; flex-shrink: 0;
}
.swatch:hover { transform: scale(1.15); border-color: var(--border-hover); }
.swatch.active-swatch { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); }

/* 滑块 */
.slider-row { display: flex; align-items: center; gap: 8px; }
.slider-row label { font-size: 12px; color: var(--text-muted); min-width: 36px; }
.slider-row .val { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-muted); min-width: 32px; text-align: right; }
input[type="range"] {
    -webkit-appearance: none; appearance: none; flex: 1; height: 5px;
    background: var(--surface-3); border-radius: 3px; outline: none;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 14px; height: 14px;
    background: var(--accent); border-radius: 50%; cursor: pointer;
    box-shadow: 0 0 8px var(--accent-glow);
}
input[type="range"]::-moz-range-thumb {
    width: 14px; height: 14px; background: var(--accent); border: none;
    border-radius: 50%; cursor: pointer;
}

/* 操作网格 */
.action-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.action-grid .btn { width: 100%; font-size: 11px; padding: 6px 4px; justify-content: center; gap: 4px; }

.panel-section-divider { height: 1px; background: var(--border); margin: 2px 0; }

/* ===== 画布面板 ===== */
.canvas-panel { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.canvas-body {
    flex: 1; position: relative; overflow: hidden; background: var(--bg); cursor: crosshair;
}
.canvas-body canvas { display: block; width: 100%; height: 100%; }

.text-input-overlay {
    position: absolute; display: none; background: transparent;
    border: 1.5px dashed var(--accent); border-radius: 2px;
    color: var(--text); font-family: 'DM Sans', sans-serif;
    padding: 2px 4px; outline: none; resize: none; min-width: 80px; min-height: 28px;
    z-index: 10; overflow: hidden; line-height: 1.3;
}

/* 画布空状态居中 */
.canvas-body .empty-state {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    z-index: 3;
}

/* 拖拽提示在底部居中（复用 common.drag-hint） */
.drag-hint { z-index: 5; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .tool-panel { width: 56px !important; min-width: 56px !important; }
    .panel-title, .section-label, .color-row label, .slider-row label,
    .slider-row .val, .fill-toggle, .tool-btn .tool-tip, .btn span.btn-label { display: none !important; }
    .tool-grid { grid-template-columns: 1fr; }
    .swatch-grid { display: none; }
    .action-grid { grid-template-columns: 1fr; }
    .color-row { justify-content: center; }
    .slider-row { justify-content: center; }
    .panel-body { padding: 8px; gap: 10px; }
}
