/* 图床系统 - 结构底样式（v1.3 起：四套布局主题在 themes.css 里覆盖这套底子，
   data-layout 永远是 minimal / apple / sakura / midnight 之一，不再直接用这套橙色外观）。
   移动端优先，桌面端居中容器 max-width 960px。 */
:root {
  --orange: #ff6b1a;
  --orange-soft: #ff8c42;
  --orange-light: #fff1e6;
  --ink: #1a1a1a;
  --paper: #fffaf3;
  --white: #ffffff;
  --muted: #7a6a5f;
  --green: #22a06b;
  --red: #e5484d;
  --radius: 16px;
  --shadow: 5px 5px 0 var(--ink);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color: var(--ink);
  /* touch-action: manipulation 禁掉双击缩放（保留双指捏合缩放），点按钮也不再有 300ms 延迟 */
  touch-action: manipulation;
  background-color: var(--paper);
  /* 半调圆点背景 */
  background-image: radial-gradient(#ffd9b8 1.6px, transparent 1.7px);
  background-size: 22px 22px;
  min-height: 100vh;
}
a { color: var(--orange); }
.wrap { max-width: 960px; margin: 0 auto; padding: 20px 16px 60px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.logo { font-size: 26px; font-weight: 900; letter-spacing: 1px; }
.logo span { color: var(--orange); }
.badge {
  background: var(--orange); color: #fff; font-size: 12px; font-weight: 700;
  padding: 5px 12px; border-radius: 999px; border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}
.hero {
  background: var(--orange); color: #fff; border: 3px solid var(--ink);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 28px 22px; margin-bottom: 20px; position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -30px; top: -30px; width: 140px; height: 140px;
  border-radius: 50%; background: radial-gradient(#fff 2px, transparent 2.5px);
  background-size: 14px 14px; opacity: .35;
}
.hero h1 { font-size: 30px; line-height: 1.25; margin-bottom: 8px; }
.hero p { opacity: .95; font-size: 15px; }
.card {
  background: var(--white); border: 3px solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px;
}
.card h2 { font-size: 18px; margin-bottom: 12px; }
.dropzone {
  border: 3px dashed var(--orange); border-radius: 12px; background: var(--orange-light);
  padding: 34px 16px; text-align: center; cursor: pointer; transition: .15s;
}
.dropzone:hover, .dropzone.over { background: #ffe3c7; transform: translateY(-2px); }
.dropzone .big { font-size: 40px; margin-bottom: 6px; }
.dropzone p { color: var(--muted); font-size: 14px; margin-top: 6px; }
.btn {
  display: inline-block; background: var(--orange); color: #fff; border: 3px solid var(--ink);
  border-radius: 999px; padding: 10px 22px; font-size: 15px; font-weight: 700; cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink); text-decoration: none;
}
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn.ghost { background: #fff; color: var(--ink); }
.btn.small { padding: 6px 14px; font-size: 13px; }
.btn.danger { background: var(--red); }
.input, select.input {
  /* 16px：iOS 上输入框小于 16px 时点一下会自动放大整个页面，16px 起不触发 */
  width: 100%; padding: 11px 12px; font-size: 16px; border: 2px solid var(--ink);
  border-radius: 10px; background: #fff; outline: none;
}
.input:focus { border-color: var(--orange); }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row .input { flex: 1; min-width: 0; }
.progress { height: 12px; background: #f0e6db; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; margin-top: 12px; display: none; }
.progress i { display: block; height: 100%; width: 0; background: var(--orange); }
/* v1.3.2 上传记录改列表模式：一行一条，缩略图在左、删除键在右 */
.result { display: block; margin-top: 16px; }
.item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 2px solid var(--ink); border-radius: 12px; overflow: hidden; background: #fff; }
.item + .item { margin-top: 10px; }
.item img { width: 64px; height: 64px; flex: none; object-fit: cover; display: block; background: #f5efe8; border-radius: 8px; }
.item .body { flex: 1; min-width: 0; }
.item .meta { padding: 0; margin-bottom: 6px; font-size: 13px; color: var(--muted); word-break: break-all; }
.item .links { padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.item .del { flex: none; border: none; background: none; color: #d93025; font-size: 13px; cursor: pointer; padding: 6px 4px; }
.item .del:hover { text-decoration: underline; }
.chip {
  border: 2px solid var(--ink); background: var(--orange-light); border-radius: 999px;
  padding: 4px 10px; font-size: 12px; cursor: pointer; font-weight: 700; color: var(--ink);
}
.chip:hover { background: var(--orange); color: #fff; }
.tip { font-size: 13px; color: var(--muted); line-height: 1.7; }
.tip b { color: var(--ink); }
/* v1.3 提示三档：hint=输入框下一行小灰字；details=折叠点开看；Toast=操作结果飘一下 */
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
details.tip { cursor: pointer; }
details.tip summary { font-weight: 600; color: var(--ink); }
/* v1.1 后台统计卡片 */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--white); border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; text-align: center; }
.stat-num { font-size: 26px; font-weight: 900; color: var(--orange); }
.stat-label { font-size: 13px; color: var(--muted); margin-top: 4px; }
.batch-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; padding: 10px 12px; background: var(--orange-light); border: 2px solid var(--ink); border-radius: 10px; font-size: 14px; }
.batch-bar label { font-weight: 700; cursor: pointer; }
.sel { width: 18px; height: 18px; accent-color: var(--orange); flex-shrink: 0; margin-top: 18px; }
.admin-list { display: flex; flex-direction: column; gap: 12px; }
.admin-item { display: flex; gap: 12px; align-items: flex-start; border: 2px solid var(--ink); border-radius: 12px; padding: 12px; background: #fff; max-width: 100%; min-width: 0; }
.admin-item img { width: 72px; height: 54px; object-fit: cover; border-radius: 8px; border: 2px solid var(--ink); flex-shrink: 0; display: block; }
.admin-info { flex: 1; min-width: 0; }
.admin-name { font-weight: 700; font-size: 14px; word-break: break-all; }
.admin-url { color: #999; font-size: 12px; word-break: break-all; margin-top: 4px; }
.admin-meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.admin-actions { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.admin-actions .btn { white-space: nowrap; }
.pager { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; align-items: center; }
@media (max-width: 640px) {
  .wrap { padding: 16px 12px 50px; overflow-x: hidden; }
  .card { padding: 16px 14px; }
  .topbar { flex-wrap: wrap; gap: 8px; }
  .logo { font-size: 22px; }
  .admin-item { flex-wrap: wrap; }
  .admin-item img { width: 64px; height: 48px; }
  .admin-actions { flex-direction: row; width: 100%; }
  .admin-actions .btn { flex: 1; text-align: center; }
  .btn.small { padding: 6px 10px; font-size: 12px; white-space: nowrap; }
  .pager { justify-content: center; }
}
.watermark {
  position: fixed; inset: 0; pointer-events: none; z-index: 9999; opacity: .06;
  display: flex; flex-wrap: wrap; align-content: space-around; justify-content: space-around;
  font-size: 22px; font-weight: 900; transform: rotate(-18deg); white-space: nowrap;
}
.footer { text-align: center; color: var(--muted); font-size: 13px; margin-top: 30px; }

/* ===== v1.2：标签页 / Toast / 弹窗 / 图表 / 健康检查 / 表单 ===== */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.tab {
  background: var(--white); color: var(--ink); border: 3px solid var(--ink); border-radius: 999px;
  padding: 8px 18px; font-size: 14px; font-weight: 700; cursor: pointer; box-shadow: 3px 3px 0 var(--ink);
}
.tab.active { background: var(--orange); color: #fff; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(80px);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-size: 14px;
  font-weight: 700; box-shadow: 0 6px 20px rgba(0,0,0,.25); opacity: 0; transition: .25s; z-index: 10000;
  max-width: 90vw; text-align: center; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--red); }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 9000; padding: 16px; }
.modal-card { background: var(--white); border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; max-width: 560px; width: 100%; max-height: 88vh; overflow: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.chart { display: flex; gap: 8px; align-items: flex-end; height: 130px; padding-top: 20px; }
.chart .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; justify-content: flex-end; height: 100%; }
.chart .bar i { display: block; width: 70%; background: var(--orange); border: 2px solid var(--ink); border-radius: 6px 6px 0 0; min-height: 4px; }
.chart .bar span { font-size: 11px; color: var(--muted); }
.chart .bar b { font-size: 12px; }
.health-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed #e8dccf; font-size: 14px; flex-wrap: wrap; }
.health-row:last-child { border-bottom: none; }
.log-table { font-size: 13px; }
.log-row { display: grid; grid-template-columns: 150px 1fr 80px 1fr; gap: 8px; padding: 6px 0; border-bottom: 1px dashed #e8dccf; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.form-grid label { font-size: 14px; font-weight: 700; display: flex; flex-direction: column; gap: 6px; }
.check-row { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; font-size: 14px; }
.check-row label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.check-row input, .batch-bar input { width: 18px; height: 18px; accent-color: var(--orange); }
/* 前台：上传预览 / 灯箱 / 画廊 */
.preview-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.preview-row img { width: 80px; height: 80px; object-fit: cover; border: 2px solid var(--ink); border-radius: 10px; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: flex; align-items: center; justify-content: center; z-index: 9000; cursor: zoom-out; }
.lightbox img { max-width: 92vw; max-height: 88vh; border: 3px solid #fff; border-radius: 12px; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
@media (max-width: 640px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
.gallery img { width: 100%; height: 110px; object-fit: cover; border: 2px solid var(--ink); border-radius: 10px; cursor: zoom-in; display: block; }
@media (min-width: 1024px) { .result { grid-template-columns: 1fr 1fr 1fr; } .wrap { max-width: 1080px; } }
.theme-btn { background: var(--white); }

/* ===== v1.2 深色模式 ===== */
html[data-theme="dark"] {
  --paper: #171310; --white: #221c18; --ink: #f5efe8; --muted: #b8a99c;
  --orange-light: #3a2415; --shadow: 5px 5px 0 #000;
}
html[data-theme="dark"] body { background-image: radial-gradient(#3a2a1c 1.6px, transparent 1.7px); }
html[data-theme="dark"] .card, html[data-theme="dark"] .stat, html[data-theme="dark"] .item,
html[data-theme="dark"] .admin-item, html[data-theme="dark"] .modal-card { background: #221c18; }
html[data-theme="dark"] .input, html[data-theme="dark"] select.input { background: #2c241e; color: #f5efe8; }
html[data-theme="dark"] .btn.ghost, html[data-theme="dark"] .tab { background: #2c241e; color: #f5efe8; }
html[data-theme="dark"] .dropzone { background: #2c1f14; }
html[data-theme="dark"] .admin-url { color: #8a7a6c; }
html[data-theme="dark"] .progress { background: #2c241e; }
html[data-theme="dark"] .health-row, html[data-theme="dark"] .log-row { border-bottom-color: #3a2f27; }

/* ===== v1.3.3 ===== */
/* 网站 Logo（前台顶栏，设置里上传或填链接后显示在站名前） */
.logo { display: flex; align-items: center; }
.site-logo { height: 28px; width: auto; max-width: 140px; object-fit: contain; margin-right: 8px; }
/* 深色模式按钮：SVG 图标（月亮/太阳），不用 emoji */
.theme-btn { display: inline-flex; align-items: center; gap: 5px; }
.theme-ico { display: inline-flex; line-height: 0; }
/* 设置页：底部保存栏常驻（滚动页面也不动），改了设置就点它 */
#tab-settings { padding-bottom: 84px; }
.save-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 800; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; background: var(--white); border-top: 2px solid var(--ink); box-shadow: 0 -4px 16px rgba(0,0,0,.08); }
.save-bar .tip { margin: 0; }
/* 总览：新版本提醒横幅（有新版本才显示，最新版不提示） */
.update-banner { align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; margin-bottom: 14px; border: 2px solid var(--ink); border-radius: 12px; background: var(--orange-light); box-shadow: var(--shadow); }
/* 总览：系统存储容量 */
.disk-bar { height: 14px; border: 2px solid var(--ink); border-radius: 99px; overflow: hidden; background: #f5efe8; margin: 10px 0 8px; }
.disk-fill { height: 100%; background: var(--orange); transition: width .3s; }
/* 健康检查 / 登录日志的状态点与文字（不用 emoji） */
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: -1px; }
.dot-ok { background: var(--green); }
.dot-warn { background: #e8a13a; }
.dot-bad { background: var(--red); }
.ok-text { color: var(--green); font-weight: 700; }
.fail-text { color: var(--red); font-weight: 700; }
/* 设置页：Logo 上传行 / 安全分组小标题 */
.logo-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
#tab-settings h3 { font-size: 15px; margin: 4px 0 10px; }
/* 深色模式下的新元素 */
html[data-theme="dark"] .disk-bar { background: #2c241e; }
html[data-theme="dark"] .save-bar { background: #221c18; }
