/* ============================================================
 * components.css — 侧栏列表 / 子标签 / 占位卡片 / 按钮样式
 * 分类色通过 .c-* 暴露 --tint（圆点、描边）与 --tint-soft（淡底）。
 * ============================================================ */
.c-pink     { --tint: #FFB3BA; --tint-soft: #FFF4F5; }
.c-peach    { --tint: #FFD8A8; --tint-soft: #FFF8EE; }
.c-cream    { --tint: #FFF3BF; --tint-soft: #FFFCF0; }
.c-mint     { --tint: #B8E8D0; --tint-soft: #F1FBF6; }
.c-sky      { --tint: #BFE3F5; --tint-soft: #F1F8FD; }
.c-lavender { --tint: #D0C4E8; --tint-soft: #F7F4FC; }
.c-mauve    { --tint: #E4D8EE; --tint-soft: #FAF7FC; }

/* ---------- 顶部品牌 ---------- */
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }

.brand__mark {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  display: grid;
  grid-template-columns: repeat(2, 10px);
  grid-template-rows: repeat(2, 10px);
  gap: 5px;
  align-content: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.brand__mark i { width: 10px; height: 10px; border-radius: 50%; }
.brand__mark i:nth-child(1) { background: var(--pink); }
.brand__mark i:nth-child(2) { background: var(--sky); }
.brand__mark i:nth-child(3) { background: var(--mint); }
.brand__mark i:nth-child(4) { background: var(--lavender); }

.brand__title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}
.brand__subtitle {
  font-size: var(--fs-sm);
  color: var(--ink-3);
  margin-top: 2px;
  white-space: nowrap;
}

/* ---------- 搜索与计数 ---------- */
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 300px;
  min-height: 46px;
  padding: 10px 18px;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.search:focus-within {
  background: var(--surface);
  border-color: var(--sky);
  box-shadow: 0 0 0 3px rgba(191, 227, 245, .35);
}
.search__icon { flex: 0 0 auto; color: var(--ink-3); font-size: 17px; }
.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: var(--fs-sm);
  color: var(--ink);
}
.search input::placeholder { color: var(--ink-3); }

.counter { font-size: var(--fs-sm); color: var(--ink-3); white-space: nowrap; }

.menu-toggle {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
}
.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink-2);
}

/* ---------- 侧栏 ---------- */
.sidebar__title { font-size: var(--fs-lg); font-weight: 700; }
.sidebar__hint { font-size: var(--fs-xs); color: var(--ink-3); margin-top: 2px; }

.cat + .cat { margin-top: 6px; }

.cat__head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 12px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  font-size: var(--fs-base);
  font-weight: 600;
  text-align: left;
  color: var(--ink);
  min-height: 48px;
  touch-action: manipulation;
}
.cat__head:hover { background: var(--surface-soft); }
.cat__dot {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--tint);
  box-shadow: 0 0 0 3px var(--tint-soft);
}
.cat__count {
  margin-left: auto;
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink-3);
  font-size: var(--fs-xs);
  font-weight: 500;
}
.cat__chevron {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--ink-3);
  transition: transform .18s ease;
}
.cat__head[aria-expanded="false"] .cat__chevron { transform: rotate(-90deg); }

.cat__list { padding: 2px 0 8px; }
.cat__list[hidden] { display: none; }

.model-item {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px 12px 30px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  text-align: left;
  font-size: 15px;
  color: var(--ink-2);
  touch-action: manipulation;
  transition: background .15s ease, color .15s ease;
}
.model-item:hover { background: #f6f8fa; color: var(--ink); }
.model-item.is-active {
  background: var(--tint-soft);
  color: var(--ink);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--tint);
}
.model-item__name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.model-item__tag {
  flex: 0 0 auto;
  padding: 3px 8px;
  border: 1px solid;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.5;
  white-space: nowrap;
}
.tag--done { background: #f0faf5; border-color: #cceede; color: #4c9a77; }
.tag--todo { background: var(--bg); border-color: var(--line); color: var(--ink-3); }

.empty {
  padding: 44px 16px;
  text-align: center;
  color: var(--ink-3);
  font-size: var(--fs-sm);
}

/* ---------- 主区：模型头部 ---------- */
.model-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.model-header__meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.subject-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 13px;
  border: 1px solid var(--tint);
  border-radius: 999px;
  background: var(--tint-soft);
  font-size: var(--fs-sm);
  color: var(--ink-2);
}
.subject-tag::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tint);
}
.model-header__title {
  margin-top: 12px;
  font-size: var(--fs-3xl);
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1.25;
}
.model-header__brief {
  margin-top: 10px;
  max-width: 860px;
  font-size: var(--fs-lg);
  color: var(--ink-2);
}
.draft-chip {
  flex: 0 0 auto;
  padding: 7px 14px;
  border: 1px dashed var(--line-2);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-3);
  font-size: var(--fs-xs);
}
.draft-chip.is-live {
  border-style: solid;
  border-color: #cceede;
  background: #f1fbf6;
  color: #4c9a77;
  font-weight: 600;
}

/* ---------- 主区：拓展模型子标签 ---------- */
.subtabs {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 30px;
  padding-bottom: 6px;
  overflow-x: auto;
}
.subtabs__label {
  flex: 0 0 auto;
  font-size: var(--fs-sm);
  color: var(--ink-3);
  margin-right: 4px;
}
.tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 11px 22px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: var(--fs-base);
  white-space: nowrap;
  touch-action: manipulation;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.tab:hover { background: var(--tint-soft); border-color: var(--tint); color: var(--ink); }
.tab.is-active {
  background: var(--tint-soft);
  border-color: var(--tint);
  color: var(--ink);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(88, 108, 132, .07);
}
.tab.is-active::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tint);
}

/* ---------- 主区：内容占位卡片 ---------- */
.panel { margin-top: 22px; }

.placeholder {
  position: relative;
  overflow: hidden;
  padding: 34px 36px 38px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.placeholder::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--tint);
}
.placeholder__badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 13px;
  border: 1px solid var(--tint);
  border-radius: 999px;
  background: var(--tint-soft);
  color: var(--ink-2);
  font-size: 13px;
}
.placeholder__title {
  margin-top: 18px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.5;
}
.placeholder__desc {
  margin-top: 10px;
  max-width: 820px;
  font-size: var(--fs-base);
  color: var(--ink-2);
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
  margin-top: 28px;
}
.slot {
  display: flex;
  flex-direction: column;
  min-height: 196px;
  padding: 22px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r-md);
  background: var(--surface-soft);
}
.slot__num {
  font-size: var(--fs-xs);
  letter-spacing: .14em;
  color: var(--ink-3);
}
.slot h4 { margin-top: 6px; font-size: var(--fs-lg); font-weight: 700; }
.slot p { margin-top: 4px; font-size: var(--fs-sm); color: var(--ink-3); }
.slot__lines { display: grid; gap: 9px; margin-top: auto; padding-top: 18px; }
.slot__line { height: 9px; border-radius: 99px; background: #eef2f6; }
.slot__line:nth-child(2) { width: 84%; }
.slot__line:nth-child(3) { width: 62%; }

.external-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 28px;
  padding: 12px 20px;
  min-height: 44px;
  border: 1px solid #cceede;
  border-radius: var(--r-sm);
  background: #f1fbf6;
  color: var(--ink);
  font-size: var(--fs-base);
  font-weight: 600;
  transition: background .15s ease, transform .15s ease;
}
.external-link:hover { background: #e6f7ef; transform: translateY(-1px); }
.external-link[hidden] { display: none; }
.external-link__arrow { color: #4c9a77; font-size: var(--fs-lg); line-height: 1; }

@media (max-width: 900px) {
  .brand__title { font-size: var(--fs-lg); }
  .brand__subtitle { font-size: var(--fs-xs); }
  .model-header { flex-direction: column; gap: 12px; }
  .model-header__title { font-size: 28px; }
  .placeholder { padding: 26px 22px 30px; }
  .placeholder__title { font-size: var(--fs-lg); }
}

/* ---------- 通用内容折叠块（app.js 后处理注入，原生 details/summary） ---------- */
.ml-fold {
  margin-top: 14px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r-md);
  background: var(--surface-soft);
  overflow: hidden;
}
.ml-fold[open] { border-style: solid; background: transparent; }

.ml-fold > .ml-fold__summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 11px 16px;
  list-style: none;
  cursor: pointer;
  touch-action: manipulation;
  background: var(--surface);
  color: var(--ink-2);
  font-size: var(--fs-base);
  font-weight: 600;
  user-select: none;
  transition: background .15s ease;
}
.ml-fold > .ml-fold__summary::-webkit-details-marker { display: none; }
.ml-fold > .ml-fold__summary:hover { background: var(--tint-soft); }
.ml-fold > .ml-fold__summary:active { background: var(--tint-soft); }

.ml-fold__mark {
  flex: 0 0 auto;
  color: var(--ink-3);
  font-size: 14px;
  transition: transform .18s ease;
}
.ml-fold[open] > .ml-fold__summary .ml-fold__mark { transform: rotate(90deg); }

.ml-fold__label {
  flex: 0 0 auto;
  padding: 3px 11px;
  border: 1px solid var(--tint);
  border-radius: 999px;
  background: var(--tint-soft);
  color: var(--ink-2);
  font-size: var(--fs-xs);
  font-weight: 600;
}
.ml-fold__title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: var(--fs-sm);
  color: var(--ink-3);
  font-weight: 400;
}

/* 展开后的原内容紧凑一点：去掉被包裹卡片可能与折叠外框重叠的外边距 */
.ml-fold > .ml-fold__body { padding: 2px 10px 12px; }
.ml-fold > .ml-fold__body > :first-child { margin-top: 0 !important; }
