/* ============================================================
 *  后台管理样式补充
 * ============================================================ */
:root {
  --brand: #2f6fed;
  --brand-dark: #1f57c8;
  --sidebar-bg: #1f2a44;
  --sidebar-active: #2f6fed;
}

* { box-sizing: border-box; }

html, body, #app {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: #f2f4f8;
  color: #1f2430;
  -webkit-font-smoothing: antialiased;
}

.boot-loading {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #8a93a6;
  gap: 16px;
}

.boot-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid #d8dee9;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: boot-spin .8s linear infinite;
}

@keyframes boot-spin { to { transform: rotate(360deg); } }

/* ---------------- 登录页 ---------------- */
.login-wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #22304f 0%, #2f6fed 55%, #56a8ff 100%);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 16px;
  padding: 34px 32px 26px;
  box-shadow: 0 18px 50px rgba(15, 32, 71, .28);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.login-logo .mark {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
}

.login-logo h1 {
  font-size: 19px;
  margin: 0;
  letter-spacing: .5px;
}

.login-tip {
  color: #8a93a6;
  font-size: 12.5px;
  margin: 0 0 22px;
}

.login-card .el-input__wrapper { border-radius: 9px; }
.login-card .el-button { width: 100%; border-radius: 9px; height: 42px; font-size: 15px; }

/* ---------------- 主框架 ---------------- */
.layout {
  height: 100%;
  display: flex;
  overflow: hidden;
}

.sidebar {
  width: 224px;
  background: var(--sidebar-bg);
  color: #c8d0e0;
  display: flex;
  flex-direction: column;
  transition: width .22s ease;
  flex-shrink: 0;
}

.sidebar.collapsed { width: 64px; }

.sidebar-head {
  height: 60px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  color: #fff;
  font-weight: 600;
  letter-spacing: .5px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-head .mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.sidebar-menu {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px;
}

.sidebar-menu .el-menu { border-right: none; background: transparent; }
.sidebar-menu .el-menu-item,
.sidebar-menu .el-sub-menu__title {
  color: #c8d0e0;
  border-radius: 8px;
  margin-bottom: 4px;
  height: 44px;
  line-height: 44px;
}
.sidebar-menu .el-menu-item:hover,
.sidebar-menu .el-sub-menu__title:hover {
  background: rgba(255, 255, 255, .07);
  color: #fff;
}
.sidebar-menu .el-menu-item.is-active {
  background: var(--brand);
  color: #fff;
  font-weight: 500;
}
.sidebar-menu .el-sub-menu .el-menu-item { padding-left: 46px !important; min-width: auto; }

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.topbar {
  height: 60px;
  background: #fff;
  border-bottom: 1px solid #e8ebf2;
  display: flex;
  align-items: center;
  padding: 0 18px;
  gap: 14px;
  flex-shrink: 0;
}

.topbar .collapse-btn {
  cursor: pointer;
  font-size: 18px;
  color: #5d6a80;
}

.topbar .page-title { font-size: 16px; font-weight: 600; }
.topbar .spacer { flex: 1; }

.topbar .user-box {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 9px;
}
.topbar .user-box:hover { background: #f2f4f8; }
.topbar .user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; overflow: hidden;
}
.topbar .user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.topbar .user-name { font-size: 13.5px; line-height: 1.25; }
.topbar .user-role { font-size: 11.5px; color: #98a1b3; }

.content {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 1px 3px rgba(24, 39, 75, .06);
}

.card + .card { margin-top: 16px; }

.card-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title .sub { font-size: 12.5px; color: #98a1b3; font-weight: 400; }

.page-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.page-head .spacer { flex: 1; }

/* ---------------- 仪表盘 ---------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(24, 39, 75, .06);
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-card .icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 21px;
  background: #eef3ff; color: var(--brand);
  flex-shrink: 0;
}
.stat-card.green .icon { background: #e9f8ef; color: #1aa960; }
.stat-card.orange .icon { background: #fff4e6; color: #f08c1f; }
.stat-card.purple .icon { background: #f1edfd; color: #7d5bef; }
.stat-card .value { font-size: 22px; font-weight: 600; line-height: 1.2; }
.stat-card .label { font-size: 12.5px; color: #98a1b3; margin-top: 2px; }

.chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 180px;
  padding: 10px 4px 0;
}
.chart .bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 6px;
}
.chart .bar {
  width: 100%;
  max-width: 30px;
  background: linear-gradient(180deg, #6ea2ff, var(--brand));
  border-radius: 6px 6px 2px 2px;
  min-height: 3px;
  position: relative;
  transition: all .2s;
}
.chart .bar:hover { filter: brightness(1.08); }
.chart .bar .num {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: #6b7488;
}
.chart .label { font-size: 11px; color: #98a1b3; white-space: nowrap; }

/* ---------------- 视频列表 ---------------- */
.cover-thumb {
  width: 74px; height: 44px;
  border-radius: 6px;
  object-fit: cover;
  background: #eef1f6;
  cursor: pointer;
  display: block;
}
.cover-thumb.portrait { width: 32px; height: 48px; }
.cover-empty {
  width: 74px; height: 44px;
  border-radius: 6px;
  background: #eef1f6;
  display: flex; align-items: center; justify-content: center;
  color: #b9c0cd; font-size: 16px;
}
.cover-empty.portrait { width: 32px; height: 48px; }

/* 列表内的封面 / 二维码单元格 */
.media-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.media-cell .cover-thumb,
.media-cell .cover-empty {
  margin: 0 auto;
}
.media-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.media-actions .el-button + .el-button {
  margin-left: 0;
}

/* 列表内二维码缩略图 */
.qr-thumb {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  border: 1px solid #e8ebf2;
  background: #fff;
  padding: 2px;
  cursor: pointer;
  display: block;
  transition: transform .15s ease, box-shadow .15s ease;
}
.qr-thumb:hover {
  transform: scale(1.06);
  box-shadow: 0 3px 12px rgba(47, 111, 237, .22);
}
.qr-thumb.qr-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #98a1b3;
  background: #f7f8fb;
  border-style: dashed;
}

/* 二维码大图预览 */
.qr-preview {
  text-align: center;
}.qr-preview-img {
  width: 232px;
  height: 232px;
  border: 1px solid #e8ebf2;
  border-radius: 10px;
  background: #fff;
  padding: 6px;
}
.qr-preview-empty {
  height: 232px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #98a1b3;
  font-size: 13px;
  background: #f7f8fb;
  border-radius: 10px;
}
.qr-preview-title {
  font-size: 15px;
  font-weight: 600;
  margin-top: 12px;
}
.qr-preview-link {
  font-size: 12px;
  color: #7b8497;
  word-break: break-all;
  margin-top: 6px;
}
.qr-preview-tip {
  font-size: 12px;
  color: #98a1b3;
  margin-top: 10px;
  line-height: 1.6;
}

/* ---------------- 添加视频弹窗 ---------------- */
.add-video .add-file-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #4a5468;
  margin: 4px 0 8px;
}
.add-video .upload-drop {
  padding: 22px 18px;
}
.add-file-picked {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f4f8ff;
  border: 1px solid #d6e4ff;
  border-radius: 10px;
  padding: 11px 14px;
}
.add-file-picked .ico { font-size: 18px; }
.add-file-picked .name {
  flex: 1;
  font-size: 13.5px;
  word-break: break-all;
}
.add-file-picked .size {
  font-size: 12.5px;
  color: #98a1b3;
}
.add-progress {
  margin-top: 14px;
}
.add-progress-text {
  font-size: 12.5px;
  color: #7b8497;
  margin-top: 6px;
  line-height: 1.6;
}
.add-qr-done {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #d9f0e3;
  background: #f2fbf6;
  border-radius: 10px;
}
.add-qr-done img {
  width: 84px;
  height: 84px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e8ebf2;
}
.add-qr-done .t1 {
  font-size: 14px;
  font-weight: 600;
  color: #1aa960;
}
.add-qr-done .t2 {
  font-size: 12.5px;
  color: #7b8497;
  margin-top: 4px;
}

/* ---------------- 修改视频弹窗 ---------------- */
.modify-preview {
  background: #fafbfd;
  border: 1px solid #eef1f6;
  border-radius: 12px;
  padding: 10px;
}
.modify-current {
  font-size: 12.5px;
  color: #98a1b3;
  margin-top: 8px;
}
.modify-replace {
  margin-top: 14px;
  border: 1px dashed #cfd8e8;
  border-radius: 12px;
  padding: 12px 14px;
  background: #f4f8ff;
}
.modify-replace-title {
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #1f57c8;
}
.modify-replace-tip {
  font-size: 12px;
  color: #7b8497;
  line-height: 1.7;
  margin-bottom: 10px;
}

.video-title { font-weight: 500; margin-bottom: 2px; }
.video-sub { font-size: 12px; color: #98a1b3; }

.code-tag {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  background: #f2f4f8;
  border: 1px solid #e3e8f0;
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 12.5px;
}

/* ---------------- 上传 ---------------- */
.upload-drop {
  border: 1.5px dashed #cfd8e8;
  border-radius: 12px;
  padding: 26px 18px;
  text-align: center;
  background: #fafbff;
  cursor: pointer;
  transition: all .18s;
}
.upload-drop:hover, .upload-drop.dragover {
  border-color: var(--brand);
  background: #f2f7ff;
}
.upload-drop .big { font-size: 30px; }
.upload-drop p { margin: 8px 0 4px; font-size: 14px; }
.upload-drop small { color: #98a1b3; }

.upload-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed #eef1f6;
}
.upload-item:last-child { border-bottom: none; }
.upload-item .info { flex: 1; min-width: 0; }
.upload-item .name {
  font-size: 13.5px;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------------- 二维码 ---------------- */
.qr-box {
  text-align: center;
  padding: 8px;
}
.qr-box img {
  width: 190px; height: 190px;
  border: 1px solid #e8ebf2;
  border-radius: 10px;
  background: #fff;
}
.qr-box .link {
  font-size: 12px;
  color: #7b8497;
  word-break: break-all;
  margin-top: 8px;
}
.qr-box canvas { border-radius: 10px; }

/* ---------------- 表格微调 ---------------- */
.el-table .cell { font-size: 13px; }
.el-table th.el-table__cell { background: #fafbfd !important; font-weight: 600; }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.filter-bar .el-input, .filter-bar .el-select { width: 150px; }

.detail-row { display: flex; padding: 7px 0; font-size: 13.5px; border-bottom: 1px dashed #f0f2f7; }
.detail-row .k { width: 96px; color: #98a1b3; flex-shrink: 0; }
.detail-row .v { flex: 1; word-break: break-all; }

.form-tip { font-size: 12px; color: #98a1b3; line-height: 1.6; margin-top: 4px; }

.permission-group {
  border: 1px solid #eef1f6;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.permission-group h4 { margin: 0 0 10px; font-size: 13.5px; }

.env-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px 18px;
}
.env-item { display: flex; align-items: center; font-size: 13px; gap: 8px; }
.env-item .k { color: #98a1b3; min-width: 96px; }
.env-item .v { word-break: break-all; }

/* ---------------- 移动端适配 ---------------- */
.mobile-menu-btn { display: none; }

@media (max-width: 820px) {
  .sidebar {
    position: fixed;
    z-index: 2000;
    height: 100%;
    left: -230px;
    transition: left .24s ease;
  }
  .sidebar.mobile-open { left: 0; }
  .sidebar.collapsed { width: 224px; }
  .mobile-menu-btn { display: inline-flex; }
  .topbar .user-name, .topbar .user-role { display: none; }
  .content { padding: 12px; }
  .filter-bar .el-input, .filter-bar .el-select { width: 100%; }
}
