:root {
  --primary: #1a73e8;
  --primary-light: #e8f0fe;
  --success: #34a853;
  --success-light: #e6f4ea;
  --danger: #ea4335;
  --danger-light: #fce8e6;
  --warning: #fbbc04;
  --text: #202124;
  --text-secondary: #5f6368;
  --border: #dadce0;
  --bg: #f8f9fa;
  --card-bg: #ffffff;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(60, 64, 67, 0.12), 0 1px 2px rgba(60, 64, 67, 0.08);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

#root {
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

/* ===== Container ===== */
.cashier-container {
  max-width: 480px;
  width: 100%;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 100vh;
}

/* ===== Header ===== */
.cashier-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

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

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.brand-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

/* ===== Language Switcher ===== */
.lang-switcher {
  display: flex;
  gap: 4px;
}

.lang-btn {
  border: 1px solid var(--border);
  background: var(--card-bg);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-secondary);
}

.lang-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ===== Amount ===== */
.amount-section {
  text-align: center;
  padding: 24px 0 8px;
}

.amount-label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.amount-value {
  font-size: 36px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.5px;
}

/* ===== Countdown ===== */
.countdown {
  text-align: center;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
}

.countdown.expired {
  background: var(--danger-light);
  color: var(--danger);
}

.countdown-icon {
  font-size: 18px;
}

.countdown-time {
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.countdown-hint {
  color: var(--text-secondary);
  font-size: 12px;
}

/* ===== Info Card ===== */
.info-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.pay-to-hint {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  text-align: center;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

/* ===== Pay Info Item ===== */
.pay-info-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--bg);
}

.pay-info-item:last-child {
  border-bottom: none;
}

.pay-info-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pay-info-value-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pay-info-value {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  word-break: break-all;
  flex: 1;
}

.copy-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  border-radius: 4px;
  transition: background 0.15s;
  flex-shrink: 0;
}

.copy-btn:hover {
  background: var(--bg);
}

/* ===== QR Code ===== */
.qr-section {
  text-align: center;
  padding: 16px 0 0;
}

.qr-wrapper {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.qr-copy {
  font-size: 12px;
  color: var(--text-secondary);
}

.qr-image {
  max-width: 200px;
  border-radius: 8px;
}

/* ===== Tips ===== */
.tips-section {
  background: #fff8e1;
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid #ffecb3;
}

.tips-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.tips-list {
  font-size: 13px;
  color: var(--text-secondary);
  padding-left: 20px;
  line-height: 1.8;
}

/* ===== Confirm Button ===== */
.confirm-btn {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.confirm-btn:hover:not(:disabled) {
  background: #1557b0;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3);
}

.confirm-btn:disabled {
  background: var(--border);
  cursor: not-allowed;
}

/* ===== Polling Indicator ===== */
.polling-indicator {
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.5); }
}

/* ===== Order ID ===== */
.order-id-section {
  text-align: center;
  font-size: 11px;
  color: var(--text-secondary);
  padding: 8px 0 16px;
}

/* ===== Status Cards ===== */
.success-card,
.error-card {
  text-align: center;
  padding: 48px 24px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.success-card {
  background: var(--success-light);
}

.error-card {
  background: var(--danger-light);
}

.success-icon,
.error-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.success-text,
.error-text {
  font-size: 18px;
  font-weight: 600;
}

.redirect-hint {
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-secondary);
}

/* ===== Loading ===== */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 80px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
  .cashier-container {
    padding: 12px;
  }

  .amount-value {
    font-size: 28px;
  }

  .countdown-time {
    font-size: 20px;
  }
}

/* ===== iframe 模式 ===== */
.iframe-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  flex: 1;
  min-height: 600px;
  display: flex;
  flex-direction: column;
}

.payment-iframe {
  width: 100%;
  height: 100%;
  flex: 1;
  min-height: 600px;
  border: none;
  display: block;
}
