/* ══════════════════════════════════════════════════════════════════════
   AI V3.0 prototype surface (hero / card / kpi / grid / product-card).
   Ported 1:1 from prototype assets/app.css (pages 16-22), scoped under
   .ai-v3 so it never collides with the shared styles.css (.hero / .btn …).
   Tokens reused from shell/tokens.css (MAN YI palette, light + dark).
   ══════════════════════════════════════════════════════════════════════ */

.ai-v3 { min-width: 0; }
.ai-v3 .hidden { display: none; }

/* ── Buttons ── */
.ai-v3 .btn {
  height: 38px; padding: 0 13px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); border-radius: 9px;
  font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; cursor: pointer; transition: 0.18s; white-space: nowrap;
  font-size: 13px;
}
.ai-v3 .btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-soft); border-color: var(--line-strong); }
.ai-v3 .btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.ai-v3 .btn-primary:hover { background: var(--primary-strong); border-color: var(--primary-strong); }
.ai-v3 .btn-tech { background: var(--tech); border-color: var(--tech); color: #fff; }
.ai-v3 .btn-ghost { background: transparent; }
.ai-v3 .btn-danger { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }
.ai-v3 .btn-sm { height: 32px; padding: 0 11px; border-radius: 8px; font-size: 12px; }
.ai-v3 .btn-lg { height: 44px; padding: 0 20px; }
.ai-v3 .btn:disabled { opacity: 0.6; cursor: progress; transform: none; }

/* ── Grid / card ── */
.ai-v3 .grid { display: grid; gap: 12px; min-width: 0; }
.ai-v3 .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ai-v3 .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ai-v3 .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ai-v3 .grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.ai-v3 .card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: none; min-width: 0;
}
.ai-v3 .card:hover { border-color: var(--line-strong); }
.ai-v3 .card-pad { padding: 16px; }
.ai-v3 .card-flat { box-shadow: none; }
.ai-v3 .card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.ai-v3 .card-title { font-size: 15px; font-weight: 800; margin: 0; }
.ai-v3 .card-note { color: var(--muted); font-size: 12px; margin: 4px 0 0; }
.ai-v3 .card-actions { display: flex; gap: 8px; }

/* ── KPI ── */
.ai-v3 .kpi { padding: 14px; position: relative; overflow: hidden; }
.ai-v3 .kpi::after {
  content: ""; position: absolute; width: 72px; height: 72px; border-radius: 50%;
  right: -20px; top: -22px; background: var(--primary-soft); opacity: 0.45;
}
.ai-v3 .kpi.tech::after { background: var(--tech-soft); }
.ai-v3 .kpi.blue::after { background: var(--blue); opacity: 0.1; }
.ai-v3 .kpi.warn::after { background: var(--warning-soft); }
.ai-v3 .kpi-label { font-size: 12px; color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ai-v3 .kpi-value { font-size: 24px; font-weight: 850; letter-spacing: -0.03em; margin: 6px 0 2px; }
.ai-v3 .kpi-foot { font-size: 12px; color: var(--muted); }

/* ── Section ── */
.ai-v3 .section { margin-top: 16px; }
.ai-v3 .section-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 0 0 9px; }
.ai-v3 .section-title { font-size: 17px; font-weight: 850; margin: 0; }
.ai-v3 .section-subtitle { color: var(--muted); font-size: 12px; margin: 4px 0 0; }

/* ── Badge ── */
.ai-v3 .badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 7px;
  border-radius: 999px; font-size: 11px; font-weight: 750;
  background: var(--surface-3); color: var(--muted); white-space: nowrap;
}
.ai-v3 .badge-success { background: var(--success-soft); color: var(--success); }
.ai-v3 .badge-warning { background: var(--warning-soft); color: var(--warning); }
.ai-v3 .badge-danger { background: var(--danger-soft); color: var(--danger); }
.ai-v3 .badge-primary { background: var(--primary-soft); color: var(--primary-strong); }
.ai-v3 .badge-tech { background: var(--tech-soft); color: var(--tech); }
.ai-v3 .badge-blue { background: var(--blue); color: #fff; }

/* ── Alert ── */
.ai-v3 .alert { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 9px; border: 1px solid; }
.ai-v3 .alert-warning { background: var(--warning-soft); border-color: var(--warning); color: var(--warning); }
.ai-v3 .alert-danger { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.ai-v3 .alert-success { background: var(--success-soft); border-color: var(--success); color: var(--success); }
.ai-v3 .alert-info { background: var(--surface-2); border-color: var(--line); color: var(--text); }
.ai-v3 .alert-icon { width: 24px; height: 24px; display: grid; place-items: center; flex: 0 0 24px; }
.ai-v3 .alert-body { flex: 1; }
.ai-v3 .alert-title { font-weight: 800; }
.ai-v3 .alert-text { font-size: 12px; margin-top: 2px; opacity: 0.85; }

/* ── List ── */
.ai-v3 .list { display: flex; flex-direction: column; }
.ai-v3 .list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.ai-v3 .list-row:first-child { border-top: 0; padding-top: 0; }
.ai-v3 .list-row:last-child { padding-bottom: 0; }
.ai-v3 .list-icon {
  width: 38px; height: 38px; border-radius: 10px; background: var(--surface-3);
  display: grid; place-items: center; flex: 0 0 38px; font-weight: 800; color: var(--muted);
}
.ai-v3 .list-body { min-width: 0; flex: 1; }
.ai-v3 .list-title { font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-v3 .list-meta { color: var(--muted); font-size: 12px; margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; }
.ai-v3 .list-actions { display: flex; gap: 7px; align-items: center; }

/* ── Filter bar / forms ── */
.ai-v3 .filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px; margin-bottom: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.ai-v3 .search { min-width: 220px; flex: 1; max-width: 420px; position: relative; }
.ai-v3 .search .input { width: 100%; padding-left: 38px; }
.ai-v3 .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); display: grid; place-items: center; }
.ai-v3 .input, .ai-v3 .select, .ai-v3 .textarea {
  border: 1px solid var(--line); background: var(--surface); border-radius: 9px;
  color: var(--text); outline: none; transition: 0.18s; font-size: 13px;
}
.ai-v3 .input, .ai-v3 .select { height: 38px; padding: 0 12px; }
.ai-v3 .input:focus, .ai-v3 .select:focus, .ai-v3 .textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
.ai-v3 .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ai-v3 .field label { display: block; font-size: 13px; font-weight: 750; margin-bottom: 7px; }
.ai-v3 .field .input, .ai-v3 .field .select { width: 100%; }

/* ── Tabs / chip ── */
.ai-v3 .tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow: auto; }
.ai-v3 .tab { border: 0; background: transparent; padding: 10px 13px; color: var(--muted); font-weight: 750; cursor: pointer; white-space: nowrap; border-bottom: 2px solid transparent; }
.ai-v3 .tab.active { color: var(--primary-strong); border-bottom-color: var(--primary); }
.ai-v3 .chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  color: var(--text); font-size: 12px; cursor: pointer;
}
.ai-v3 .chip.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-strong); }

/* ── Empty state ── */
.ai-v3 .empty { padding: 40px 18px; text-align: center; display: grid; place-items: center; }
.ai-v3 .empty-illustration {
  width: 72px; height: 72px; border-radius: 22px;
  background: linear-gradient(135deg, var(--primary-soft), var(--tech-soft));
  display: grid; place-items: center; margin-bottom: 14px; font-size: 28px;
}
.ai-v3 .empty h3 { margin: 0 0 6px; font-size: 17px; }
.ai-v3 .empty p { margin: 0 auto 16px; color: var(--muted); max-width: 460px; font-size: 13px; }

/* ── Hero (AI home, prototype 18) ── */
.ai-v3 .hero {
  padding: 26px; background: linear-gradient(135deg, var(--surface) 0%, var(--primary-soft) 48%, var(--tech-soft) 100%);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-soft);
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 24px; align-items: center; overflow: hidden; position: relative;
}
.ai-v3 .hero::after { content: ""; position: absolute; width: 240px; height: 240px; border-radius: 50%; right: -70px; bottom: -120px; background: var(--primary-soft); opacity: 0.5; }
.ai-v3 .hero-copy { position: relative; z-index: 1; }
.ai-v3 .hero-label { color: var(--primary-strong); font-weight: 800; font-size: 12px; letter-spacing: 0.06em; }
.ai-v3 .hero h2 { font-size: 26px; line-height: 1.25; margin: 8px 0; letter-spacing: -0.02em; }
.ai-v3 .hero p { color: var(--muted); max-width: 700px; font-size: 13px; }
.ai-v3 .hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.ai-v3 .hero-visual {
  min-height: 160px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow); display: grid; place-items: center;
  position: relative; z-index: 1; padding: 16px;
}
.ai-v3 .mini-dashboard { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ai-v3 .mini-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.ai-v3 .mini-tile strong { display: block; font-size: 20px; }
.ai-v3 .mini-tile span { color: var(--muted); font-size: 11px; }

/* ── Product card (prototype 16-22) ── */
.ai-v3 .product-card { display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.ai-v3 .product-cover {
  aspect-ratio: 16/9; padding: 18px; display: flex; align-items: flex-end;
  position: relative; overflow: hidden; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--primary-soft), var(--tech-soft));
}
.ai-v3 .product-cover::after {
  content: ""; position: absolute; right: 16px; top: 16px; width: 54px; height: 54px;
  border-radius: 18px; background: rgba(255, 255, 255, 0.45); z-index: 1;
}
.ai-v3 .product-cover img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.ai-v3 .product-cover .badge { position: relative; z-index: 2; }
.ai-v3 .product-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.ai-v3 .product-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.ai-v3 .product-title { font-size: 17px; font-weight: 850; min-width: 0; }
.ai-v3 .product-desc { color: var(--muted); font-size: 13px; min-height: 41px; }
.ai-v3 .product-price { font-size: 18px; font-weight: 850; color: var(--primary-strong); white-space: nowrap; }
.ai-v3 .product-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; }
.ai-v3 .product-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* ── Product intro (product detail) ── */
.ai-v3 .product-intro-title { font-size: 22px; font-weight: 850; letter-spacing: -0.02em; margin: 8px 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ai-v3 .product-intro-desc { color: var(--muted); font-size: 13px; max-width: 700px; }

/* ── Category card (AI home 按类型浏览) ── */
.ai-v3 .category-icon {
  width: 48px; height: 48px; border-radius: 12px; margin-top: 10px;
  background: var(--surface-3); display: grid; place-items: center;
  font-size: 22px; flex: 0 0 48px;
}
.ai-v3 .category-note { margin-top: 12px; }

/* ── Media thumb (product previews / digital human) ── */
.ai-v3 .media-thumb {
  width: 100%; min-width: 0; aspect-ratio: 16/10;
  background: linear-gradient(145deg, var(--primary-soft), var(--tech-soft));
  position: relative; display: grid; place-items: center;
  color: var(--muted); font-weight: 800; overflow: hidden; flex: 0 0 auto;
}
.ai-v3 .media-thumb.portrait { aspect-ratio: 4/5; }
.ai-v3 .media-thumb.video::after {
  content: "▶"; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.86); display: grid; place-items: center;
  box-shadow: var(--shadow); position: absolute;
}
.ai-v3 .media-thumb img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block;
}

/* ── Two pane (product detail) ── */
.ai-v3 .two-pane { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 0.42fr); gap: 16px; }
.ai-v3 .sticky-panel { position: sticky; top: 80px; align-self: start; display: grid; gap: 16px; }

/* ── Responsive ── */
@media (max-width: 1180px) {
  .ai-v3 .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-v3 .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ai-v3 .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-v3 .hero { grid-template-columns: minmax(0, 1fr) 300px; }
  .ai-v3 .two-pane { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (max-width: 900px) {
  .ai-v3 .hero, .ai-v3 .two-pane { grid-template-columns: 1fr; }
  .ai-v3 .sticky-panel { position: static; }
  .ai-v3 .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .ai-v3 .grid-2, .ai-v3 .grid-3, .ai-v3 .grid-4, .ai-v3 .grid-5 { grid-template-columns: 1fr; }
  .ai-v3 .card-pad { padding: 14px; }
  .ai-v3 .hero { padding: 18px; }
  .ai-v3 .hero h2 { font-size: 22px; }
  .ai-v3 .kpi-value { font-size: 22px; }
  .ai-v3 .filter-bar { align-items: stretch; }
  .ai-v3 .search { max-width: none; min-width: 100%; }
  .ai-v3 .list-row { align-items: flex-start; }
  .ai-v3 .list-actions { flex-direction: column; align-items: stretch; }
  .ai-v3 .product-foot { flex-wrap: wrap; }
}
