/* ==========================================================================
   GOOGLE AI STUDIO / VIBE-CODE INSPIRED INTERACTIVE SHOWCASE ENGINE
   ========================================================================== */

:root {
  --vibe-bg: #07090e;
  --vibe-surface: #0e131f;
  --vibe-surface-2: #141c2e;
  --vibe-border: rgba(255, 255, 255, 0.08);
  --vibe-gold: #d4b475;
  --vibe-cyan: #38bdf8;
  --vibe-emerald: #34d399;
}

body {
  background-color: var(--vibe-bg) !important;
}

/* Google AI Studio 標誌性星雲網格底紋 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px circle at 75% 12%, rgba(201, 169, 106, 0.11), transparent 55%),
    radial-gradient(800px circle at 20% 45%, rgba(56, 189, 248, 0.07), transparent 55%),
    radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 28px 28px;
  mask-image: radial-gradient(ellipse at 50% 35%, black 45%, transparent 90%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 35%, black 45%, transparent 90%);
  z-index: 0;
  pointer-events: none;
}

header {
  z-index: 100 !important;
  background: rgba(7, 9, 14, 0.78) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07) !important;
}
main, footer { position: relative; z-index: 2; }

/* ==========================================================================
   1. 首頁 HERO：VIBE-CODE 雙欄互動沙盒工作台 (Live Interactive Studio)
   ========================================================================== */
@media (min-width: 980px) {
  .hero .wrap {
    display: grid;
    grid-template-columns: 1.02fr 0.98fr;
    gap: 40px;
    align-items: center;
  }
  .hero .doors {
    grid-column: 1 / -1;
    margin-top: 44px;
  }
}

.vibe-studio-stage {
  position: relative;
  width: 100%;
  margin-top: 32px;
}
@media (min-width: 980px) {
  .vibe-studio-stage { margin-top: 0; }
}

/* 外層流光邊框容器 (Google AI 招牌旋轉微光) */
.vibe-workbench {
  position: relative;
  border-radius: 18px;
  background: linear-gradient(160deg, #131b2c 0%, #0a0e17 100%);
  border: 1px solid rgba(201, 169, 106, 0.32);
  box-shadow:
    0 32px 70px -15px rgba(0, 0, 0, 0.85),
    0 0 50px -10px rgba(201, 169, 106, 0.15),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.18);
  overflow: hidden;
  font-family: "Inter", "Noto Sans TC", system-ui, sans-serif;
}

/* 頂部互動切換列 */
.vibe-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(6, 9, 15, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  gap: 8px;
  flex-wrap: wrap;
}
.vibe-win-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}
.vibe-win-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}
.vibe-win-dots span:nth-child(1) { background: #f87171; }
.vibe-win-dots span:nth-child(2) { background: #fbbf24; }
.vibe-win-dots span:nth-child(3) { background: #34d399; }

.vibe-mode-tabs {
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  padding: 3px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.vibe-tab-btn {
  border: none;
  background: transparent;
  color: #9aa6b8;
  font: inherit;
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.22s ease;
}
.vibe-tab-btn:hover { color: #e8ebf0; }
.vibe-tab-btn.is-active {
  background: linear-gradient(135deg, rgba(201, 169, 106, 0.28), rgba(201, 169, 106, 0.12));
  color: #ffdf9e;
  border: 1px solid rgba(201, 169, 106, 0.45);
  box-shadow: 0 2px 10px rgba(201, 169, 106, 0.2);
}

/* 工作台雙欄主體：上方 Prompt/Pipeline 區 + 下方即時預覽渲染區 */
.vibe-prompt-strip {
  padding: 12px 16px;
  background: rgba(10, 15, 25, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.vibe-prompt-text {
  font-family: "Inter", "Noto Sans TC", monospace;
  font-size: 12.5px;
  color: #e8ebf0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.vibe-sparkle {
  color: var(--vibe-gold);
  font-size: 14px;
  animation: spinPulse 3s infinite ease-in-out;
}
@keyframes spinPulse {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
  50% { transform: scale(1.2) rotate(18deg); opacity: 0.75; }
}
.vibe-run-pill {
  font-size: 10.5px;
  font-family: "Inter", monospace;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.12);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.3);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.vibe-run-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
  animation: blinkDot 1.4s infinite;
}
@keyframes blinkDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* 即時渲染畫布區 (Live Rendered Output) */
.vibe-preview-body {
  padding: 16px;
  min-height: 270px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: radial-gradient(circle at 80% 20%, rgba(201, 169, 106, 0.08), transparent 60%);
}

/* 面板切換動畫 */
.vibe-pane {
  display: none;
  animation: vibeFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.vibe-pane.is-active {
  display: block;
}
@keyframes vibeFadeIn {
  from { opacity: 0; transform: translateY(8px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 面板內部的真實 UI 元件 */
.vibe-split-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.vibe-mini-box {
  background: rgba(16, 23, 38, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px;
  position: relative;
}
.vibe-mini-box h4 {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9aa6b8;
  font-family: "Inter", sans-serif;
  display: flex;
  justify-content: space-between;
}
.vibe-source-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  margin-bottom: 5px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  transition: all 0.25s ease;
}
.vibe-source-row.is-scanning {
  background: rgba(201, 169, 106, 0.14);
  border-color: rgba(201, 169, 106, 0.45);
  transform: translateX(3px);
}
.vibe-badge-ok {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.3);
  font-family: "Inter", monospace;
}

/* ==========================================================================
   2. 項目卡片與詳情頁：VIBE-CODE 高解析真實 DOM 互動微應用
   ========================================================================== */
.card, .door, .project-card, .exp-panel {
  position: relative;
  background: linear-gradient(165deg, rgba(20, 29, 46, 0.88) 0%, rgba(10, 15, 24, 0.95) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow:
    0 20px 45px -15px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.14) !important;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.3s ease !important;
}
.card:hover, .door:hover, .project-card:hover, .exp-panel:hover {
  border-color: rgba(201, 169, 106, 0.55) !important;
  box-shadow:
    0 28px 60px -12px rgba(0, 0, 0, 0.85),
    0 0 35px rgba(201, 169, 106, 0.15),
    inset 0 1px 0 0 rgba(201, 169, 106, 0.4) !important;
}

.card-media, .case-hero-media {
  position: relative;
  background: #080c14 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  overflow: hidden;
}

/* 卡片內的 Vibe 微型應用程式容器 */
.vibe-app-card {
  width: 100%;
  height: 100%;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: radial-gradient(circle at 50% 0%, #162238 0%, #080c14 100%);
  font-family: "Inter", "Noto Sans TC", sans-serif;
  padding: 12px 14px;
  position: relative;
  overflow: hidden;
}
.case-hero-media .vibe-app-card {
  min-height: 360px;
  padding: 22px 26px;
}

.vibe-app-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  font-family: "Inter", monospace;
  color: #9aa6b8;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  z-index: 2;
}
.vibe-app-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #e8ebf0;
  font-weight: 600;
}
.vibe-app-tag i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
}

.vibe-app-stage {
  flex: 1;
  display: flex;
   flex-direction: column;
  justify-content: center;
  padding: 10px 0;
  z-index: 2;
  position: relative;
}

.vibe-app-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  font-family: "Inter", monospace;
  color: var(--vibe-gold);
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 2;
}

/* 微應用內部組件：財報雙欄核對 */
.va-filing-grid {
  display: grid;
  grid-template-columns: 1fr 22px 1.15fr;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}
.va-box {
  background: rgba(11, 16, 26, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  padding: 8px;
}
.va-line {
  display: flex;
  justify-content: space-between;
  padding: 3px 5px;
  border-radius: 4px;
  margin-bottom: 3px;
  font-family: "Inter", "Noto Sans TC", monospace;
  font-size: 10.5px;
  color: #9aa6b8;
  transition: all 0.3s ease;
}
.va-line.active {
  background: rgba(201, 169, 106, 0.2);
  color: #ffdf9e;
  font-weight: 600;
}
.va-arrow {
  text-align: center;
  color: var(--vibe-gold);
  font-weight: bold;
  animation: pulseRight 1.2s infinite;
}
@keyframes pulseRight {
  0%, 100% { transform: translateX(-2px); opacity: 0.5; }
  50% { transform: translateX(3px); opacity: 1; }
}

/* 微應用內部組件：全球熱力圖 9 宮格 */
.va-heatmap {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}
.va-hm-cell {
  padding: 6px 8px;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: "Inter", monospace;
  font-size: 10.5px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: background-color 0.5s ease, transform 0.3s ease;
}
.va-hm-cell.up {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.3);
}
.va-hm-cell.down {
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.28);
}

/* 核心能力卡右上角微光指示器 */
.skill-mini-viz {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 80px;
  height: 32px;
  pointer-events: none;
}

.exp-sticky-viewport { background: transparent !important; }

@media (max-width: 600px) {
  .vibe-split-cards { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .vibe-studio-stage, .skill-mini-viz { display: none !important; }
}
