/* 创作工具页（/tools/quick|views|outfit）样式。
   与 app-shell.css 同一套深色语言：深底、青金强调、圆角面板。
   页面由 app-shell.js 挂在全局顶栏（.pg-cloud-bar）之下。 */

.pg-tools-page {
  display: none;
  padding: calc(var(--pg-density-topbar-h, 56px) + 16px) var(--pg-density-gutter-tight, 20px) 40px;
  max-width: var(--pg-density-max, 1760px);
  margin: 0 auto;
}
.pg-tools-page.show { display: block; }

/* ---- 顶部工具切换条 ---- */
.pg-tool-switcher {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 18px;
}
.pg-tool-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pg-tool-nav a, .pg-tool-nav .pg-tool-nav-disabled {
  appearance: none; border: 1px solid transparent; cursor: pointer;
  padding: 7px 14px; border-radius: 999px; font-size: 13.5px; line-height: 1;
  color: rgba(223, 240, 236, .72); background: rgba(255,255,255,.03);
  text-decoration: none; transition: all .18s ease;
}
.pg-tool-nav a:hover { background: rgba(255,255,255,.07); color: #eaf6f2; }
.pg-tool-nav a.active {
  color: #061313; font-weight: 600;
  background: linear-gradient(135deg, #6ee7df, #f5c16c);
  border-color: transparent;
}
.pg-tool-nav .pg-tool-nav-disabled {
  opacity: .45; cursor: not-allowed; background: transparent;
}
.pg-tool-history-filter { display: flex; gap: 4px; background: rgba(255,255,255,.03); border-radius: 999px; padding: 3px; }
.pg-tool-history-filter button {
  appearance: none; border: 0; cursor: pointer; padding: 5px 13px; border-radius: 999px;
  font-size: 12.5px; color: rgba(223,240,236,.66); background: transparent;
}
.pg-tool-history-filter button[aria-pressed="true"] { background: rgba(255,255,255,.1); color: #eaf6f2; }

/* ---- 两栏工作台 ---- */
.pg-tool-workbench { display: grid; grid-template-columns: minmax(340px, 420px) 1fr; gap: 18px; align-items: start; }
@media (max-width: 960px) { .pg-tool-workbench { grid-template-columns: 1fr; } }

.pg-tool-controls, .pg-tool-history {
  background: linear-gradient(160deg, rgba(19,32,36,.72), rgba(9,15,22,.9));
  border: 1px solid rgba(180,245,232,.12);
  border-radius: 16px; padding: 20px;
}

/* 左栏 */
.pg-tool-eyebrow { font-size: 11px; letter-spacing: .22em; color: rgba(160,189,181,.8); }
.pg-tool-title-row { display: flex; align-items: center; gap: 12px; margin: 6px 0 4px; }
.pg-tool-title-row h1 { font-size: 26px; margin: 0; color: #f0f6f3; letter-spacing: .5px; }
.pg-tool-subtitle { margin: 0 0 18px; color: rgba(210,228,222,.62); font-size: 13.5px; }
.pg-tool-mode-toggle { display: inline-flex; gap: 4px; background: rgba(255,255,255,.05); border-radius: 999px; padding: 3px; }
.pg-tool-mode-toggle button { appearance: none; border: 0; cursor: pointer; padding: 5px 14px; border-radius: 999px; font-size: 12.5px; color: rgba(223,240,236,.66); background: transparent; }
.pg-tool-mode-toggle button[aria-pressed="true"] { background: rgba(110,231,223,.18); color: #bff3ec; }
.pg-tool-mode-toggle button.is-disabled { opacity: .45; cursor: not-allowed; }

.pg-tool-field-heading { display: flex; align-items: baseline; justify-content: space-between; margin: 16px 0 8px; font-size: 13.5px; color: #e6efec; }
.pg-tool-field-heading small { color: rgba(190,210,204,.55); font-size: 12px; }
.pg-character-requirement { font-size: 11px; margin-left: 6px; padding: 1px 6px; border-radius: 999px; background: rgba(255,255,255,.07); color: rgba(210,228,222,.7); }
.pg-character-requirement.is-required { background: rgba(245,193,108,.18); color: #f5c16c; }

.pg-tool-reference-list { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.pg-tool-upload {
  width: 64px; height: 64px; border-radius: 12px; cursor: pointer;
  border: 1.5px dashed rgba(180,245,232,.28); background: rgba(255,255,255,.02);
  display: flex; align-items: center; justify-content: center;
  color: rgba(210,228,222,.6); transition: all .15s ease;
}
.pg-tool-upload:hover { border-color: rgba(110,231,223,.5); color: #bff3ec; }
.pg-tool-upload input { display: none; }
.pg-tool-upload b { font-size: 22px; font-weight: 400; }
.pg-tool-ref-thumb { position: relative; width: 64px; height: 64px; border-radius: 12px; overflow: hidden; border: 1px solid rgba(180,245,232,.2); }
.pg-tool-ref-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pg-tool-ref-remove { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%; border: 0; cursor: pointer; background: rgba(0,0,0,.65); color: #fff; font-size: 12px; line-height: 1; }

.pg-tool-field { margin-top: 16px; }
.pg-tool-field > span { display: block; font-size: 13.5px; color: #e6efec; margin-bottom: 8px; }
.pg-tool-textarea {
  width: 100%; min-height: 120px; resize: vertical; box-sizing: border-box;
  background: rgba(0,0,0,.25); border: 1px solid rgba(180,245,232,.14); border-radius: 12px;
  color: #eaf2ef; padding: 12px 14px; font-size: 13.5px; line-height: 1.6; font-family: inherit;
}
.pg-tool-textarea:focus { outline: none; border-color: rgba(110,231,223,.45); }

.pg-tool-settings { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }
.pg-tool-setting { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: rgba(210,228,222,.66); }
.pg-tool-setting select {
  appearance: none; background: rgba(0,0,0,.28); border: 1px solid rgba(180,245,232,.16);
  color: #eaf2ef; border-radius: 9px; padding: 9px 10px; font-size: 13px; width: 100%;
}

.pg-tool-footer { margin-top: 20px; border-top: 1px solid rgba(180,245,232,.1); padding-top: 14px; }
.pg-tool-summary { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 12.5px; color: rgba(210,228,222,.6); }
.pg-tool-summary .pg-tool-price { color: rgba(245,193,108,.85); }
.pg-tool-status { font-size: 12.5px; color: rgba(190,210,204,.55); margin: 10px 0; min-height: 18px; }
.pg-tool-primary {
  width: 100%; border: 0; cursor: pointer; border-radius: 12px; padding: 13px;
  font-size: 14.5px; font-weight: 600; color: #061313;
  background: linear-gradient(135deg, rgba(110,231,223,.9), rgba(245,193,108,.9));
  transition: opacity .15s ease;
}
.pg-tool-primary:disabled { opacity: .45; cursor: not-allowed; }
.pg-tool-primary[aria-busy="true"] { opacity: .7; }

/* 右栏作品记录 */
.pg-tool-history { min-height: 480px; display: flex; flex-direction: column; }
.pg-tool-history-head { display: flex; justify-content: space-between; align-items: flex-start; }
.pg-tool-history-head h2 { margin: 4px 0 0; font-size: 19px; color: #f0f6f3; }
.pg-tool-history-kicker { font-size: 11px; letter-spacing: .2em; color: rgba(160,189,181,.8); }
.pg-tool-refresh { appearance: none; border: 0; background: transparent; cursor: pointer; color: rgba(190,210,204,.7); font-size: 12.5px; }
.pg-tool-refresh:hover { color: #bff3ec; }
.pg-tool-history-note { font-size: 12px; color: rgba(190,210,204,.5); margin: 6px 0 16px; }

.pg-tool-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; color: rgba(190,210,204,.55); padding: 40px 20px;
}
.pg-tool-empty .pg-tool-empty-icon {
  width: 64px; height: 64px; border-radius: 16px; margin-bottom: 18px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(180,245,232,.14);
  display: flex; align-items: center; justify-content: center; font-size: 26px; color: rgba(219,208,172,.8);
}
.pg-tool-empty h3 { margin: 0 0 10px; font-size: 18px; color: #dfe9e5; }
.pg-tool-empty p { margin: 0; font-size: 13px; line-height: 1.7; }

.pg-tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pg-tool-item { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid rgba(180,245,232,.14); background: rgba(0,0,0,.3); }
.pg-tool-item img { width: 100%; display: block; aspect-ratio: 16/9; object-fit: cover; }
.pg-tool-item.is-error { padding: 14px; font-size: 12px; color: #f0b8a8; line-height: 1.5; aspect-ratio: auto; }
.pg-tool-item.is-pending { aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center; color: rgba(190,210,204,.6); font-size: 12.5px; }
.pg-tool-item-caption { font-size: 11px; color: rgba(190,210,204,.55); padding: 6px 8px; }

/* ---- 首页「创作工具」板块 ---- */
.pg-creative-tools { margin: 6px 0 26px; }
.pg-creative-tools-heading { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.pg-creative-tools-heading h2 { margin: 0; font-size: 18px; color: #eef4f1; }
.pg-creative-tools-heading span { font-size: 13px; color: rgba(190,210,204,.55); }
.pg-creative-tools-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 900px) { .pg-creative-tools-row { grid-template-columns: repeat(2, 1fr); } }
.pg-tool-card {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 14px; text-decoration: none;
  background: linear-gradient(160deg, rgba(19,32,36,.72), rgba(9,15,22,.9));
  border: 1px solid rgba(180,245,232,.12); color: #eaf2ef; transition: all .18s ease;
}
.pg-tool-card:hover { border-color: rgba(110,231,223,.4); transform: translateY(-1px); }
.pg-tool-cover { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 10px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #17282c; }
.pg-tool-cover svg { width: 100%; height: 100%; display: block; }
.pg-tool-card strong { font-size: 14.5px; font-weight: 600; }
.pg-tool-card-arrow { margin-left: auto; color: rgba(190,210,204,.5); }
.pg-tool-card.is-disabled { opacity: .55; cursor: not-allowed; }
.pg-tool-card-state { margin-left: auto; font-size: 11.5px; color: rgba(190,210,204,.5); }

/* ---------- 首页 · 创作工具卡（美化版） ---------- */
.pg-creative-tools { width: min(980px, 100%); margin: 24px auto 34px; }
.pg-creative-tools-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 2px 12px; }
.pg-creative-tools-heading h2 { margin: 0; color: #eef8f6; font-size: 13px; font-weight: 800; letter-spacing: .02em; }
.pg-creative-tools-heading > span { color: #9fb4b8; font-size: 11.5px; }
.pg-creative-tools-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }

.pg-tool-card {
  --ct-accent: #5eead4;
  --ct-glow: rgba(94, 234, 212, .16);
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 70px;
  padding: 12px 12px 12px 14px;
  border: 1px solid rgba(146, 214, 203, .22);
  border-radius: 16px;
  background:
    radial-gradient(130% 150% at 6% 0%, var(--ct-glow), transparent 58%),
    linear-gradient(158deg, #17272e 0%, #101a21 58%, #0b1418 100%);
  color: #ecf8f6;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .055), 0 12px 26px -20px rgba(0, 0, 0, .95);
  transition: transform .22s cubic-bezier(.2,.7,.2,1), border-color .22s ease, box-shadow .22s ease, background-color .22s ease;
}
.pg-tool-card::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 2px;
  background: linear-gradient(90deg, transparent, var(--ct-accent), transparent);
  opacity: .5; transition: opacity .22s ease;
}
.pg-tool-cover {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  aspect-ratio: auto;
  border: 1px solid color-mix(in srgb, var(--ct-accent) 42%, transparent);
  border-radius: 12px;
  background: linear-gradient(155deg, color-mix(in srgb, var(--ct-accent) 20%, #0d1a1f), #0d1a1f 82%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 8px 18px -12px rgba(0, 0, 0, .9);
  transition: transform .22s cubic-bezier(.2,.7,.2,1), border-color .22s ease;
}
.pg-tool-cover svg { display: block; width: 34px; height: 34px; border-radius: 8px; }
.pg-tool-card strong {
  font-size: 13.5px; font-weight: 800; line-height: 1.4;
  letter-spacing: .01em; overflow-wrap: anywhere; color: #f1fbf9;
}
.pg-tool-card-dash { margin: 0 2px; color: #7d9b9c; font-weight: 600; }
.pg-tool-card-suffix { font-style: normal; color: var(--ct-accent); font-weight: 800; }
.pg-tool-card-arrow {
  display: grid; place-items: center;
  width: 20px; height: 20px; flex: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .08);
  color: #a9c6c3; font-size: 12px; line-height: 1;
  transition: transform .2s ease, color .2s ease, background-color .2s ease, border-color .2s ease;
}

.pg-creative-tools-row > :nth-child(1) { --ct-accent: #5eead4; --ct-glow: rgba(94, 234, 212, .16); }
.pg-creative-tools-row > :nth-child(2) { --ct-accent: #f2cd8b; --ct-glow: rgba(242, 205, 139, .15); }
.pg-creative-tools-row > :nth-child(3) { --ct-accent: #b7a6ff; --ct-glow: rgba(183, 166, 255, .15); }
.pg-creative-tools-row > :nth-child(4) { --ct-accent: #8ea3a8; --ct-glow: rgba(142, 163, 168, .12); }
/* 第五、六张（口播创作 / GPU 抢购）：不加就会落回默认青色，两行之间没有色彩区分 */
.pg-creative-tools-row > :nth-child(5) { --ct-accent: #f6b8c4; --ct-glow: rgba(246, 184, 196, .15); }
.pg-creative-tools-row > :nth-child(6) { --ct-accent: #96d4a2; --ct-glow: rgba(150, 212, 162, .14); }

a.pg-tool-card:is(:hover, :focus-visible) {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--ct-accent) 62%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .08),
    0 18px 34px -22px rgba(0, 0, 0, 1),
    0 0 0 1px color-mix(in srgb, var(--ct-accent) 26%, transparent),
    0 12px 32px -18px color-mix(in srgb, var(--ct-accent) 55%, transparent);
}
a.pg-tool-card:is(:hover, :focus-visible)::before { opacity: 1; }
a.pg-tool-card:is(:hover, :focus-visible) .pg-tool-cover { transform: scale(1.05); border-color: color-mix(in srgb, var(--ct-accent) 70%, transparent); }
a.pg-tool-card:is(:hover, :focus-visible) .pg-tool-card-arrow {
  color: #f4fffd; background: color-mix(in srgb, var(--ct-accent) 28%, transparent);
  border-color: color-mix(in srgb, var(--ct-accent) 55%, transparent);
  transform: translate(2px, -2px);
}
a.pg-tool-card:focus-visible { outline: 2px solid color-mix(in srgb, var(--ct-accent) 70%, #fff); outline-offset: 3px; }
a.pg-tool-card:active { transform: translateY(-1px); }

.pg-tool-card.is-disabled {
  --ct-accent: #7f9296;
  --ct-glow: rgba(127, 146, 150, .08);
  color: #9fb0b5; cursor: not-allowed;
  background: linear-gradient(158deg, #131e24, #0d161a);
  border-color: rgba(120, 140, 145, .22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03);
}
.pg-tool-card.is-disabled::before { opacity: .18; }
.pg-tool-card.is-disabled .pg-tool-cover { filter: saturate(.3) brightness(.85); opacity: .72; }
.pg-tool-card.is-disabled .pg-tool-card-arrow { display: none; }
.pg-tool-card-state {
  justify-self: end; padding: 3px 7px; border-radius: 999px;
  border: 1px solid rgba(150, 170, 175, .3); color: #a9bcc0;
  background: rgba(255, 255, 255, .04); font-size: 10.5px; font-weight: 600; white-space: nowrap;
}

@media (max-width: 860px) {
  .pg-creative-tools-row {
    display: flex; gap: 10px; overflow-x: auto; padding: 3px 2px 10px;
    scroll-snap-type: x proximity; scrollbar-width: thin;
  }
  .pg-tool-card { flex: 0 0 210px; scroll-snap-align: start; }
}
@media (prefers-reduced-motion: reduce) {
  .pg-tool-card, .pg-tool-cover, .pg-tool-card-arrow { transition: none; }
}

/* 工具卡双行文案：主标题 + 模块副标 */
.pg-tool-copy { display: grid; gap: 1px; min-width: 0; }
.pg-tool-card .pg-tool-copy strong { display: block; font-size: 17px; font-weight: 800; line-height: 1.32; letter-spacing: .01em; color: #f1fbf9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 「带货批量创作」6 个字比原标题长，单独收一点字号，保证卡片内整名显示不被省略 */
a.pg-tool-card[href="/Hotvideo/"] .pg-tool-copy strong { font-size: 15px; letter-spacing: 0; }
.pg-tool-card-sub {
  display: block; font-size: 14px; font-weight: 700; line-height: 1.3;
  color: var(--ct-accent); letter-spacing: .04em; white-space: normal; overflow-wrap: anywhere;
}
a.pg-tool-card[data-creative-tool="quick"] .pg-tool-card-sub {
  font-size: 11px; letter-spacing: 0; white-space: nowrap;
}
.pg-tool-card-sub::before { content: "- "; opacity: .55; }
.pg-tool-card-sub.is-muted { color: #9fb0b5; }
.pg-tool-card.is-disabled .pg-tool-card-arrow { display: none; }
.pg-tool-card-state { display: none; }
/* ============================================================
   新建作品「设置继承来源」面板（CRvideo 新建短视频）
   ------------------------------------------------------------
   照字字动画的创作设置：默认作品 / 上个作品 / 指定作品，
   外加「同步继承角色，场景，物品」「同步继承作品音频」两个开关。
   ============================================================ */
.pg-dialog-inherit {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.pg-dialog-inherit-title {
  margin: 0 0 10px;
  color: #cbd5db;
  font-size: 13px;
  font-weight: 700;
}
.pg-dialog-inherit-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.pg-dialog-inherit-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 10px;
  color: #dce5e9;
  font-size: 13px;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease;
}
.pg-dialog-inherit-option:has(input:checked) {
  border-color: #80d8ca;
  background: rgba(128, 216, 202, .09);
}
.pg-dialog-inherit-option input[type="radio"] {
  width: 15px;
  height: 15px;
  margin: 0;
  flex-shrink: 0;
  accent-color: #80d8ca;
}
.pg-dialog-inherit-project {
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin-top: 10px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 10px;
  background: rgba(12, 20, 26, .92);
  color: #e6edf0;
  font-size: 13px;
}
.pg-dialog-inherit-project[hidden] { display: none; }
.pg-dialog-inherit-check {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 10px;
  color: #e6edf0;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease;
}
.pg-dialog-inherit-check:has(input:checked) {
  border-color: rgba(255, 143, 143, .66);
  background: rgba(255, 120, 120, .08);
}
.pg-dialog-inherit-check input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 0;
  flex-shrink: 0;
  accent-color: #ff8f8f;
}

/* 内容变多（含继承面板）时让弹窗自身可滚动，避免小窗口里按钮被挤出屏幕 */
.pg-dialog {
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
}
