/* ════════════════════════════════════════════════════════════════════════
   SKILLS —— 目录页 + 工作台

   ⚠️ 本文件【只在 propai-shell 的 index.html 里 link】。两份壳的 styles/
      是两份拷贝，往共用样式表里加东西会直接出现在 lumiq.asia 上。
   ⚠️ 每一条选择器都以 .sk 开头，没有一条全局规则。
   ⚠️ 颜色全部取 base.css :root 已有的暖黑+金，一个新色值都不发明 ——
      base.css 是两份壳共用的，只读不写。
   ════════════════════════════════════════════════════════════════════════ */

.sk {
  --sk-r: 14px;
  --sk-line: var(--gold-edge);
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 24px 64px;
  color: var(--cream);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  /* ⚠️ 兜住一切横向溢出。手机上任何一个子元素超宽都会让整页能左右拖。 */
  overflow-x: hidden;
}
.sk *,
.sk *::before,
.sk *::after { box-sizing: border-box; }
.sk a { color: inherit; text-decoration: none; }

.sk__head { margin-bottom: 22px; }
.sk__back {
  display: inline-block; margin-bottom: 10px;
  font-size: 13px; color: var(--gold);
}
.sk__back:hover { filter: brightness(1.15); }
.sk__h1 { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.sk__sub { margin: 8px 0 0; font-size: 14.5px; line-height: 1.6; color: var(--muted); }
.sk__muted { font-size: 14px; color: rgba(247, 242, 233, 0.5); }
.sk__err { font-size: 14px; color: #e08a7a; }
.sk__hint { margin: 8px 0 0; font-size: 12px; color: rgba(247, 242, 233, 0.42); }
.sk__notice {
  margin: 12px 0 0; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--sk-line); background: var(--gold-wash);
  font-size: 13px; line-height: 1.5; color: var(--muted);
}

/* ── 目录页 ─────────────────────────────────────────────────────────── */
.sk__filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  margin-bottom: 22px;
}
.sk__search {
  flex: 1 1 260px; min-width: 0;
  padding: 10px 14px; border-radius: 999px;
  border: 1px solid var(--sk-line); background: var(--panel);
  color: var(--cream); font: inherit; font-size: 14px;
}
.sk__search::placeholder { color: rgba(247, 242, 233, 0.36); }
.sk__search:focus { outline: none; border-color: var(--gold-live); }
.sk__cats { display: flex; flex-wrap: wrap; gap: 6px; }
.sk__cat {
  padding: 7px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--sk-line); background: transparent;
  color: var(--muted); font: inherit; font-size: 12.5px;
  transition: border-color var(--ease) 200ms, color var(--ease) 200ms;
}
.sk__cat:hover { border-color: var(--gold-live); color: var(--cream); }
.sk__cat.is-on { background: var(--gold); border-color: transparent; color: var(--ink); font-weight: 600; }

.sk__grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px; align-items: start;
}
.sk__card {
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--sk-line); border-radius: var(--sk-r);
  background: var(--panel);
  transition: border-color var(--ease) 220ms, transform var(--ease) 220ms;
}
.sk__card:hover { border-color: var(--gold-live); transform: translateY(-2px); }
.sk__cardImg {
  display: block; width: 100%; aspect-ratio: 3 / 4;
  object-fit: cover; background: var(--bg-landing);
}
/* 封面缺失：纯色块 + 标题，不放破图。 */
.sk__cardImg--empty {
  display: grid; place-items: center; padding: 16px;
  background: linear-gradient(150deg, var(--gold-wash), var(--bg-landing) 72%);
  color: var(--gold); font-size: 15px; font-weight: 600; text-align: center;
}
.sk__cardBody { display: block; padding: 14px 15px 16px; }
.sk__cardTitle { display: block; font-size: 15.5px; font-weight: 600; }
.sk__cardDesc {
  display: block; margin-top: 6px; font-size: 12.5px; line-height: 1.55;
  color: var(--muted); font-style: normal;
}
.sk__tag {
  display: inline-block; margin-top: 11px;
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--sk-line); font-size: 11px;
  color: rgba(247, 242, 233, 0.5);
}

/* ── 工作台：三栏 ───────────────────────────────────────────────────── */
.sk__cols {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr) minmax(0, 320px);
  gap: 18px; align-items: start;
}
/* 对话栏不存在时（还没出摘要），前两栏摊开占满。 */
.sk__cols:not(:has(.sk__chat)) {
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
}
.sk__col {
  border: 1px solid var(--sk-line); border-radius: var(--sk-r);
  background: var(--panel); padding: 18px;
}

.sk__field { margin-bottom: 16px; }
.sk__label {
  display: block; margin-bottom: 6px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  color: rgba(247, 242, 233, 0.62);
}
.sk__input, .sk__ta {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--sk-line); background: var(--bg-landing);
  color: var(--cream); font: inherit; font-size: 13.5px; line-height: 1.5;
}
.sk__input::placeholder, .sk__ta::placeholder { color: rgba(247, 242, 233, 0.3); }
.sk__input:focus, .sk__ta:focus { outline: none; border-color: var(--gold-live); }
.sk__ta { resize: vertical; margin-bottom: 10px; }

.sk__imgs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.sk__thumb { position: relative; display: block; width: 54px; height: 54px; }
.sk__thumb img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: 9px; border: 1px solid var(--sk-line);
}
.sk__thumbX {
  position: absolute; top: -6px; right: -6px;
  width: 19px; height: 19px; border-radius: 50%; cursor: pointer;
  border: 0; background: var(--gold); color: var(--ink);
  font: inherit; font-size: 13px; line-height: 1;
}
.sk__addImg {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 12px; height: 54px; border-radius: 9px; cursor: pointer;
  border: 1px dashed var(--gold-live); background: transparent;
  color: var(--gold); font: inherit; font-size: 12.5px;
}
.sk__addImg i { font-style: normal; color: rgba(247, 242, 233, 0.4); }
/* 🔴 sr-only 而不是 display:none —— 某些 Chromium 会静默丢掉
   display:none 的 file input 上的 .click()。 */
.sk__srOnly {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.sk__choices { display: flex; flex-wrap: wrap; gap: 8px; }
.sk__choice {
  flex: 1 1 auto; min-width: 0; padding: 9px 12px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--sk-line); background: var(--bg-landing);
  color: var(--muted); font: inherit; text-align: left;
  transition: border-color var(--ease) 200ms;
}
.sk__choice:hover { border-color: var(--gold-live); }
.sk__choice.is-on { border-color: var(--gold); background: var(--gold-wash); color: var(--cream); }
.sk__choice b { display: block; font-size: 13px; font-weight: 600; }
.sk__choice i { display: block; margin-top: 2px; font-size: 11px; font-style: normal; color: rgba(247, 242, 233, 0.4); }

.sk__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 12px 18px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--gold-live); background: transparent;
  color: var(--cream); font: inherit; font-size: 13.5px; font-weight: 600;
  transition: filter var(--ease) 200ms, opacity var(--ease) 200ms;
}
.sk__btn--primary { background: var(--gold); border-color: transparent; color: var(--ink); }
.sk__btn:hover:not(:disabled) { filter: brightness(1.1); }
.sk__btn:disabled { opacity: 0.45; cursor: not-allowed; }

.sk__stage { display: flex; flex-direction: column; gap: 14px; }
.sk__video {
  display: block; width: 100%; max-width: 340px; margin: 0 auto;
  aspect-ratio: 9 / 16; object-fit: cover;
  border-radius: 12px; border: 1px solid var(--sk-line); background: #000;
}
.sk__summary {
  padding: 14px; border-radius: 12px;
  border: 1px solid var(--sk-line); background: var(--gold-wash);
}
.sk__summaryLabel {
  margin: 0 0 6px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: rgba(247, 242, 233, 0.45);
}
.sk__summaryText { margin: 0 0 14px; font-size: 15px; line-height: 1.6; }
.sk__dry {
  border: 1px solid var(--sk-line); border-radius: 10px; padding: 10px 12px;
  font-size: 12px; color: var(--muted);
}
.sk__dry pre {
  margin: 10px 0 0; padding: 10px; border-radius: 8px;
  background: var(--bg-landing); color: rgba(247, 242, 233, 0.72);
  font-size: 11px; line-height: 1.5; overflow-x: auto; white-space: pre-wrap;
  word-break: break-word;
}

.sk__chat { display: flex; flex-direction: column; }
.sk__chatHead {
  margin: 0 0 10px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: rgba(247, 242, 233, 0.45);
}
.sk__log {
  flex: 1 1 auto; min-height: 120px; max-height: 320px; overflow-y: auto;
  margin-bottom: 10px; display: flex; flex-direction: column; gap: 8px;
}
.sk__msg {
  margin: 0; padding: 9px 11px; border-radius: 10px;
  font-size: 13px; line-height: 1.55;
}
.sk__msg--user { background: var(--gold-wash); border: 1px solid var(--sk-line); }
.sk__msg--assistant { background: var(--bg-landing); color: var(--muted); }

/* ── 断点 ───────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .sk__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  /* 🔴 三栏在窄屏放不下 → 竖排：表单 → 样片/结果 → 对话。
     顺序跟桌面从左到右一致，用户的心智模型不变。 */
  .sk__cols,
  .sk__cols:not(:has(.sk__chat)) { grid-template-columns: minmax(0, 1fr); }
  .sk__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .sk { padding: 20px 16px 56px; }
  .sk__h1 { font-size: 24px; }
  .sk__grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .sk__col { padding: 15px; }
  .sk__video { max-width: 100%; }
}

/* ════════════════════════════════════════════════════════════════════════
   Dashboard 上的 Templates 区块（PropDashTemplates，23-Skills.js）

   🔴 注意主题：这一块【长在 .pai 里面】，而 .pai 是【浅色】工作区
      （propai.css: --paper #fff / --ink #17181a）。本文件上面所有 .sk__
      规则是金黑深色，那是 #/tool/skills 整页自成一体时用的。
      —— 所以这里【一个上面的变量都不能复用】，颜色全取 .pai 自己的那套，
         跟隔壁 .dcard 用的是同一批。写错了就是浅底上印深卡。
   ⚠️ 区块外框（.dsec / .dsec__head / .dsec__t / .dsec__s / .dsec__link）
      直接复用 propai-dashboard.css 现成的，不另写一份 —— 标题字号和边距
      跟 "AI Studio" 那节要逐像素对齐。这里只补卡片行。
   ════════════════════════════════════════════════════════════════════════ */

.skdash {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
  margin-top: 16px;
}

/* 横向小卡，不是 .dcard 那种带 16:9 剧照的大卡。
   template 封面是 9:16 竖图，塞进 16:9 会把主体裁掉一半；而且以后有几百个，
   dashboard 上只是一瞥，不该占掉一整屏。 */
.skdash__card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper);
  text-decoration: none;
  transition: transform 180ms var(--ease), border-color 180ms var(--ease),
              box-shadow 180ms var(--ease);
}
/* 跟 .dcard:hover 同一组数值 —— 两种卡挨着，抬升幅度不一样会很明显。 */
.skdash__card:hover {
  transform: translateY(-3px);
  border-color: rgba(217, 164, 65, 0.45);
  box-shadow: 0 16px 34px -18px rgba(23, 24, 26, 0.26);
}

.skdash__thumb {
  flex: none;
  width: 46px;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: 8px;
  /* 封面缺失/未加载时是一块浅灰，不是破图空洞。 */
  background: var(--line-2);
}

/* ⚠️ min-width:0 —— 没有它，下面的 ellipsis 在 grid 里不会生效，
   长标题会把整张卡撑破格。 */
.skdash__txt { min-width: 0; }

.skdash__t {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.skdash__s {
  margin-top: 3px;
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
  color: var(--ink-2);
  /* 两行封顶。description 是作者在 .md 里自由写的，长度不可控。 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 1100px) {
  .skdash { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .skdash { grid-template-columns: minmax(0, 1fr); }
}
