/* =========================================================
   图片长图拼接工具 · tool.css
   说明：.navbar/.logo/.footer 桌面端样式完全由官网 style.css 决定，
   本文件只负责工具页面专属样式 + 移动端断点适配（与官网断点一致）。
   ========================================================= */

/* ===== 工具页头部 ===== */
.tool-header {
    padding: 120px 0 32px;
    background: linear-gradient(180deg, #f0f5ff 0%, #ffffff 100%);
    text-align: center;
}
.breadcrumb {
    display: flex; align-items: center; justify-content: center;
    gap: 8px; margin-bottom: 16px;
    font-size: 13px; color: var(--text-light);
}
.breadcrumb a { color: var(--primary); text-decoration: none; font-weight: 500; }
.breadcrumb a:hover { text-decoration: underline; }
.tool-header h1 {
    font-size: clamp(24px, 4vw, 36px);
    font-weight: 900; color: var(--text);
    margin-bottom: 12px;
}
.tool-header p {
    font-size: 15px; color: var(--text-secondary);
    max-width: 680px; margin: 0 auto 18px; 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;
}

/* ===== 主体布局 ===== */
.tool-main { padding: 40px 0 80px; }
.tool-layout {
    display: grid;
    grid-template-columns: 400px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

/* ===== 左侧面板 ===== */
.tool-panel { display: flex; flex-direction: column; gap: 16px; }
.panel-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}
.panel-card h3 {
    font-size: 15px; font-weight: 700;
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 16px;
}
.pc-dot { width: 8px; height: 8px; background: var(--primary-gradient); border-radius: 50%; }

/* 拖放区 */
.dropzone {
    border: 2px dashed rgba(26, 110, 255, 0.3);
    border-radius: var(--radius-sm);
    background: var(--primary-light);
    padding: 28px 16px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}
.dropzone:hover, .dropzone.dragover {
    border-color: var(--primary);
    background: rgba(26, 110, 255, 0.1);
}
.dropzone svg { width: 36px; height: 36px; color: var(--primary); margin-bottom: 8px; }
.dropzone p { font-size: 14px; color: var(--text); margin-bottom: 4px; }
.dz-hint { font-size: 12px; color: var(--text-light); }

/* 按钮 */
.btn-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.tbtn {
    flex: 1;
    display: inline-flex; align-items: center; justify-content: center;
    gap: 6px; padding: 10px 14px;
    border: 1.5px solid var(--border); border-radius: 10px;
    background: white; color: var(--text-secondary);
    font-family: inherit; font-size: 13px; font-weight: 600;
    cursor: pointer; transition: var(--transition);
    white-space: nowrap;
}
.tbtn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.tbtn:disabled { opacity: 0.45; cursor: not-allowed; }
.tbtn:disabled:hover { border-color: var(--border); color: var(--text-secondary); background: white; }
.tbtn-primary { background: var(--primary-gradient); color: white; border-color: transparent; box-shadow: 0 4px 14px rgba(26, 110, 255, 0.3); }
.tbtn-primary:hover { color: white; background: var(--primary-gradient); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(26, 110, 255, 0.4); }
.tbtn-danger:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-light); }
.tbtn-block { width: 100%; flex: none; }

/* 缩略图列表 */
.thumb-list { list-style: none; margin-top: 14px; display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.thumb-list:empty { display: none; }
.thumb-item {
    display: flex; align-items: center; gap: 10px;
    background: var(--bg-warm);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 10px;
    cursor: grab;
    transition: var(--transition);
}
.thumb-item.dragging { opacity: 0.4; border-style: dashed; }
.thumb-item.drag-over { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(26, 110, 255, 0.15); }
.thumb-item img { width: 46px; height: 46px; object-fit: cover; border-radius: 6px; flex-shrink: 0; background: #e2e8f0; }
.thumb-info { flex: 1; min-width: 0; }
.thumb-info .tname { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb-info .tmeta { font-size: 11px; color: var(--text-light); }
.thumb-order {
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--primary-light); color: var(--primary);
    font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.thumb-ops { display: flex; gap: 4px; flex-shrink: 0; }
.thumb-ops button {
    width: 26px; height: 26px;
    border: 1px solid var(--border); background: white; border-radius: 6px;
    font-size: 12px; color: var(--text-secondary);
    cursor: pointer; transition: var(--transition);
    display: flex; align-items: center; justify-content: center;
    padding: 0; font-family: inherit;
}
.thumb-ops button:hover { border-color: var(--primary); color: var(--primary); }
.thumb-ops .t-del:hover { border-color: var(--danger); color: var(--danger); }
.panel-note { font-size: 12px; color: var(--text-light); margin-top: 10px; line-height: 1.6; }

/* 表单组 */
.form-group { margin-bottom: 14px; }
.form-group:last-child { margin-bottom: 0; }
.form-group > label {
    display: block; font-size: 13px; font-weight: 600;
    color: var(--text); margin-bottom: 6px;
}
.fg-val { color: var(--primary); font-weight: 700; margin-left: 4px; }
.seg { display: flex; background: var(--bg-warm); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 3px; }
.seg-btn {
    flex: 1; padding: 7px 6px;
    border: none; background: transparent; border-radius: 8px;
    font-family: inherit; font-size: 12px; font-weight: 600;
    color: var(--text-secondary); cursor: pointer; transition: var(--transition);
    white-space: nowrap;
}
.seg-btn:hover { color: var(--primary); }
.seg-btn.active { background: var(--primary-gradient); color: white; box-shadow: 0 2px 8px rgba(26, 110, 255, 0.3); }

input[type="range"] {
    width: 100%; height: 6px;
    -webkit-appearance: none; appearance: none;
    background: var(--border); border-radius: 100px;
    outline: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 18px; height: 18px; border-radius: 50%;
    background: var(--primary-gradient);
    border: 2.5px solid white;
    box-shadow: 0 2px 8px rgba(26, 110, 255, 0.4);
    cursor: grab;
}
input[type="range"]::-moz-range-thumb {
    width: 18px; height: 18px; border-radius: 50%;
    background: #1a6eff; border: 2.5px solid white;
    box-shadow: 0 2px 8px rgba(26, 110, 255, 0.4);
    cursor: grab;
}
select {
    width: 100%; padding: 9px 12px;
    border: 1.5px solid var(--border); border-radius: 10px;
    background: white; font-family: inherit; font-size: 13px; color: var(--text);
    cursor: pointer; outline: none;
}
select:focus { border-color: var(--primary); }
input[type="color"] {
    width: 44px; height: 34px; padding: 2px;
    border: 1.5px solid var(--border); border-radius: 8px;
    background: white; cursor: pointer; flex-shrink: 0;
}
.bg-row { display: flex; align-items: center; gap: 10px; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.sw {
    width: 26px; height: 26px; border-radius: 8px;
    border: 1.5px solid rgba(0, 0, 0, 0.12);
    cursor: pointer; transition: var(--transition); padding: 0;
    font-size: 12px; color: var(--text-light);
    background-image: linear-gradient(45deg, #eee 25%, transparent 25%, transparent 75%, #eee 75%),
        linear-gradient(45deg, #eee 25%, transparent 25%, transparent 75%, #eee 75%);
    background-size: 10px 10px; background-position: 0 0, 5px 5px;
}
.sw:hover { transform: scale(1.12); }
.sw.active { box-shadow: 0 0 0 2px white, 0 0 0 4px var(--primary); }
.check-line {
    display: flex !important; align-items: center; gap: 8px;
    font-size: 12px !important; font-weight: 500 !important;
    color: var(--text-secondary) !important;
    margin-top: 10px !important; margin-bottom: 0 !important;
    cursor: pointer;
}
.check-line input { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }

/* ===== 右侧预览 ===== */
.tool-preview { display: flex; flex-direction: column; gap: 16px; min-width: 0; position: sticky; top: 88px; }
.preview-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.preview-toolbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-warm);
    flex-wrap: wrap;
}
.pt-title { font-size: 14px; font-weight: 700; }
.pt-title::before { content: ''; display: inline-block; width: 8px; height: 8px; background: #16a34a; border-radius: 50%; margin-right: 8px; animation: pt-pulse 1.6s infinite; }
@keyframes pt-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
.pt-info { font-size: 12px; color: var(--text-light); font-family: monospace; }
.preview-body {
    min-height: 420px;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    background:
        linear-gradient(45deg, #f1f5f9 25%, transparent 25%, transparent 75%, #f1f5f9 75%),
        linear-gradient(45deg, #f1f5f9 25%, transparent 25%, transparent 75%, #f1f5f9 75%);
    background-color: #ffffff;
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
}
.preview-empty { text-align: center; color: var(--text-light); }
.preview-empty svg { width: 56px; height: 56px; margin-bottom: 12px; opacity: 0.5; }
.preview-empty p { font-size: 14px; }
#outCanvas {
    max-width: 100%; max-height: 72vh;
    border-radius: 6px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14);
}
.preview-note {
    padding: 10px 20px;
    font-size: 12px; color: #854d0e;
    background: #fef9c3;
    border-top: 1px solid #fde68a;
}
.privacy-card {
    display: flex; align-items: flex-start; gap: 12px;
    background: var(--primary-light);
    border: 1.5px solid rgba(26, 110, 255, 0.15);
    border-radius: var(--radius);
    padding: 16px 20px;
}
.privacy-card svg { width: 22px; height: 22px; color: var(--primary); flex-shrink: 0; margin-top: 2px; }
.privacy-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.7; margin: 0; }

/* =========================================================
   移动端适配 —— 断点与官网保持一致（1024 / 768）
   ========================================================= */
@media (max-width: 1024px) {
    .tool-layout { grid-template-columns: 1fr; }
    .tool-preview { position: static; }
    .preview-body { min-height: 320px; }
    .footer-grid { grid-template-columns: 1fr 1fr !important; }
}

@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; }

    .tool-header { padding: 104px 0 24px; }
    .tool-main { padding: 24px 0 56px; }
    .panel-card { padding: 16px; }
    .btn-row .tbtn { flex: 1 1 auto; }
    .thumb-list { max-height: 240px; }
    .preview-body { padding: 12px; min-height: 240px; }
    #outCanvas { max-height: 60vh; }
    .preview-toolbar { padding: 12px 14px; }
    .pt-info { font-size: 11px; }

    /* 页脚单列（与官网一致） */
    .footer-grid { grid-template-columns: 1fr !important; gap: 32px; }
}
