/* 图书带货视频生成系统 - 深灰 + 橙 扁平风 */
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

:root {
  --bg: #17181a;
  --card: #212327;
  --card2: #26282d;
  --line: #33363c;
  --text: #e8e6e3;
  --muted: #9a9da3;
  --accent: #e8833a;
  --accent-h: #f0954f;
  --ok: #6fbf4a;
  --err: #f56c6c;
  --radius: 12px;
}

/* 浅色主题（左下角键钮切换，localStorage 记忆） */
html[data-theme="light"] {
  --bg: #f2f3f5;
  --card: #ffffff;
  --card2: #f5f6f8;
  --line: #e3e5ea;
  --text: #26282c;
  --muted: #7a7f87;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
}

button {
  border: 1px solid var(--line);
  background: var(--card2);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}
button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-h); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover:not(:disabled) { background: var(--accent-h); color: #fff; }
button.big { padding: 12px 16px; font-size: 15px; width: 100%; }
button.mini { padding: 4px 9px; font-size: 12.5px; border-radius: 7px; }
button.del:hover:not(:disabled) { border-color: var(--err); color: var(--err); }

input, select, textarea {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; }
input[type="range"] { padding: 0; accent-color: var(--accent); border: none; background: transparent; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--accent); }

/* ---------- 系统布局：左侧栏 + 主内容区 ---------- */
.shell { display: flex; min-height: 100vh; }
.side {
  width: 200px;
  flex: none;
  display: flex;
  flex-direction: column;
  padding: 18px 12px 14px;
  background: var(--card);
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: 100vh;
  transition: width .18s ease;
}
.side-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 6px 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.logo-mark {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #f5a15d, #e8833a 55%, #d96f28);
  color: #fff;
  font-size: 21px;
  font-weight: 800;
  font-family: "Segoe UI", Arial, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 2px 8px rgba(232, 131, 58, .35);
}
.logo-text { font-size: 14px; font-weight: 600; line-height: 1.35; }
.side-toggle { align-self: center; }
.side-toggle {
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.side-toggle svg { width: 15px; height: 15px; transition: transform .18s; }
.side-toggle:hover { background: var(--card2); color: var(--text); border-color: transparent; }
.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 0 0 auto; }
.side-flex { flex: 1 1 0; min-height: 12px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: var(--muted);
  font-size: 14.5px;
  text-align: left;
}
.nav-item svg { width: 18px; height: 18px; flex: none; }
.nav-item:hover { background: var(--card2); color: var(--text); border-color: transparent; }
.nav-item.active { background: var(--accent); color: #fff; }
.nav-item.active:hover { color: #fff; }
.side-foot {
  /* 底部键钮组：头像/设置/主题/收起箭头，居左排列 */
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  flex: none;
  z-index: 6;
}
.side-fab {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  background: var(--card2);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}
.side-fab svg { width: 16px; height: 16px; }
.side-fab:hover { color: var(--accent-h); border-color: var(--accent); }
.side-fab.is-user { background: var(--accent); border-color: var(--accent); color: #fff; }
.user-wrap { position: relative; display: flex; align-items: center; }
.user-pop {
  position: absolute;
  left: calc(100% + 8px);
  bottom: 0;
  width: auto;
  height: 34px;
  border-radius: 17px;
  padding: 7px 15px;
  display: none;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  z-index: 30;
  background: var(--card);
}
.user-pop svg { width: 15px; height: 15px; }
.user-pop:hover { color: var(--err); border-color: var(--err); }
.user-wrap:hover .user-pop, .user-pop:focus-visible { display: flex; }
/* 未登录时只显示头像键（点击弹登录），不出退出钮 */
.user-wrap:not(:has(.is-user)) .user-pop { display: none; }
.main-wrap { flex: 1; min-width: 0; }

/* 主题键钮图标：深色显示太阳（点它变浅色），浅色显示月亮 */
html[data-theme="dark"] .ico-sun { display: none; }
html[data-theme="light"] .ico-sun { display: block; }
html[data-theme="light"] .ico-moon { display: none; }

/* ---------- 侧栏收起态（顶部按钮切换，localStorage 记忆） ---------- */
html[data-side="collapsed"] .side { width: 58px; padding: 14px 9px 12px; align-items: center; }
/* 收起态：箭头按钮由 margin:auto 自动居中于三键上方 */
html[data-side="collapsed"] .side-logo { padding: 0 0 12px; margin-bottom: 10px; border-bottom: none; justify-content: center; }
html[data-side="collapsed"] .logo-text { display: none; }
html[data-side="collapsed"] .side-toggle svg { transform: rotate(180deg); }
html[data-side="collapsed"] .nav-item { padding: 10px; justify-content: center; }
html[data-side="collapsed"] .nav-item span { display: none; }
html[data-side="collapsed"] .side-foot { flex-direction: column; gap: 8px; }

/* ---------- 片头书单 ---------- */
.car-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 86px;
}
.car-item {
  position: relative;
  width: 64px;
  flex: none;
}
.car-item img {
  width: 64px;
  height: 85px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: block;
}
.car-name {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.car-del {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: #b3402f;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
.car-add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.car-add input {
  width: 200px;
  max-width: 45%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}
.sub-block {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.s-count {
  align-self: flex-start;
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 6px;
  flex: none;
}

/* ---------- 布局 ---------- */
main {
  max-width: 940px;
  margin: 20px auto;
  padding: 0 20px;
}
#view-history { max-width: 1300px; }
.flow { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* ---------- 制作页步骤导航（点按直达，滚动跟随高亮） ---------- */
.stepnav {
  position: sticky;
  top: 10px;
  z-index: 9;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 7px 9px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.stepnav button {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  border-radius: 16px;
  font-size: 13px;
  padding: 5px 13px;
}
.stepnav button:hover { background: var(--card2); color: var(--text); border-color: var(--line); }
.stepnav button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.stepnav button.active:hover { color: #fff; }
.card { scroll-margin-top: 84px; }

/* ---------- 登录浮层 ---------- */
.login-box {
  width: min(340px, 92vw);
  background: var(--card);
  border-radius: 16px;
  padding: 30px 28px 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
}
.login-mark {
  width: 54px;
  height: 54px;
  margin: 0 auto;
  border-radius: 15px;
  background: linear-gradient(135deg, #f5a15d, #e8833a 55%, #d96f28);
  color: #fff;
  font-size: 30px;
  font-weight: 800;
  font-family: "Segoe UI", Arial, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 3px 10px rgba(232, 131, 58, .35);
}
.login-title { font-size: 17px; font-weight: 700; }
.login-sub { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
#btn_login { margin-top: 6px; }
#login_error { text-align: center; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sec-title {
  font-size: 15.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}
.step {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex: none;
}
.covers-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cover-sub {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.sub-title { font-weight: 600; font-size: 14px; color: var(--text); }
@media (max-width: 720px) { .covers-grid { grid-template-columns: 1fr; } }
.sec-title .spacer { flex: 1; }
.small-sel { width: auto; padding: 5px 8px; font-size: 13px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--muted); min-width: 0; }
label > input, label > select, label > div { width: 100%; }

.hint { font-size: 12.5px; color: var(--muted); }
.hint-inline { font-size: 12px; font-weight: 400; color: var(--muted); }
.switch-row {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}
.pos-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pos-row label { flex-direction: row; align-items: center; gap: 4px; color: var(--text); cursor: pointer; }
.pos-row .hint { margin-right: 2px; }

/* ---------- 封面/书封 媒体行 ---------- */
.media-row { display: flex; gap: 14px; align-items: flex-start; }
.thumb-lg {
  width: 96px;
  height: 128px;
  border-radius: 10px;
  background: var(--card2);
  border: 1px dashed var(--line);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  position: relative;
}
.thumb-lg img { width: 100%; height: 100%; object-fit: cover; }
.thumb-lg .ph { font-size: 12px; color: var(--muted); }
.btn-col { display: flex; flex-direction: column; gap: 8px; }
.voice-row { display: flex; gap: 8px; align-items: center; }
.voice-row select { flex: 1; min-width: 0; }
.voice-row .mini { flex: none; }
.slider-label span { color: var(--accent-h); }

/* ---------- 音色克隆 ---------- */
.clone-box {
  grid-column: 1 / -1;
  border: 1px dashed var(--line, #444);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.clone-row { display: flex; gap: 8px; align-items: center; }
.clone-row input[type="file"] { flex: 1; min-width: 0; }
.clone-row input[type="text"] { flex: 1; min-width: 0; }
.clone-row .btn { flex: none; }

/* ---------- 分镜卡 ---------- */
.import-row { display: flex; gap: 10px; align-items: stretch; }
.import-row textarea { flex: 1; min-width: 0; }

.storyboard { display: flex; flex-direction: column; gap: 12px; max-height: 62vh; overflow-y: auto; padding-right: 4px; }
.scene-card {
  background: var(--card2);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.s-row1 { display: flex; gap: 10px; min-width: 0; }
.no {
  width: 22px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
}
.thumb, .thumb.empty {
  width: 64px;
  height: 85px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--line);
  flex: none;
}
.s-text { flex: 1; min-width: 0; }
.s-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 152px;
  flex: none;
  align-content: flex-start;
}
.s-row2 { display: flex; gap: 10px; }
.s-motion { width: 132px; flex: none; font-size: 13px; }
.s-prompt { flex: 1; min-width: 0; font-size: 13px; }

.tag {
  font-size: 12px;
  color: var(--accent-h);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 0 10px;
  line-height: 20px;
}
.btn-row { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; }
.btn-row.center { justify-content: center; }
.btn-row .big { width: auto; flex: 1 1 auto; }
.action-card { gap: 10px; }

/* ---------- 进度 / 预览 ---------- */
.progress {
  height: 8px;
  background: var(--card2);
  border-radius: 6px;
  overflow: hidden;
}
#progress_bar { height: 100%; width: 0; background: var(--accent); border-radius: 6px; transition: width .4s; }
.error { color: var(--err); font-size: 13.5px; white-space: pre-wrap; }
.error.ok { color: var(--ok); }
#preview_card video { width: 100%; max-width: 420px; border-radius: 10px; background: #000; }
.download {
  color: var(--accent-h);
  font-size: 14px;
  text-decoration: none;
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 8px 18px;
  align-self: flex-start;
}
.download:hover { background: var(--accent); color: #fff; }

/* ---------- 任务历史 ---------- */
.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}
.hist-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-wrap: wrap;   /* 按钮多时整行换行，不挤压信息区 */
  gap: 14px;
  align-items: center;
}
.h-thumb {
  width: 72px;
  height: 96px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--card2);
  flex: none;
}
.h-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.h-title {
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  word-break: break-word;
  line-height: 1.45;
}
.h-sub { font-size: 12.5px; color: var(--muted); }
.h-status { font-size: 12.5px; color: var(--muted); }
.h-status.ok { color: var(--ok); }
.h-status.run { color: var(--accent-h); }
.h-btns { display: flex; flex-direction: column; gap: 8px; flex: none; }

/* ---------- 素材库弹窗 ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .62);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.modal[hidden] { display: none; }
.modal-box {
  background: var(--card);
  border-radius: var(--radius);
  width: min(880px, 94vw);
  max-height: 88vh;
  overflow-y: auto;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15.5px;
  font-weight: 600;
}
.modal-head small { color: var(--accent-h); font-weight: 400; margin-left: 8px; }
.modal-actions { display: flex; align-items: center; gap: 14px; }
.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 12px;
}
.asset-grid img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
}
.asset-grid img:hover { border-color: var(--accent); }

/* ---------- 响应式 ---------- */
@media (max-width: 1020px) {
  main { grid-template-columns: 1fr; }
  .storyboard { max-height: none; }
}

/* ---------- 库页分类标签 ---------- */
.lib-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.lib-tab { padding: 7px 18px; border-radius: 18px; }
.lib-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.lib-tab.active:hover { color: #fff; }
.lib-toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }

/* ---------- 素材库页 ---------- */
.lib-item {
  background: var(--card2);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lib-item img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 8px;
  background: var(--line);
}
.lib-name {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lib-ops { display: flex; gap: 6px; }

.audio-list { display: flex; flex-direction: column; gap: 10px; }
.audio-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border-radius: 10px;
  padding: 12px 14px;
  flex-wrap: wrap;
}
.audio-name { flex: 1; min-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }

.video-list { display: flex; flex-direction: column; gap: 10px; }
.video-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border-radius: 10px;
  padding: 12px 14px;
  flex-wrap: wrap;
}
.video-item .v-info, .video-item .v-btns { display: flex; flex-direction: column; gap: 4px; }
.video-item .v-btns { flex-direction: row; align-items: center; flex-wrap: wrap; }
.video-item .v-info { flex: 1; min-width: 180px; }
.dl-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}
.dl-link:hover { border-color: var(--accent); color: var(--accent-h); }

/* ---------- 配音库页 ---------- */
.v-card {
  background: var(--card2);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.v-card.default { border-color: var(--accent); }
.v-name { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.v-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.tag2 { font-size: 11px; color: #fff; background: var(--accent); border-radius: 6px; padding: 1px 8px; font-weight: 400; }
.reclone-form {
  border-top: 1px dashed var(--line);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.reclone-form select, .reclone-form input[type="file"] { flex: 1; min-width: 0; }

.v-group { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; }
.v-group summary { cursor: pointer; font-weight: 600; }
.v-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
  flex-wrap: wrap;
}
.v-row:last-child { border-bottom: none; }
.v-label { flex: 1; min-width: 200px; font-size: 14px; }

.hint.ok { color: var(--ok); }
.hint.err { color: var(--err); }

/* ---------- 成片播放弹窗 ---------- */
.video-box { width: min(560px, 94vw); }
.video-box video { width: 100%; border-radius: 10px; background: #000; }

/* ---------- 二期：历史页工具栏 / 最近使用标记 / 快捷键提示 ---------- */
.hist-toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.hist-toolbar input { flex: 1; min-width: 160px; max-width: 320px; }
.hist-toolbar select { width: auto; min-width: 130px; }
.h-author { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 6px; }
.hint.center { text-align: center; }
.hist-card .h-btns { flex: 1 1 100%; flex-direction: row; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.used-chip {
  position: absolute; top: 16px; left: 16px; z-index: 2;
  font-size: 11px; color: #fff; background: var(--accent);
  border-radius: 6px; padding: 1px 8px; pointer-events: none;
}
.lib-item, .asset-item { position: relative; }

/* ---------- 三期：选品库 / 风格卡片 / 来源chip ---------- */
.prod-toolbar .spacer { flex: 1; }
.prod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 14px;
}
.prod-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.p-cover { position: relative; }
.p-cover img, .p-ph {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 8px;
  background: var(--card2);
}
.p-ph { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; }
.p-status {
  position: absolute; top: 8px; left: 8px;
  font-size: 11px; color: #fff; background: rgba(0, 0, 0, .55);
  border-radius: 6px; padding: 1px 8px;
}
.p-status.ok { background: var(--ok); }
.p-status.run { background: var(--accent); }
.p-hot {
  position: absolute; top: 8px; right: 8px;
  font-size: 11px; color: #fff; background: var(--err);
  border-radius: 6px; padding: 1px 8px;
}
.p-info { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.p-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-author { font-size: 12.5px; color: var(--muted); }
.p-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.p-tag {
  font-size: 11px; color: var(--accent-h);
  border: 1px solid var(--line); border-radius: 8px;  padding: 0 7px; line-height: 18px;
}
.p-tag.p-cat { background: var(--accent); border-color: var(--accent); color: #fff; }
.p-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.p-price { color: var(--err); font-size: 13.5px; font-weight: 600; }
.p-desc {
  font-size: 12px; color: var(--muted); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.p-btns { display: flex; gap: 6px; justify-content: flex-end; }

.prod-box { width: min(640px, 94vw); }

.pick-block select { max-width: 460px; }
.style-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 6px;
}
.style-card {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  align-items: flex-start;
  border-radius: 10px;
}
.style-card.sel {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  background: var(--card2);
}
.sc-name { font-weight: 600; font-size: 14px; color: var(--text); display: inline-flex; gap: 6px; align-items: center; }
.style-card.sel .sc-name { color: var(--accent-h); }
.sc-soon {
  font-style: normal; font-size: 10.5px; color: #fff;
  background: var(--muted); border-radius: 6px; padding: 0 6px;
}
.sc-cur {
  font-style: normal; font-size: 10.5px; color: #fff;
  background: var(--accent); border-radius: 6px; padding: 0 6px;
}
.sc-desc { font-size: 12px; color: var(--muted); line-height: 1.5; }
.src-book { color: var(--accent-h); }
.comm-val { color: var(--err); font-weight: 600; font-size: 14px; }
.p-comm { color: var(--ok); font-size: 12.5px; font-weight: 600; }

/* ---------- 平板/手机：选品卡片单列 ---------- */
@media (max-width: 640px) {
  .prod-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .style-cards { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .side { width: 58px; padding: 14px 9px 12px; align-items: center; }
  .logo-text, .nav-item span { display: none; }
  .side-toggle { display: none; }
  .side-logo { padding: 0 0 12px; margin-bottom: 10px; border-bottom: none; justify-content: center; }
  .logo-mark { width: 30px; height: 30px; font-size: 17px; border-radius: 8px; }
  .nav-item { padding: 10px; justify-content: center; }
  .side-foot { flex-direction: column; gap: 8px; }
  main { padding: 0 12px; }
}

/* ---------- 手机端适配 ---------- */
@media (max-width: 640px) {
  main { margin: 10px auto; padding: 0 10px; }
  .card { padding: 15px 13px; border-radius: 12px; gap: 12px; }
  .stepnav { gap: 5px; padding: 6px 7px; top: 6px; }
  .stepnav button { padding: 4px 10px; font-size: 12.5px; }
  .sec-title { font-size: 14.5px; }
  /* iOS 输入框字号小于 16px 会自动放大页面，统一提到 16px */
  input, select, textarea { font-size: 16px; }
  .btn-row { gap: 8px; }
  .btn-row button, .btn-row .big { flex: 1 1 100%; width: 100%; }
  .car-strip { gap: 8px; }
  .scene-card { padding: 12px 11px; }
  .covers-grid { grid-template-columns: 1fr; }
  .v-label { min-width: 120px; }
  .audio-item, .video-item { gap: 8px; }
  .audio-name { flex-basis: 100%; order: 2; }
  .v-btns { justify-content: flex-start; }
  .clone-row { flex-wrap: wrap; }
  .clone-row input, .clone-row select { flex: 1 1 160px; }
  .video-item .v-info { flex-basis: 100%; }
  .hist-card { flex-wrap: wrap; }
  .hist-card .h-btns { justify-content: flex-start; }
}

