/* ===== caid3898.com · 苹果简约风 ===== */
:root {
  --bg: #f5f5f7;
  --card: #ffffff;
  --text: #1d1d1f;
  --sub: #6e6e73;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --line: #d2d2d7;
  --nav-bg: rgba(251, 251, 253, 0.8);
  --radius: 18px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #1c1c1e;
    --text: #f5f5f7;
    --sub: #86868b;
    --accent: #2997ff;
    --accent-hover: #409cff;
    --line: #333336;
    --nav-bg: rgba(22, 22, 23, 0.8);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro SC", "SF Pro Display", "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
section { scroll-margin-top: 72px; }

/* ---- 导航 ---- */
nav {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: var(--nav-bg);
  border-bottom: 1px solid transparent;
}
.nav-inner {
  max-width: 1024px; margin: 0 auto; padding: 0 24px;
  height: 52px; display: flex; align-items: center; justify-content: space-between;
}
.nav-logo { font-weight: 600; font-size: 17px; color: var(--text); letter-spacing: -0.01em; }
.nav-logo span { color: var(--accent); }
.nav-logo:hover { text-decoration: none; }
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a { color: var(--text); opacity: 0.8; font-size: 14px; transition: opacity 0.2s; }
.nav-links a:hover { opacity: 1; text-decoration: none; }
.nav-account {
  font: inherit; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer;
  background: rgba(120, 120, 128, 0.12); border: none; border-radius: 999px; padding: 7px 15px;
  max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nav-account:hover { background: rgba(120, 120, 128, 0.2); }
@media (max-width: 700px) {
  .nav-links { gap: 14px; }
  .nav-links a { display: none; }
  .nav-account { font-size: 12px; padding: 6px 12px; }
}

/* ---- Hero ---- */
.hero {
  max-width: 1024px; margin: 0 auto;
  padding: 110px 24px 70px; text-align: center;
}
.hero h1 {
  font-size: clamp(44px, 8vw, 84px);
  font-weight: 700; letter-spacing: -0.03em; line-height: 1.08;
}
.hero .grad {
  background: linear-gradient(92deg, #0071e3 0%, #7d4cff 45%, #e8508b 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero p {
  margin: 22px auto 34px; max-width: 560px;
  font-size: clamp(18px, 2.6vw, 22px); color: var(--sub); font-weight: 400;
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-badge {
  display: inline-block; margin-bottom: 22px; padding: 6px 14px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.02em; color: var(--sub);
  background: rgba(120, 120, 128, 0.1); border: 1px solid rgba(120, 120, 128, 0.12);
}

/* ---- 四入口 ---- */
.hub-section { padding-top: 18px; }
.hub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.hub-card {
  position: relative; display: flex; flex-direction: column; min-height: 252px;
  padding: 30px 30px 26px; border-radius: 24px; background: var(--card);
  color: var(--text); text-decoration: none !important; box-shadow: var(--shadow);
  border: 1px solid rgba(120, 120, 128, 0.08); overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.hub-card::after {
  content: '↗'; position: absolute; top: 24px; right: 26px; font-size: 18px;
  color: var(--sub); opacity: 0.5; transition: transform 0.25s, opacity 0.25s;
}
.hub-card:hover { transform: translateY(-4px); box-shadow: 0 18px 44px rgba(0, 0, 0, 0.1); }
.hub-card:hover::after { transform: translate(2px, -2px); opacity: 1; }
.hub-icon {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  font-size: 21px; color: #fff; margin-bottom: 20px; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
}
.hub-card.ai .hub-icon { background: linear-gradient(135deg, #0071e3, #5e5ce6); }
.hub-card.game .hub-icon { background: linear-gradient(135deg, #ff9f0a, #ff375f); }
.hub-card.blog .hub-icon { background: linear-gradient(135deg, #7d4cff, #e8508b); }
.hub-card.guestbook .hub-icon { background: linear-gradient(135deg, #30d158, #00c7be); }
.hub-kicker { font-size: 10.5px; font-weight: 700; letter-spacing: 0.16em; color: var(--sub); margin-bottom: 6px; }
.hub-card h2 { font-size: clamp(23px, 3.4vw, 28px); font-weight: 700; letter-spacing: -0.02em; margin-bottom: 8px; }
.hub-card p { color: var(--sub); font-size: 14.5px; line-height: 1.65; flex: 1; max-width: 94%; }
.hub-link { display: inline-block; margin-top: 18px; font-size: 13px; font-weight: 600; color: var(--accent); }

.account-strip {
  margin-top: 20px; display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 24px 28px; border-radius: 22px;
  background: linear-gradient(120deg, rgba(0, 113, 227, 0.1), rgba(125, 76, 255, 0.08));
  border: 1px solid rgba(0, 113, 227, 0.16);
}
.account-strip.signed {
  background: linear-gradient(120deg, rgba(48, 209, 88, 0.11), rgba(0, 199, 190, 0.07));
  border-color: rgba(48, 209, 88, 0.22);
}
.strip-copy strong { font-size: 16px; font-weight: 650; letter-spacing: -0.01em; }
.strip-copy p { color: var(--sub); font-size: 13.5px; margin-top: 4px; }
.strip-actions { display: flex; gap: 10px; flex-wrap: wrap; flex: none; }

@media (max-width: 760px) {
  .hub-grid { grid-template-columns: 1fr; }
  .account-strip { flex-direction: column; align-items: flex-start; }
  .hub-card { min-height: 220px; padding: 26px; }
}

.btn {
  display: inline-block; padding: 12px 26px; border-radius: 980px;
  font-size: 16px; font-weight: 500; border: none; cursor: pointer;
  background: var(--accent); color: #fff !important;
  transition: background 0.2s, transform 0.2s; text-decoration: none !important;
}
.btn:hover { background: var(--accent-hover); transform: scale(1.02); }
.btn.ghost { background: transparent; color: var(--accent) !important; border: 1px solid var(--accent); }
.btn.ghost:hover { background: rgba(0, 113, 227, 0.08); }
.btn.small { padding: 7px 16px; font-size: 13px; }
.btn.danger { background: #e0304a; }
.btn.danger:hover { background: #ef455f; }

/* ---- 分区 ---- */
.section { max-width: 1024px; margin: 0 auto; padding: 70px 24px; }
.section-head { text-align: center; margin-bottom: 44px; }
.section-head .eyebrow {
  display: block; font-size: 15px; font-weight: 600;
  color: var(--accent); margin-bottom: 8px; letter-spacing: 0.02em;
}
.section-head h2 { font-size: clamp(30px, 5vw, 44px); font-weight: 700; letter-spacing: -0.02em; }
.section-head p { color: var(--sub); font-size: 17px; margin-top: 10px; }

.grid { display: grid; gap: 20px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .grid { grid-template-columns: 1fr; } }
.card {
  background: var(--card); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1); }
.card .icon { font-size: 30px; margin-bottom: 14px; }
.card h3 { font-size: 19px; font-weight: 600; margin-bottom: 8px; letter-spacing: -0.01em; }
.card p { color: var(--sub); font-size: 14.5px; margin-bottom: 14px; }
.card .link { font-size: 14px; }

/* ---- 游戏区 ---- */
.game-box {
  max-width: 560px; margin: 0 auto; text-align: center;
  background: var(--card); border-radius: 24px; padding: 44px 28px; box-shadow: var(--shadow);
}
.game-count {
  font-size: 64px; font-weight: 700; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.game-label { color: var(--sub); font-size: 14px; margin: 6px 0 26px; }
.game-btn {
  width: 150px; height: 150px; border-radius: 50%;
  border: none; cursor: pointer; font-size: 21px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, #0071e3, #7d4cff);
  box-shadow: 0 10px 30px rgba(0, 113, 227, 0.35);
  transition: transform 0.08s ease, box-shadow 0.2s;
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.game-btn:active { transform: scale(0.92); box-shadow: 0 4px 14px rgba(0, 113, 227, 0.4); }
.game-status { margin-top: 22px; font-size: 13px; color: var(--sub); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #ff9f0a; margin-right: 5px; }
.dot.on { background: #30d158; box-shadow: 0 0 6px #30d158; }
.game-tip { margin-top: 18px; font-size: 12.5px; color: var(--sub); }

/* ---- 博客 ---- */
.post-list { display: flex; flex-direction: column; gap: 16px; max-width: 720px; margin: 0 auto; }
.post-item {
  background: var(--card); border-radius: var(--radius); padding: 24px 28px;
  cursor: pointer; box-shadow: var(--shadow); transition: transform 0.25s;
  border: none; text-align: left; width: 100%; font: inherit; color: inherit;
}
.post-item:hover { transform: translateY(-3px); }
.post-item .meta { font-size: 13px; color: var(--sub); display: flex; gap: 12px; margin-bottom: 6px; flex-wrap: wrap; }
.post-item .meta .tag { color: var(--accent); }
.post-item h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.post-item p { color: var(--sub); font-size: 14.5px; margin-top: 6px; }

.post-view {
  max-width: 720px; margin: 0 auto; background: var(--card);
  border-radius: var(--radius); padding: 44px 40px; box-shadow: var(--shadow);
}
.post-view h1 { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 10px; }
.post-view .meta { color: var(--sub); font-size: 14px; margin-bottom: 30px; }
.post-view h3 { font-size: 21px; margin: 28px 0 10px; letter-spacing: -0.01em; }
.post-view p { font-size: 16.5px; line-height: 1.75; margin-bottom: 16px; }
.post-view pre {
  background: rgba(120, 120, 128, 0.12); border-radius: 12px;
  padding: 16px 18px; overflow-x: auto; margin: 16px 0;
  font-size: 13.5px; line-height: 1.55; font-family: "SF Mono", ui-monospace, Menlo, monospace;
}
.post-view code {
  font-family: "SF Mono", ui-monospace, Menlo, monospace; font-size: 0.9em;
  background: rgba(120, 120, 128, 0.14); border-radius: 5px; padding: 1.5px 6px;
}
.post-view pre code { background: none; padding: 0; }
.back-link { display: inline-block; margin-bottom: 20px; font-size: 15px; cursor: pointer; }

/* ---- 留言板 ---- */
.gb-wrap { max-width: 720px; margin: 0 auto; }
.gb-form {
  background: var(--card); border-radius: var(--radius); padding: 26px 28px;
  box-shadow: var(--shadow); margin-bottom: 28px; display: flex; flex-direction: column; gap: 14px;
}
.gb-form input, .gb-form textarea {
  font: inherit; color: var(--text); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 16px; background: transparent;
  outline: none; transition: border 0.2s; resize: vertical;
}
.gb-form input:focus, .gb-form textarea:focus { border-color: var(--accent); }
.gb-form .row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.gb-form .hint { font-size: 12.5px; color: var(--sub); }
.gb-msg {
  background: var(--card); border-radius: var(--radius); padding: 18px 22px;
  box-shadow: var(--shadow); margin-bottom: 14px;
}
.gb-msg .head { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--sub); margin-bottom: 6px; }
.gb-msg .head b { color: var(--text); font-weight: 600; }
.gb-msg .body { font-size: 15px; white-space: pre-wrap; word-break: break-word; }

/* ---- 页脚 ---- */
footer { border-top: 1px solid var(--line); margin-top: 40px; }
.footer-inner {
  max-width: 1024px; margin: 0 auto; padding: 26px 24px 40px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-size: 13px; color: var(--sub);
}
.footer-inner a { color: var(--sub); }
.footer-inner a:hover { color: var(--accent); }

/* ---- 提示气泡 ---- */
#toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: 10px 22px; border-radius: 980px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: all 0.3s; z-index: 200;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
