/* ============================================
   SBTI 每日状态 — 赛博朋克风格
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700;900&display=swap');

:root {
  --bg: #0a0a0f;
  --surface: #12121f;
  --surface-alt: #1a1a2e;
  --neon-green: #39FF14;
  --neon-purple: #BF40FF;
  --neon-pink: #FF2D78;
  --neon-cyan: #00F0FF;
  --neon-yellow: #FFE500;
  --text: #E0E0E0;
  --text-dim: #666680;
  --text-bright: #FFFFFF;
  --type-color: #39FF14;
  --type-color-alt: #66ff44;
  --radius: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Noto Sans SC', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 扫描线背景 */
body::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(255,255,255,0.012) 2px,
    rgba(255,255,255,0.012) 4px
  );
  pointer-events: none;
  z-index: 0;
}

/* ===== 故障效果 ===== */
.glitch-title {
  font-family: 'Courier New', 'SF Mono', monospace;
  font-size: clamp(80px, 18vw, 120px);
  font-weight: 900;
  letter-spacing: 12px;
  color: var(--type-color, var(--neon-green));
  text-shadow:
    3px 0 var(--neon-pink),
    -3px 0 var(--neon-cyan);
  animation: glitch-flicker 4s infinite;
  position: relative;
}

.glitch-title::before,
.glitch-title::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
}
.glitch-title::before {
  color: var(--neon-pink);
  clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%);
  animation: glitch-shift 3s infinite linear alternate;
}
.glitch-title::after {
  color: var(--neon-cyan);
  clip-path: polygon(0 66%, 100% 66%, 100% 100%, 0 100%);
  animation: glitch-shift 2s infinite linear alternate-reverse;
}

@keyframes glitch-flicker {
  0%, 94%, 100% { opacity: 1; }
  95% { opacity: 0.8; }
  96% { opacity: 1; }
  97% { opacity: 0.9; }
}

@keyframes glitch-shift {
  0% { transform: translateX(0); }
  20% { transform: translateX(-2px); }
  40% { transform: translateX(2px); }
  60% { transform: translateX(-1px); }
  80% { transform: translateX(1px); }
  100% { transform: translateX(0); }
}

.glitch-text {
  text-shadow:
    2px 0 var(--neon-pink),
    -2px 0 var(--neon-cyan);
  animation: glitch-flicker 3s infinite;
}

/* ===== 首页 ===== */
.home {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

.home-hero {
  text-align: center;
  padding: 80px 0 40px;
}

.home-subtitle {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  color: var(--text-dim);
  letter-spacing: 6px;
  margin-top: 8px;
}

.home-desc {
  font-size: 14px;
  color: var(--text-dim);
  margin-top: 16px;
}

.home-section {
  margin-top: 48px;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 500;
  letter-spacing: 2px;
  margin-bottom: 24px;
  text-align: center;
  justify-content: center;
}

.label-line {
  display: block;
  width: 40px;
  height: 1px;
  background: rgba(255,255,255,0.1);
}

/* 类型卡片网格 */
.type-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.type-card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.type-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--type-color);
  opacity: 0;
  transition: opacity 0.3s;
}

.type-card:hover,
.type-card:active {
  border-color: var(--type-color);
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.4), 0 0 15px var(--type-color, rgba(57,255,20,0.1));
}

.type-card:hover::before,
.type-card:active::before {
  opacity: 1;
}

.type-emoji {
  font-size: 48px;
  margin-bottom: 8px;
}

.type-code {
  font-family: 'Courier New', monospace;
  font-size: 24px;
  font-weight: 900;
  color: var(--type-color);
  letter-spacing: 4px;
  text-shadow: 0 0 10px var(--type-color);
}

.type-name {
  font-size: 14px;
  color: var(--text-dim);
  margin-top: 4px;
}

.type-tagline {
  font-size: 11px;
  color: rgba(255,255,255,0.25);
  margin-top: 8px;
  line-height: 1.5;
}

/* 速测 */
.quick-test {
  text-align: center;
}

.test-question {
  text-align: center;
}

.test-progress {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 16px;
  letter-spacing: 2px;
}

.test-q {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 24px;
  line-height: 1.6;
}

.test-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.test-option {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text);
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.test-option:hover,
.test-option:active {
  background: var(--surface-alt);
  border-color: var(--neon-green);
  color: var(--neon-green);
}

.test-result {
  text-align: center;
  padding: 24px 0;
}

.test-result-emoji {
  font-size: 64px;
  margin-bottom: 8px;
}

.test-result-code {
  font-family: 'Courier New', monospace;
  font-size: 42px;
  font-weight: 900;
  color: var(--neon-green);
  letter-spacing: 6px;
  text-shadow: 0 0 20px rgba(57,255,20,0.3);
}

.test-result-name {
  font-size: 18px;
  margin-top: 8px;
  color: var(--text);
}

.test-result-tagline {
  font-size: 13px;
  color: var(--text-dim);
  margin: 8px 0 24px;
}

/* ===== 每日状态页 ===== */
.daily {
  max-width: 420px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

.daily-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  position: sticky;
  top: 0;
  background: rgba(10,10,15,0.9);
  backdrop-filter: blur(10px);
  z-index: 10;
}

.back-btn {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  letter-spacing: 1px;
  transition: color 0.2s;
}

.back-btn:hover { color: var(--text); }

.daily-date {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  letter-spacing: 2px;
}

/* 翻卡 */
.card-container {
  perspective: 1200px;
  padding: 32px 0;
}

.card {
  width: 100%;
  aspect-ratio: 3/4;
  max-height: 420px;
  position: relative;
  cursor: pointer;
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.card.flipped {
  transform: rotateY(180deg);
}

.card-front, .card-back {
  -webkit-transform: rotateY(180deg) translateZ(1px);
  transform: rotateY(180deg) translateZ(1px);
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: var(--radius);
  overflow: hidden;
}

.card-front {
  -webkit-transform: translateZ(1px);
  transform: translateZ(1px);
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.08);
}

.card-back {
  -webkit-transform: rotateY(180deg) translateZ(1px);
  transform: rotateY(180deg) translateZ(1px);
  background: var(--surface);
  border: 1px solid var(--type-color);
  transform: rotateY(180deg);
  box-shadow: 0 0 30px var(--type-color, rgba(57,255,20,0.15));
}

.card-inner-front {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 24px;
  position: relative;
  z-index: 2;
}

.card-glow {
  position: absolute;
  top: 50%; left: 50%;
  width: 200px; height: 200px;
  background: radial-gradient(circle, var(--type-color, var(--neon-green)), transparent);
  opacity: 0.06;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.06; }
  50% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.1; }
}

.scanline-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 2px,
    rgba(255,255,255,0.02) 2px, rgba(255,255,255,0.02) 4px
  );
  pointer-events: none;
  z-index: 3;
}

.card-logo {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  color: var(--text-dim);
  letter-spacing: 8px;
  margin-bottom: 24px;
}

.card-emoji-big {
  font-size: 80px;
  margin-bottom: 16px;
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.card-type-hint {
  font-family: 'Courier New', monospace;
  font-size: 28px;
  font-weight: 900;
  color: var(--type-color);
  letter-spacing: 8px;
  opacity: 0.2;
  margin-bottom: 24px;
}

.card-flip-hint {
  font-size: 13px;
  color: var(--text-dim);
  animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.streak-badge {
  font-size: 12px;
  color: var(--neon-yellow);
  margin-top: 8px;
}

/* 翻卡结果 */
.card-inner-back {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 32px;
}

.result-header {
  text-align: center;
}

.result-emoji {
  font-size: 64px;
  margin-bottom: 12px;
}

.result-code {
  font-family: 'Courier New', monospace;
  font-size: 56px;
  font-weight: 900;
  color: var(--type-color);
  letter-spacing: 8px;
}

.result-name {
  font-size: 18px;
  color: var(--text-dim);
  margin-top: 4px;
}

.result-desc {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  line-height: 1.7;
  margin-top: 12px;
  padding: 0 8px;
  max-height: 80px;
  overflow: hidden;
}

.result-tagline {
  font-size: 13px;
  color: rgba(255,255,255,0.3);
  margin-top: 12px;
  font-style: italic;
}

/* 结果详情 */
.result-body {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
}

.result-body.show {
  opacity: 1;
  transform: translateY(0);
}

.block {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 16px;
}

.block-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 16px;
  letter-spacing: 1px;
}

/* 指数条 */
.meters {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.meter-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.meter-icon { font-size: 18px; flex-shrink: 0; }
.meter-label {
  font-size: 12px;
  color: var(--text-dim);
  width: 80px;
  flex-shrink: 0;
}

.meter-bar {
  flex: 1;
  height: 12px;
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 8px var(--type-color);
}

.meter-val {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: var(--type-color);
  width: 36px;
  text-align: right;
  flex-shrink: 0;
}

/* 语录 */
.quote-box {
  background: rgba(255,255,255,0.02);
  border-left: 3px solid var(--type-color);
  padding: 16px 20px;
  border-radius: 0 12px 12px 0;
}

.quote-text {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
  font-style: italic;
}

/* 挑战 */
.challenge-box {
  background: rgba(255,255,255,0.02);
  border: 1px dashed rgba(255,255,255,0.1);
  padding: 16px 20px;
  border-radius: 12px;
}

.challenge-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--neon-yellow);
}

/* 搭档/克星 */
.pairing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pairing-card {
  background: rgba(255,255,255,0.02);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.pairing-card.buddy { border: 1px solid rgba(52,211,153,0.2); }
.pairing-card.rival { border: 1px solid rgba(255,45,120,0.2); }

.pairing-label {
  font-size: 11px;
  margin-bottom: 8px;
}

.pairing-emoji { font-size: 36px; margin-bottom: 4px; }

.pairing-code {
  font-family: 'Courier New', monospace;
  font-size: 16px;
  font-weight: 900;
  color: var(--type-color);
  letter-spacing: 2px;
}

.pairing-name {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

.pairing-desc {
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  margin-top: 8px;
  line-height: 1.5;
}

/* 周签到 */
.week-grid {
  display: flex;
  justify-content: space-between;
  gap: 4px;
}

.week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.week-label {
  font-size: 11px;
  color: var(--text-dim);
}

.week-dot {
  font-size: 20px;
  color: var(--text-dim);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.02);
}

.week-day.checked .week-dot {
  background: rgba(255,255,255,0.06);
}

.week-day.today .week-dot {
  border: 1px solid var(--type-color);
  box-shadow: 0 0 8px var(--type-color, rgba(57,255,20,0.2));
}

.week-day.future .week-dot {
  opacity: 0.3;
}

.streak-text {
  text-align: center;
  font-size: 12px;
  color: var(--neon-yellow);
  margin-top: 12px;
}

/* 分享按钮 */
.share-section {
  margin-top: 24px;
  text-align: center;
}

/* 按钮 */
.btn-neon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  background: transparent;
  border: 1px solid var(--type-color, var(--neon-green));
  color: var(--type-color, var(--neon-green));
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: 1px;
  transition: all 0.3s;
  text-decoration: none;
  box-shadow: 0 0 10px rgba(57,255,20,0.1);
}

.btn-neon:hover,
.btn-neon:active {
  background: var(--type-color, var(--neon-green));
  color: var(--bg);
  box-shadow: 0 0 20px var(--type-color, rgba(57,255,20,0.3));
}

.btn-share {
  width: 100%;
  padding: 16px;
  font-size: 16px;
}

/* 底部 */
.daily-footer, .home-footer {
  text-align: center;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.daily-footer a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}

.daily-footer a:hover { color: var(--text); }

.footer-dim {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  margin-top: 8px;
}

.home-footer p {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 2px;
}

/* 分享弹窗 */
.share-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.share-modal.show { opacity: 1; pointer-events: auto; }

.share-modal-bg {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85);
}

.share-modal-content {
  position: relative;
  max-width: 340px;
  width: 90%;
  text-align: center;
}

.share-img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
}

.share-hint {
  font-size: 12px;
  color: var(--text-dim);
  margin: 12px 0;
}

.btn-close-modal {
  margin-top: 8px;
  padding: 10px 24px;
  font-size: 13px;
}

/* ===== 响应式 ===== */
@media (max-width: 380px) {
  .type-grid { gap: 8px; }
  .type-card { padding: 16px 12px; }
  .type-emoji { font-size: 36px; }
  .type-code { font-size: 20px; }
  .card-emoji-big { font-size: 60px; }
  .result-code { font-size: 40px; }
}

@media (min-width: 600px) {
  .type-grid { grid-template-columns: repeat(3, 1fr); }
}
