/* 落地页 / 管理后台 通用样式 */
:root {
  --brand: #1aad19;            /* 微信绿 */
  --brand-dark: #128a16;
  --ink: #1f2329;
  --ink-mute: #646a73;
  --bg: #f7f8fa;
  --card: #ffffff;
  --border: #e5e6eb;
  --warn: #ff7d00;
  --danger: #d03050;
  --radius: 12px;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

/* 通用容器 */
.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
}

/* 落地页 */
.landing-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-top: 12px;
}

.landing-header {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: white;
  padding: 24px 16px 32px;
  text-align: center;
}

.landing-store {
  font-size: 14px;
  opacity: 0.9;
}

.landing-title {
  font-size: 22px;
  font-weight: 600;
  margin: 6px 0 2px;
}

.landing-subtitle {
  font-size: 13px;
  opacity: 0.9;
}

.agent-info {
  display: flex;
  align-items: center;
  padding: 16px;
  gap: 12px;
}

.agent-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg);
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--border);
}

.agent-meta {
  flex: 1;
  min-width: 0;
}

.agent-name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.agent-intro {
  font-size: 13px;
  color: var(--ink-mute);
}

.agent-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  background: rgba(26, 173, 25, 0.1);
  color: var(--brand);
  margin-left: 4px;
}

.qr-section {
  text-align: center;
  padding: 0 16px 16px;
}

.qr-frame {
  width: 240px;
  height: 240px;
  margin: 0 auto;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: white;
  position: relative;
}

.qr-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.qr-tip {
  margin-top: 12px;
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
}

.qr-tip-icon {
  color: var(--brand);
  margin-right: 4px;
}

.wechat-id-row {
  margin: 16px;
  padding: 12px;
  background: var(--bg);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wechat-id-label {
  font-size: 13px;
  color: var(--ink-mute);
}

.wechat-id-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  margin-left: 8px;
}

.copy-btn {
  border: none;
  background: var(--brand);
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  margin-left: 8px;
}

.copy-btn:active { background: var(--brand-dark); }
.copy-btn.copied { background: var(--ink-mute); }

.actions {
  padding: 0 16px 16px;
  display: flex;
  gap: 8px;
}

.btn-primary {
  flex: 1;
  padding: 12px;
  border: none;
  background: var(--brand);
  color: white;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.btn-primary:active { background: var(--brand-dark); }

.btn-secondary {
  flex: 1;
  padding: 12px;
  border: 1px solid var(--border);
  background: white;
  color: var(--ink);
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.tips {
  background: rgba(255, 125, 0, 0.06);
  border-left: 3px solid var(--warn);
  padding: 10px 12px;
  margin: 12px 16px;
  font-size: 13px;
  color: var(--ink);
  border-radius: 4px;
}

.tips strong {
  color: var(--warn);
}

/* 微信号加粗醒目版 */
.wechat-id-big {
  background: rgba(26, 173, 25, 0.08);
  border: 1px dashed var(--brand);
  margin: 12px 16px;
  padding: 14px 12px;
}
.wechat-id-big .wechat-id-value {
  font-size: 18px;
  color: var(--brand-dark);
}
.all-agents {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 16px 8px;
}

.all-agent-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--ink);
  transition: all 0.15s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.all-agent-card:active {
  border-color: var(--brand);
  background: rgba(26, 173, 25, 0.04);
  transform: scale(0.99);
}

.all-agent-card .avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg);
}

.all-agent-card .info {
  flex: 1;
  min-width: 0;
}

.all-agent-card .name {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

.all-agent-card .intro {
  font-size: 13px;
  color: var(--ink-mute);
  margin-top: 3px;
}

.all-agent-card .arrow {
  font-size: 22px;
  color: var(--ink-mute);
  font-weight: 300;
  line-height: 1;
  margin-left: 4px;
}

.shuffle-row {
  display: flex;
  justify-content: center;
  padding: 8px 16px 12px;
}

.shuffle-btn {
  border: 1px solid var(--brand);
  background: white;
  color: var(--brand);
  padding: 10px 28px;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  min-width: 140px;
}

.shuffle-btn:active {
  background: var(--brand);
  color: white;
  transform: scale(0.97);
}

.tips-short {
  font-size: 14px;
  margin-top: 0;
  margin-bottom: 12px;
}

.all-agent-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  transition: all 0.2s;
}

.all-agent-card:active {
  transform: scale(0.98);
  border-color: var(--brand);
}

.all-agent-card img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin: 0 auto 6px;
  object-fit: cover;
}

.all-agent-card .name {
  font-size: 13px;
  font-weight: 500;
}

.all-agent-card .intro {
  font-size: 11px;
  color: var(--ink-mute);
  margin-top: 2px;
}

/* 占位 / 错误 */
.img-fallback {
  width: 240px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--ink-mute);
  font-size: 13px;
  border-radius: 4px;
  margin: 0 auto;
}

.error-card {
  text-align: center;
  padding: 48px 16px;
}

.error-card .icon { font-size: 48px; }
.error-card .msg { color: var(--ink-mute); margin-top: 12px; }

/* 语言切换按钮（右上角浮动） */
.lang-switcher {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: 12px;
  z-index: 999;
  display: flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 6px;
  padding: 2px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  font-size: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.lang-switcher button {
  border: none;
  background: transparent;
  color: var(--ink-mute);
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  min-width: 28px;
}
.lang-switcher button.active {
  background: var(--brand);
  color: white;
  font-weight: 600;
}
.lang-switcher button:active {
  transform: scale(0.95);
}

/* 后台管理页 */
.admin-layout {
  max-width: 1024px;
  margin: 0 auto;
  padding: 16px;
}

.admin-header {
  background: white;
  padding: 16px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-title {
  font-size: 18px;
  font-weight: 600;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  background: white;
  padding: 16px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  text-align: center;
}

.stat-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--brand);
}

.stat-label {
  font-size: 12px;
  color: var(--ink-mute);
  margin-top: 4px;
}

.agent-table {
  background: white;
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.agent-table table {
  width: 100%;
  border-collapse: collapse;
}

.agent-table th,
.agent-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.agent-table th {
  background: var(--bg);
  font-weight: 600;
}

.qr-mini {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  object-fit: cover;
}

.status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
}

.status-on { background: rgba(26, 173, 25, 0.1); color: var(--brand); }
.status-off { background: rgba(208, 48, 80, 0.1); color: var(--danger); }

.btn-mini {
  padding: 4px 10px;
  font-size: 12px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 4px;
  cursor: pointer;
}

.btn-mini.primary {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}

/* 提示 toast */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  z-index: 999;
  opacity: 0;
  transition: opacity 0.2s;
}

.toast.show { opacity: 1; }
