/* ===== CSS Variables ===== */
:root {
  --walmart-blue: #0071ce;
  --walmart-blue-dark: #004f9a;
  --walmart-yellow: #ffc220;
  --walmart-yellow-light: #fff4cc;
  --text-primary: #1a1a1a;
  --text-secondary: #555;
  --text-muted: #888;
  --bg-page: #f4f7fb;
  --bg-white: #ffffff;
  --border-color: #dde3ea;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 20px rgba(0, 113, 206, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --header-height: 80px;
  --max-width: 1200px;
  --transition: 0.25s ease;
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  color: var(--text-primary);
  background: var(--bg-page);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--walmart-blue);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--walmart-blue-dark);
  text-decoration: underline;
}

ul {
  list-style: none;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== Header ===== */
.site-header {
  background: linear-gradient(135deg, var(--walmart-blue) 0%, var(--walmart-blue-dark) 100%);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  gap: 16px;
}

.logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo {
  height: 48px;
  width: auto;
}

.header-tagline {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  letter-spacing: 2px;
  white-space: nowrap;
}

/* ===== Main Layout ===== */
.site-main {
  flex: 1;
  padding: 32px 0 48px;
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr 420px 1fr;
  gap: 24px;
  align-items: start;
}

/* ===== Side Panels ===== */
.side-panel {
  position: sticky;
  top: calc(var(--header-height) + 24px);
}

.info-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.info-card h2 {
  font-size: 1.15rem;
  color: var(--walmart-blue);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--walmart-yellow);
}

.info-figure {
  margin-bottom: 16px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--walmart-yellow-light);
}

.info-figure img {
  width: 100%;
  object-fit: cover;
}

.info-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.info-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-list li {
  position: relative;
  padding-left: 18px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.info-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--walmart-blue);
  font-weight: bold;
}

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-page);
  transition: background var(--transition);
}

.feature-list li:hover {
  background: var(--walmart-yellow-light);
}

.feature-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  line-height: 1;
}

.feature-list strong {
  display: block;
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.feature-list p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

/* ===== Form Panel ===== */
.form-panel {
  width: 100%;
}

.form-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
}

.form-title {
  font-size: 1.5rem;
  color: var(--walmart-blue);
  text-align: center;
  margin-bottom: 8px;
}

.form-desc {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 28px;
}

.balance-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-group input[type="text"],
.form-group input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: var(--bg-white);
}

.form-group input:focus {
  outline: none;
  border-color: var(--walmart-blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 206, 0.15);
}

.form-group input.error {
  border-color: #e53935;
  box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.12);
}

.field-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Captcha */
.captcha-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.captcha-row input {
  flex: 1;
  min-width: 0;
}

.captcha-display {
  flex-shrink: 0;
  width: 100px;
  height: 44px;
  background: linear-gradient(135deg, #e8f0fe 0%, #fff8e1 100%);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: bold;
  letter-spacing: 6px;
  color: var(--walmart-blue-dark);
  user-select: none;
  font-family: "Courier New", monospace;
  position: relative;
  overflow: hidden;
}

.captcha-display::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 4px,
    rgba(0, 113, 206, 0.05) 4px,
    rgba(0, 113, 206, 0.05) 8px
  );
}

.captcha-display span {
  position: relative;
  z-index: 1;
}

.btn-refresh {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-white);
  color: var(--walmart-blue);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), border-color var(--transition);
}

.btn-refresh:hover {
  background: var(--walmart-yellow-light);
  border-color: var(--walmart-yellow);
}

.btn-refresh:active {
  transform: scale(0.95);
}

/* Form Message */
.form-message {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  text-align: center;
}

.form-message.error {
  background: #fdecea;
  color: #c62828;
  border: 1px solid #f5c6cb;
}

.form-message.success {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}

/* Submit Button */
.btn-submit {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--walmart-blue) 0%, var(--walmart-blue-dark) 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
  margin-top: 4px;
}

.btn-submit:hover {
  opacity: 0.92;
}

.btn-submit:active {
  transform: scale(0.98);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ===== Footer ===== */
.site-footer {
  background: #1e2a3a;
  color: rgba(255, 255, 255, 0.85);
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  padding: 40px 20px;
}

.footer-block h3 {
  font-size: 1rem;
  color: var(--walmart-yellow);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.footer-block p {
  font-size: 0.875rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.75);
}

.footer-block a {
  color: rgba(255, 255, 255, 0.9);
}

.footer-block a:hover {
  color: var(--walmart-yellow);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 16px 0;
  text-align: center;
}

.footer-bottom p {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
}

/* ===== Responsive: Tablet ===== */
@media (max-width: 1024px) {
  .main-grid {
    grid-template-columns: 1fr 380px 1fr;
    gap: 16px;
  }

  .info-card {
    padding: 18px;
  }

  .form-card {
    padding: 24px 20px;
  }
}

/* ===== Responsive: Mobile ===== */
@media (max-width: 768px) {
  :root {
    --header-height: 64px;
  }

  .header-inner {
    flex-direction: column;
    justify-content: center;
    padding: 12px 0;
    min-height: var(--header-height);
    gap: 4px;
  }

  .logo {
    height: 36px;
  }

  .header-tagline {
    font-size: 0.75rem;
    letter-spacing: 1px;
  }

  .site-main {
    padding: 20px 0 32px;
  }

  .main-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .side-panel {
    position: static;
  }

  .side-left {
    order: 2;
  }

  .form-panel {
    order: 1;
  }

  .side-right {
    order: 3;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 28px 20px;
  }

  .captcha-row {
    flex-wrap: wrap;
  }

  .captcha-row input {
    width: 100%;
    flex: none;
  }

  .captcha-display {
    flex: 1;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 14px;
  }

  .form-card {
    padding: 20px 16px;
  }

  .form-title {
    font-size: 1.25rem;
  }

  .captcha-display {
    width: 80px;
    font-size: 1.1rem;
    letter-spacing: 4px;
  }
}
