/* CSS Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background-color: #f5f5f5;
  color: #333;
  line-height: 1.5;
  min-height: 100vh;
}

/* Container */
.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
}

/* Header */
.header {
  text-align: center;
  padding: 20px 0;
}

.header h1 {
  font-size: 20px;
  font-weight: 600;
  color: #333;
}

/* Card */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
}

/* Form Fields */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 14px;
  color: #666;
  margin-bottom: 8px;
}

.form-select,
.form-input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 15px;
  color: #333;
  background: #fff;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.form-select:focus,
.form-input:focus {
  border-color: #07c160;
}

/* Amount Grid */
.amount-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.amount-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 72px;
  border: 2px solid #eee;
  border-radius: 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.2s, background-color 0.2s;
}

.amount-item:active {
  transform: scale(0.97);
}

.amount-item.selected {
  border-color: #07c160;
  background-color: #f0faf5;
}

.amount-price {
  font-size: 18px;
  font-weight: 700;
  color: #333;
}

.amount-item.selected .amount-price {
  color: #07c160;
}

.amount-diamonds {
  font-size: 12px;
  color: #999;
  margin-top: 2px;
}

/* Pay Button */
.btn-pay {
  display: block;
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 24px;
  background: linear-gradient(135deg, #07c160, #06ad56);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.2s;
  margin-top: 20px;
}

.btn-pay:active {
  opacity: 0.85;
}

.btn-pay:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* Error State */
.error-box {
  text-align: center;
  padding: 40px 20px;
}

.error-box .error-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.error-box .error-msg {
  font-size: 15px;
  color: #666;
  margin-bottom: 16px;
}

.error-box .btn-retry {
  display: inline-block;
  padding: 10px 24px;
  border: 1px solid #07c160;
  border-radius: 20px;
  background: #fff;
  color: #07c160;
  font-size: 14px;
  cursor: pointer;
}

/* Result Page */
.result-card {
  text-align: center;
  padding: 32px 16px;
}

.result-icon {
  font-size: 56px;
  margin-bottom: 16px;
}

.result-status {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.result-status.success { color: #07c160; }
.result-status.failed { color: #ee0a24; }
.result-status.cancelled { color: #ff976a; }

.result-message {
  font-size: 14px;
  color: #999;
  margin-bottom: 24px;
}

.result-info {
  text-align: left;
  background: #f8f8f8;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 24px;
}

.result-info-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px solid #eee;
}

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

.result-info-item .label {
  color: #999;
}

.result-info-item .value {
  color: #333;
  font-weight: 500;
}

.btn-back {
  display: block;
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 24px;
  background: linear-gradient(135deg, #07c160, #06ad56);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  line-height: 48px;
  text-decoration: none;
}

/* Toast */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 9999;
  max-width: 80%;
  text-align: center;
  opacity: 1;
  transition: opacity 0.3s;
  -webkit-transition: opacity 0.3s;
}

.toast-hide {
  opacity: 0;
}

/* Loading */
.loading {
  text-align: center;
  padding: 60px 20px;
}

.loading-spinner {
  display: inline-block;
  width: 36px;
  height: 36px;
  border: 3px solid #eee;
  border-top-color: #07c160;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-text {
  font-size: 14px;
  color: #999;
  margin-top: 12px;
}
