/* 影视内容管理后台 —— 布局与编辑器样式 */

* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: #f3f5f9;
  color: #303133;
}

/* ---- 登录页 ---- */
.login-wrap {
  height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1f2d3d 0%, #2b5876 55%, #4e4376 100%);
}
.login-card {
  width: 380px; padding: 36px 40px 30px; border-radius: 10px;
  background: #fff; box-shadow: 0 12px 40px rgba(0,0,0,.28);
}
.login-title { font-size: 20px; font-weight: 600; text-align: center; margin-bottom: 6px; }
.login-sub { font-size: 12px; color: #909399; text-align: center; margin-bottom: 24px; }

/* ---- 顶栏 ---- */
.topbar {
  height: 56px; display: flex; align-items: center; padding: 0 20px;
  background: #1f2d3d; color: #fff;
}
.topbar .brand { font-size: 17px; font-weight: 600; letter-spacing: 1px; }
.topbar .brand .sub { font-size: 11px; font-weight: 400; opacity: .65; margin-left: 8px; }
.topbar .spacer { flex: 1; }
.topbar .user-chip { display: flex; align-items: center; gap: 10px; font-size: 13px; opacity: .92; cursor: pointer; }

.layout { display: flex; height: calc(100% - 56px); }
.sidebar {
  width: 208px; background: #263445; color: #cfd8e3; padding-top: 8px; flex-shrink: 0;
  overflow-y: auto;
}
.sidebar .nav-item {
  display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 18px;
  cursor: pointer; font-size: 14px; border-left: 3px solid transparent; user-select: none;
}
.sidebar .nav-item:hover { background: rgba(255,255,255,.06); }
.sidebar .nav-item.active { background: rgba(64,158,255,.18); color: #fff; border-left-color: #409eff; }
.main { flex: 1; overflow: auto; padding: 18px 22px 40px; }

.page-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.page-title h2 { font-size: 18px; margin: 0; }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { background: #fff; border-radius: 8px; padding: 16px 18px; box-shadow: 0 1px 4px rgba(31,45,61,.08); }
.stat-card .label { font-size: 12px; color: #909399; }
.stat-card .value { font-size: 26px; font-weight: 600; margin-top: 6px; }
.stat-card .extra { font-size: 12px; color: #909399; margin-top: 4px; }
.business-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.business-stats .stat-card { padding: 24px; min-width: 0; }
.business-stats .label { font-size: 16px; color: #606266; }
.business-stats .extra { font-size: 14px; color: #606266; margin-top: 8px; }
.business-stats .value { overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.dashboard-status { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; color: #606266; }
@media (max-width: 1100px) { .business-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .business-stats { grid-template-columns: minmax(0, 1fr); } }

.panel { background: #fff; border-radius: 8px; padding: 16px; box-shadow: 0 1px 4px rgba(31,45,61,.08); margin-bottom: 14px; }
.panel-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }

/* ---- 编辑器 ---- */
.editor-grid { display: grid; grid-template-columns: 300px minmax(300px, 1fr) minmax(400px, 640px); gap: 14px; align-items: start; }
.editor-col { min-width: 0; }
@media (max-width: 1200px) {
  .editor-grid { grid-template-columns: 240px minmax(0, 1fr); }
  .editor-preview-col { grid-column: 1 / -1; }
}
.channel-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }
.channel-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 14px;
  border: 1px solid #dcdfe6; background: #fff; font-size: 13px; cursor: pointer; user-select: none;
}
.channel-chip.active { background: #409eff; border-color: #409eff; color: #fff; }
.channel-chip .type-tag { font-size: 10px; opacity: .7; }

.floor-item {
  border: 1px solid #e4e7ed; border-radius: 8px; padding: 10px 12px; margin-bottom: 10px;
  background: #fff; cursor: pointer; position: relative;
}
.floor-item.active { border-color: #409eff; box-shadow: 0 0 0 2px rgba(64,158,255,.15); }
.floor-item .floor-head { display: flex; align-items: center; gap: 8px; }
.floor-item .floor-title { font-weight: 600; font-size: 13px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.floor-item .floor-meta { font-size: 11px; color: #909399; margin-top: 4px; display: flex; gap: 10px; }
.drag-handle { cursor: grab; color: #c0c4cc; font-size: 15px; }
.floor-item.dragging { opacity: .45; }
.floor-item.drop-target { border-top: 2px solid #409eff; }

.pit-card {
  display: flex; gap: 10px; border: 1px solid #e4e7ed; border-radius: 8px; padding: 8px; margin-bottom: 8px; background: #fff;
}
.pit-card .poster {
  width: 54px; height: 78px; border-radius: 4px; object-fit: cover; background: #2b5876; flex-shrink: 0; display: block;
}
.pit-card .poster.h { width: 84px; height: 48px; }
.pit-card .info { flex: 1; min-width: 0; font-size: 12px; }
.pit-card .info .name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pit-card .info .meta { color: #909399; margin-top: 3px; }
.pit-card .actions { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; }

/* ---- 预览（电视端模拟） ---- */
.tv-preview {
  position: relative; width: 100%; max-width: 1920px; aspect-ratio: 16 / 9;
  background: #10151d; border-radius: 12px; overflow: hidden;
}
.tv-preview-screen {
  position: absolute; top: 0; left: 0; width: 1920px; height: 1080px;
  padding: 64px; overflow-x: hidden; overflow-y: auto; transform-origin: top left;
}
.tv-preview .tv-notice { color: #8b96a5; font-size: 32px; text-align: center; padding: 160px 0; }
.tv-floor { margin-bottom: 48px; }
.tv-floor-title { color: #e8eaf0; font-size: 36px; font-weight: 600; margin-bottom: 24px; display: flex; align-items: center; gap: 16px; }
.tv-floor-title img { height: 48px; }
.tv-grid { display: grid; gap: 32px; }
.tv-cell { position: relative; }
.tv-cell img {
  width: 100%; display: block; border-radius: 12px; background: #2b5876; object-fit: cover;
}
.tv-cell .cell-name { color: #cfd8e3; font-size: 28px; margin-top: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-cell .cell-corner {
  position: absolute; top: 0; right: 0; background: #ff3b30; color: #fff;
  font-size: 24px; padding: 4px 16px; border-radius: 8px; z-index: 2;
}
.tv-cell .cell-score {
  position: absolute; right: 12px; bottom: 16px; color: #ffd21e; font-size: 28px; font-weight: 700;
  text-shadow: 0 0 3px rgba(0,0,0,.8); z-index: 2;
}

.json-view { background: #10151d; color: #9ecbff; font-family: Consolas, Menlo, monospace; font-size: 12px; border-radius: 8px; padding: 14px; overflow: auto; max-height: 420px; white-space: pre-wrap; word-break: break-all; }

.muted { color: #909399; font-size: 12px; }
.mono { font-family: Consolas, Menlo, monospace; }

.tv-cell img.cell-corner-image { position:absolute;top:0;right:0;width:auto;height:52px;max-width:35%;object-fit:contain;background:none;border-radius:0;z-index:3; }

.entitlements-page { font-size:16px; line-height:1.5; }
.entitlement-toolbar { display:flex; flex-wrap:wrap; gap:16px; margin-bottom:24px; }
.entitlement-detail { white-space:pre-wrap; overflow-wrap:anywhere; padding:24px; }
.entitlements-page .el-form-item { margin-bottom:24px; }

.entitlement-dialog .el-dialog__body { max-height:calc(90vh - 140px); overflow-y:auto; }
.entitlement-dialog { --el-font-size-base:16px; }
@media(max-width:600px) { .entitlements-page .el-button,.entitlement-dialog .el-button { min-height:44px; } }

.entitlements-page .el-table .el-button { margin:0 8px 8px 0; }

/* Device and entitlement values each occupy one line; wide tables scroll horizontally. */
.entitlements-page .el-table .cell { white-space: nowrap; }

/* Keep right-side device actions fixed without a vertical shadow divider. */
.entitlements-page .device-table { --el-table-fixed-right-column:none; }

/* Keep all list and dialog pagination aligned consistently. */
.el-pagination { justify-content: flex-end; flex-wrap: wrap; gap: 8px; }

.sidebar button.nav-item,.sidebar .nav-group-toggle { width:100%;border:0;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer; }
.sidebar button.nav-item { border-left:3px solid transparent; }
.sidebar .nav-group-toggle { display:flex;align-items:center;gap:10px;padding:14px 20px;font-weight:600; }
.sidebar .nav-group-toggle:hover { background:rgba(255,255,255,.06); }
.sidebar button.nav-child { padding-left:36px;font-size:13px; }
.sidebar .nav-group-arrow { margin-left:auto;font-size:22px;line-height:16px;transition:transform .15s; }
.sidebar .nav-group-arrow.open { transform:rotate(90deg); }
.sidebar button:focus-visible { outline:2px solid #409eff;outline-offset:-3px; }

.hotel-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hotel-stats-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hotel-stats .stat-card { min-width: 0; }
.hotel-stats .stat-card .muted { margin: 8px 0; font-size: 12px; }

@media (min-width: 1800px) { .hotel-stats { grid-template-columns: repeat(6, minmax(0, 1fr)); } .hotel-stats-four { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .hotel-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .hotel-stats { grid-template-columns: minmax(0, 1fr); } }
