/* AI铅笔盒-画图站 V6 双栏抽屉 + 主画廊壳子 */

.v6-shell {
  display: grid;
  grid-template-columns: 4fr 6fr;
  height: 100vh;
  background: var(--color-bg);
}

.v6-shell-aside {
  position: relative;
  display: grid;
  grid-template-rows: 72px auto;
  border-right: 1px solid var(--color-border);
  background-color: var(--color-bg-sunken);
  height: 100vh;
  overflow-y: auto;
  overflow-x: visible;
  min-width: 0;
  box-shadow: 4px 0 32px rgba(0,0,0,.55), 1px 0 0 rgba(255,255,255,.04);
  z-index: 2;
}
.v6-shell-aside::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url('/static/img/bg-korok.svg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.22;
  filter: brightness(0.75);
}
[data-theme="dark"] .v6-shell-aside::before {
  background-image: url('/static/img/bg-hyrule.svg');
  opacity: 0.18;
  filter: brightness(0.65);
}

#zelda-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 40%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}
.v6-top, .v6-body { position: relative; z-index: 1; }

/* ===== 顶部品牌区 ===== */
.v6-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--color-primary) 44%, var(--color-border));
  background:
    linear-gradient(135deg, rgba(245, 158, 11, .18), transparent 38%),
    linear-gradient(180deg, color-mix(in srgb, var(--color-bg-card) 72%, transparent), var(--color-bg-sunken));
  box-shadow: 0 12px 28px rgba(0,0,0,.24), inset 0 -1px 0 rgba(255,255,255,.04);
}
.v6-brand {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-decoration: none;
  margin-right: auto;
  line-height: 1.05;
  color: var(--color-text);
  min-width: 0;
}
.v6-brand-text {
  font-size: 22px;
  font-weight: 900;
  font-family: 'Space Grotesk', var(--font-ui);
  letter-spacing: -.035em;
  white-space: nowrap;
  color: var(--color-text);
  text-decoration: none;
  text-shadow: 0 1px 0 rgba(255,255,255,.18), 0 10px 22px rgba(0,0,0,.32);
}
.v6-brand-sub {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-faint);
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.brand-dmxapi {
  background: linear-gradient(90deg, #f59e0b, #ef4444, #a855f7, #3b82f6, #f59e0b);
  background-size: 300% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 600;
  animation: dmxapiFlow 4s linear infinite;
}
@keyframes dmxapiFlow {
  0%   { background-position: 0% center; }
  100% { background-position: 300% center; }
}
.v6-top-btn {
  width: auto;
  min-width: 36px;
  height: auto;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--color-text);
  font-size: 22px;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  transition: background var(--dur-fast), border-color var(--dur-fast);
  padding: 4px 6px;
}
.v6-top-btn:hover {
  background: var(--color-bg-sunken);
  border-color: var(--color-border);
}
.v6-top-btn-label {
  font-size: 12px;
  line-height: 1;
  color: var(--color-text-muted);
  font-weight: 500;
  white-space: nowrap;
}

/* ===== 主体两列 ===== */
.v6-body {
  display: grid;
  grid-template-columns: 56px 1fr;
  min-height: 0;
  min-width: 0;
  overflow: visible;
}

/* ===== 厂商列 ===== */
.v6-vcol {
  border-right: 1px solid var(--color-border);
  background: var(--color-bg-sunken);
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.v6-step-tag {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-align: center;
  padding: 2px 0 6px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.v6-vendor {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  cursor: pointer;
  border-left: 3px solid transparent;
  color: var(--color-text-muted);
  user-select: none;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.v6-vendor:hover {
  background: var(--color-bg-card);
  color: var(--color-text);
}
.v6-vendor-emoji {
  font-size: 22px;
  line-height: 1;
}
.v6-vendor-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 50px;
}
.v6-vendor.active {
  border-left-color: var(--color-primary);
  background: var(--color-bg-soft);
  color: var(--color-text);
}
.v6-vendor { text-decoration: none; }

/* ===== 模型/功能/输入列 ===== */
.v6-mcol {
  padding: 12px 12px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: visible;
  min-width: 0;
}
.v6-mcol-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 0 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.v6-mlist, .v6-flist {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.m-row, .f-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--color-text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--dur-fast);
  border: 1px solid transparent;
}
.m-row:hover, .f-row:hover {
  background: var(--color-bg-sunken);
}
.m-row.active, .f-row.active {
  background: var(--color-accent-blue-soft);
  border-color: var(--color-primary);
  color: var(--color-primary);
  font-weight: 600;
}
.m-row-ic, .f-row-ic {
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}
.m-row-name, .f-row-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.m-row-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--color-primary);
  color: #FFF;
  flex-shrink: 0;
}

/* feature 不支持时（暂未用，预留） */
.f-row.dis {
  opacity: .4;
  pointer-events: none;
}

/* ===== 主画廊区 ===== */
.v6-gallery {
  padding: var(--sp-5);
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
}

/* 首页空态 */
.gallery-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  padding: 80px 24px;
  color: var(--color-text-muted);
}
.gallery-empty-icon {
  font-size: 72px;
  line-height: 1;
  opacity: .85;
}
.gallery-empty h1 {
  margin: 0;
  font-size: 24px;
  color: var(--color-text);
}
.gallery-empty-hint {
  font-size: var(--fs-sm);
  margin: 0;
}

/* ===== 首页：隐藏侧边栏，主区全宽 ===== */
.page-select .v6-shell { grid-template-columns: 1fr; }
.page-select .v6-shell-aside { display: none; }

/* ===== 功能页精简侧边栏 ===== */
.v6-feature-sidebar {
  display: flex;
  flex-direction: column;
  padding: 14px 14px 24px;
  gap: 12px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.v6-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  align-self: flex-start;
  padding: 9px 14px;
  font-size: var(--fs-sm);
  font-weight: 800;
  color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 12%, var(--color-bg-card));
  border: 1px solid color-mix(in srgb, var(--color-primary) 44%, var(--color-border));
  border-radius: var(--radius-pill);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast);
}
.v6-back-btn:hover {
  background: color-mix(in srgb, var(--color-primary) 20%, var(--color-bg-card));
  border-color: var(--color-primary);
  color: var(--color-primary);
  text-decoration: none;
  transform: translateX(-2px);
}
.v6-model-current {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--color-bg-card) 78%, transparent);
  box-shadow: var(--shadow-sm);
}
.v6-model-current-ic { font-size: 18px; }
.v6-model-current-name {
  font-size: 15px;
  font-weight: 800;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.v6-model-current-label {
  color: var(--color-text-muted);
  font-weight: 700;
}

/* ===== 横向功能 Tab ===== */
.f-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 12px;
  border-bottom: 1px solid var(--color-border);
}
.f-tab {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  font-weight: 500;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: border-color var(--dur-fast), color var(--dur-fast), background var(--dur-fast);
}
.f-tab:hover { border-color: var(--color-primary); color: var(--color-primary); text-decoration: none; }
.f-tab.active {
  background: var(--color-accent-blue-soft);
  border-color: var(--color-primary);
  color: var(--color-primary);
  font-weight: 600;
}

/* ===== 响应式（小屏隐藏抽屉，留 toggle 入口；先兜底） ===== */
@media (max-width: 880px) {
  .v6-shell {
    grid-template-columns: 1fr;
    height: auto;
  }
  .v6-shell-aside {
    grid-column: 1;
    position: static;
    height: auto;
    overflow: visible;
    grid-template-rows: 54px auto;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }
  .v6-gallery {
    height: auto;
    overflow: visible;
  }
  .v6-body {
    grid-template-columns: 56px 1fr;
    max-height: 50vh;
  }
}
