/* ============ 布局 / 视图切换 / 通用面板（赛博风） ============ */

#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.view {
  width: 100%;
  min-height: 100vh;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  animation: view-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(12px) scale(0.99); filter: blur(4px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

.view[hidden] {
  display: none !important;
}

/* ============ 卡片（切角玻璃风 + 角标） ============ */
.card {
  position: relative;
  width: 100%;
  max-width: 460px;
  background: var(--bg-panel);
  border: 1px solid var(--border-cyan);
  padding: 40px 28px;
  backdrop-filter: blur(14px);
  clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
  box-shadow:
    0 0 40px rgba(0, 240, 255, 0.18),
    0 0 60px rgba(176, 77, 255, 0.08),
    inset 0 1px 0 rgba(0, 240, 255, 0.15);
}

/* 卡片装饰：四角 L 形角标 */
.card::before,
.card::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--neon-cyan);
  filter: drop-shadow(0 0 4px var(--neon-cyan));
  pointer-events: none;
}

.card::before {
  top: 6px;
  left: 6px;
  border-right: none;
  border-bottom: none;
}

.card::after {
  bottom: 6px;
  right: 6px;
  border-left: none;
  border-top: none;
}

/* ============ 顶部品牌栏 ============ */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 56px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(10, 5, 24, 0.95), rgba(10, 5, 24, 0.78));
  border-bottom: 1px solid var(--border-cyan);
  backdrop-filter: blur(14px);
  box-shadow: 0 4px 20px rgba(0, 240, 255, 0.1);
}

.topbar::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), var(--neon-magenta), transparent);
  opacity: 0.6;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-serif);
  color: var(--gold);
  letter-spacing: 0.2em;
  text-shadow: 0 0 8px rgba(201, 168, 76, 0.5);
}

.topbar-logo {
  font-size: 22px;
  color: var(--neon-cyan);
  text-shadow: 0 0 12px var(--neon-cyan);
  animation: logo-spin 12s linear infinite;
  display: inline-block;
}

@keyframes logo-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.topbar-name {
  font-size: 16px;
  font-weight: 700;
}

.topbar-restart {
  padding: 8px 18px;
  border: 1px solid var(--border-magenta);
  color: var(--neon-magenta);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  transition: all 0.2s;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  background: rgba(255, 45, 149, 0.08);
}

.topbar-restart:hover {
  background: rgba(255, 45, 149, 0.18);
  box-shadow: 0 0 12px rgba(255, 45, 149, 0.5);
  text-shadow: 0 0 6px var(--neon-magenta);
}

body.view-anim-active .topbar,
body.view-home-active .topbar {
  display: none;
}

/* ============ 结果页 Tabs（科技风） ============ */
.tabs {
  position: -webkit-sticky;
  position: sticky;
  top: 56px; /* 粘在 topbar (56px) 下方 */
  z-index: 10;
  display: flex;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  background: linear-gradient(180deg, rgba(10, 5, 24, 0.96), rgba(10, 5, 24, 0.88));
  border-bottom: 1px solid var(--border-cyan);
  backdrop-filter: blur(14px);
  overflow-x: auto;
  scrollbar-width: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex: 1 0 auto;
  padding: 16px 20px;
  color: var(--text-muted);
  font-family: var(--font-serif);
  font-size: 17px;
  letter-spacing: 0.2em;
  position: relative;
  white-space: nowrap;
  transition: all 0.2s;
}

.tab:hover {
  color: var(--neon-cyan);
  text-shadow: 0 0 6px rgba(0, 240, 255, 0.4);
}

.tab.active {
  color: var(--gold);
  font-weight: 700;
  text-shadow:
    0 0 6px rgba(201, 168, 76, 0.6),
    0 0 12px rgba(201, 168, 76, 0.3);
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), var(--gold), var(--neon-magenta), transparent);
  box-shadow:
    0 0 8px var(--neon-cyan),
    0 0 12px var(--gold);
}

.tab.active::before {
  content: '◢';
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 8px;
  color: var(--neon-cyan);
  text-shadow: 0 0 4px var(--neon-cyan);
}

.tab-panels {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 0 60px;
}

.tab-panel {
  display: none;
  animation: panel-in 0.4s ease;
}

.tab-panel.active {
  display: block;
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ 通用 Panel（玻璃 + 霓虹边） ============ */
.panel {
  position: relative;
  background: var(--bg-panel);
  border: 1px solid var(--border-cyan);
  border-radius: 2px;
  padding: 24px 22px;
  margin-bottom: 16px;
  backdrop-filter: blur(8px);
  overflow: hidden;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  box-shadow:
    0 0 25px rgba(0, 240, 255, 0.06),
    inset 0 0 0 1px rgba(0, 240, 255, 0.05);
}

/* panel 顶部右侧的小三角装饰（赛博风） */
.panel::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, transparent 50%, rgba(0, 240, 255, 0.18) 50%);
  pointer-events: none;
}

.panel::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 6px;
  width: 8px;
  height: 8px;
  border-top: 1.5px solid var(--neon-cyan);
  border-left: 1.5px solid var(--neon-cyan);
  filter: drop-shadow(0 0 3px var(--neon-cyan));
  pointer-events: none;
  z-index: 1;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--gold);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-gold);
  letter-spacing: 0.2em;
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  text-shadow: 0 0 8px rgba(201, 168, 76, 0.4);
}

.section-title::before {
  content: '◢';
  color: var(--neon-cyan);
  font-size: 11px;
  opacity: 0.9;
  text-shadow: 0 0 6px var(--neon-cyan);
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, var(--neon-cyan), transparent);
  box-shadow: 0 0 6px var(--neon-cyan);
}

.info-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: 16px;
  padding: 12px 0;
  border-top: 1px dashed rgba(0, 240, 255, 0.2);
}

.info-item {
  font-size: 14px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.info-item strong {
  color: var(--neon-cyan);
  font-weight: 500;
  text-shadow: 0 0 4px rgba(0, 240, 255, 0.4);
}

/* ============ 视图结果布局 ============ */
.view-result {
  padding-top: 56px; /* 给 topbar (56px) 留空间，否则 tabs 被遮挡 */
  align-items: center;
}

/* ============ 首页主题动态场景（.cyber-scene 样式见 home-scene.css） ============ */
.view-home .card {
  position: relative;
  z-index: 3;
  backdrop-filter: blur(12px);
}

.view-home {
  position: relative;
  overflow: hidden;
  /* 卡片在视口垂直居中 */
  justify-content: center;
}

/* ============ 大屏适配 ============ */
@media (min-width: 768px) {
  .view { padding: 60px 20px; }
  .card { padding: 48px 40px; }
  .panel { padding: 28px 30px; }
  .section-title { font-size: 20px; }
}

@media (min-width: 1024px) {
  .view { padding: 60px 20px; }
  .tab-panels { max-width: 1100px; }
  .tabs { max-width: 1100px; }
}

@media (min-width: 1440px) {
  .tab-panels { max-width: 1280px; }
  .tabs { max-width: 1280px; }
}

/* ============ 手机端：Tab 紧凑（5 个标签挤进视口） ============ */
@media (max-width: 767px) {
  .tab {
    padding: 14px 10px;
    font-size: 13px;
    letter-spacing: 0.08em;
  }

  .tab-panels {
    padding: 16px 0 60px;
  }

  /* 首页/动画页 sticky topbar 也要避开 */
  .view-result {
    padding-top: 56px;
  }

  /* Panel 紧凑（默认 24px 22px 在 375px 视口太占空间） */
  .panel {
    padding: 16px 14px;
    margin-bottom: 12px;
  }

  .section-title {
    font-size: 15px;
    margin-bottom: 14px;
    padding-bottom: 8px;
    letter-spacing: 0.15em;
  }

  .view {
    padding: 30px 14px;
  }
}
