/* ============================================================
   极简快传 - 全局样式（文本保存分享 + 分享墙）
   主题：极简、明亮、蓝色主色调
   ============================================================ */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;
  --text: #1f2937;
  --text-2: #6b7280;
  --text-3: #9ca3af;
  --bg: #ffffff;
  --bg-soft: #f5f7fb;
  --border: #e5e7eb;
  --danger: #dc2626;
  --success: #16a34a;
  --radius: 14px;
  --shadow-lg: 0 16px 48px rgba(15, 23, 42, .12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg-soft);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }

.container { max-width: 720px; margin: 0 auto; padding: 0 20px; width: 100%; }

.hidden { display: none !important; }

/* ---------------- 顶部导航 ---------------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav .container { display: flex; align-items: center; height: 62px; max-width: 1080px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  display: flex; align-items: center; justify-content: center;
}
.brand .logo svg { width: 20px; height: 20px; fill: #fff; }

/* ---------------- 保存分享卡片 ---------------- */
main.container { padding-top: 40px; padding-bottom: 56px; }

.share-card {
  background: #fff; border: 1px solid var(--border); border-radius: 20px;
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.card-body { padding: 32px 32px 30px; }

.card-title { font-size: 24px; letter-spacing: -.3px; line-height: 1.3; }
.card-desc { font-size: 14px; color: var(--text-2); margin: 10px 0 22px; }

/* 文本区 */
.text-area { width: 100%; min-height: 90px; resize: vertical; padding: 16px; border: 1px solid var(--border); border-radius: 12px; font-size: 15px; font-family: inherit; outline: none; line-height: 1.7; transition: border-color .2s, box-shadow .2s; background: #fff; }
.text-area:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.text-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 12px; color: var(--text-3); }
.text-meta .count.over { color: var(--danger); }

/* 保存按钮 */
.btn-submit {
  width: 100%; margin-top: 20px; padding: 14px; border: none; border-radius: 12px;
  background: var(--primary); color: #fff; font-size: 16px; font-weight: 700; cursor: pointer;
  transition: background .2s, transform .05s; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-submit:hover { background: var(--primary-dark); }
.btn-submit:active { transform: scale(.99); }
.btn-submit:disabled { background: #b3cdf7; cursor: not-allowed; }
.btn-submit .spinner {
  width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  border-radius: 50%; animation: spin .8s linear infinite; display: none;
}
.btn-submit.loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 错误提示 / 成功提示 */
.form-error { display: none; margin-top: 14px; padding: 12px 14px; background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; border-radius: 10px; font-size: 14px; }
.form-error.show { display: block; }
.save-tip { margin-top: 14px; padding: 12px 14px; background: #f0fdf4; border: 1px solid #bbf7d0; color: var(--success); border-radius: 10px; font-size: 14px; font-weight: 600; }

/* ---------------- 分享墙 ---------------- */
.board { margin-top: 32px; }
.board-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.board-head h2 { font-size: 19px; }
.board-actions { display: flex; align-items: center; gap: 10px; }
.board-count { font-size: 13px; color: var(--text-3); background: #fff; border: 1px solid var(--border); padding: 4px 12px; border-radius: 999px; white-space: nowrap; }
.btn-refresh {
  display: inline-flex; align-items: center; gap: 5px;
  background: #fff; border: 1px solid var(--border); color: var(--text-2);
  font-size: 13px; padding: 4px 12px; border-radius: 999px; cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, opacity .2s;
  white-space: nowrap;
}
.btn-refresh:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary-border); }
.btn-refresh:active { transform: scale(.97); }
.btn-refresh:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.board-tip { font-size: 12px; color: var(--text-3); margin-bottom: 14px; }

/* 列表容器：固定高度 + 内部滚动（电脑滚轮 / 手机手指滑动）
   滚到顶部/底部后继续滑动 → 滚动链传递到整个页面 */
.board-list {
  display: flex; flex-direction: column; gap: 14px;
  max-height: 520px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: auto;
  padding-right: 4px;
}
.board-list::-webkit-scrollbar { width: 6px; }
.board-list::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
.board-list::-webkit-scrollbar-track { background: transparent; }

.board-empty {
  text-align: center; padding: 48px 20px; color: var(--text-3); font-size: 14px;
  background: #fff; border: 1px dashed var(--border); border-radius: 16px;
}

.text-item {
  background: #fff; border: 1px solid var(--border); border-radius: 16px;
  padding: 18px 20px; cursor: pointer; transition: box-shadow .2s, transform .06s;
  -webkit-tap-highlight-color: transparent;
}
.text-item:hover { box-shadow: var(--shadow-lg); }
.text-item:active { transform: scale(.995); }
/* 文本内容：不内嵌滚动（保证列表是唯一滚动容器，滚动穿透更顺畅），超长截断，点击复制全文 */
.ti-content pre {
  white-space: pre-wrap; word-break: break-word; font-family: inherit;
  font-size: 15px; line-height: 1.75; color: var(--text);
  max-height: 160px; overflow: hidden;
}
.ti-meta { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--bg-soft); font-size: 12px; color: var(--text-3); }

.board-more { text-align: center; padding: 14px 0 2px; font-size: 13px; color: var(--text-3); }
.board-more .loading {
  display: inline-block; width: 14px; height: 14px; vertical-align: -2px; margin-right: 6px;
  border: 2px solid #d1d5db; border-top-color: var(--primary); border-radius: 50%;
  animation: spin .8s linear infinite;
}

.copy-tip { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(20px); background: #111827; color: #fff; padding: 10px 22px; border-radius: 10px; font-size: 14px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 999; }
.copy-tip.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 520px) {
  .card-body { padding: 24px 20px; }
  .text-item { padding: 14px 16px; }
  .board-list { max-height: 440px; }
}
