/* 图片工具箱 - 通用样式（所有页面共享）
   各页面通过 :root 覆盖 --primary 等主题变量 */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --primary: #4f6df5; --primary-dark: #3b56d4;
  --bg: #f0f2f8; --panel: #fff; --text: #1a1f36; --sub: #6b7280;
  --border: #e5e7eb; --radius: 14px; --shadow: 0 2px 10px rgba(0,0,0,0.06);
}
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; padding-bottom: 40px; }

/* 顶栏 */
.topbar { background: var(--panel); padding: 14px 16px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow); position: sticky; top: 0; z-index: 10; }
.topbar a { color: var(--primary); text-decoration: none; font-size: 15px; font-weight: 600; }
.topbar h1 { font-size: 17px; font-weight: 700; flex: 1; }

/* 布局 */
.wrap { max-width: 860px; margin: 0 auto; padding: 16px; }
.panel { background: var(--panel); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.panel h3 { font-size: 15px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.panel h3 .hint { font-size: 12px; font-weight: 400; color: var(--sub); }
.hidden { display: none !important; }

/* 按钮 */
.btn { padding: 11px; border: none; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; transition: .15s; background: var(--primary); color: #fff; }
.btn:active { transform: scale(0.98); }
.btn.ghost { background: #f3f4f6; color: var(--text); }
.btn.outline { background: #fff; border: 1.5px solid var(--primary); color: var(--primary); }
.btn.small { padding: 7px 14px; flex: none; font-size: 13px; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

/* 分段控件 */
.seg { display: flex; flex-wrap: wrap; background: #f3f4f6; border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { flex: 1; min-width: 60px; padding: 8px 4px; border: none; background: none; border-radius: 7px; font-size: 13px; cursor: pointer; color: var(--sub); font-weight: 600; transition: .15s; }
.seg button.active { background: var(--panel); color: var(--primary); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

/* 表单字段 */
.field { margin-bottom: 12px; }
.field label { display: flex; justify-content: space-between; font-size: 13px; color: var(--sub); margin-bottom: 5px; }
.field label .val { color: var(--text); font-weight: 600; }
input[type="text"], input[type="number"], textarea, select { width: 100%; padding: 9px 12px; border: 1.5px solid var(--border); border-radius: 9px; font-size: 14px; font-family: inherit; outline: none; transition: .15s; }
input[type="text"]:focus, input[type="number"]:focus, textarea:focus, select:focus { border-color: var(--primary); }
textarea { resize: vertical; min-height: 60px; }
input[type="range"] { width: 100%; accent-color: var(--primary); height: 24px; cursor: pointer; }

/* 开关 */
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 4px 0; }
.toggle-row span { font-size: 13px; color: var(--text); }
.sw { width: 42px; height: 24px; background: #d1d5db; border-radius: 12px; position: relative; cursor: pointer; transition: .2s; flex-shrink: 0; }
.sw.on { background: var(--primary); }
.sw::after { content: ''; position: absolute; width: 18px; height: 18px; background: #fff; border-radius: 50%; top: 3px; left: 3px; transition: .2s; }
.sw.on::after { left: 21px; }

/* 上传区 */
.upload-area { border: 2px dashed var(--border); border-radius: var(--radius); padding: 36px 16px; text-align: center; color: var(--sub); cursor: pointer; transition: .2s; }
.upload-area:hover { border-color: var(--primary); }
.upload-area svg { width: 40px; height: 40px; fill: var(--primary); margin-bottom: 8px; }

/* Toast 提示 */
.toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(20px); background: rgba(0,0,0,0.85); color: #fff; padding: 10px 22px; border-radius: 22px; font-size: 14px; opacity: 0; transition: .3s; z-index: 100; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 反馈按钮 + 弹窗 */
.fab-fb { position: fixed; right: 18px; bottom: 22px; z-index: 80; width: 52px; height: 52px; border-radius: 50%; border: none; background: linear-gradient(135deg,#6366f1,#8b5cf6); color: #fff; box-shadow: 0 8px 24px rgba(99,102,241,0.35); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform .2s; }
.fab-fb svg { width: 24px; height: 24px; fill: #fff; }
.fab-fb:active { transform: scale(0.92); }
.fb-mask { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 90; display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; pointer-events: none; transition: opacity .2s; }
.fb-mask.show { opacity: 1; pointer-events: auto; }
.fb-card { width: 100%; max-width: 320px; background: #fff; border-radius: 18px; padding: 24px 22px; transform: translateY(14px) scale(.98); transition: transform .2s; box-shadow: 0 20px 60px rgba(0,0,0,0.2); text-align: center; }
.fb-mask.show .fb-card { transform: translateY(0) scale(1); }
.fb-card h2 { font-size: 17px; font-weight: 800; margin-bottom: 12px; color: #1a1f36; }
.fb-tip { font-size: 13px; color: #6b7280; line-height: 1.6; margin-bottom: 16px; }
.fb-mail { display: inline-flex; align-items: center; gap: 7px; padding: 12px 20px; background: linear-gradient(135deg,#6366f1,#8b5cf6); color: #fff; text-decoration: none; border-radius: 12px; font-size: 15px; font-weight: 700; transition: transform .15s; }
.fb-mail svg { width: 16px; height: 16px; fill: #fff; flex-shrink: 0; }
.fb-mail:active { transform: scale(0.96); }

/* 大图长按保存浮层（手机端绕开下载管理器） */
.big-img-mask { position: fixed; inset: 0; background: rgba(0,0,0,0.88); z-index: 95; display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; pointer-events: none; transition: opacity .2s; }
.big-img-mask.show { opacity: 1; pointer-events: auto; }
.big-img-card { max-width: 92vw; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.big-img-card img { max-width: 100%; max-height: 70vh; border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,0.5); -webkit-touch-callout: default; user-select: none; }
.big-img-tip { color: #fff; font-size: 14px; opacity: .9; text-align: center; }
.big-img-actions { display: flex; justify-content: center; }
.big-img-actions .btn { min-width: 180px; }
.big-img-card .btn { min-width: 130px; }
