/* ── shared.css — shenao.de v1 公共样式库 ──────────────────────────────────── */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

/* ── 颜色变量（默认蓝紫配色，各页面可在自身 <style> 中覆盖） ── */
:root {
  --bg: #f9f9f8;
  --surface: #ffffff;
  --border: #eaeaeb;
  --text: #1a1a1a;
  --muted: #888884;
  --subtle: #f4f4f5;
  --shadow: rgba(0, 0, 0, 0.04);
  --highlight-start: #3b82f6;
  --highlight-end: #8b5cf6;
  --ripple-color: rgba(0, 0, 0, 0.06);
  --glow: rgba(59, 130, 246, 0.08);
  --glow-dark: rgba(59, 130, 246, 0.05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111111;
    --surface: #1a1a1a;
    --border: #2e2e2e;
    --text: #eeeeee;
    --muted: #888888;
    --subtle: #242424;
    --shadow: rgba(0, 0, 0, 0.2);
    --highlight-start: #60a5fa;
    --highlight-end: #a78bfa;
    --ripple-color: rgba(255, 255, 255, 0.08);
  }
}

/* ── Base body ── */
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 80px 24px 100px;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
  position: relative;
  z-index: 1;
}

/* 顶部装饰光晕 */
body::before {
  content: '';
  position: fixed;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 400px;
  background: radial-gradient(ellipse at center, var(--glow) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
}
@media (prefers-color-scheme: dark) {
  body::before {
    background: radial-gradient(ellipse at center, var(--glow-dark) 0%, rgba(17, 17, 17, 0) 70%);
  }
}

.page { width: 100%; max-width: 640px; }

/* ── 入场动画 ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-1 { animation: fadeUp 0.6s ease-out forwards; }
.animate-2 { animation: fadeUp 0.6s ease-out 0.1s forwards; opacity: 0; }
.animate-3 { animation: fadeUp 0.6s ease-out 0.2s forwards; opacity: 0; }
.animate-4 { animation: fadeUp 0.6s ease-out 0.3s forwards; opacity: 0; }
.animate-5 { animation: fadeUp 0.6s ease-out 0.4s forwards; opacity: 0; }

/* ── 返回链接 ── */
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 40px;
  padding: 6px 12px 6px 0;
  border-radius: 8px;
  transition: color 0.2s, transform 0.2s;
}
.back:hover { color: var(--text); transform: translateX(-4px); }

/* ── 排版 ── */
.logo {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}

h1 {
  font-size: 2.2rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 16px;
}

.text-gradient {
  background: linear-gradient(135deg, var(--highlight-start), var(--highlight-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sub {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.7;
  font-weight: 400;
}

/* ── 布局 ── */
header { margin-bottom: 48px; }
section { margin-bottom: 48px; }

.section-title {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
  padding-left: 4px;
}

/* ── 卡片容器 ── */
.cards {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 4px 20px var(--shadow);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}
.cards:hover { box-shadow: 0 8px 30px var(--shadow); }

/* ── 卡片 ── */
.card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: background 0.2s ease;
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
}
.card:last-child { border-bottom: none; }
.card:hover { background: var(--subtle); }

.card-title, .card-desc, .card-arrow { position: relative; z-index: 2; }

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.card:hover .card-icon { transform: scale(1.05); }

.card-content { flex: 1; min-width: 0; }

.card-title { font-size: 0.95rem; font-weight: 500; margin-bottom: 4px; }

.card-desc {
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-arrow {
  color: var(--muted);
  flex-shrink: 0;
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.2s ease;
  display: flex;
}
.card:hover .card-arrow { opacity: 1; transform: translateX(0); color: var(--text); }

/* ── 徽章 ── */
.card-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 100px;
  letter-spacing: 0.05em;
  white-space: nowrap;
  flex-shrink: 0;
}
.badge-new    { background: rgba(16,185,129,0.12); color: #10b981; }
.badge-hot    { background: rgba(244,63,94,0.12);  color: #f43f5e; }
.badge-free   { background: rgba(16,185,129,0.12); color: #10b981; }

/* ── 水波纹 ── */
.ripple {
  position: absolute;
  border-radius: 50%;
  background-color: var(--ripple-color);
  transform: scale(0);
  animation: ripple-animation 0.6s linear;
  pointer-events: none;
  z-index: 1;
}
@keyframes ripple-animation { to { transform: scale(4); opacity: 0; } }

/* ── 图标颜色 ── */
.icon-blue   { background: #eef2ff; color: #3b82f6; }
.icon-green  { background: #edfaf3; color: #10b981; }
.icon-amber  { background: #fff8ec; color: #f59e0b; }
.icon-rose   { background: #fff0f0; color: #f43f5e; }
.icon-violet { background: #f3f0ff; color: #8b5cf6; }
.icon-sky    { background: #edf7ff; color: #0ea5e9; }
.icon-gray   { background: var(--subtle); color: #52525b; }
@media (prefers-color-scheme: dark) {
  .icon-blue   { background: rgba(59,130,246,0.15);  color: #60a5fa; }
  .icon-green  { background: rgba(16,185,129,0.15);  color: #34d399; }
  .icon-amber  { background: rgba(245,158,11,0.15);  color: #fbbf24; }
  .icon-rose   { background: rgba(244,63,94,0.15);   color: #fb7185; }
  .icon-violet { background: rgba(139,92,246,0.15);  color: #a78bfa; }
  .icon-sky    { background: rgba(14,165,233,0.15);  color: #38bdf8; }
  .icon-gray   { background: rgba(255,255,255,0.08); color: #a1a1aa; }
}

/* ── Toast 通知 ── */
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--text);
  color: var(--bg);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 100px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
  z-index: 999;
}
#toast.show  { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.error { background: #f43f5e; color: #fff; }

/* ── Footer ── */
footer {
  margin-top: 24px;
  font-size: 0.85rem;
  color: var(--muted);
  padding-left: 4px;
}
footer a { color: var(--muted); text-decoration: none; transition: color 0.2s; }
footer a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 4px; }

/* ── Spinner ── */
.spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid transparent; border-top-color: currentColor;
  border-radius: 50%; animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 响应式 ── */
@media (max-width: 480px) {
  body { padding: 56px 20px 80px; }
  h1 { font-size: 1.8rem; }
  .card { padding: 16px; gap: 14px; }
  .card-icon { width: 40px; height: 40px; }
}

/* ── Accessibility ── */
:focus-visible { outline: 2px solid var(--highlight-start); outline-offset: 2px; }

/* ── Common Tool Components ── */
.block { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: 0 4px 20px var(--shadow); transition: border-color 0.2s, box-shadow 0.2s; }
.block:focus-within { border-color: var(--highlight-start); box-shadow: 0 0 0 3px var(--glow), 0 4px 20px var(--shadow); }
.block-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.block-label { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.btn { display: inline-flex; align-items: center; gap: 5px; font-size: 0.78rem; font-weight: 500; color: var(--muted); background: none; border: none; cursor: pointer; padding: 4px 8px; border-radius: 6px; transition: color 0.2s, background 0.2s; font-family: inherit; }
.btn:hover { color: var(--text); background: var(--subtle); }
.main-btn { width: 100%; padding: 13px; border: none; border-radius: 12px; background: linear-gradient(135deg, var(--highlight-start), var(--highlight-end)); color: #fff; font-size: 0.9375rem; font-weight: 600; cursor: pointer; font-family: inherit; transition: opacity 0.2s, transform 0.15s; }
.main-btn:hover { opacity: 0.9; }
.main-btn:active { transform: scale(0.98); }
textarea { font-family: 'Inter', system-ui, sans-serif; color: var(--text); background: transparent; border: none; outline: none; }
