:root {
  --bg-color: #050505;
  --text-primary: #ffffff;
  --text-secondary: #888888;
  --accent-color: #00ff41; /* Neon green */
  --accent-secondary: #bd00ff; /* Cyber purple */
  --card-bg: #111111;
  --border-color: #333333;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background: radial-gradient(circle at center, #1a1a1a 0%, #050505 100%);
  overflow-y: auto;
}

/* 视图切换 */
.view {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  padding: 30px 20px;
  animation: fadeIn 0.4s ease-out forwards;
}

.view.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- 首页样式 --- */
.glitch-container {
  margin-top: 10vh;
  text-align: center;
  margin-bottom: 10px;
}

.glitch {
  font-size: 3.5rem;
  font-weight: 900;
  text-transform: uppercase;
  position: relative;
  display: inline-block;
  color: var(--text-primary);
  letter-spacing: 2px;
}

.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.glitch::before {
  left: 2px;
  text-shadow: -2px 0 var(--accent-secondary);
  clip: rect(24px, 550px, 90px, 0);
  animation: glitch-anim 3s infinite linear alternate-reverse;
}

.glitch::after {
  left: -2px;
  text-shadow: -2px 0 var(--accent-color);
  clip: rect(85px, 550px, 140px, 0);
  animation: glitch-anim 2.5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
  0% { clip: rect(10px, 9999px, 81px, 0); }
  20% { clip: rect(61px, 9999px, 19px, 0); }
  40% { clip: rect(98px, 9999px, 45px, 0); }
  60% { clip: rect(22px, 9999px, 73px, 0); }
  80% { clip: rect(44px, 9999px, 12px, 0); }
  100% { clip: rect(55px, 9999px, 90px, 0); }
}

.subtitle {
  text-align: center;
  color: var(--accent-color);
  font-size: 1.2rem;
  margin-bottom: 40px;
  letter-spacing: 1px;
}

.intro-box {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 20px;
  margin-bottom: 40px;
  position: relative;
}

.intro-box::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  width: 10px;
  height: 10px;
  border-top: 2px solid var(--accent-color);
  border-left: 2px solid var(--accent-color);
}

.intro-box p {
  margin-bottom: 15px;
  font-size: 0.95rem;
  color: #cccccc;
}
.intro-box p:last-child {
  margin-bottom: 0;
}

.btn-primary {
  background: var(--accent-color);
  color: #000;
  border: none;
  padding: 18px 0;
  font-size: 1.2rem;
  font-weight: bold;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--accent-secondary);
  transition: all 0.1s;
  width: 100%;
  letter-spacing: 2px;
  margin-top: auto;
}

.btn-primary:active {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 var(--accent-secondary);
}

.footer-note {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 20px;
}

/* --- 答题页样式 --- */
.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--border-color);
  margin-bottom: 20px;
}

#progress-fill {
  height: 100%;
  background: var(--accent-color);
  width: 20%;
  transition: width 0.3s ease;
}

.question-header {
  display: flex;
  align-items: baseline;
  margin-bottom: 20px;
  font-family: monospace;
}

.q-num {
  font-size: 2rem;
  color: var(--accent-color);
  font-weight: bold;
}

.q-total {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-left: 5px;
}

.q-text {
  font-size: 1.3rem;
  margin-bottom: 30px;
  line-height: 1.4;
}

.options-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.option-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 18px 15px;
  text-align: left;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.option-btn:hover, .option-btn:active {
  border-color: var(--accent-color);
  background: rgba(0, 255, 65, 0.05);
}

.option-btn::before {
  content: '>';
  color: var(--accent-color);
  margin-right: 10px;
  opacity: 0;
  transition: opacity 0.2s;
}

.option-btn:hover::before, .option-btn:active::before {
  opacity: 1;
}

/* --- 结果页样式 --- */
#view-result {
  padding: 20px;
}

.result-card {
  background: var(--card-bg);
  border: 2px solid #222;
  padding: 25px;
  margin-bottom: 30px;
  position: relative;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
}

/* 四个角装饰 */
.result-card::before, .result-card::after {
  content: '';
  position: absolute;
  width: 15px;
  height: 15px;
}
.result-card::before { top: -2px; left: -2px; border-top: 2px solid var(--accent-color); border-left: 2px solid var(--accent-color); }
.result-card::after { bottom: -2px; right: -2px; border-bottom: 2px solid var(--accent-color); border-right: 2px solid var(--accent-color); }

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 15px;
  margin-bottom: 20px;
}

.barcode {
  font-family: monospace;
  font-size: 1.2rem;
  letter-spacing: -2px;
  color: var(--text-secondary);
}

.scan-id {
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--accent-color);
}

.r-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.r-code {
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--accent-color);
  margin: 5px 0;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
}

.r-title {
  font-size: 1.4rem;
  margin-bottom: 25px;
  color: #fff;
}

.r-section {
  margin-bottom: 20px;
}

.r-section h3 {
  font-size: 0.9rem;
  color: var(--accent-secondary);
  margin-bottom: 8px;
  font-family: monospace;
}

.r-section p {
  font-size: 0.95rem;
  color: #dddddd;
  line-height: 1.6;
}

.r-section.highlight {
  background: rgba(0, 255, 65, 0.05);
  border-left: 3px solid var(--accent-color);
  padding: 15px;
}

.r-section.highlight h3 {
  color: var(--accent-color);
}

.card-footer {
  margin-top: 30px;
  border-top: 1px solid var(--border-color);
  padding-top: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.footer-logo {
  font-weight: bold;
  color: var(--text-secondary);
}

.footer-action {
  color: var(--accent-color);
  animation: blink 2s infinite;
}

.footer-qr {
  width: 50px;
  height: 50px;
  background: #fff;
  padding: 2px;
}

.footer-qr img {
  width: 100%;
  height: 100%;
  display: block;
}

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

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 15px 0;
  font-size: 1rem;
  cursor: pointer;
  width: 100%;
  font-family: monospace;
  margin-top: 10px;
}

.btn-secondary:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}