/* 工具区 + 前后对比播放器(Claude 2026-10-07 UI 改版)。依赖 style.css 的变量;只在首页、案例页加载。
   DOM 由 index.html 与 app.js 共同生成:#queue 行的子元素顺序(名/进度/状态/移除)被前端测试钉住,只能用 grid 摆位。 */
.tool { position: relative; padding: clamp(16px, 2vw, 22px); border-radius: 22px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.tool-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 2px 14px; }
.tool-title { margin: 0; font-size: 1.04rem; font-weight: 640; letter-spacing: -.012em; }
.tag { padding: 3px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-ink); font-family: var(--mono); font-size: .74rem; white-space: nowrap; }

/* 上传区:空状态是大块可点区域;有文件后收成一行(:has 不支持的浏览器保持大块,不影响使用) */
.drop {
  display: grid; justify-items: center; gap: 2px; padding: 30px 18px 28px; text-align: center; cursor: pointer;
  border: 1.5px dashed var(--line-2); border-radius: 16px; background: var(--paper); transition: border-color .18s, background-color .18s;
}
.drop:hover, .drop.dragover { border-color: var(--accent); background: var(--accent-soft); }
.drop:focus-visible { outline-offset: 3px; }
.drop[aria-disabled="true"] { cursor: progress; opacity: .65; }
.drop input { display: none; }
.drop p { margin: 0; }
.drop-icon {
  display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 12px; border-radius: 15px; color: #fff;
  background: var(--accent); box-shadow: 0 10px 20px -10px rgba(10, 86, 66, .8); transition: transform .2s;
}
.drop:hover .drop-icon, .drop.dragover .drop-icon { transform: translateY(-2px); }
.drop-icon svg { width: 24px; height: 24px; }
.drop-title { font-weight: 640; font-size: 1.1rem; letter-spacing: -.012em; }
.drop-sub { color: var(--ink-3); font-size: .92rem; }
.formats { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin: 10px 4px 0; font-family: var(--mono); font-size: .74rem; color: var(--ink-3); }
.facts { list-style: none; display: grid; gap: 10px; margin: 16px 0 0; padding: 16px 2px 2px; border-top: 1px solid var(--line); font-size: .9rem; color: var(--ink-2); }
.facts li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; }
.facts li::before { content: ""; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; background: var(--accent-soft) var(--i-check) center / 11px no-repeat; }
.facts .fact-soon::before { background: var(--paper-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234b5058' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M12 7.5V12l3 2'/%3E%3C/svg%3E") center / 12px no-repeat; }
.facts .fact-privacy::before { background: var(--paper-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234b5058' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='9.5' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E") center / 11px no-repeat; }
.tool:has(#queue li) .drop { grid-template-columns: auto minmax(0, 1fr); justify-items: start; column-gap: 14px; padding: 12px 14px; text-align: left; }
.tool:has(#queue li) .drop-icon { grid-row: span 2; width: 38px; height: 38px; margin: 0; border-radius: 11px; }
.tool:has(#queue li) .drop-icon svg { width: 18px; height: 18px; }
.tool:has(#queue li) .drop-title { font-size: .98rem; }
.tool:has(#queue li) .drop-sub { font-size: .84rem; }
.tool:has(#queue li) .facts, .tool:has(#queue li) .formats { display: none; }

/* 文件行 */
#queue { list-style: none; display: grid; gap: 8px; margin: 12px 0 0; padding: 0; }
#queue li {
  display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; grid-template-areas: "icon name rm" "icon st rm" "bar bar bar";
  column-gap: 12px; align-items: center; padding: 11px 10px 11px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper);
}
#queue li::before {
  content: ""; grid-area: icon; width: 38px; height: 38px; border-radius: 11px; background: var(--card); border: 1px solid var(--line);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234b5058' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 12h2M8 8v8M12 5v14M16 9v6M20 11v2'/%3E%3C/svg%3E");
  background-position: center; background-size: 18px; background-repeat: no-repeat;
}
#queue li.is-ready::before { background-color: var(--accent-soft); border-color: var(--accent-line); }
#queue .row-name { grid-area: name; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; font-size: .96rem; }
#queue .row-status { grid-area: st; font-family: var(--mono); font-size: .76rem; color: var(--ink-3); }
#queue li.is-ready .row-status { color: var(--accent-ink); }
#queue progress {
  grid-area: bar; width: 100%; height: 4px; margin-top: 10px; border: 0; border-radius: 4px; overflow: hidden;
  -webkit-appearance: none; appearance: none; background: var(--line); color: var(--accent);
}
#queue progress::-webkit-progress-bar { background: var(--line); border-radius: 4px; }
#queue progress::-webkit-progress-value { background: var(--accent); border-radius: 4px; transition: width .3s; }
#queue progress::-moz-progress-bar { background: var(--accent); border-radius: 4px; }
#queue li.is-ready progress { display: none; }
/* 处理进度条(10/23,app.js 动态插在 #status 后面):样式与上传进度条一致 */
#job-progress { display: block; width: 100%; height: 6px; margin: 10px 0 0; border: 0; border-radius: 4px; overflow: hidden; background: var(--line); color: var(--accent); -webkit-appearance: none; appearance: none; }
#job-progress[hidden] { display: none; }
#job-progress::-webkit-progress-bar { background: var(--line); border-radius: 4px; }
#job-progress::-webkit-progress-value { background: var(--accent); border-radius: 4px; transition: width .6s; }
#job-progress::-moz-progress-bar { background: var(--accent); border-radius: 4px; }
#queue .row-remove { grid-area: rm; min-height: 34px; padding: 5px 10px; border-radius: 9px; background: transparent; border-color: transparent; color: var(--ink-3); font-size: .84rem; box-shadow: none; }
#queue .row-remove:hover:not(:disabled) { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
#queue .row-remove:disabled { visibility: hidden; }
#queue li.failed { border-color: #e7beb5; background: var(--danger-soft); }
#queue li.failed .row-status { color: var(--danger); }
#queue li.failed progress { display: none; }

/* 报价与操作 */
#actions { display: grid; gap: 14px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
#quoted { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 2px 16px; margin: 0; padding: 14px 16px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); }
#quoted:empty { display: none; }
#quoted[data-tier="free"] { background: var(--accent-soft); border-color: var(--accent-line); }
#quoted .q-main { grid-row: span 2; font-size: 1.75rem; font-weight: 660; letter-spacing: -.035em; line-height: 1; font-variant-numeric: tabular-nums; }
#quoted[data-tier="free"] .q-main { color: var(--accent-ink); }
#quoted .q-meta { font-family: var(--mono); font-size: .78rem; color: var(--ink-2); }
#quoted .q-note { font-size: .88rem; color: var(--ink-2); line-height: 1.45; }
#free-box button, #actions > button { width: 100%; }
#clean { min-height: 52px; font-size: 1.04rem; }
#paid-box { display: grid; gap: 14px; }
.field label { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-weight: 600; font-size: .92rem; }
#start-label { font-family: var(--mono); font-weight: 500; color: var(--accent-ink); }
.field select { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--card); color: var(--ink); font: inherit; font-size: .95rem; }
input[type="range"] { width: 100%; height: 28px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--line); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%; background: var(--card); border: 2px solid var(--accent); box-shadow: 0 2px 6px rgba(23, 25, 28, .18); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 6px; background: var(--paper-2); }
input[type="range"]::-moz-range-progress { height: 6px; border-radius: 6px; background: var(--accent); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--card); border: 2px solid var(--accent); }
.paid-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
/* A3:付款开放时假门按钮隐藏,试听按钮占满一行;PayPal 按钮(iframe)放在下面,宽度跟工具列走 */
.paid-buttons:has(#pay[hidden]) { grid-template-columns: minmax(0, 1fr); }
.paypal-box { min-height: 44px; position: relative; z-index: 0; }
#paid-box .hint { margin: 0; }
.tool .hint { margin: 10px 2px 0; font-size: .86rem; color: var(--ink-3); }
.tool > .hint a { font-weight: 600; }
.tool > .hint button { min-height: 36px; margin-left: 8px; padding: 6px 12px; font-size: .86rem; }

/* 状态行:处理中(app.js 置 data-busy=1)带转圈 */
.status { display: flex; align-items: center; gap: 10px; margin: 14px 2px 0; font-size: .94rem; color: var(--ink-2); }
.status:empty { display: none; }
.status[data-busy="1"]::before { content: ""; flex: none; width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--accent-line); border-top-color: var(--accent); animation: ae-spin .8s linear infinite; }
@keyframes ae-spin { to { transform: rotate(360deg); } }
.tool .error { display: block; margin: 12px 0 0; }

/* 结果:工具列较窄,处理后/原始上下排 */
#result, #ab { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
#result h2, #ab h2 { font-size: 1.16rem; letter-spacing: -.015em; margin: 0 0 6px; }
#result > p { font-size: .92rem; color: var(--ink-2); margin-bottom: 14px; }
.compare { display: grid; gap: 14px; }
.compare h3 { margin: 0 0 6px; font-family: var(--mono); font-size: .74rem; font-weight: 500; color: var(--ink-3); }
video, audio { display: block; width: 100%; }
video { aspect-ratio: 16 / 9; border-radius: 12px; background: #1d1f22; }
video.audio-only { aspect-ratio: auto; height: 54px; background: transparent; border-radius: 27px; }
#download { width: 100%; margin-top: 12px; }
/* A3 批量付费单结果:一行一个文件,成功给下载按钮,失败写原因 */
.files-out { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.files-out li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.files-out .fo-name { min-width: 0; overflow-wrap: anywhere; font-size: .92rem; }
.files-out .button { flex: none; }
.files-out li.failed { border-color: var(--danger-soft); background: var(--danger-soft); }
.files-out .fo-error { flex: none; max-width: 55%; font-size: .84rem; color: var(--danger); text-align: right; }

/* 前后对比播放器:同一时间点切换。未增强(无 JS)时显示原生播放器 .ab-native */
.ab-player { display: grid; gap: 12px; }
.ab-lanes { position: relative; display: grid; gap: 6px; padding: 8px; border-radius: 16px; background: var(--paper); border: 1px solid var(--line); }
.ab-on .ab-lanes { cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; }
.ab-lane { position: relative; height: 64px; border-radius: 10px; overflow: hidden; transition: opacity .2s; }
.ab-on .ab-lane { opacity: .4; }
.ab-on .ab-lane.is-active { opacity: 1; }
.ab-lane::after { content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--p, 0) * 100%); background: rgba(23, 25, 28, .05); pointer-events: none; }
.ab-wave { display: block; width: 100%; height: 100%; }
.ab-wave svg { display: block; width: 100%; height: 100%; }
.ab-wave .v { fill: #9a9184; } .ab-wave .n { fill: var(--clay); } .ab-wave .c { fill: var(--accent); }
.ab-lane-label { position: absolute; z-index: 1; top: 6px; left: 8px; padding: 1px 7px; border-radius: 6px; background: rgba(255, 253, 248, .9); font-family: var(--mono); font-size: .7rem; color: var(--ink-2); }
.ab-lane[data-lane="after"].is-active .ab-lane-label { color: var(--accent-ink); }
.ab-playhead { position: absolute; z-index: 2; top: 4px; bottom: 4px; left: calc(8px + var(--p, 0) * (100% - 16px)); width: 2px; margin-left: -1px; border-radius: 2px; background: var(--ink); opacity: 0; pointer-events: none; }
.ab-on .ab-playhead { opacity: 1; }
.ab-wave-empty .ab-wave { background: repeating-linear-gradient(90deg, var(--line) 0 2px, transparent 2px 6px) center / 100% 2px no-repeat; }
.ab-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.ab-play { width: 50px; min-height: 50px; padding: 0; border-radius: 50%; background: var(--ink); color: #fff; }
.ab-play:hover:not(:disabled) { background: #000; }
.ab-play svg { width: 18px; height: 18px; }
.ab-play .i-pause, .ab-play[aria-pressed="true"] .i-play { display: none; }
.ab-play[aria-pressed="true"] .i-pause { display: block; }
.ab-switch { display: inline-flex; padding: 4px; border-radius: 13px; background: var(--paper-2); }
.ab-switch button { min-height: 40px; padding: 6px 18px; border-radius: 10px; background: transparent; color: var(--ink-2); box-shadow: none; }
.ab-switch button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(23, 25, 28, .12), 0 0 0 1px var(--line); }
.ab-switch button[data-pick="after"][aria-pressed="true"] { color: var(--accent-ink); }
.ab-time { margin-left: auto; font-family: var(--mono); font-size: .84rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ab-native { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.ab-native figure { margin: 0; }
.ab-native figcaption, .ab-native h3 { margin: 0 0 6px; font-size: .86rem; font-weight: 600; }
.ab-on .ab-native { display: none; }
.sample-card { padding: clamp(12px, 2vw, 22px); border-radius: 22px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.sample-card .ab-lane { height: clamp(58px, 7vw, 96px); }
/* 效果反馈(10/24,app.js askFeedback):两组小按钮,按下的那颗绿底 */
.feedback { margin-top: 16px; padding: 14px 16px; border-radius: 16px; background: var(--paper-2); }
.fb-q { margin: 0 0 8px; font-size: .9rem; font-weight: 600; }
.fb-q + .fb-row + .fb-q { margin-top: 14px; }
.fb-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 36px; padding: 6px 13px; border-radius: 999px; font-size: .86rem; font-weight: 500; background: var(--card); color: var(--ink); border: 1px solid var(--line-2); box-shadow: none; }
.chip:hover:not(:disabled) { border-color: var(--ink-3); }
.chip[aria-pressed="true"], .chip[aria-pressed="true"]:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); color: #fff; }
.fb-thanks { margin: 12px 0 0; }
/* 实测页:对比播放器下方单独放原声 */
.plain-audio { margin: 14px 0 0; }
.plain-audio figcaption { margin: 0 0 6px; font-size: .86rem; font-weight: 600; }
.plain-audio audio { width: 100%; }
@media (max-width: 640px) {
  .paid-buttons { grid-template-columns: minmax(0, 1fr); }
  .ab-lane { height: 54px; }
  .lbl-more { display: none; }     /* 窄屏标签只留 Before/After,不挡波形 */
  .ab-time { margin-left: 0; }
}
