/* ============================================================
 * DMMJ 文件分享 - 全局样式
 * 视觉参考：VMConsole-Try-Demo（Format1452 字体 / 白底细边框 /
 *           4px 小圆角 / Google 蓝 accent / 轻阴影卡片）
 * ============================================================ */
@font-face {
  font-family: 'Format1452Medium';
  src: url('fonts/Format_1452.woff2') format('woff2'),
       url('fonts/Format_1452.woff') format('woff');
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --border: #e3e3e3;
  --border-strong: #d5d5d5;
  --text-main: #111;
  --text-dim: #777;
  --text-faint: #999;
  --accent: #1a73e8;
  --accent-hover: #1765cc;
  --accent-soft: rgba(26, 115, 232, 0.08);
  --accent-glow: rgba(26, 115, 232, 0.16);
  --green: #188038;
  --green-soft: rgba(24, 128, 56, 0.08);
  --red: #d93025;
  --red-soft: rgba(217, 48, 37, 0.06);
  --amber: #b06000;
  --amber-soft: rgba(249, 171, 0, 0.14);
  --line-row: #f0f0f0;
  --bg-soft: #f8f9fa;
  --radius: 4px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* 界面内除输入/可复制文本外，一律禁止选中；图片禁止拖拽；移动端禁止长按选取 */
html { -webkit-touch-callout: none; }
body, body * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
img { -webkit-user-drag: none; user-drag: none; }
html, body { height: 100%; }
body {
  font-family: "Format1452Medium", "Noto Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--text-main);
  background: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-user-select: none;
  user-select: none;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }

/* ---------- 顶栏 ---------- */
.site-header {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 22px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.brand-word {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--text-main);
  user-select: none;
  white-space: nowrap;
}
.brand-word b { color: var(--accent); font-weight: 600; }
.brand-word:hover { text-decoration: none; opacity: 0.85; }
.brand-text b {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.14em;
  line-height: 1.2;
  display: block;
  color: var(--text-main);
}
.brand-text span {
  font-size: 9.5px;
  color: var(--text-dim);
  letter-spacing: 0.34em;
  display: block;
}
.hdr-note { font-size: 11.5px; color: var(--text-dim); letter-spacing: 0.08em; white-space: nowrap; }

/* ---------- 布局（页面为居中白色卡片，宽参照参考面板 560px） ---------- */
.wrap {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 22px 18px 44px;
  flex: 1;
}
.wrap.wide { max-width: 980px; }
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
  animation: viewIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes viewIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.page-title {
  font-size: 21px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-align: center;
}
.lead { font-size: 12.5px; margin: 8px 0 18px; }
.muted { color: var(--text-dim); }
.center { text-align: center; }
.hint { font-size: 11.5px; color: var(--text-faint); margin-top: 10px; text-align: center; }
.foot {
  text-align: center;
  color: #aaa;
  font-size: 10.5px;
  letter-spacing: 0.22em;
  padding: 14px 0 24px;
}

/* ---------- 按钮（与参考页 try-btn 完全一致：方形 / 白底 / 细边框 / hover 蓝光晕） ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid #d5d5d5;
  background: #fff;
  color: var(--text-main);
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 0.16em;
  padding: 12px 26px;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}
.btn:hover { border-color: var(--accent); box-shadow: 0 10px 26px var(--accent-glow); text-decoration: none; }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.primary { font-weight: 500; letter-spacing: 0.2em; }
.btn.ghost { background: #fff; }
.btn.big { width: 100%; padding: 17px 30px; font-size: 15px; }
.btn.small { padding: 7px 14px; font-size: 11.5px; letter-spacing: 0.1em; }
.btn.danger { color: var(--red); }
.btn.danger:hover { border-color: var(--red); color: var(--red); box-shadow: 0 8px 22px rgba(217, 48, 37, 0.14); }
.btn svg { display: block; }

/* ---------- 输入控件 ---------- */
.inp {
  width: 100%;
  background: #fff;
  border: 1px solid var(--border-strong);
  color: var(--text-main);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.inp:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.14); }
.inp::placeholder { color: #aaa; }
.lbl {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 500;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
select.inp { cursor: pointer; }

/* ---------- 状态信息 ---------- */
.err { color: var(--red); font-size: 12.5px; margin-top: 10px; min-height: 1em; }
.hidden { display: none !important; }
.icon-badge {
  width: 64px;
  height: 64px;
  margin: 2px auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
}
.icon-badge svg { display: block; }
.icon-badge.lock { background: var(--accent-soft); color: var(--accent); }
.icon-badge.ok { background: var(--green-soft); color: var(--green); }
.icon-badge.warn { background: var(--amber-soft); color: var(--amber); }

/* ---------- 分享信息列表 ---------- */
.meta-list { list-style: none; margin: 6px 0 20px; border-top: 1px solid var(--line-row); }
.meta-list li {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line-row);
  font-size: 13px;
}
.meta-list li span { color: var(--text-dim); flex: none; letter-spacing: 0.04em; }
.meta-list li b { color: var(--text-main); font-weight: 500; text-align: right; word-break: break-all; max-width: 78%; }

.share-card { text-align: center; }
.share-card .lead { color: var(--text-dim); }
.share-card .meta-list { text-align: left; }
.share-card .btn.big { margin-top: 4px; }
.share-card .back-link {
  display: block;
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 0.04em;
}
.share-card .back-link:hover { color: var(--accent); text-decoration: none; }

/* ---------- 密码行 ---------- */
.pwd-row { display: flex; gap: 9px; }
.pwd-row .inp { flex: 1; }

/* ---------- 上传页 ---------- */
.up-head { text-align: center; margin-bottom: 18px; }
.up-head h1 { font-size: 26px; font-weight: 500; letter-spacing: 0.16em; color: var(--text-main); margin: 6px 0 2px; }
.up-head p { color: var(--text-dim); font-size: 12.5px; margin-top: 7px; letter-spacing: 0.04em; }
.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 40px 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  color: var(--text-main);
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: #f8fbff; color: var(--accent); }
.dropzone .dz-icon { margin-bottom: 10px; opacity: 0.85; }
.dropzone .dz-main { font-size: 15px; font-weight: 500; letter-spacing: 0.05em; }
.dropzone .dz-sub { color: var(--text-dim); font-size: 12px; margin-top: 5px; }
.dropzone .dz-sub b { color: var(--text-main); font-weight: 500; }
.dropzone input[type=file] { display: none; }
.file-chip {
  display: none;
  align-items: center;
  gap: 11px;
  margin-top: 13px;
  background: var(--bg-soft);
  border: 1px solid #ececec;
  border-radius: var(--radius);
  padding: 9px 13px;
}
.file-chip.show { display: flex; }
.file-chip svg { flex: none; }
.file-chip .fc-info { flex: 1; min-width: 0; }
.file-chip .fc-name { font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-chip .fc-size { color: var(--text-dim); font-size: 11.5px; margin-top: 1px; }
.file-chip .fc-del { cursor: pointer; color: var(--text-faint); border: 0; background: none; font-size: 18px; line-height: 1; padding: 0 2px; }
.file-chip .fc-del:hover { color: var(--red); }

.up-options { margin-top: 18px; display: grid; gap: 15px; }
.up-actions { display: flex; gap: 10px; }
.up-actions .btn.big { flex: 1; }
#pauseBtn { flex: 0 0 108px; }
.seg { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.seg label {
  text-align: center;
  cursor: pointer;
  padding: 9px 2px;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: #555;
  background: #fff;
  transition: all 0.16s;
  user-select: none;
}
.seg label:hover { border-color: var(--accent); color: var(--accent); }
.seg input { display: none; }
.seg input:checked + label {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 500;
}
.custom-row { display: none; gap: 8px; margin-top: 9px; align-items: stretch; }
.custom-row.show { display: flex; }
.custom-row .inp { flex: 1; }
.custom-row select.inp { width: auto; flex: 0 0 96px; }
.pwd-wrap { display: flex; gap: 8px; }
.pwd-wrap .inp { flex: 1; }
.pwd-wrap .btn { padding: 10px 12px; font-size: 13px; }
.exp-hint { font-size: 11.5px; color: var(--text-faint); margin-top: 7px; }
.upload-note { font-size: 12px; color: var(--text-dim); text-align: center; margin-top: 12px; letter-spacing: 0.03em; }
.upload-note b { color: var(--accent); font-weight: 500; }

.progress {
  height: 4px;
  background: #ececec;
  border-radius: 99px;
  margin-top: 9px;
  overflow: hidden;
  display: none;
}
.progress.show { display: block; }
.progress i {
  display: block; height: 100%; width: 0;
  background: var(--accent);
  transition: width 0.15s;
}

/* ---------- 上传成功 ---------- */
.resultbox { display: none; }
.resultbox.show { display: block; }
.result-head { display: flex; align-items: center; gap: 9px; margin-bottom: 15px; }
.result-head .okdot {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: var(--green-soft); color: var(--green);
  display: flex; align-items: center; justify-content: center;
}
.result-head h2 { font-size: 15px; font-weight: 500; letter-spacing: 0.08em; }
.link-row { display: flex; gap: 8px; }
.link-row .inp { font-size: 13px; color: var(--accent); flex: 1; }
.result-meta { margin-top: 12px; font-size: 12.5px; color: var(--text-dim); line-height: 1.9; }
.result-meta b { color: var(--text-main); font-weight: 500; }
.result-actions { display: flex; gap: 9px; margin-top: 16px; }
.result-actions .btn { flex: 1; }

/* ---------- 管理后台 ---------- */
.admin-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.admin-top h1 { font-size: 18px; font-weight: 500; letter-spacing: 0.14em; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.stat {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: #fff;
}
.stat span { display: block; font-size: 11px; color: var(--text-dim); letter-spacing: 0.1em; }
.stat b { display: block; font-size: 20px; font-weight: 500; color: var(--text-main); margin-top: 3px; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.toolbar .inp { flex: 1; }
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left;
  color: var(--text-dim);
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.tbl td { padding: 10px; border-bottom: 1px solid var(--line-row); vertical-align: middle; }
.tbl tbody tr:hover { background: var(--bg-soft); }
.tbl .fname { font-weight: 500; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl .fmeta { color: var(--text-dim); font-size: 11.5px; margin-top: 2px; }
.tbl .dim { color: var(--text-dim); white-space: nowrap; }

/* 管理后台：新建分享面板 */
.create-box .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 16px; }
.create-box .full { grid-column: 1 / -1; }
.create-box .inp.file { display: none; }
.pick-row { display: flex; gap: 8px; align-items: center; }
.pick-row .pick-name { flex: 1; color: var(--text-main); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-row .pick-name.empty { color: #aaa; }
.link-preview { font-size: 11.5px; color: var(--text-dim); margin-top: 6px; letter-spacing: 0.02em; }
.link-preview b { color: var(--accent); font-weight: 500; word-break: break-all; }
.create-actions { display: flex; gap: 9px; margin-top: 4px; }
.create-actions .btn { flex: 1; }
.create-result { margin-top: 12px; padding: 10px 13px; background: var(--bg-soft); border: 1px solid #ececec; border-radius: var(--radius); font-size: 12.5px; color: var(--text-main); display: none; }
.create-result.show { display: block; }
.create-result a { word-break: break-all; }
@media (max-width: 560px) {
  .create-box .grid { grid-template-columns: 1fr; }
}
.pill {
  display: inline-block;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: var(--radius);
  border: 1px solid;
  white-space: nowrap;
}
.pill.blue { color: var(--accent); border-color: rgba(26, 115, 232, 0.35); background: var(--accent-soft); }
.pill.green { color: var(--green); border-color: rgba(24, 128, 56, 0.3); background: var(--green-soft); }
.pill.gray { color: var(--text-dim); border-color: var(--border-strong); background: #fafafa; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.empty { text-align: center; color: var(--text-dim); font-size: 13px; padding: 34px 0; }
.pager { display: flex; justify-content: center; gap: 8px; margin-top: 16px; align-items: center; font-size: 12.5px; color: var(--text-dim); }

/* 登录卡 */
.auth-wrap { display: flex; justify-content: center; padding: 9vh 18px 0; }
.auth-card { width: min(372px, 100%); }
.auth-card .card { padding: 30px 30px 26px; }
.auth-card h1 { font-size: 20px; font-weight: 500; letter-spacing: 0.16em; text-align: center; }
.auth-card .sub { text-align: center; color: var(--text-dim); font-size: 12px; margin: 6px 0 20px; }
.auth-card .inp { margin-bottom: 12px; }
.auth-card .btn { width: 100%; }

/* 响应式 */
@media (max-width: 560px) {
  .hdr-note { display: none; }
  .card { padding: 20px 16px; }
  .pwd-row { flex-direction: column; }
  .seg { grid-template-columns: repeat(3, 1fr); }
  .result-actions { flex-direction: column; }
  .stats { grid-template-columns: 1fr; }
}

/* 管理后台板块 Tab 导航 */
.tabs-nav { display: flex; gap: 4px; margin-bottom: 14px; flex-wrap: wrap; }
.tab {
  padding: 8px 18px; border: 1px solid #e3e3e3; border-radius: 4px;
  background: #fff; color: #3c4043; font-size: 14px; cursor: pointer;
  text-decoration: none; user-select: none; transition: all .15s ease;
}
.tab:hover { border-color: #1a73e8; color: #1a73e8; box-shadow: 0 1px 4px rgba(26,115,232,.18); }
.tab.on { background: #1a73e8; border-color: #1a73e8; color: #fff; font-weight: 500; }
.tab.on:hover { color: #fff; }

/* 明细弹层 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 50;
  display: none; align-items: flex-start; justify-content: center; padding: 7vh 16px;
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff; border: 1px solid #e3e3e3; border-radius: 4px;
  box-shadow: 0 12px 40px rgba(0,0,0,.16); width: 640px; max-width: 100%;
  max-height: 80vh; display: flex; flex-direction: column;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid #eee; }
.modal-body { overflow: auto; padding: 14px 18px; font-size: 14px; }
.stat-ips { width: 100%; border-collapse: collapse; margin-top: 8px; }
.stat-ips th, .stat-ips td { padding: 6px 10px; text-align: left; border-bottom: 1px solid #f0f0f0; }
.muted { color: #888; }
