/* =====================================================
   管理后台样式
   ===================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: #f6f2ec; color: #333;
}
a { text-decoration: none; color: inherit; }

.btn {
  display: inline-block; padding: 9px 18px; border-radius: 20px;
  font-size: 14px; cursor: pointer; border: none; font-family: inherit; transition: all .2s;
}
.btn.primary { background: linear-gradient(135deg, #b03a2e, #d24a3c); color: #fff; }
.btn.primary:hover { opacity: .9; }
.btn.ghost { background: #fff; color: #b03a2e; border: 1.5px solid #d9a441; }
.btn.small { padding: 6px 14px; font-size: 13px; }

/* ---------------- 登录页 ---------------- */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(150deg, #f7e8d0, #fdeef0); }
.login-box {
  width: 340px; background: #fff; border-radius: 18px; padding: 40px 34px;
  box-shadow: 0 20px 50px rgba(0,0,0,.12); text-align: center;
}
.login-box h1 { color: #b03a2e; font-size: 26px; margin-bottom: 6px; }
.login-sub { color: #999; font-size: 13px; letter-spacing: 3px; margin-bottom: 26px; }
.login-box input {
  width: 100%; padding: 12px 14px; border: 1px solid #e3d6c6; border-radius: 10px;
  font-size: 15px; outline: none; margin-bottom: 16px;
}
.login-box input:focus { border-color: #b03a2e; }
.login-box .btn { width: 100%; padding: 12px; font-size: 16px; }
.login-error { color: #c0392b; font-size: 13px; margin-bottom: 12px; }
.login-tip { margin-top: 18px; font-size: 12px; color: #bbb; }

/* ---------------- 后台布局 ---------------- */
.ad-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 18px;
  padding: 14px 28px; background: #fff; border-bottom: 1px solid #f0e4d8;
}
.ad-title { color: #999; font-size: 15px; }
.ad-header-right { margin-left: auto; }

.ad-main { max-width: 1180px; margin: 0 auto; padding: 26px 20px 60px; }

/* ---------------- 统计卡片 ---------------- */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card {
  background: #fff; border-radius: 14px; padding: 22px; text-align: center;
  box-shadow: 0 6px 18px rgba(0,0,0,.05);
}
.stat-card b { display: block; font-size: 30px; color: #b03a2e; margin-bottom: 6px; }
.stat-card span { font-size: 13px; color: #999; }

/* ---------------- 图表 ---------------- */
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 22px; }
.chart-box { background: #fff; border-radius: 14px; padding: 18px; box-shadow: 0 6px 18px rgba(0,0,0,.05); }
.chart-box h3 { font-size: 15px; color: #5c3a1e; margin-bottom: 10px; }
.chart { height: 300px; }

/* ---------------- 表格 ---------------- */
.table-box { background: #fff; border-radius: 14px; padding: 20px; box-shadow: 0 6px 18px rgba(0,0,0,.05); }
.table-box h3 { font-size: 16px; color: #5c3a1e; margin-bottom: 14px; }
.hint { font-size: 12px; color: #999; font-weight: 400; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 10px; text-align: left; border-bottom: 1px solid #f4ece2; white-space: nowrap; }
th { color: #999; font-weight: 500; font-size: 13px; background: #fbf8f3; }
tbody tr:hover { background: #fffaf3; }
.couple { font-weight: 600; color: #b03a2e; }
.visit-num { font-weight: 700; color: #b03a2e; }
.tag { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; }
.tag-on { background: #e8f5e9; color: #2e7d32; }
.tag-off { background: #f5f5f5; color: #999; }
.ops { display: flex; gap: 8px; align-items: center; }
.op-link { color: #b03a2e; font-size: 13px; }
.op-btn {
  border: 1px solid #e3d6c6; background: #fff; color: #666; font-size: 12px;
  padding: 4px 10px; border-radius: 12px; cursor: pointer; transition: all .2s;
}
.op-btn:hover { border-color: #b03a2e; color: #b03a2e; }
.op-btn.danger:hover { border-color: #c0392b; color: #c0392b; }

/* 留言管理 */
.msg-box { margin-top: 20px; }
.msg-content-cell { max-width: 320px; white-space: normal; word-break: break-word; }
.empty-cell { text-align: center; color: #aaa; }

/* 二维码分享弹窗 */
.hidden { display: none !important; }.qr-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 999;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.qr-box {
  background: #fff; border-radius: 18px; padding: 28px 32px; text-align: center;
  max-width: 360px; width: 100%; box-shadow: 0 24px 60px rgba(0,0,0,.25);
}
.qr-box h3 { color: #b03a2e; font-size: 18px; margin-bottom: 16px; }
.qr-img { display: flex; justify-content: center; margin-bottom: 14px; }
.qr-img img, .qr-img canvas { border-radius: 8px; }
.qr-link {
  font-size: 12px; color: #888; word-break: break-all; margin-bottom: 18px;
  line-height: 1.6;
}
.qr-box .btn { width: 100%; }

/* 音乐管理 / 账号安全 / 通用表单 */
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: end; }
.grid3 label { display: block; font-size: 13px; color: #666; }
.grid3 input[type=text], .grid3 input[type=password], .grid3 input[type=file] {
  width: 100%; margin-top: 6px; padding: 9px 12px; border: 1px solid #e3d6c6;
  border-radius: 10px; font-size: 14px; outline: none;
}
.grid3 input:focus { border-color: #d24a3c; }
.music-form, .chpass-form { margin-bottom: 14px; }
.music-form .btn, .chpass-form .btn { margin-top: 6px; }
.music-lib { display: flex; flex-wrap: wrap; gap: 10px; }
.music-lib-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px;
  background: #fff; border: 1px solid #f0e4d4; border-radius: 12px; font-size: 13px;
}
.music-lib-item small { color: #aaa; font-size: 12px; }
.msg-tip { font-size: 13px; color: #c0392b; margin-left: 12px; }
.msg-tip.ok { color: #2e7d32; }

@media (max-width: 900px) {
  .charts { grid-template-columns: 1fr; }
  .ad-header { padding: 12px 16px; }
  .grid3 { grid-template-columns: 1fr; }
}
