/* 小沙 OpenClaw 激活码商城 - 样式 */
:root {
  --green: #2e7d32;
  --green-light: #4caf50;
  --green-bg: #e8f5e9;
  --red: #c62828;
  --orange: #ef6c00;
  --gray: #757575;
  --gray-light: #f5f5f5;
  --border: #e0e0e0;
  --white: #ffffff;
  --text: #333333;
  --radius: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--text);
  background: #fafafa;
  line-height: 1.6;
}

/* 导航栏 */
nav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
nav .logo { font-size: 18px; font-weight: bold; color: var(--green); }
nav .logo a { text-decoration: none; color: inherit; }
nav .nav-right { display: flex; align-items: center; gap: 16px; }
nav .nav-right a { text-decoration: none; color: var(--text); font-size: 14px; }
nav .nav-right a:hover { color: var(--green); }
nav .user-info { font-size: 13px; color: var(--gray); }
.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text);
  text-decoration: none;
}
.btn-sm:hover { background: var(--gray-light); }
.btn-sm.primary {
  background: var(--green);
  color: var(--white);
  border-color: var(--green);
}
.btn-sm.primary:hover { background: var(--green-light); }
.btn-sm.danger { color: var(--red); border-color: var(--red); }
.btn-sm.danger:hover { background: #ffebee; }

/* 主容器 */
.container { max-width: 800px; margin: 0 auto; padding: 24px 16px; }

/* 卡片 */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border: 1px solid var(--border);
}
.card h2 { font-size: 20px; margin-bottom: 16px; color: var(--text); }
.card h3 { font-size: 16px; margin-bottom: 12px; }

/* 商品卡片 */
.product-grid { 
  display: flex; 
  justify-content: center; 
  gap: 24px; 
  flex-wrap: wrap;
  max-width: 780px;
  margin: 0 auto;
}
.product-card {
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 32px 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--white);
  min-width: 200px;
  flex: 1;
  max-width: 240px;
}
.product-card:hover { border-color: var(--green); transform: translateY(-3px); box-shadow: 0 6px 20px rgba(46,125,50,0.15); }
.product-card.selected { border-color: var(--green); background: var(--green-bg); box-shadow: 0 4px 16px rgba(46,125,50,0.2); }
.product-card .name { font-size: 18px; font-weight: bold; margin-bottom: 12px; color: #444; }
.product-card .price { font-size: 36px; color: var(--green); font-weight: bold; margin-bottom: 6px; }
.product-card .price .unit { font-size: 18px; }
.product-card .days { font-size: 14px; color: var(--gray); margin-top: 4px; }

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: #555; }
.form-group input, .form-group select {
  width: 100%;
  padding: 10px 14px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus { border-color: var(--green); }
.form-group .hint { font-size: 12px; color: var(--gray); margin-top: 4px; }

/* 按钮 */
.btn {
  display: inline-block;
  padding: 12px 28px;
  font-size: 16px;
  font-weight: 500;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}
.btn-primary {
  background: var(--green);
  color: var(--white);
  width: 100%;
}
.btn-primary:hover { background: var(--green-light); }
.btn-primary:disabled { background: #a5d6a7; cursor: not-allowed; }
.btn-outline {
  background: var(--white);
  color: var(--green);
  border: 1px solid var(--green);
}
.btn-outline:hover { background: var(--green-bg); }

/* 状态标签 */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}
.status-pending { background: #fff3e0; color: var(--orange); }
.status-paid { background: #e8f5e9; color: #2e7d32; }
.status-fulfilled { background: #c8e6c9; color: #1b5e20; }
.status-refunded { background: #fce4ec; color: var(--red); }
.status-cancelled { background: var(--gray-light); color: var(--gray); }

/* 激活码展示 */
.activation-box {
  background: #f1f8e9;
  border: 2px dashed var(--green);
  border-radius: var(--radius);
  padding: 20px;
  margin: 16px 0;
  text-align: center;
}
.activation-box .key {
  font-family: "Consolas", "Courier New", monospace;
  font-size: 16px;
  font-weight: bold;
  word-break: break-all;
  color: var(--green);
}
.activation-box .meta { font-size: 13px; color: var(--gray); margin-top: 8px; }

/* 支付弹窗 */
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
}
.modal {
  background: var(--white);
  border-radius: 12px;
  padding: 32px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.modal h3 { margin-bottom: 16px; }
.modal .price-display { font-size: 28px; color: var(--green); font-weight: bold; margin-bottom: 20px; }
.modal .pay-options { display: flex; gap: 12px; margin-bottom: 20px; }
.modal .pay-btn {
  flex: 1; padding: 14px; border: 2px solid var(--border); border-radius: var(--radius);
  background: var(--white); cursor: pointer; font-size: 15px; transition: all 0.2s;
}
.modal .pay-btn:hover { border-color: var(--green); background: var(--green-bg); }
.modal .pay-btn.selected { border-color: var(--green); background: var(--green-bg); }
.modal .qrcode-placeholder {
  width: 200px; height: 200px; margin: 20px auto; background: var(--gray-light);
  border: 1px solid var(--border); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 8px; color: var(--gray);
}
.modal .qrcode-placeholder .icon { font-size: 48px; }

/* 订单表格 */
.order-table { width: 100%; border-collapse: collapse; }
.order-table th, .order-table td {
  padding: 12px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.order-table th { color: var(--gray); font-weight: 500; background: var(--gray-light); }
.order-table td .key-preview {
  font-family: Consolas, monospace;
  font-size: 12px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 消息提示 */
.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  padding: 12px 24px; border-radius: 6px; font-size: 14px;
  z-index: 300; box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  animation: slideDown 0.3s ease;
}
.toast-success { background: #c8e6c9; color: #1b5e20; }
.toast-error { background: #ffcdd2; color: #b71c1c; }
.toast-info { background: #bbdefb; color: #0d47a1; }
@keyframes slideDown { from { opacity: 0; transform: translateX(-50%) translateY(-20px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* 管理后台 */
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat-card { background: var(--white); border-radius: var(--radius); padding: 16px; text-align: center; border: 1px solid var(--border); }
.stat-card .value { font-size: 28px; font-weight: bold; color: var(--green); }
.stat-card .label { font-size: 13px; color: var(--gray); margin-top: 4px; }

/* 空状态 */
.empty-state { text-align: center; padding: 40px 20px; color: var(--gray); }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }

/* 页脚 */
footer { text-align: center; padding: 20px; color: var(--gray); font-size: 12px; }
footer a { color: var(--green); text-decoration: none; }

/* 响应式 */
@media (max-width: 600px) {
  .product-grid { grid-template-columns: 1fr 1fr; }
  .container { padding: 16px 8px; }
  nav { padding: 0 12px; }
}
