/* ===== 码工坊小屋 · 全局样式（模仿草料二维码简洁风） ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #07c160;
  --primary-dark: #06ad56;
  --primary-light: #e8f9ef;
  --text: #111827;
  --muted: #6b7280;
  --border: #e9edf1;
  --bg-gray: #f8fafb;
  --danger: #e64340;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: #ffffff;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

.hidden { display: none !important; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.bold { font-weight: 600; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  transition: all .15s;
  line-height: 1.5;
  background: none;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }

.btn-ghost {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

.btn-danger { background: #fff; color: var(--danger); border: 1px solid #f5c2c0; }
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-sm { padding: 6px 14px; font-size: 13px; }

/* ===== 顶部导航 ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner { display: flex; align-items: center; height: 60px; }

.logo { font-size: 20px; font-weight: 700; color: var(--primary); }
.logo span { color: var(--text); }

.nav { flex: 1; margin-left: 40px; display: flex; gap: 28px; }
.nav a { color: var(--text); font-size: 15px; }
.nav a:hover { color: var(--primary); }

/* ===== 首屏 ===== */
.hero {
  background: linear-gradient(180deg, #f3fdf7 0%, #ffffff 100%);
  padding: 56px 0 64px;
  text-align: center;
}

.hero-title { font-size: 34px; font-weight: 700; letter-spacing: .5px; }
.hero-sub { color: var(--muted); margin-top: 12px; font-size: 16px; }

/* ===== 生成器卡片 ===== */
.gen-card {
  max-width: 720px;
  margin: 36px auto 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 6px 24px rgba(7, 193, 96, .06);
  text-align: left;
  overflow: hidden;
}

.gen-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 18px 20px 0;
}

.gen-tab {
  padding: 6px 18px;
  border-radius: 999px;
  background: var(--bg-gray);
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  user-select: none;
}

.gen-tab.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.gen-body { padding: 20px; }

.gen-field { margin-bottom: 12px; }
.gen-row { display: flex; gap: 12px; margin-bottom: 12px; }
.gen-row .input { flex: 1; }

.input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  outline: none;
  background: #fff;
  transition: border-color .15s;
}
.input:focus { border-color: var(--primary); }

.select { appearance: none; -webkit-appearance: none; }

.gen-actions { display: flex; gap: 12px; margin-top: 16px; }
.gen-actions .btn { flex: 1; }

/* 生成结果 */
.gen-result { text-align: center; }
.qr-box {
  display: inline-block;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}
.qr-box canvas { display: block; }
.qr-meta {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  white-space: pre-line;
  word-break: break-all;
}

/* ===== 区块 ===== */
.section { padding: 56px 0; }
.section-gray { background: var(--bg-gray); }
.section-title { font-size: 26px; font-weight: 700; text-align: center; }
.section-sub { text-align: center; color: var(--muted); margin-top: 8px; margin-bottom: 32px; }

.page-head { margin-bottom: 28px; }

/* 卡片网格 */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media (max-width: 720px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-title { font-size: 26px; }
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.sol-card { text-align: center; cursor: pointer; transition: all .15s; }
.sol-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.sol-ico { font-size: 30px; }
.sol-name { font-weight: 600; margin-top: 10px; }
.sol-desc { color: var(--muted); font-size: 13px; margin-top: 6px; }

.tpl-card { cursor: pointer; transition: all .15s; }
.tpl-card:hover { border-color: var(--primary); }
.tpl-name { font-weight: 600; }
.tpl-desc { color: var(--muted); font-size: 13px; margin-top: 4px; }
.tpl-tag {
  display: inline-block;
  margin-top: 10px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
}

/* ===== 活码列表 ===== */
.live-list { display: flex; flex-direction: column; gap: 14px; }

.live-item { display: flex; align-items: center; gap: 16px; }
.live-item-main { flex: 1; min-width: 0; }
.live-item-title { font-weight: 600; }
.live-item-url { color: var(--primary); word-break: break-all; margin-top: 4px; }
.live-item-actions { display: flex; gap: 8px; flex-shrink: 0; }

@media (max-width: 720px) {
  .live-item { flex-direction: column; align-items: stretch; }
  .live-item-actions { justify-content: flex-end; }
}

.empty {
  text-align: center;
  padding: 60px 0;
  color: var(--muted);
}
.empty .btn { margin-top: 16px; }

.load-more-wrap { text-align: center; margin-top: 24px; }

/* ===== 弹窗 ===== */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal {
  width: 90%;
  max-width: 480px;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-close { font-size: 24px; color: var(--muted); cursor: pointer; line-height: 1; }

.modal-body { padding: 20px; }

.modal-foot {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.modal-foot .btn { flex: 1; }

/* ===== 页脚 ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.beian { margin-top: 8px; }
.beian a { color: var(--muted); }
.beian a:hover { color: var(--primary); }
