/* 一块冰图片工具箱 - 自定义样式（深色主题，Tailwind 之外的补充） */
:root {
  --brand: #fbbf24;
  --brand-dark: #f59e0b;
  --bg: #0a0a0b;
  --surface: #15151a;
  --surface-2: #1c1c21;
  --line: rgba(255, 255, 255, .09);
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --dim: #71717a;
}
html { background: var(--bg); color-scheme: dark; }
body { font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); }
::selection { background: rgba(251, 191, 36, .85); color: #1a1105; }

/* 滚动条 */
* { scrollbar-color: #3f3f46 transparent; scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #33333a; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #4a4a55; }

/* 主按钮 */
.btn-primary { display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  background: linear-gradient(135deg, #fbbf24, #f97316); color: #1a1105; font-weight: 700;
  padding: .8rem 2.2rem; border-radius: .9rem; box-shadow: 0 6px 18px -6px rgba(251, 146, 60, .55); transition: .18s; cursor: pointer; }
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 12px 26px -8px rgba(251, 146, 60, .7); }
.btn-primary:disabled { opacity: .38; cursor: not-allowed; box-shadow: none; }
.btn-ghost { display: inline-flex; align-items: center; gap: .4rem; color: #d4d4d8; padding: .75rem 1.2rem;
  border-radius: .9rem; border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .04); transition: .15s; cursor: pointer; }
.btn-ghost:hover { border-color: rgba(251, 191, 36, .55); color: var(--brand); background: rgba(251, 191, 36, .08); }
.btn-sm { padding: .45rem 1rem !important; border-radius: .7rem !important; font-size: .875rem; }

/* 上传区 */
.dropzone { border: 2px dashed rgba(251, 191, 36, .32); background: rgba(251, 191, 36, .035); border-radius: 1.2rem; transition: .2s; }
.dropzone:hover { border-color: rgba(251, 191, 36, .5); background: rgba(251, 191, 36, .055); }
.dropzone.dragover { border-color: var(--brand); background: rgba(251, 191, 36, .1); transform: scale(1.008); }

/* 队列缩略图 */
.thumb-box { position: relative; overflow: hidden; background: rgba(255, 255, 255, .06); flex-shrink: 0; }
.thumb-box img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb-box .ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: rgba(251, 191, 36, .55); }

/* 结果卡片 */
.result-card { display: flex; align-items: center; gap: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; padding: 1rem; }

/* 滑块 */
input[type="range"] { accent-color: var(--brand); width: 100%; }
input[type="color"] { height: 2.4rem; width: 3.2rem; border: 1px solid rgba(255, 255, 255, .14); border-radius: .5rem; padding: 2px; background: var(--surface-2); cursor: pointer; }
input[type="number"], input[type="text"], textarea {
  background: var(--surface-2); border: 1px solid rgba(255, 255, 255, .12); border-radius: .6rem;
  padding: .5rem .75rem; color: var(--text); }
input[type="number"]::placeholder, input[type="text"]::placeholder, textarea::placeholder { color: #6b6b75; }
input[type="number"]:focus, input[type="text"]:focus, textarea:focus {
  outline: 2px solid rgba(251, 191, 36, .35); border-color: rgba(251, 191, 36, .7); }
select { background: var(--surface-2); border: 1px solid rgba(255, 255, 255, .12); border-radius: .6rem;
  padding: .5rem .75rem; color: var(--text); cursor: pointer; }
select:focus { outline: 2px solid rgba(251, 191, 36, .35); border-color: rgba(251, 191, 36, .7); }
select option { background: var(--surface-2); color: var(--text); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); }

/* toast */
#toast-box { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: .5rem; align-items: center; }
.toast { background: #26262c; color: #f4f4f5; padding: .7rem 1.3rem; border-radius: .8rem; font-size: .9rem;
  border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 8px 24px rgba(0, 0, 0, .6); animation: toastIn .25s ease; max-width: 90vw; }
.toast.err { background: #7f1d1d; border-color: rgba(248, 113, 113, .45); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* 加载 */
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 首页工具卡片 */
.tool-card { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.tool-card:hover { transform: translateY(-3px); box-shadow: 0 16px 36px -12px rgba(251, 146, 60, .45); border-color: rgba(251, 191, 36, .5); }

/* 裁剪交互区 */
#crop-stage { position: relative; display: inline-block; touch-action: none; user-select: none; -webkit-user-select: none;
  border-radius: .75rem; overflow: hidden; cursor: crosshair; line-height: 0;
  background: repeating-conic-gradient(#17171c 0 25%, #20202a 0 50%) 0 0 / 16px 16px; }
#crop-stage img { max-width: 100%; max-height: 62vh; display: block; }
#crop-box { position: absolute; border: 2px solid var(--brand); box-shadow: 0 0 0 9999px rgba(0, 0, 0, .68); cursor: move; }
.crop-handle { position: absolute; width: 14px; height: 14px; background: #1c1c21; border: 2px solid var(--brand); border-radius: 4px; }
.crop-handle:hover { background: var(--brand); }

/* 选项面板标题 */
.opt-label { font-size: .875rem; font-weight: 600; color: #e4e4e7; margin-bottom: .5rem; display: block; }
.opt-hint { font-size: .75rem; color: var(--dim); margin-top: .35rem; line-height: 1.5; }

/* 证件照底色选择 */
.bg-swatch { width: 2.4rem; height: 2.4rem; border-radius: .6rem; border: 1px solid rgba(255, 255, 255, .22);
  cursor: pointer; transition: transform .15s, box-shadow .15s; }
.bg-swatch:hover { transform: translateY(-1px); box-shadow: 0 6px 14px -6px rgba(0, 0, 0, .7); }
