/* ============================================================
 * theme.css —— 创作中心统一主题
 * 香槟金 #D437 主色 + 深色文字，柔和色标签
 * ============================================================ */

:root {
  --gold: #D437;
  --gold-soft: #F4DFA6;
  --gold-deep: #a97c1b;
  --gold-wash: rgba(212, 55, 55, .08);

  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-2: #fafbfc;
  --line: #e6e8eb;
  --line-2: #eef0f2;

  --text: #1f2328;
  --text-2: #5b6470;
  --text-3: #8b95a1;

  --ok: #12a150;
  --warn: #d98b00;
  --err: #d437;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .06);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);

  --sidebar-w: 232px;
  --topbar-h: 56px;
}

* { box-sizing: border-box; }

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

body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 system-ui, -apple-system, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: .92em;
  background: var(--line-2);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ---------- 登录 ---------- */
.login-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #faf7f0 0%, #f4f6f8 100%);
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 32px 28px;
  text-align: center;
}
.login-logo {
  width: 48px; height: 48px;
  margin: 0 auto 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  color: #3a2a0e;
  display: flex; align-items: center; justify-content: center;
  font: 800 24px/1 system-ui;
  box-shadow: 0 6px 16px rgba(212, 55, 55, .28);
}
.login-card h1 { margin: 0 0 6px; font-size: 20px; font-weight: 700; }
.login-sub { margin: 0 0 20px; color: var(--text-3); font-size: 12.5px; }
.login-card input {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--panel-2);
  transition: border-color .18s, box-shadow .18s;
}
.login-card input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-wash);
  background: #fff;
}
.login-msg { min-height: 18px; margin-top: 10px; font-size: 12.5px; color: var(--err); }
.login-foot { margin-top: 8px; font-size: 11.5px; color: var(--text-3); }
.login-seg { margin-bottom: 16px; }

/* ---------- 分段控件 ---------- */
.seg {
  display: inline-flex;
  background: var(--line-2);
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
}
.seg button {
  border: 0;
  background: transparent;
  color: var(--text-2);
  padding: 7px 15px;
  border-radius: 7px;
  font-size: 13px;
  cursor: pointer;
  transition: background .18s, color .18s;
  font-family: inherit;
}
.seg button.on {
  background: #fff;
  color: var(--gold);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* ---------- 按钮 ---------- */
.btn-primary {
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--gold), #b82c2c);
  color: #fff;
  font: 600 14px/1 inherit;
  cursor: pointer;
  transition: filter .18s, transform .1s;
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font: 500 13px/1 inherit;
  cursor: pointer;
  transition: all .18s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--gold); color: var(--gold); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary-sm {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
}
.btn-primary-sm:hover { filter: brightness(1.06); color: #fff; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  z-index: 50;
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo-mark {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  color: #3a2a0e;
  display: flex; align-items: center; justify-content: center;
  font: 800 15px/1 system-ui;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text b { font-size: 14.5px; font-weight: 700; }
.brand-text span { font-size: 11px; color: var(--text-3); }

.top-right { display: flex; align-items: center; gap: 9px; }
.points {
  font-size: 12.5px;
  color: var(--text-2);
  background: var(--line-2);
  padding: 4px 9px;
  border-radius: 7px;
}
.points b { color: var(--gold); }
.badge {
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--gold-wash);
  color: var(--gold);
  font-weight: 600;
}
.badge.trial { background: rgba(217, 139, 0, .1); color: var(--warn); }
.badge.locked { background: rgba(212, 55, 55, .1); color: var(--err); }
.icon-btn {
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text-2);
  font: 500 12.5px/1 inherit;
  cursor: pointer;
  transition: all .18s;
}
.icon-btn:hover { border-color: var(--gold); color: var(--gold); }

/* ---------- 侧栏 ---------- */
.sidebar {
  position: fixed;
  top: var(--topbar-h);
  bottom: 0;
  left: 0;
  width: var(--sidebar-w);
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  z-index: 40;
  overflow-y: auto;
}
.nav-group-label {
  font-size: 11px;
  color: var(--text-3);
  padding: 12px 10px 6px;
  letter-spacing: .04em;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 10px;
  margin-bottom: 2px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 13.5px;
  cursor: pointer;
  transition: background .16s, color .16s;
  user-select: none;
}
.nav-item:hover { background: var(--line-2); color: var(--text); }
.nav-item.on {
  background: var(--gold-wash);
  color: var(--gold);
  font-weight: 600;
}
.nav-ico { width: 20px; text-align: center; font-size: 15px; }
.nav-tag {
  margin-left: auto;
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--line-2);
  color: var(--text-3);
}
.nav-item.on .nav-tag { background: rgba(212,55,55,.12); color: var(--gold); }

.side-foot {
  margin-top: auto;
  padding: 12px 10px 4px;
  border-top: 1px solid var(--line-2);
}
.side-info {
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  gap: 6px;
}
.side-info code { font-size: 10px; }

/* ---------- 内容区 ---------- */
.content {
  margin-top: var(--topbar-h);
  margin-left: var(--sidebar-w);
  padding: 20px 22px 40px;
  min-height: calc(100vh - var(--topbar-h));
}
.page-head { margin-bottom: 18px; }
.page-head h2 {
  margin: 0 0 4px;
  font-size: 19px;
  font-weight: 700;
}
.page-head p { margin: 0; color: var(--text-3); font-size: 12.5px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px;
  margin-bottom: 14px;
}
.card-title {
  font-size: 14.5px;
  font-weight: 600;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

/* ---------- 表单 ---------- */
.field { margin-bottom: 13px; }
.field label {
  display: block;
  font-size: 12.5px;
  color: var(--text-2);
  margin-bottom: 6px;
  font-weight: 500;
}
.field input[type=text],
.field input[type=password],
.field input[type=number],
.field textarea,
.field select {
  width: 100%;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font: 14px/1.5 inherit;
  background: var(--panel-2);
  transition: border-color .18s, box-shadow .18s;
  font-family: inherit;
}
.field textarea { min-height: 88px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-wash);
  background: #fff;
}
.field .hint { font-size: 11.5px; color: var(--text-3); margin-top: 5px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 160px; }

/* ---------- 上传区 ---------- */
.drop {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
  cursor: pointer;
  transition: all .18s;
  background: var(--panel-2);
}
.drop:hover, .drop.over {
  border-color: var(--gold);
  background: var(--gold-wash);
  color: var(--gold);
}

/* ---------- 分镜网格 ---------- */
.scene-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  gap: 10px;
}
.scene-cell {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
  transition: border-color .18s;
}
.scene-cell:hover { border-color: var(--gold); }
.scene-thumb {
  width: 100%;
  aspect-ratio: 9 / 16;
  background: var(--line-2);
  object-fit: cover;
  display: block;
}
.scene-thumb.ph {
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 11px;
}
.scene-meta {
  padding: 6px 8px;
  font-size: 11px;
  color: var(--text-3);
  display: flex;
  justify-content: space-between;
}
.scene-meta input {
  width: 100%;
  border: 0;
  border-bottom: 1px dashed var(--line);
  font: 12px/1.5 inherit;
  padding: 2px 0;
  background: transparent;
  color: var(--text);
}
.scene-meta input:focus { outline: none; border-color: var(--gold); }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.tbl th {
  text-align: left;
  padding: 9px 11px;
  color: var(--text-3);
  font-weight: 500;
  font-size: 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.tbl td {
  padding: 10px 11px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
}
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tr:hover td { background: var(--panel-2); }

.tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--line-2);
  color: var(--text-2);
}
.tag.ok { background: rgba(18,161,80,.1); color: var(--ok); }
.tag.err { background: rgba(212,55,55,.1); color: var(--err); }
.tag.gold { background: var(--gold-wash); color: var(--gold); }

/* ---------- 空状态 ---------- */
.empty {
  text-align: center;
  padding: 34px 16px;
  color: var(--text-3);
  font-size: 13px;
}
.empty .ico { font-size: 30px; display: block; margin-bottom: 8px; opacity: .5; }

/* ---------- 模块容器（内嵌各功能页） ---------- */
.module-frame {
  width: 100%;
  height: calc(100vh - var(--topbar-h) - 84px);
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.module-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------- 提示条 ---------- */
.notice {
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  margin-bottom: 13px;
  background: var(--gold-wash);
  color: var(--gold-deep);
  border: 1px solid rgba(212, 55, 55, .16);
}
.notice.warn { background: rgba(217,139,0,.08); color: var(--warn); border-color: rgba(217,139,0,.2); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%) translateY(14px);
  background: rgba(31, 35, 40, .94);
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s, transform .22s;
  z-index: 200;
  max-width: 80vw;
  text-align: center;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 进度条 ---------- */
.bar {
  height: 6px;
  background: var(--line-2);
  border-radius: 4px;
  overflow: hidden;
  margin: 8px 0;
}
.bar > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold-soft), var(--gold));
  border-radius: 4px;
  transition: width .3s;
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .sidebar {
    width: 210px;
    transform: translateX(-100%);
    transition: transform .24s;
    box-shadow: var(--shadow);
  }
  .sidebar.open { transform: translateX(0); }
  .content { margin-left: 0; padding: 16px 14px 40px; }
  .menu-toggle { display: flex !important; }
}
.menu-toggle {
  display: none;
  width: 32px; height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}
