/* ===================================================
   KOSMOS - Visual System & Astrolabe UI [v1.3.0]
   File: style.css
   =================================================== */

:root {
  --bg-color: #08090b;
  --card-bg: rgba(255, 255, 255, 0.025);
  --card-border: rgba(255, 255, 255, 0.06);
  --text-main: #f0f2f5;
  --text-sub: #7a808c;
  --accent-gold: #d4af37;
  --qi-glow: rgba(212, 175, 55, 0.25);
  --font-serif: "Noto Serif TC", "Source Han Serif TC", "Songti TC", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem 1rem;
  overflow-x: hidden;
  position: relative;
}

.qi-aura {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 440px; height: 440px;
  background: radial-gradient(circle, var(--qi-glow) 0%, rgba(8, 9, 11, 0) 70%);
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  mix-blend-mode: screen;
  transition: background 1.2s ease;
  z-index: 0;
}

.container {
  width: 100%;
  max-width: 410px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
}

.header { text-align: center; }
.brand-title {
  font-size: 1.6rem;
  font-weight: 300;
  letter-spacing: 0.4em;
  color: var(--text-main);
  margin-left: 0.4em;
}
.time-stamp {
  margin-top: 0.6rem;
  font-size: 0.8rem;
  color: var(--text-sub);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.shichen-tag { color: var(--accent-gold); letter-spacing: 0.08em; }

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 24px;
  padding: 1.5rem 1.3rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.4rem;
}
.section-title {
  font-size: 0.76rem;
  color: var(--text-sub);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.current-resonance-tag {
  font-size: 0.75rem;
  color: var(--accent-gold);
  background: rgba(212, 175, 55, 0.08);
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, 0.2);
}

.axis-group {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}
.axis-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.axis-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
}
.axis-title { color: var(--text-sub); letter-spacing: 0.05em; }
.axis-value { color: var(--text-main); font-weight: 500; }

.track-line {
  position: relative;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}
.track-line::before {
  content: "";
  position: absolute;
  left: 10px; right: 10px; top: 50%;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-50%);
  z-index: 0;
}

.node {
  position: relative;
  z-index: 1;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #121418;
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  display: flex; justify-content: center; align-items: center;
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}
.node::after {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
}
.node:hover {
  border-color: var(--accent-gold);
  transform: scale(1.15);
}
.node.active {
  border-color: var(--accent-gold);
  background: rgba(212, 175, 55, 0.15);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.3);
  transform: scale(1.25);
}
.node.active::after {
  background: var(--accent-gold);
  box-shadow: 0 0 6px var(--accent-gold);
}

.resonance-trigger {
  position: relative;
  height: 52px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  border-radius: 26px;
  display: flex;
  align-items: center;
  padding: 0 6px;
  overflow: hidden;
  transition: border-color 0.3s ease;
}
.trigger-text {
  position: absolute;
  width: 100%;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-sub);
  letter-spacing: 0.15em;
  pointer-events: none;
  z-index: 1;
}
.trigger-range {
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 3;
}
.trigger-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.25));
  border-radius: 26px;
  pointer-events: none;
  z-index: 0;
  transition: width 0.1s ease;
}

.limit-hint {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-sub);
}

.poetic-card {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.qi-summary { font-size: 1.05rem; color: var(--accent-gold); margin-bottom: 0.8rem; font-weight: 500; }
.poetic-text { font-family: var(--font-serif); line-height: 1.8; font-size: 0.98rem; color: #e2e4d2; }
.mirror-reflection { margin-top: 1rem; padding-top: 0.8rem; border-top: 1px dashed rgba(255, 255, 255, 0.08); font-size: 0.85rem; color: var(--text-sub); line-height: 1.6; }
.loading { display: none; text-align: center; color: var(--text-sub); font-size: 0.85rem; }

.share-trigger-wrap { text-align: center; }
.share-btn {
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text-sub);
  padding: 0.55rem 1.2rem;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.25s ease;
}

.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(5, 6, 8, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 100;
  display: flex; justify-content: center; align-items: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }

.modal-content {
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
}

.share-card-target {
  width: 320px; height: 568px;
  background: #0d0f12;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 2rem 1.6rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
}

.card-aura {
  position: absolute;
  top: -15%; right: -15%;
  width: 320px; height: 320px;
  background: radial-gradient(circle, var(--qi-color, rgba(212, 175, 55, 0.3)) 0%, rgba(13, 15, 18, 0) 70%);
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  mix-blend-mode: screen;
  transition: background 0.8s ease;
}

.card-inner {
  height: 100%; display: flex; flex-direction: column; justify-content: space-between; z-index: 1;
}
.card-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.8rem;
  display: flex; justify-content: space-between; align-items: baseline;
}
.card-brand { font-size: 1.05rem; letter-spacing: 0.3em; color: var(--text-main); font-weight: 300; }

.card-meta-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
}
.card-time-stamp {
  font-size: 0.68rem;
  color: var(--accent-gold);
  letter-spacing: 0.08em;
  font-family: var(--font-sans);
  opacity: 0.9;
}
.card-meta {
  font-size: 0.68rem;
  color: var(--text-sub);
  letter-spacing: 0.05em;
}

.card-body { display: flex; flex-direction: column; gap: 1rem; margin: auto 0; }
.card-summary { font-size: 0.95rem; color: var(--accent-gold); font-weight: 500; }
.card-poetic { font-family: var(--font-serif); font-size: 1.02rem; line-height: 1.85; color: #eceee0; }
.card-mirror { font-size: 0.78rem; color: var(--text-sub); line-height: 1.65; padding-top: 0.6rem; border-top: 1px dashed rgba(255, 255, 255, 0.08); }

.card-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.8rem;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.7rem; color: var(--text-sub);
}

.modal-actions { display: flex; gap: 0.8rem; width: 100%; }
.modal-btn {
  flex: 1; padding: 0.75rem; border-radius: 12px; font-size: 0.82rem; cursor: pointer;
}
.modal-btn.primary { background: var(--text-main); color: #0d0f12; border: none; font-weight: 500; }
.modal-btn.secondary { background: rgba(255, 255, 255, 0.05); color: var(--text-sub); border: 1px solid var(--card-border); }