/* ==================================================================
   耍看影创 Studio —— v2 组件样式
   剧本 AI 分析面板 / 场景道具管理 / 纳米风格资产库
   依赖 app.css 里的 CSS 变量（--bg / --gold / --line ...）
   ================================================================== */

/* ---------------- 通用弹窗 ---------------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(0, 0, 0, .62); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal-box {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px;
  width: 100%; max-width: 560px; max-height: 88vh;
  display: flex; flex-direction: column; box-shadow: 0 24px 70px rgba(0, 0, 0, .6);
}
.modal-box.wide { max-width: 940px; }
.modal-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 22px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 700; }
.modal-body { padding: 20px 22px; overflow-y: auto; flex: 1; }
.modal-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-top: 1px solid var(--line); flex-shrink: 0;
}
.modal-close {
  background: none; border: none; color: var(--text-dim); font-size: 22px;
  cursor: pointer; line-height: 1; padding: 0 4px;
}
.modal-close:hover { color: var(--text); }

/* ---------------- Tab 条 ---------------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tab {
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--text-dim); padding: 9px 16px; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: .15s; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab .cnt { font-size: 12px; opacity: .7; margin-left: 4px; }

/* ---------------- AI 剧本分析结果 ---------------- */
.ana-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.ana-stat {
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 8px;
  padding: 12px; text-align: center; cursor: pointer; transition: .15s;
}
.ana-stat:hover { border-color: var(--gold); }
.ana-stat.active { border-color: var(--gold); background: rgba(201, 169, 97, .1); }
.ana-stat .n { font-size: 22px; font-weight: 800; color: var(--gold); }
.ana-stat .l { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.ana-list { display: flex; flex-direction: column; gap: 8px; }
.ana-item {
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 8px;
  padding: 11px 14px; font-size: 14px;
}
.ana-item .nm { font-weight: 700; color: var(--text); }
.ana-item .sub { color: var(--text-dim); font-size: 13px; margin-top: 4px; line-height: 1.55; }
.ana-item .pmt {
  color: var(--gold-soft); font-size: 12px; margin-top: 6px;
  background: rgba(201, 169, 97, .07); border-left: 2px solid var(--gold);
  padding: 5px 9px; border-radius: 0 5px 5px 0; word-break: break-word; line-height: 1.6;
}
.ana-mode {
  font-size: 12px; padding: 3px 10px; border-radius: 999px;
  background: rgba(201, 169, 97, .16); color: var(--gold-soft);
}
.ana-mode.offline { background: rgba(154, 163, 175, .16); color: var(--text-dim); }

.ana-loading { text-align: center; padding: 40px 20px; }
.ana-bar { height: 4px; background: var(--bg-3); border-radius: 3px; overflow: hidden; margin-top: 16px; }
.ana-bar > i {
  display: block; height: 100%; width: 34%; border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  animation: anaSlide 1.25s ease-in-out infinite;
}
@keyframes anaSlide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(330%); }
}

/* ---------------- 资产库：左树 + 右网格（学纳米流水线） ---------------- */
.asset-layout { display: grid; grid-template-columns: 190px 1fr; gap: 20px; align-items: start; }
.asset-tree {
  position: sticky; top: 0;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px; display: flex; flex-direction: column; gap: 2px;
}
.asset-tree .grp {
  font-size: 11px; color: var(--text-dim); font-weight: 700; letter-spacing: 1px;
  padding: 10px 10px 5px;
}
.tree-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 7px; cursor: pointer;
  color: var(--text-dim); font-size: 14px; transition: .12s;
  border: none; background: none; text-align: left; width: 100%; font-family: inherit;
}
.tree-item:hover { background: var(--bg-3); color: var(--text); }
.tree-item.active { background: rgba(201, 169, 97, .14); color: var(--gold-soft); font-weight: 600; }
.tree-item .ic { width: 17px; text-align: center; flex-shrink: 0; }
.tree-item .n { margin-left: auto; font-size: 12px; opacity: .65; }

.asset-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.asset-toolbar input[type="search"],
.asset-toolbar select {
  background: var(--bg-3); border: 1px solid var(--line); color: var(--text);
  padding: 8px 12px; border-radius: 8px; font-size: 14px; outline: none; font-family: inherit;
}
.asset-toolbar input[type="search"] { min-width: 210px; }
.asset-toolbar input[type="search"]:focus,
.asset-toolbar select:focus { border-color: var(--gold); }

.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
.asset-tile {
  position: relative; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; transition: .15s;
}
.asset-tile:hover { border-color: var(--gold); transform: translateY(-2px); }
.asset-tile .pic {
  width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; background: var(--bg-3);
}
.asset-tile .ph {
  width: 100%; aspect-ratio: 3/4; display: flex; align-items: center; justify-content: center;
  background: var(--bg-3); color: var(--text-dim); font-size: 30px;
}
.asset-tile .meta { padding: 9px 11px; }
.asset-tile .meta .t {
  font-size: 13px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.asset-tile .meta .s {
  font-size: 11px; color: var(--text-dim); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 操作条平时隐藏，鼠标移上去才浮出，保持版面清爽 */
.asset-tile .ops {
  position: absolute; left: 0; right: 0; bottom: 52px;
  display: flex; gap: 6px; justify-content: center; padding: 8px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .78));
  opacity: 0; transition: opacity .15s;
}
.asset-tile:hover .ops { opacity: 1; }
.asset-tile .ops button,
.asset-tile .ops a {
  background: rgba(20, 22, 28, .92); border: 1px solid var(--line); color: var(--text);
  border-radius: 6px; padding: 5px 10px; font-size: 12px; cursor: pointer;
  text-decoration: none; line-height: 1.4; font-family: inherit;
}
.asset-tile .ops button:hover,
.asset-tile .ops a:hover { border-color: var(--gold); color: var(--gold); }
.asset-tile .corner {
  position: absolute; top: 7px; right: 8px; font-size: 15px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .8); cursor: pointer; line-height: 1;
  background: none; border: none; padding: 0;
}
.asset-tile .badge {
  position: absolute; top: 7px; left: 8px;
  background: rgba(0, 0, 0, .68); color: var(--gold-soft);
  font-size: 10px; padding: 2px 7px; border-radius: 5px;
}

/* 四视图参考图槽位（场景 E/S/W/N） */
.view4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.view4 .slot {
  aspect-ratio: 1; border: 1px dashed var(--line); border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); font-size: 11px; cursor: pointer;
  background: var(--bg-3); overflow: hidden; position: relative;
}
.view4 .slot:hover { border-color: var(--gold); color: var(--gold); }
.view4 .slot img { width: 100%; height: 100%; object-fit: cover; }
.view4 .slot .lb {
  position: absolute; bottom: 0; left: 0; right: 0; text-align: center;
  background: rgba(0, 0, 0, .6); font-size: 10px; padding: 1px 0; color: var(--text);
}

@media (max-width: 900px) {
  .asset-layout { grid-template-columns: 1fr; }
  .asset-tree { position: static; flex-direction: row; flex-wrap: wrap; }
  .asset-tree .grp { display: none; }
  .tree-item { width: auto; }
  .ana-summary { grid-template-columns: repeat(2, 1fr); }
}

/* ==================================================================
   工作台首页（Vidu 风格）+ 导航增强
   ================================================================== */

/* Logo tagline */
.logo-tagline {
  font-size: 10px; color: var(--text-dim); letter-spacing: 1.5px;
  text-align: center; margin-top: -6px; padding-bottom: 8px;
}

/* Nav group labels */
.nav-grp {
  font-size: 11px; color: var(--text-dim); letter-spacing: 1px;
  padding: 10px 14px 4px; font-weight: 600;
}
.nav a .ai-dot {
  display: inline-block; width: 6px; height: 6px;
  background: var(--gold); border-radius: 50%; margin-left: 4px;
  vertical-align: middle;
}

/* Hero 区域 */
.home-hero {
  background:
    radial-gradient(1200px 620px at 12% -12%, rgba(201,169,97,.17), transparent 62%),
    radial-gradient(900px 520px at 88% 112%, rgba(201,169,97,.09), transparent 58%),
    linear-gradient(180deg, #12151b 0%, var(--bg) 100%);
  border-radius: 16px; border: 1px solid var(--line);
  overflow: hidden; position: relative; margin-bottom: 20px;
}
.home-hero::before {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 40px, rgba(201,169,97,.045) 40px, rgba(201,169,97,.045) 41px);
  pointer-events: none;
}
.hero-inner {
  display: flex; gap: 32px; padding: 48px 36px; position: relative; z-index: 1;
  align-items: center; min-height: 340px;
}
.hero-left { flex: 1; min-width: 0; }
.hero-right { width: 200px; flex-shrink: 0; }

.hero-brand {
  font-size: 11px; letter-spacing: 3px; color: var(--gold);
  font-weight: 700; margin-bottom: 12px;
}
.hero-brand::after {
  content: ''; display: block; width: 60px; height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent); margin-top: 6px;
}
.hero-title {
  font-size: 34px; font-weight: 800; color: var(--text);
  line-height: 1.25; margin: 0 0 12px;
}
.hero-sub {
  font-size: 14px; color: var(--text-dim); line-height: 1.7;
  margin: 0 0 22px; max-width: 420px;
}
.hero-ctas { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.btn-lg { padding: 13px 24px; font-size: 15px; }
.hero-status {
  font-size: 12px; color: var(--text-dim); display: flex; align-items: center; gap: 6px;
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%; display: inline-block;
}
.status-dot.on { background: #4caf7d; box-shadow: 0 0 6px rgba(76,175,125,.5); }
.status-dot.off { background: var(--text-dim); }

/* 胶片条 */
.film-strip { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.film-card {
  width: 80px; height: 120px; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0,0,0,.35);
  transition: transform .2s;
}
.film-card:hover { transform: scale(1.06) !important; border-color: var(--gold); }
.film-card img { width: 100%; height: 100%; object-fit: cover; }
.film-placeholder { display: flex; flex-direction: column; gap: 8px; }
.film-skeleton {
  width: 80px; height: 120px; border-radius: 8px;
  background: var(--bg-3); border: 1px dashed var(--line);
  animation: heroSheen 2s ease-in-out infinite;
}
@keyframes heroSheen {
  0%, 100% { opacity: .4; }
  50% { opacity: .8; }
}

/* 三步流水线 */
.pipeline {
  display: flex; align-items: stretch; gap: 0;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 20px 24px; margin-bottom: 20px;
}
.pipe-step {
  flex: 1; display: flex; flex-direction: column; gap: 6px;
  padding: 0 12px; position: relative;
}
.pipe-highlight {
  background: rgba(201,169,97,.07); border-radius: 8px;
  border: 1px solid rgba(201,169,97,.25);
}
.pipe-num {
  font-size: 22px; font-weight: 800; color: var(--gold);
  line-height: 1;
}
.pipe-step:not(.pipe-highlight) .pipe-num { color: var(--text-dim); }
.pipe-body strong { font-size: 14px; color: var(--text); }
.pipe-sub { font-size: 12px; color: var(--text-dim); }
.pipe-connector {
  width: 40px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; position: relative;
}
.pipe-connector::after {
  content: ''; width: 24px; height: 1px;
  background: linear-gradient(90deg, var(--gold), var(--line));
}

/* 剧本迷你卡 */
.script-mini { padding: 12px 14px; transition: .15s; }
.script-mini:hover { border-color: var(--gold); }

/* 分析状态徽章 */
.ana-badge {
  font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 600;
  white-space: nowrap; flex-shrink: 0;
}
.ana-badge.done { background: rgba(76,175,125,.15); color: var(--green); }
.ana-badge.waiting { background: rgba(201,169,97,.18); color: var(--gold); }
.ana-badge.todo { background: transparent; color: var(--gold); border: 1px solid var(--gold); }
.ana-badge.empty { background: rgba(154,163,175,.12); color: var(--text-dim); }

/* AI 分析常驻面板（详情页左栏） */
.ai-panel {
  background: rgba(201,169,97,.05); border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0; padding: 14px 16px; margin: 14px 0;
}
.ai-panel-inner { display: flex; flex-direction: column; gap: 6px; }
.btn-sm { padding: 7px 14px; font-size: 12px; }

/* 底部数据条 */
.stats-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 18px; margin-top: 20px;
}
.stat-chip {
  font-size: 12px; color: var(--text-dim); background: var(--bg-3);
  padding: 3px 10px; border-radius: 6px;
}
.stat-link {
  font-size: 12px; color: var(--gold); margin-left: auto; cursor: pointer;
  text-decoration: none; font-weight: 600;
}
.stat-link:hover { text-decoration: underline; }

/* 响应式 */
@media (max-width: 900px) {
  .hero-inner { flex-direction: column; padding: 32px 20px; min-height: auto; }
  .hero-right { display: none; }
  .hero-title { font-size: 26px; }
  .pipeline { flex-direction: column; gap: 12px; }
  .pipe-connector { width: 1px; height: 20px; }
  .pipe-connector::after { width: 1px; height: 20px; background: linear-gradient(180deg, var(--gold), var(--line)); }
}
@media (prefers-reduced-motion: reduce) {
  .film-skeleton { animation: none; }
}
