/* 固定二维码内容管理系统 —— 移动端优先样式 */
:root {
  --primary: #2f6fed;
  --primary-dark: #1d54c7;
  --danger: #e5484d;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #1f2733;
  --muted: #6b7686;
  --border: #e3e8f0;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 头部 */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 700; font-size: 17px; color: var(--text); }
.site-header nav a { margin-left: 14px; font-size: 14px; }

.container { max-width: 860px; margin: 0 auto; padding: 20px 16px 40px; }
.site-footer { text-align: center; color: var(--muted); font-size: 12px; padding: 24px 0 32px; }

h2 { margin: 8px 0 16px; font-size: 22px; }
h3 { margin: 0 0 12px; font-size: 17px; }

/* 面板与卡片 */
.panel {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; margin-bottom: 16px;
}
.panel-narrow { max-width: 420px; margin: 24px auto; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.code { font-family: ui-monospace, Consolas, monospace; font-weight: 700; letter-spacing: 1px; }

/* 首页 */
.hero { text-align: center; padding: 40px 8px 28px; }
.hero h1 { font-size: 26px; margin: 0 0 12px; }
.hero .sub { color: var(--muted); }
.hero-actions { margin-top: 20px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.grid3 .card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.grid3 .emoji { font-size: 28px; }

/* 表单 */
label { display: block; margin-bottom: 14px; font-size: 14px; color: var(--muted); }
input[type=text], input[type=password], input[type=number], textarea {
  display: block; width: 100%; margin-top: 6px;
  padding: 10px 12px; font-size: 15px;
  border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text);
}
input:focus, textarea:focus { outline: 2px solid rgba(47, 111, 237, .25); border-color: var(--primary); }
input[type=file] { margin-top: 6px; font-size: 13px; }

/* 按钮 */
.btn {
  display: inline-block; padding: 10px 18px; font-size: 15px;
  border: 1px solid var(--border); border-radius: 8px;
  background: #fff; color: var(--text); cursor: pointer;
}
.btn:hover { text-decoration: none; border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-danger { background: #fff; border-color: var(--danger); color: var(--danger); }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.block { display: block; width: 100%; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inline { display: inline-block; margin-top: 10px; }

.notice { background: #eef4ff; border: 1px solid #c9dbff; border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; font-size: 14px; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: #eef2f8; color: var(--muted); }
.tag-on { background: #e7f7ed; color: #187a3d; }
.tag-off { background: #fdeeee; color: #c03538; }

/* 内容展示 */
.viewer { max-width: 640px; margin: 16px auto; }
.viewer .cover { width: 100%; border-radius: 8px; margin-bottom: 12px; }
.viewer .ctitle { margin: 4px 0 8px; }
.viewer .cdesc { color: var(--muted); white-space: pre-wrap; }
.media { margin-top: 14px; }
.media-img { width: 100%; border-radius: 8px; cursor: zoom-in; }
.media video { width: 100%; border-radius: 8px; background: #000; }
.media audio { width: 100%; }
.media iframe { width: 100%; height: 72vh; border: 1px solid var(--border); border-radius: 8px; }
.hint { font-size: 13px; }

/* 上传管理 */
.qr-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 12px; }
.qr-thumb { width: 72px; height: 72px; flex: none; cursor: zoom-in; border: 1px solid var(--border); border-radius: 8px; padding: 4px; background: #fff; }
.qr-thumb img { width: 100%; height: 100%; }
.qr-meta { min-width: 0; }
.qr-meta h3 { margin: 0 0 4px; }
.ctitle-sm { font-weight: 600; margin: 6px 0; }
.cover-s { max-width: 160px; border-radius: 6px; display: block; margin: 6px 0; }
details { margin-top: 10px; }
details summary { list-style: none; }
details summary::-webkit-details-marker { display: none; }
details form { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }

/* 后台 */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; text-align: center; }
.stat b { display: block; font-size: 24px; }
.stat span { font-size: 12px; color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 13px; }
.ops .btn { margin-right: 6px; margin-bottom: 4px; }

/* 弹层与提示 */
.modal { position: fixed; inset: 0; background: rgba(15, 22, 34, .55); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
/* display:flex 会覆盖 hidden 属性，必须显式让 [hidden] 的弹层真正隐藏 */
.modal[hidden] { display: none; }
.modal-box { background: #fff; border-radius: 14px; padding: 20px; text-align: center; max-width: 320px; width: 100%; }
.modal-box img { margin: 0 auto; }
.toast {
  position: fixed; left: 50%; bottom: 48px; transform: translateX(-50%);
  padding: 10px 20px; border-radius: 999px; font-size: 14px; color: #fff;
  z-index: 200; display: none; max-width: 86vw;
}
.toast.ok { background: #1f9d55; }
.toast.err { background: #d64545; }
.emoji.big { font-size: 44px; }

@media (max-width: 480px) {
  .container { padding: 14px 12px 32px; }
  .hero h1 { font-size: 22px; }
  .qr-head { gap: 10px; }
  .ops { white-space: normal; }
}
