/* ============================================
   飞书推送测试台 — 样式（单页版）
   风格参考 face-swap-on-Replicate（移动端优先、卡片式）
   ============================================ */

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* hidden 属性必须生效：防止被 .xxx { display: block } 等作者样式覆盖（UA 样式同优先级输给作者样式）
 * 注意：初始隐藏的元素必须写 hidden 属性（如 <div hidden>），不要只用 class="hidden"——
 * 本文件没有 .hidden 类规则，且 JS 一律通过 el.hidden 属性切换显示/隐藏。 */
[hidden] { display: none !important; }

:root {
  --feishu-600: #3370ff;
  --feishu-500: #5e8cff;
  --feishu-50: #edf3ff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --red-500: #ef4444;
  --red-100: #fee2e2;
  --green-600: #16a34a;
  --green-100: #dcfce7;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-lg: 0 4px 6px rgba(0,0,0,.07), 0 10px 15px rgba(0,0,0,.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-100);
  color: var(--gray-900);
  line-height: 1.6;
  padding-bottom: env(safe-area-inset-bottom);
  -webkit-font-smoothing: antialiased;
}

.app-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px calc(16px + env(safe-area-inset-bottom));
}

/* === Header（全出血延伸至顶部，规避灵动岛遮挡） === */
.app-header {
  background: linear-gradient(135deg, #1f56d6, var(--feishu-600), var(--feishu-500));
  color: #fff;
  padding: calc(20px + env(safe-area-inset-top)) 16px 18px;
  padding-top: calc(20px + constant(safe-area-inset-top)); /* iOS 11 兼容 */
  margin: 0 -16px 20px;
  border-radius: 0 0 var(--radius) var(--radius);
  text-align: center;
  box-shadow: var(--shadow-lg);
  -webkit-tap-highlight-color: transparent;
}
.app-header h1 {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: .5px;
}
.app-version {
  font-size: .7rem;
  font-weight: 400;
  margin-left: 8px;
  color: rgba(255,255,255,.85);
  background: rgba(255,255,255,.15);
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: .5px;
  white-space: nowrap;
  user-select: none;
  -webkit-touch-callout: none;
}
.app-sub {
  margin-top: 6px;
  font-size: .8rem;
  color: rgba(255,255,255,.85);
}

/* === Card === */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}
.card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--gray-700);
}
.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.card-title-row .card-title { margin-bottom: 0; }

/* === 分段选择器 === */
.seg {
  display: flex;
  background: var(--gray-100);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 16px;
}
.seg-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--gray-500);
  font-size: .85rem;
  font-weight: 500;
  padding: 8px 4px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .2s, color .2s, box-shadow .2s;
  -webkit-tap-highlight-color: transparent;
}
.seg-btn.active {
  background: #fff;
  color: var(--feishu-600);
  box-shadow: var(--shadow);
  font-weight: 600;
}

/* === 表单 === */
.form-group-label {
  font-size: .82rem;
  color: var(--gray-500);
  margin: 12px 0 6px;
}
.form-group-label:first-child { margin-top: 0; }
.label-sub { font-size: .72rem; color: var(--gray-300); font-weight: 400; }
.input {
  width: 100%;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: .9rem;
  color: var(--gray-900);
  background: #fff;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  font-family: inherit;
}
.input:focus {
  border-color: var(--feishu-600);
  box-shadow: 0 0 0 3px rgba(51,112,255,.12);
}
.textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; }
select.input { appearance: auto; }

.url-row { margin-top: 6px; }
.preset-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.preset-row .input { flex: 1; }
.hint {
  font-size: .76rem;
  color: var(--gray-500);
  margin-top: 10px;
}
.field { margin-top: 4px; }
.field .input { margin-bottom: 0; }

/* === 按钮 === */
.btn {
  border: none;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 600;
  padding: 10px 14px;
  cursor: pointer;
  transition: opacity .2s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--feishu-600), var(--feishu-500));
  color: #fff;
  box-shadow: 0 2px 6px rgba(51,112,255,.35);
}
.btn-outline {
  background: #fff;
  color: var(--feishu-600);
  border: 1px solid var(--feishu-500);
}
.btn-ghost {
  border: none;
  background: transparent;
  color: var(--gray-500);
  font-size: .82rem;
  padding: 4px 10px;
  border-radius: 14px;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.btn-ghost:hover { background: var(--gray-100); color: var(--gray-700); }
.btn-block { width: 100%; }
.btn-sm { font-size: .8rem; padding: 6px 12px; }
.btn-row { display: flex; gap: 8px; margin-top: 8px; }

/* === 状态区 === */
.status-area {
  margin-top: 14px;
  padding: 12px;
  border-radius: 10px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
}
.status-line { display: flex; align-items: center; gap: 10px; font-size: .88rem; color: var(--gray-700); }
.spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--gray-200);
  border-top-color: var(--feishu-600);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === 响应区 === */
.result-area {
  margin-top: 14px;
  border-radius: 10px;
  border: 1px solid var(--gray-200);
  overflow: hidden;
}
.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}
.result-status { font-size: .82rem; font-weight: 600; }
.result-status.ok { color: var(--green-600); }
.result-status.err { color: var(--red-500); }
.result-actions { display: flex; gap: 4px; }
.result-body {
  padding: 12px;
  font-size: .8rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 320px;
  overflow: auto;
  background: #0f172a;
  color: #e2e8f0;
}

/* === 历史 === */
.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-item {
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.history-item:hover { border-color: var(--feishu-500); background: var(--feishu-50); }
.history-item-head { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--gray-500); }
.history-item .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.history-item .dot.ok { background: var(--green-600); }
.history-item .dot.err { background: var(--red-500); }
.history-item .dot.wait { background: var(--gray-300); }
.history-item-time { margin-left: auto; }
.history-item-body {
  margin-top: 4px;
  font-size: .8rem;
  color: var(--gray-700);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* === 底部 === */
.app-footer {
  text-align: center;
  font-size: .74rem;
  color: var(--gray-500);
  padding: 8px 0 16px;
}
