/* ============================================================
   截图标注 · 超强画图板  —— 工具页专属样式
   依赖官网根目录 style.css（导航/页脚/变量），本文件只补充工具样式
   ============================================================ */

/* ===== 移动端顶部导航适配（与官网首页内联规则一致，照抄不重写桌面端） ===== */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 72px;
        left: 0; right: 0;
        background: white;
        flex-direction: column;
        padding: 16px 24px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
        gap: 4px;
        border-bottom: 1px solid var(--border);
        z-index: 999;
    }
    .nav-links.active { display: flex; }
    .mobile-toggle { display: flex; }
}
@media (max-width: 1024px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* ===== 工具页头部 ===== */
.tool-header {
    padding: 120px 0 32px;
    background: linear-gradient(180deg, #f0f5ff 0%, #ffffff 100%);
    text-align: center;
}
.tool-header .breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--text-light);
    flex-wrap: wrap;
}
.tool-header .breadcrumb a { color: var(--primary); text-decoration: none; font-weight: 500; }
.tool-header .breadcrumb a:hover { text-decoration: underline; }
.tool-header h1 {
    font-size: clamp(24px, 4vw, 36px);
    font-weight: 900;
    color: var(--text);
    margin-bottom: 10px;
}
.tool-header p {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 720px;
    margin: 0 auto 16px;
    line-height: 1.8;
}
.tool-badges { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.tbadge {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-light);
    padding: 4px 14px;
    border-radius: 100px;
}

/* ===== 画图板布局 ===== */
.board-wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px 48px;
}
.board {
    display: grid;
    grid-template-columns: 56px 1fr 216px;
    gap: 12px;
    background: var(--bg-warm);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    box-shadow: var(--shadow);
}

/* 左侧工具栏 */
.toolbar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 0;
    height: fit-content;
    position: sticky;
    top: 84px;
}
.tbtn {
    width: 40px; height: 40px;
    border: none;
    background: transparent;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all .2s ease;
    position: relative;
}
.tbtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tbtn:hover { background: var(--primary-light); color: var(--primary); }
.tbtn.active { background: var(--primary-gradient); color: white; box-shadow: 0 4px 12px rgba(26,110,255,.3); }
.tdiv { width: 24px; height: 1px; background: var(--border); margin: 4px 0; }

/* 画布区 */
.canvas-area {
    position: relative;
    height: 600px;
    background:
        linear-gradient(45deg, #eef1f6 25%, transparent 25%, transparent 75%, #eef1f6 75%),
        linear-gradient(45deg, #eef1f6 25%, transparent 25%, transparent 75%, #eef1f6 75%),
        #ffffff;
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    touch-action: none;
}
#boardCanvas { position: absolute; inset: 0; cursor: crosshair; }
.canvas-area.tool-pan #boardCanvas { cursor: grab; }
.canvas-area.panning #boardCanvas { cursor: grabbing !important; }
.canvas-area.tool-picker #boardCanvas { cursor: copy; }
.canvas-area.tool-text #boardCanvas { cursor: text; }

.canvas-hint {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
    transition: opacity .3s;
}
.canvas-hint.hidden { opacity: 0; }
.hint-inner { text-align: center; color: var(--text-light); }
.hint-inner svg { opacity: .4; margin-bottom: 8px; }
.hint-inner p { font-size: 14px; }
.hint-inner b { color: var(--primary); }
.hint-sub { font-size: 12px; margin-top: 6px; opacity: .7; }

.text-input {
    position: absolute;
    display: none;
    min-width: 60px;
    padding: 4px 8px;
    border: 1.5px dashed var(--primary);
    background: rgba(255,255,255,.9);
    border-radius: 4px;
    font-family: inherit;
    outline: none;
    z-index: 5;
}

.zoom-badge {
    position: absolute;
    right: 10px; bottom: 10px;
    background: rgba(20,25,40,.75);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 100px;
    pointer-events: none;
}

/* 右侧属性面板 */
.panel {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    height: fit-content;
    position: sticky;
    top: 84px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}
.panel-group { margin-bottom: 16px; }
.panel-group h4 {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
}
.panel-group .pv { color: var(--primary); font-weight: 600; }
.color-row { display: flex; gap: 8px; align-items: flex-start; }
#colorPicker {
    width: 36px; height: 36px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2px;
    background: white;
    cursor: pointer;
    flex-shrink: 0;
}
.color-presets {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 5px;
    flex: 1;
}
.cp {
    width: 100%; aspect-ratio: 1;
    border-radius: 6px;
    border: 1px solid rgba(0,0,0,.08);
    cursor: pointer;
    transition: transform .15s;
}
.cp:hover { transform: scale(1.2); }
.cp.active { outline: 2px solid var(--primary); outline-offset: 1px; }

input[type="range"] {
    width: 100%;
    accent-color: var(--primary);
    cursor: pointer;
}
.bg-btns { display: flex; gap: 8px; }
.mini-btn {
    flex: 1;
    padding: 7px 0;
    font-size: 12px;
    font-weight: 600;
    border: 1.5px solid var(--border);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    transition: all .2s;
}
.mini-btn:hover { border-color: var(--primary); color: var(--primary); }
.panel-tip {
    font-size: 11px;
    color: var(--text-light);
    line-height: 1.8;
    border-top: 1px dashed var(--border);
    padding-top: 12px;
}
.panel-tip b { color: var(--text-secondary); }

/* 底部操作栏 */
.actionbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 12px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
}
.ab-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-secondary);
    background: white;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all .2s;
}
.ab-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ab-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.ab-btn:disabled { opacity: .4; cursor: not-allowed; }
.ab-btn.primary {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(26,110,255,.28);
}
.ab-btn.primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(26,110,255,.38); color: #fff; }
.ab-btn.danger:hover:not(:disabled) { border-color: var(--danger); color: var(--danger); }
.zoom-label { font-size: 12px; font-weight: 700; color: var(--text); min-width: 44px; text-align: center; }

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
    .board { grid-template-columns: 48px 1fr 190px; gap: 8px; }
    .canvas-area { height: 520px; }
}
@media (max-width: 768px) {
    .tool-header { padding: 100px 0 24px; }
    .board {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
        padding: 8px;
        gap: 8px;
    }
    .toolbar {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 6px;
        gap: 2px;
        position: static;
        -webkit-overflow-scrolling: touch;
    }
    .toolbar::-webkit-scrollbar { height: 4px; }
    .tbtn { width: 38px; height: 38px; flex-shrink: 0; }
    .tdiv { width: 1px; height: 22px; margin: 0 4px; }
    .canvas-area { height: 56vh; min-height: 320px; }
    .panel {
        position: static;
        max-height: none;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    .panel-group { margin-bottom: 0; }
    .panel-tip { grid-column: 1 / -1; }
    .actionbar { justify-content: center; gap: 8px; padding: 10px; }
    .ab-btn { padding: 8px 12px; font-size: 12px; }
    .ab-group { justify-content: center; }
}
@media (max-width: 480px) {
    .canvas-area { height: 50vh; min-height: 280px; }
    .panel { grid-template-columns: 1fr; }
    .ab-btn span { display: none; }
}
