/* 对齐 App 支付页：375 设计稿、主题色 #E10916 */
:root {
  --primary: #e10916;
  --bg: #f8f8f8;
  --text: #333;
  --text-secondary: #666;
  --text-muted: #999;
  --border: #eaeaea;
  --card: #fff;
  --primary-light: #fff0f0;
  font-size: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
}

.app-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  background: var(--card);
  border-bottom: 1px solid #f0f0f0;
  font-size: 17px;
  font-weight: 600;
}

.app-bar .back {
  position: absolute;
  left: 12px;
  font-size: 22px;
  color: var(--text);
  text-decoration: none;
  line-height: 1;
  padding: 8px;
}

.page-body {
  padding-bottom: 88px;
}

.card {
  background: var(--card);
  margin-bottom: 5px;
  padding: 15px;
}

.author-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.author-row img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  background: #eee;
}

.author-meta .name {
  font-size: 14px;
  font-weight: 500;
}

.author-meta .sign {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.product-row {
  display: flex;
  gap: 10px;
}

.product-cover {
  width: 138px;
  height: 78px;
  border-radius: 8px;
  object-fit: cover;
  background: #eee;
  flex-shrink: 0;
}

.product-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.product-title {
  font-size: 14px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-price {
  margin-top: auto;
  font-size: 15px;
  font-weight: bold;
  color: #0d0d0d;
}

.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  font-size: 14px;
}

.row-between .label {
  color: var(--text-muted);
}

.row-between .value {
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 4px;
}

.row-between.clickable {
  cursor: pointer;
}

.pay-summary-title {
  font-size: 16px;
  margin-bottom: 8px;
}

.pay-summary-right {
  text-align: right;
  font-size: 14px;
  color: var(--text-secondary);
}

.pay-summary-right .final {
  color: var(--primary);
  font-size: 16px;
  font-weight: bold;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 480px;
  margin: 0 auto;
  background: var(--card);
  padding: 10px 15px calc(10px + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bottom-price {
  font-size: 24px;
  font-weight: bold;
  color: var(--primary);
}

.btn-primary {
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  padding: 12px 40px;
  border-radius: 22px;
  cursor: pointer;
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-block {
  width: 100%;
  padding: 14px;
  border-radius: 22px;
  font-size: 16px;
  font-weight: bold;
}

.pay-method-list {
  padding: 12px 16px;
}

.pay-method-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  cursor: pointer;
}

.pay-method-item.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.pay-method-item.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pay-method-item .title {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
}

.pay-method-item .check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #ccc;
}

.pay-method-item.selected .check {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: inset 0 0 0 3px #fff;
}

.method-footer {
  padding: 10px 20px calc(10px + env(safe-area-inset-bottom));
}

.hint {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.loading,
.error-box {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.error-box {
  color: var(--primary);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 100px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 99;
  max-width: 90%;
  text-align: center;
}

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 50;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.modal-mask.show {
  display: flex;
}

.modal-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 60vh;
  background: var(--card);
  border-radius: 12px 12px 0 0;
  overflow: auto;
}

.modal-sheet h3 {
  padding: 16px;
  font-size: 16px;
  border-bottom: 1px solid #f0f0f0;
}

.coupon-option {
  padding: 14px 16px;
  border-bottom: 1px solid #f5f5f5;
  cursor: pointer;
}

.coupon-option:active {
  background: #fafafa;
}

.coupon-option.none {
  color: var(--text-muted);
}
