:root {
  --bg-color: #0d1117;
  --panel-bg: rgba(22, 27, 34, 0.65);
  --panel-border: rgba(255, 255, 255, 0.08);
  --inner-panel-bg: rgba(255, 255, 255, 0.03);
  
  --primary: #58a6ff;
  --primary-hover: #3182ce;
  --accent-1: #c90a9a;
  --accent-2: #238636;
  
  --text-main: #e6edf3;
  --text-muted: #8b949e;
  
  --font-family: 'Inter', 'Noto Sans TC', sans-serif;
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  position: relative;
  line-height: 1.6;
}

/* Background Animations */
.background-elements {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  filter: blur(80px);
  border-radius: 50%;
  opacity: 0.4;
  animation: float 20s infinite alternate ease-in-out;
}

.blob-1 {
  background: radial-gradient(circle, #58a6ff, rgba(88, 166, 255, 0));
  width: 40vw;
  height: 40vw;
  top: -10%;
  left: -10%;
}

.blob-2 {
  background: radial-gradient(circle, #c90a9a, rgba(201, 10, 154, 0));
  width: 35vw;
  height: 35vw;
  bottom: -5%;
  right: -5%;
  animation-delay: -5s;
}

.blob-3 {
  background: radial-gradient(circle, #238636, rgba(35, 134, 54, 0));
  width: 30vw;
  height: 30vw;
  top: 40%;
  left: 30%;
  animation-delay: -10s;
  opacity: 0.2;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(5%, 10%) scale(1.1); }
  100% { transform: translate(-5%, 5%) scale(0.9); }
}

/* Main Container */
.container {
  width: 90%;
  max-width: 800px;
  margin: 40px auto;
  padding: 40px;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--panel-border);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.glass-panel-inner {
  background: var(--inner-panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 24px;
}

/* Typography */
header {
  text-align: center;
}

.gradient-text {
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(to right, #58a6ff, #a371f7, #c90a9a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
  letter-spacing: -1px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Sections */
.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.step-number {
  background: var(--primary);
  color: #fff;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 700;
  font-size: 1.1rem;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
}

/* Grid Layouts */
.card-grid, .scenario-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

/* Selectable Items (Cards & Scenarios) */
.selectable-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.selectable-item:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
}

.selectable-item.selected {
  background: rgba(88, 166, 255, 0.15);
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(88, 166, 255, 0.2);
}

.selectable-item.selected::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(88, 166, 255, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

.item-icon {
  font-size: 2rem;
  margin-bottom: 4px;
}

.item-name {
  font-weight: 500;
  font-size: 0.95rem;
}

.item-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Button */
.action-container {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.primary-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 30px;
  padding: 16px 40px;
  font-size: 1.1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(88, 166, 255, 0.3);
}

.primary-btn:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(88, 166, 255, 0.4);
}

.primary-btn:active:not(:disabled) {
  transform: translateY(0);
}

.primary-btn:disabled {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.3);
  cursor: not-allowed;
  box-shadow: none;
}

/* Results */
.result-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.result-section.hidden {
  display: none;
  opacity: 0;
  transform: translateY(20px);
}

.result-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #a371f7;
}

.result-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.1), rgba(163, 113, 247, 0.1));
  border: 1px solid rgba(88, 166, 255, 0.3);
  border-radius: 16px;
  padding: 24px;
}

.result-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.bank-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  padding: 2px;
}

.bank-logo.hidden {
  display: none;
}

.result-card-info h4 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.result-payment-method {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.result-payment-method span {
  color: #58a6ff;
  font-weight: 600;
}

.reward-rate-container {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.reward-rate {
  font-size: 2.5rem;
  font-weight: 800;
  color: #4ade80;
  line-height: 1;
}

.reward-type {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.result-notes {
  font-size: 0.85rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 12px;
  border-radius: 8px;
  border-left: 3px solid #f1e05a;
}

.other-options-title {
  font-size: 1rem;
  font-weight: 500;
  margin-top: 10px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.other-options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.other-option-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.other-option-name {
  font-weight: 500;
}

.other-option-method {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.other-option-rate {
  font-weight: 600;
  color: #4ade80;
}

/* Footer */
footer {
  margin-top: auto;
  padding: 20px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  width: 100%;
}

/* Animations */
.fade-in {
  animation: fadeIn 0.8s ease-out forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 600px) {
  .container {
    width: 95%;
    padding: 24px;
    margin: 20px auto;
  }
  
  .gradient-text {
    font-size: 2.2rem;
  }
  
  .result-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .reward-rate-container {
    align-items: flex-start;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
  }
}
