/* components-blocks.css */
/* Design tokens & global layout */
:root {
  --blue-main: #2563ff;
  --blue-soft: #e5edff;
  --bg-gradient: radial-gradient(circle at 0% 0%, #ecf4ff 0, #f7fbff 40%, #eef5ff 100%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg-gradient);
  color: #1f2933;
}

.page-wrapper {
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 16px 64px;
}

/* Shared glass card */
.glass {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.6));
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow:
    0 18px 40px rgba(37, 99, 255, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* 顶部主视觉 hero */
.hero {
  position: relative;
  padding: 26px 24px 24px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  right: -60px;
  top: -60px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle at center, rgba(37, 99, 255, 0.5), transparent 60%);
  opacity: 0.8;
}

.hero::after {
  content: "";
  position: absolute;
  left: -40px;
  bottom: -60px;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle at center, rgba(45, 212, 191, 0.45), transparent 60%);
  opacity: 0.7;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
}

.hero-main {
  flex: 1 1 260px;
}

.hero-title {
  font-size: 28px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
}

.hero-subtitle {
  font-size: 14px;
  color: #4b5563;
  margin-bottom: 14px;
}

.hero-highlight {
  font-size: 13px;
  color: #1d4ed8;
  margin-bottom: 14px;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.hero-tag {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(37, 99, 255, 0.18);
  color: #1f2937;
  backdrop-filter: blur(8px);
}

.hero-side {
  flex: 0 0 270px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.hero-pill {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
  backdrop-filter: blur(8px);
}

.hero-metric {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: #4b5563;
}

.hero-metric-item strong {
  display: block;
  font-size: 16px;
  color: #1d4ed8;
}

/* Section header */
.section1 {
  margin-top: 28px;
}

.section-title-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 12px;
}

.section-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 600;
}

.section-title::before {
  content: "";
  width: 4px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, #2563ff, #38bdf8);
}

.section-sub {
  font-size: 12px;
  color: #6b7280;
}

/* 双列布局 */
.dual-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

/* 用户活动卡 user-card */
.user-card {
  position: relative;
  padding: 16px 16px 14px;
  overflow: hidden;
}

.user-card::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -40px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle at center, rgba(37, 99, 255, 0.18), transparent 70%);
  opacity: 0.9;
}

.user-card-inner {
  position: relative;
  z-index: 1;
}

.user-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 8px;
}

.user-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
}

.user-flag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(37, 99, 255, 0.08);
  color: #1d4ed8;
}

.user-tagline {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 10px;
}

.user-footnote {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  gap: 10px;
  font-size: 11px;
  color: #94a3b8;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  color: #6b7280;
}

/* 规则提示条 */
.rule-strip {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px dashed rgba(148, 163, 184, 0.8);
  font-size: 12px;
  color: #4b5563;
  line-height: 1.7;
}

.rule-strip strong {
  color: #1d4ed8;
}

.rule-strip ul {
  margin: 6px 0 0;
  padding-left: 16px;
}

.rule-strip li {
  margin-bottom: 2px;
}

/* 活动机型 model 卡片 */
.model-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.model-card {
  position: relative;
  padding: 14px 14px 12px;
  overflow: hidden;
}

.model-card::before {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle at center, rgba(59, 130, 246, 0.25), transparent 70%);
}

.model-inner {
  position: relative;
  z-index: 1;
}

.model-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.model-tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(37, 99, 255, 0.08);
  color: #1d4ed8;
}

.model-spec {
  font-size: 12px;
  color: #4b5563;
  margin-bottom: 4px;
}

.model-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 10px;
  color: #6b7280;
}

.model-pill {
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
}

/* 活动机型卡片底部：左文字链接 + 右按钮 */
.model-footer {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* 代金券 coupon 区 */
.coupon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.coupon-card {
  position: relative;
  padding: 14px 16px;
  overflow: hidden;
}

.coupon-card::before {
  content: "";
  position: absolute;
  left: -40px;
  top: -40px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle at center, rgba(59, 130, 246, 0.26), transparent 65%);
}

.coupon-card::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -40px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle at center, rgba(56, 189, 248, 0.3), transparent 65%);
}

.coupon-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.coupon-main {
  min-width: 86px;
  text-align: left;
}

.coupon-amount {
  font-size: 24px;
  font-weight: 700;
  color: #1d4ed8;
  line-height: 1.1;
}

.coupon-amount span {
  font-size: 14px;
  margin-left: 2px;
}

.coupon-line {
  font-size: 11px;
  color: #6b7280;
}

.coupon-body {
  flex: 1;
  font-size: 12px;
  color: #4b5563;
}

.coupon-tags {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.coupon-tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(37, 99, 255, 0.08);
  color: #1d4ed8;
}

.coupon-note {
  margin-top: 6px;
  font-size: 10px;
  color: #9ca3af;
}

.coupon-rules-strip {
  margin-top: 10px;
  font-size: 11px;
  color: #6b7280;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px dashed rgba(148, 163, 184, 0.7);
}

.coupon-rules-strip strong {
  color: #1d4ed8;
}

/* Q&A */
.qa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 12px;
  margin-bottom: 36px;
}

.qa-card {
  position: relative;
  padding: 12px 14px 10px;
  overflow: hidden;
}

.qa-card::before {
  content: "";
  position: absolute;
  right: -30px;
  top: -40px;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle at center, rgba(59, 130, 246, 0.22), transparent 70%);
}

.qa-inner {
  position: relative;
  z-index: 1;
  font-size: 12px;
  color: #4b5563;
}

.qa-q {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.qa-q-tag {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(37, 99, 255, 0.08);
  color: #1d4ed8;
  font-weight: 600;
}

.qa-q-text {
  font-weight: 600;
  color: #111827;
}

.qa-a {
  font-size: 12px;
  color: #4b5563;
  line-height: 1.7;
}

.qa-a strong {
  color: #1d4ed8;
}

.qa-footer {
  margin-top: 10px;
  font-size: 11px;
  color: #9ca3af;
  text-align: center;
}

.legal-line {
  margin-top: 12px;
  font-size: 11px;
  color: #9ca3af;
  text-align: center;
}

/* ===== 新增：通用内容块 / 卡片组件 ===== */

/* 通用卡片 */
.card {
  position: relative;
  padding: 16px 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.78));
  box-shadow:
    0 18px 40px rgba(15, 23, 42, 0.06),
    0 0 0 1px rgba(255, 255, 255, 0.9);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
  color: #111827;
}

.card-subtitle {
  font-size: 12px;
  color: #6b7280;
}

.card-meta {
  font-size: 11px;
  color: #9ca3af;
}

.card-body {
  font-size: 13px;
  color: #4b5563;
}

.card-footer {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* 统计卡片 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.stat-card {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.stat-label {
  font-size: 11px;
  color: #6b7280;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: #1d4ed8;
}

.stat-trend {
  margin-top: 4px;
  font-size: 11px;
  color: #10b981;
}

/* 通知 / 提示块 */
.alert {
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.6;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.alert::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  margin-top: 6px;
}

.alert-info {
  background: rgba(219, 234, 254, 0.95);
  border: 1px solid rgba(191, 219, 254, 1);
  color: #1d4ed8;
}

.alert-info::before {
  background: #1d4ed8;
}

.alert-success {
  background: rgba(220, 252, 231, 0.95);
  border: 1px solid rgba(187, 247, 208, 1);
  color: #166534;
}

.alert-success::before {
  background: #16a34a;
}

.alert-warning {
  background: rgba(254, 243, 199, 0.96);
  border: 1px solid rgba(253, 230, 138, 1);
  color: #92400e;
}

.alert-warning::before {
  background: #d97706;
}

.alert-danger {
  background: rgba(254, 226, 226, 0.96);
  border: 1px solid rgba(254, 202, 202, 1);
  color: #b91c1c;
}

.alert-danger::before {
  background: #ef4444;
}

/* 标签 / 徽章 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.5;
}

.badge-soft {
  background: rgba(37, 99, 255, 0.08);
  color: #1d4ed8;
}

.badge-outline {
  border: 1px solid rgba(148, 163, 184, 0.7);
  color: #4b5563;
  background: rgba(255, 255, 255, 0.9);
}

/* Tab 切换 */
.tabs {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow:
    0 10px 25px rgba(15, 23, 42, 0.06),
    0 0 0 1px rgba(255, 255, 255, 0.9);
}

.tab-item {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  color: #6b7280;
  cursor: pointer;
}

.tab-item.is-active {
  background: var(--blue-soft);
  color: #1d4ed8;
}

/* 时间线 */
.timeline {
  position: relative;
  margin: 0;
  padding-left: 16px;
  list-style: none;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, rgba(148, 163, 184, 0.2), rgba(148, 163, 184, 0.6));
}

.timeline-item {
  position: relative;
  padding-left: 12px;
  padding-bottom: 12px;
  font-size: 12px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 3px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(37, 99, 255, 0.65);
}

.timeline-meta {
  font-size: 11px;
  color: #9ca3af;
  margin-bottom: 2px;
}

/* 表单元素 */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px 16px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}

.form-label {
  font-weight: 500;
  color: #374151;
}

.form-hint {
  font-size: 11px;
  color: #9ca3af;
}

.input,
.select,
.textarea {
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(255, 255, 255, 0.9);
  font-family: inherit;
  font-size: 13px;
  color: #111827;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

/* 下拉选择框专属样式 */
.select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  cursor: pointer;
}

.select:hover {
  border-color: rgba(37, 99, 255, 0.5);
  background-color: rgba(255, 255, 255, 0.98);
}

.select:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%232563ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* 下拉选项样式 */
.select option {
  padding: 10px 12px;
  background: #fff;
  color: #111827;
  font-size: 13px;
}

.select option:checked {
  background: linear-gradient(135deg, rgba(37, 99, 255, 0.1), rgba(37, 99, 255, 0.05));
  color: var(--blue-deep);
}

.select option:hover {
  background: rgba(37, 99, 255, 0.08);
}

/* 下拉框尺寸变体 */
.select.is-sm {
  padding: 5px 28px 5px 8px;
  font-size: 12px;
  border-radius: 8px;
}

.select.is-lg {
  padding: 10px 36px 10px 14px;
  font-size: 14px;
  border-radius: 12px;
  background-position: right 12px center;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--blue-main);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.9),
    0 0 0 1px rgba(37, 99, 255, 0.35);
  background: #ffffff;
}

.textarea {
  min-height: 80px;
  resize: vertical;
}

.form-row-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

/* Switch / 开关 */
.switch {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.5);
  cursor: pointer;
  transition: background 0.2s ease;
}

.switch-handle {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
  transition: transform 0.2s ease;
}

.switch.is-on {
  background: rgba(37, 99, 255, 0.75);
}

.switch.is-on .switch-handle {
  transform: translateX(16px);
}

/* Layout 辅助类 */
.stack-8 {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stack-12 {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.row-8 {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.row-12 {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* 组件库页面顶部导航 */
.library-header {
  margin-bottom: 24px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.library-title {
  font-size: 18px;
  font-weight: 600;
}

.library-subtitle {
  font-size: 12px;
  color: #6b7280;
}

.library-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
}

.library-nav a {
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(226, 232, 240, 1);
  color: #4b5563;
}

.library-nav a:hover {
  border-color: rgba(37, 99, 255, 0.65);
  color: #1d4ed8;
}

/* Demo 容器 */
.component-group {
  margin-top: 12px;
}

.component-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.component-col {
  flex: 1 1 260px;
}

/* 响应式 */
@media (max-width: 900px) {
  .dual-columns {
    grid-template-columns: 1fr;
  }

  .hero-inner {
    flex-direction: column;
  }

  .hero-side {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .library-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 768px) {
  .page-wrapper {
    padding: 24px 12px 48px;
  }

  .hero-title {
    font-size: 22px;
  }

  .hero-subtitle {
    font-size: 13px;
  }
}
