/* VIBCC 免费工具专用样式。变量、按钮、卡片、说明文字等基础样式在 src/styles/site.css。 */

/* ---------- 工具布局 ---------- */
.tool { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.step { padding: 20px; margin-bottom: 20px; }
.step-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; flex-wrap: wrap; }
.step-num { font: 600 12px/1 var(--mono); color: var(--accent); background: var(--accent-wash); padding: 4px 7px; border-radius: 4px; }
.step h2 { font-family: var(--serif); font-size: 21px; font-weight: 600; margin: 0; }
.step-sub { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }

.field { position: relative; }
.field label, .label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field .hint { font-weight: 400; color: var(--muted); }
textarea, input[type="text"] {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  padding: 9px 12px; font-size: 15px; line-height: 1.5; transition: border-color .15s, box-shadow .15s;
}
textarea:focus, input[type="text"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
textarea { resize: vertical; min-height: 64px; }
.mono { font-family: var(--mono); font-size: 13px; }
.counter { position: absolute; right: 10px; bottom: 8px; font: 12px/1 var(--mono); color: var(--faint); pointer-events: none; }
.counter.is-err, .input-n.is-err { color: var(--err); font-weight: 600; }

.title-preview { margin: 10px 0 0; padding: 10px 12px; background: var(--line-soft); border-radius: var(--radius); font-size: 14px; color: var(--muted); word-break: break-word; }
.title-preview mark { background: var(--accent-wash); color: var(--ink); padding: 1px 0; border-bottom: 2px solid var(--accent); }
.title-legend { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.title-legend span { display: inline-block; width: 10px; height: 10px; background: var(--accent-wash); border-bottom: 2px solid var(--accent); margin-right: 4px; vertical-align: -1px; }

/* ---------- 检查项 ---------- */
.checks { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.check { position: relative; padding: 7px 10px 7px 30px; border-radius: var(--radius); font-size: 14px; line-height: 1.5; background: var(--line-soft); color: var(--ink-soft); word-break: break-word; }
.check::before { position: absolute; left: 10px; top: 7px; font: 700 13px/1.5 var(--sans); }
.check.is-ok { background: var(--ok-wash); color: #17573a; }
.check.is-ok::before { content: "✓"; color: var(--ok); }
.check.is-warn { background: var(--warn-wash); color: #6e3f00; }
.check.is-warn::before { content: "!"; color: var(--warn); }
.check.is-err { background: var(--err-wash); color: #8a1b12; }
.check.is-err::before { content: "×"; color: var(--err); }
.check.is-info::before { content: "i"; color: var(--muted); font-family: var(--serif); font-style: italic; }
.check.is-ready { background: var(--ok); color: #fff; font-weight: 600; }
.check.is-ready::before { content: "✓"; color: #fff; }

/* ---------- 分类卡片 ---------- */
.buckets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.bucket { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: var(--surface); position: relative; display: flex; flex-direction: column; min-width: 0; }
.bucket::before { content: ""; position: absolute; left: -1px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--bc); }
.bucket[data-bucket="core"] { --bc: var(--b-core); }
.bucket[data-bucket="attr"] { --bc: var(--b-attr); }
.bucket[data-bucket="use"] { --bc: var(--b-use); }
.bucket[data-bucket="gift"] { --bc: var(--b-gift); }
.bucket[data-bucket="style"] { --bc: var(--b-style); }
.bucket[data-bucket="long"] { --bc: var(--b-long); }
.bucket[data-bucket="none"] { --bc: var(--b-none); grid-column: 1 / -1; background: var(--line-soft); border-style: dashed; }
.bucket-head { display: flex; align-items: center; gap: 8px; }
.bucket-head h3 { font-size: 15px; margin: 0; font-weight: 600; }
.bucket-range { font-size: 12px; color: var(--muted); }
.bucket-count { margin-left: auto; font: 600 12px/1 var(--mono); min-width: 24px; height: 22px; padding: 0 7px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: var(--line-soft); color: var(--muted); }
.bucket.is-ok .bucket-count { background: var(--ok-wash); color: var(--ok); }
.bucket.is-over .bucket-count { background: var(--warn-wash); color: var(--warn); }
.bucket-hint { font-size: 13px; color: var(--muted); margin: 4px 0 10px; line-height: 1.5; }
.bucket-hint em { font-style: normal; font-family: var(--mono); font-size: 12px; color: var(--ink-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chips:empty { display: none; }
.input-wrap { position: relative; margin-top: auto; }
.tag-input { padding-right: 52px !important; font-size: 14px !important; }
.input-n { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 12px/1 var(--mono); color: var(--faint); pointer-events: none; }

.chip { display: inline-flex; align-items: stretch; max-width: 100%; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 14px; line-height: 1.3; }
.chip-main { display: inline-flex; align-items: center; gap: 6px; min-width: 0; border: 0; background: none; padding: 5px 4px 5px 11px; cursor: pointer; border-radius: 999px 0 0 999px; text-align: left; }
.chip-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-n { font: 11px/1 var(--mono); color: var(--faint); }
.chip-x { border: 0; background: none; padding: 0 10px 0 4px; cursor: pointer; color: var(--faint); font-size: 16px; border-radius: 0 999px 999px 0; }
.chip-x:hover { color: var(--err); }
.chip:hover { border-color: var(--bc, var(--accent)); }
.chip.is-err { border-color: var(--err); background: var(--err-wash); }
.chip.is-err .chip-n { color: var(--err); font-weight: 700; }
.chip.is-warn { border-color: #e7b766; background: var(--warn-wash); }
.chip.is-info { border-style: dashed; }
.chip.is-flash { animation: flash .9s ease; }
@keyframes flash { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 30% { box-shadow: 0 0 0 4px var(--accent-wash); border-color: var(--accent); } }

.chip-menu { position: absolute; z-index: 50; min-width: 180px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 32px rgba(23, 33, 58, .16); }
.chip-menu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: 0; background: none; border-radius: 5px; font-size: 14px; text-align: left; cursor: pointer; }
.chip-menu button:hover, .chip-menu button:focus-visible { background: var(--line-soft); outline: none; }
.chip-menu .is-danger { color: var(--err); }
.chip-menu hr { border: 0; border-top: 1px solid var(--line-soft); margin: 4px 0; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--b-none); flex: none; }

[data-bucket="core"].dot, .slot[data-bucket="core"] { background: var(--b-core); }
[data-bucket="attr"].dot, .slot[data-bucket="attr"] { background: var(--b-attr); }
[data-bucket="use"].dot, .slot[data-bucket="use"] { background: var(--b-use); }
[data-bucket="gift"].dot, .slot[data-bucket="gift"] { background: var(--b-gift); }
[data-bucket="style"].dot, .slot[data-bucket="style"] { background: var(--b-style); }
[data-bucket="long"].dot, .slot[data-bucket="long"] { background: var(--b-long); }
.slot[data-bucket="none"] { background: var(--b-none); }

/* ---------- 右侧结果面板 ---------- */
.panel { position: sticky; top: 80px; padding: 18px; }
.panel h2 { font-family: var(--serif); font-size: 18px; margin: 0 0 10px; font-weight: 600; }
.meter-head { display: flex; align-items: baseline; gap: 6px; }
.meter-head strong { font: 600 32px/1 var(--serif); }
.meter-head .of { color: var(--muted); font-size: 15px; }
.meter-head #m-left { margin-left: auto; font-size: 13px; color: var(--muted); }
.slots { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 3px; margin: 12px 0 4px; }
.slot { height: 14px; border-radius: 3px; background: var(--line-soft); border: 1px dashed var(--line); }
.slot.is-filled { border: 0; }
.slot.is-extra { outline: 2px solid var(--err); outline-offset: -2px; }
.slots-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--muted); margin: 8px 0 0; padding: 0; list-style: none; }
.slots-legend li { display: inline-flex; align-items: center; gap: 4px; }
.panel-sec { border-top: 1px solid var(--line-soft); margin-top: 16px; padding-top: 16px; }
.panel .checks { margin-top: 0; max-height: 46vh; overflow: auto; }
.out-row { display: flex; gap: 8px; margin-top: 8px; }
.out-row .btn { flex: 1; }
#out-tags { min-height: 92px; font-size: 13px; background: var(--line-soft); }
.privacy { font-size: 12px; color: var(--muted); margin: 12px 0 0; display: flex; gap: 6px; align-items: flex-start; }
.privacy svg { flex: none; width: 14px; height: 14px; margin-top: 2px; }

.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.checklist label { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.checklist input { margin-top: 4px; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }

/* ---------- AI 提示词 ---------- */
.ai-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.ai-grid .full { grid-column: 1 / -1; }
#prompt-out { min-height: 220px; background: var(--line-soft); }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.row-actions .note { font-size: 13px; color: var(--muted); }

/* ---------- 提示与手机底栏 ---------- */
.dock { display: none; }

@media (max-width: 920px) {
  .tool { grid-template-columns: minmax(0, 1fr); }
  .panel { position: static; }
  .panel .checks { max-height: none; }
  .dock {
    display: flex; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 40;
    align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 14px; border-radius: 10px; background: var(--ink); color: #fff;
    font-size: 14px; box-shadow: 0 8px 24px rgba(23, 33, 58, .25);
  }
  .dock:hover { text-decoration: none; }
  .dock.is-ready { background: var(--ok); }
  .dock span:last-child { opacity: .8; font-size: 13px; }
}
@media (max-width: 640px) {
  .buckets, .ai-grid { grid-template-columns: minmax(0, 1fr); }
  .step { padding: 16px; }
  .step-head .toolbar { margin-left: 0; width: 100%; }
}

/* ---------- 亚马逊标题检查器 ---------- */
.fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.fields .field input { font-size: 14px; }
.switch { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; margin-top: 12px; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 36px; height: 20px; border-radius: 999px; background: var(--line); position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .15s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch .hint { color: var(--muted); }
.field + .field, .checks + .field, .overflow + .field { margin-top: 18px; }
.overflow { margin: 8px 0 0; padding: 8px 12px; background: var(--err-wash); border-radius: var(--radius); font-size: 14px; color: var(--ink-soft); word-break: break-word; }
.overflow del { color: var(--err); text-decoration-thickness: 1.5px; background: rgba(180, 35, 24, .08); }
.overflow::before { content: attr(data-label); display: block; font-size: 12px; color: var(--err); font-weight: 600; margin-bottom: 2px; }
.btn-sm { min-height: 28px; padding: 3px 10px; font-size: 13px; }

.meters { display: grid; gap: 12px; }
.meter-row { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 4px 8px; font-size: 14px; }
.meter-row strong { font: 600 22px/1 var(--serif); }
.meter-row .of { color: var(--muted); }
.meter-row .lbl { grid-column: 1 / -1; font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .04em; }
.meter-row .rest { color: var(--muted); font-size: 13px; text-align: right; }
.bar { grid-column: 1 / -1; height: 6px; background: var(--line-soft); border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .15s; }
.bar span.is-near { background: var(--warn); }
.bar span.is-err { background: var(--err); }
body.is-media .hl-only { display: none; }

.preview { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.preview .ph { width: 76px; height: 76px; border-radius: 6px; background: linear-gradient(135deg, var(--line-soft), var(--line)); }
.preview .pv-title { font-size: 14px; line-height: 1.4; color: var(--ink); margin: 0; word-break: break-word; }
.preview .pv-hl { font-size: 12.5px; line-height: 1.4; color: var(--muted); margin: 4px 0 0; word-break: break-word; }
.preview .pv-meta { font-size: 12px; color: var(--faint); margin: 6px 0 0; letter-spacing: .02em; }
.preview-note { font-size: 12px; color: var(--muted); margin: 6px 0 0; }

.segs { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 8px; }
.seg { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; cursor: pointer; text-align: left; }
.seg-to { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.seg-text { min-width: 0; overflow-wrap: anywhere; }
.seg-n { font: 11px/1 var(--mono); color: var(--faint); }
.seg.is-title { border-color: #b8c7f0; }
.seg.is-title .seg-to { background: var(--accent); color: #fff; }
.seg.is-hl { border-color: #a9d6d8; }
.seg.is-hl .seg-to { background: var(--b-attr); color: #fff; }
.seg.is-drop { background: var(--line-soft); color: var(--faint); }
.seg.is-drop .seg-to { background: var(--line); color: var(--muted); }
.seg.is-drop .seg-text { text-decoration: line-through; }
.split-foot { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
#split-sum { font: 13px/1.4 var(--mono); color: var(--muted); }
#split-sum.is-err { color: var(--err); font-weight: 600; }

.batch-wrap { margin-top: 12px; }
#batch-note { font-size: 14px; color: var(--ink-soft); margin: 10px 0 0; }
.batch-table { min-width: 0; table-layout: fixed; }
.batch-table th:nth-child(1), .batch-table td:nth-child(1) { width: 40px; }
.batch-table th:nth-child(3), .batch-table td:nth-child(3) { width: 56px; }
.batch-table th:nth-child(4), .batch-table td:nth-child(4) { width: 132px; }
.batch-table td.num { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.batch-table td.tt { word-break: break-word; }
.batch-table .why { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.batch-table td:last-child { white-space: nowrap; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; margin-right: 6px; }
tr.is-ok .badge { background: var(--ok-wash); color: var(--ok); }
tr.is-warn .badge { background: var(--warn-wash); color: var(--warn); }
tr.is-err .badge { background: var(--err-wash); color: var(--err); }
tr.is-err td.num:nth-child(3) { color: var(--err); font-weight: 600; }
.batch-scroll { max-height: 480px; overflow: auto; }

.prompts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.prompts textarea { min-height: 240px; background: var(--line-soft); }

@media (max-width: 920px) {
  .prompts { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .fields { grid-template-columns: minmax(0, 1fr); }
  .batch-table th:nth-child(4), .batch-table td:nth-child(4) { width: 92px; }
  .batch-table td:last-child { white-space: normal; }
  .batch-table td:last-child .btn { margin-top: 4px; }
}
@media (max-width: 420px) {
  .dock span:last-child { display: none; }
}
@media (max-width: 640px) {
  .batch-table th:nth-child(1), .batch-table td:nth-child(1) { display: none; }
}

@media (max-width: 920px) {
  .toast { bottom: 76px; }
}
