/* Caret 官网样式 —— 简洁、去 AI 感、双端适配 */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: #f7f8fa;
  color: #1a1a1a;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: #0a7fd1; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: #eef1f6;
  padding: 1px 5px;
  border-radius: 4px;
}

.container { max-width: 980px; margin: 0 auto; padding: 24px 20px; }

/* ---------- 导航 ---------- */
.site-nav {
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid #ebeef3;
  position: sticky; top: 0; z-index: 30;
}
.site-nav .inner {
  max-width: 980px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; height: 60px; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-logo { width: 26px; height: 26px; object-fit: contain; }
.brand-name { font-weight: 700; font-size: 18px; color: #111; letter-spacing: .3px; }
.nav-links { display: flex; gap: 20px; margin-left: auto; }
.nav-links a { color: #55606e; font-size: 14px; }
.nav-links a:hover { color: #0a7fd1; text-decoration: none; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span {
  display: block; width: 20px; height: 2px; background: #333; margin: 4px 0; border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}

/* ---------- Hero ---------- */
.hero { padding: 72px 20px 56px; text-align: center; }
.hero-logo {
  display: block; width: 76px; height: 76px; object-fit: contain;
  margin: 0 auto 18px;
  filter: drop-shadow(0 10px 24px rgba(10,127,209,.18));
}
.hero h1 { font-size: 40px; margin: 0 0 12px; font-weight: 700; letter-spacing: -0.5px; }
.hero p { color: #666; font-size: 17px; margin: 0 auto; max-width: 640px; }
.hero .tag {
  display: inline-block; background: #eaf3fd; color: #0a7fd1;
  padding: 3px 10px; border-radius: 999px; font-size: 12px; margin-bottom: 14px;
}
.hero-home .tag { margin-top: 2px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block; padding: 10px 22px; border-radius: 8px; font-size: 14px;
  font-weight: 500; border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: #111; color: #fff; }
.btn-primary:hover { background: #000; }
.btn-secondary { background: #fff; color: #111; border-color: #dde2ea; }
.btn-secondary:hover { border-color: #111; }
.btn-row { display: flex; gap: 12px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }

/* ---------- 卡片 ---------- */
.card { background: #fff; border: 1px solid #ebeef3; border-radius: 12px; padding: 22px; margin-bottom: 16px; }
.card h3 { margin: 0 0 10px; font-size: 17px; }
.card p { margin: 0; color: #555; font-size: 14px; }

/* 横条卡片 */
.bar-card {
  position: relative;
  display: flex; align-items: stretch; gap: 0;
  background: #fff; border: 1px solid #ebeef3; border-radius: 14px;
  overflow: hidden; margin-bottom: 14px;
  transition: box-shadow .22s ease, transform .22s ease, border-color .22s ease;
}
.bar-card:hover {
  border-color: #d8e3f2;
  box-shadow: 0 14px 34px -18px rgba(23,43,77,.28);
  transform: translateY(-2px);
}
.bar-card .bar {
  position: absolute; left: 0; top: 0; height: 3px; width: 100%;
  background: linear-gradient(90deg, #0a9bf5, #7c4dff 55%, #00bfa5);
  opacity: .85;
}
.bar-card .body { flex: 1 1 auto; padding: 26px 28px; min-width: 0; }
.bar-card h3 { margin: 0 0 8px; font-size: 19px; letter-spacing: -.2px; }
.bar-card p { margin: 0; color: #5a6472; font-size: 14.5px; }
.bar-card .art {
  flex: 0 0 240px; width: 240px; height: auto; object-fit: cover;
  align-self: stretch; background: #f2f5fa;
  transition: transform .4s cubic-bezier(.2,.7,.3,1);
}
.bar-card:hover .art { transform: scale(1.04); }
.bar-card.reverse { flex-direction: row-reverse; }

/* CTA 横条 */
.cta-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  background: #10151c; color: #fff; border-radius: 14px;
  padding: 22px 26px; margin: 34px 0 8px;
}
.cta-strip strong { display: block; font-size: 16px; margin-bottom: 2px; }
.cta-strip span { color: #a9b4c2; font-size: 13.5px; }
.cta-strip .btn-primary { background: #fff; color: #10151c; flex: 0 0 auto; }
.cta-strip .btn-primary:hover { background: #e9eef5; }

/* ---------- 区块 ---------- */
.section { padding: 36px 0; }
.section h2 { font-size: 24px; margin: 0 0 8px; letter-spacing: -.3px; }
.section .lead { color: #6a7380; margin-bottom: 24px; font-size: 14.5px; }

/* 表格 */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #ebeef3; }
th { background: #fafbfd; font-weight: 600; color: #333; }

/* ---------- 页脚 ---------- */
.site-footer {
  position: relative; overflow: hidden;
  border-top: 1px solid #ebeef3; margin-top: 40px;
  background: #fff;
}
.footer-mark {
  position: absolute; right: -30px; top: 50%; transform: translateY(-50%);
  pointer-events: none; user-select: none;
}
.footer-mark img {
  width: 300px; height: 300px; object-fit: contain;
  filter: brightness(0) saturate(0);     /* 剪影 */
  opacity: .045;
}
.footer-inner {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 6px; padding-top: 28px; padding-bottom: 28px;
  color: #98a1ad; font-size: 13px;
}
.footer-inner a { color: #98a1ad; }
.footer-inner a:hover { color: #0a7fd1; }
.footer-inner .dot { opacity: .6; }

/* ---------- 表单 ---------- */
form label { display: block; font-size: 13px; color: #444; margin: 12px 0 4px; }
form input[type=text], form input[type=password], form input[type=url],
form input[type=number], form textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #dfe3eb; border-radius: 8px;
  font-size: 14px; font-family: inherit; background: #fff; outline: none;
}
form input:focus, form textarea:focus { border-color: #0a7fd1; box-shadow: 0 0 0 3px rgba(10,127,209,.12); }
form textarea { min-height: 120px; resize: vertical; }
form .form-row { display: flex; gap: 12px; }
form .form-row > div { flex: 1; }
form button { margin-top: 18px; }

/* ---------- 探索 / 公告 ---------- */
.prompt-item { background: #fff; border: 1px solid #ebeef3; border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; }
.prompt-item .title { font-weight: 600; }
.prompt-item .desc { font-size: 13px; color: #666; margin: 4px 0 8px; }
.prompt-item pre {
  background: #f5f7fb; padding: 10px; border-radius: 6px; font-size: 13px;
  white-space: pre-wrap; word-break: break-word; margin: 0;
}
.explore-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.explore-card {
  background: #fff; border: 1px solid #ebeef3; border-radius: 10px;
  padding: 16px; display: block; color: inherit; transition: border-color .2s, transform .2s;
}
.explore-card:hover { border-color: #0a7fd1; text-decoration: none; transform: translateY(-2px); }
.explore-card .t { font-weight: 600; }
.explore-card .s { font-size: 13px; color: #666; margin-top: 4px; }
.ann-item { background: #fff; border: 1px solid #ebeef3; border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; }
.ann-item .t { font-weight: 600; }
.ann-item img { max-height: 180px; border-radius: 6px; margin-top: 8px; }

/* ---------- 后台 ---------- */
.admin-section { margin-bottom: 40px; }
.admin-section h2 { font-size: 18px; margin-bottom: 12px; border-bottom: 1px solid #ebeef3; padding-bottom: 8px; }
.admin-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 28px; }
.admin-stat { background: #fff; border: 1px solid #ebeef3; border-radius: 10px; padding: 14px; }
.admin-stat .num { font-size: 26px; font-weight: 700; color: #111; }
.admin-stat .lbl { font-size: 12px; color: #888; }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: 90px 20px 60px; }
.notfound-code {
  font-size: 96px; font-weight: 800; line-height: 1;
  letter-spacing: -4px; color: #e4eaf2;
}
.notfound h1 { font-size: 24px; margin: 8px 0 6px; }
.notfound p { color: #77808d; margin: 0; }

/* ---------- 登录 ---------- */
.login-wrap { max-width: 320px; margin: 80px auto; padding: 0 16px; }

/* ---------- 右键菜单 ---------- */
.ctx-menu {
  position: fixed; z-index: 9999; min-width: 178px;
  background: #fff; border: 1px solid #e3e8ef; border-radius: 10px;
  box-shadow: 0 14px 40px -12px rgba(17,24,39,.28);
  padding: 6px; display: none; animation: ctxIn .12s ease;
}
.ctx-menu.open { display: block; }
@keyframes ctxIn { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: scale(1); } }
.ctx-menu button {
  display: block; width: 100%; text-align: left;
  background: none; border: 0; border-radius: 6px;
  padding: 8px 12px; font-size: 13.5px; color: #26303c;
  cursor: pointer; font-family: inherit;
}
.ctx-menu button:hover { background: #f1f5fa; }
.ctx-sep { height: 1px; background: #eef1f6; margin: 5px 4px; }
.toast-wrap {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  z-index: 10000; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  background: #1b2430; color: #fff; font-size: 13px;
  padding: 8px 16px; border-radius: 999px; opacity: 0;
  transform: translateY(8px); transition: opacity .2s ease, transform .2s ease;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ---------- 二维码卡片 ---------- */
.qr-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.qr-card {
  display: flex; align-items: center; gap: 18px;
  background: #fff; border: 1px solid #ebeef3; border-radius: 14px; padding: 20px;
}
.qr-info { flex: 1 1 auto; min-width: 0; }
.qr-info h3 { margin: 0 0 8px; font-size: 17px; }
.qr-info p { margin: 0 0 14px; color: #5a6472; font-size: 14px; }
.qr { flex: 0 0 auto; margin: 0; text-align: center; }
.qr img {
  width: 116px; height: 116px; object-fit: contain;
  background: #fff; border: 1px solid #eef1f6; border-radius: 10px; padding: 4px;
}
.qr figcaption { margin-top: 6px; font-size: 12px; color: #98a1ad; }

/* ---------- 教程文档 ---------- */
.doc-head { padding: 26px 0 4px; }
.doc-head h1 { font-size: 32px; margin: 6px 0 10px; letter-spacing: -.4px; }
.doc-head p { color: #6a7380; margin: 0; font-size: 15px; }
.doc {
  background: #fff; border: 1px solid #ebeef3; border-radius: 14px;
  padding: 34px 40px; margin-top: 18px; font-size: 15px; color: #2b3138;
  overflow-wrap: break-word;
}
.doc > :first-child { margin-top: 0; }
.doc h1 { font-size: 27px; margin: 0 0 14px; }
.doc h2 { font-size: 22px; margin: 34px 0 12px; padding-bottom: 8px; border-bottom: 1px solid #f0f3f8; }
.doc h3 { font-size: 18px; margin: 24px 0 8px; }
.doc h4 { font-size: 16px; margin: 20px 0 6px; }
.doc h1, .doc h2, .doc h3 { scroll-margin-top: 76px; }
.doc p { margin: 10px 0; }
.doc ul, .doc ol { margin: 10px 0; padding-left: 22px; }
.doc li { margin: 5px 0; }
.doc blockquote {
  margin: 16px 0; padding: 10px 16px;
  border-left: 3px solid #bfdcf7; background: #f7fafd;
  color: #55606e; border-radius: 0 8px 8px 0;
}
.doc blockquote p { margin: 0; }
.doc hr { border: 0; border-top: 1px solid #ebeef3; margin: 28px 0; }
.doc pre {
  background: #151b23; color: #e6ebf3; padding: 14px 16px; border-radius: 10px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  font-size: 13px; line-height: 1.6; margin: 14px 0;
}
.doc pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.md-table {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  margin: 14px 0; border: 1px solid #ebeef3; border-radius: 10px;
}
.md-table table { min-width: 440px; margin: 0; }
.md-table th, .md-table td { font-size: 13.5px; }

/* 占位页 */
.placeholder { text-align: center; padding: 80px 20px; }
.placeholder h1 { font-size: 24px; margin: 0 0 8px; }
.placeholder p { color: #77808d; margin: 0; }

/* ---------- 移动端 ---------- */
@media (max-width: 720px) {
  body { font-size: 15px; line-height: 1.72; }
  .container { padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }

  /* 导航：抽屉式 */
  .site-nav .inner { height: 54px; padding: 0 14px; }
  .brand-logo { width: 24px; height: 24px; }
  .brand-name { font-size: 17px; }
  .nav-toggle {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 44px; height: 44px; margin-left: auto; margin-right: -8px; padding: 0;
  }
  .nav-toggle span { width: 19px; margin: 2.5px 0; }
  .nav-links {
    position: absolute; left: 0; right: 0; top: 54px;
    display: flex; flex-direction: column; gap: 0;
    background: #fff; border-bottom: 1px solid #ebeef3;
    box-shadow: 0 18px 28px -22px rgba(17,24,39,.35);
    max-height: 0; overflow: hidden; transition: max-height .26s ease;
  }
  .site-nav.open .nav-links { max-height: 380px; }
  .nav-links a { padding: 14px 18px; font-size: 15px; border-top: 1px solid #f2f5f9; }
  .nav-links a:active { background: #f5f9fd; }

  /* Hero */
  .hero { padding: 40px 16px 30px; }
  .hero-logo { width: 64px; height: 64px; margin-bottom: 14px; }
  .hero h1 { font-size: clamp(25px, 7.4vw, 32px); line-height: 1.32; }
  .hero p { font-size: 15px; }
  .hero .tag { margin-bottom: 10px; }
  .btn { padding: 12px 18px; font-size: 15px; border-radius: 10px; }
  .btn-row { gap: 10px; margin-top: 20px; }

  /* 区块 */
  .section { padding: 24px 0; }
  .section h2 { font-size: 20px; }
  .section .lead { font-size: 14px; margin-bottom: 18px; }

  /* 横条卡片：图片置顶，固定比例占位 */
  .bar-card, .bar-card.reverse { flex-direction: column; border-radius: 12px; }
  .bar-card .art {
    order: -1; flex: 0 0 auto; align-self: auto;
    width: 100%; height: auto; aspect-ratio: 3 / 2;
    object-fit: cover; background: #eef2f8; transform: none !important;
  }
  .bar-card .body { padding: 16px 18px 20px; }
  .bar-card h3 { font-size: 17px; }
  .bar-card p { font-size: 14px; line-height: 1.7; }

  /* CTA */
  .cta-strip {
    flex-direction: column; align-items: stretch; gap: 14px;
    padding: 20px 18px; margin: 26px 0 8px;
  }
  .cta-strip .btn-primary { width: 100%; text-align: center; }

  /* 卡片与二维码 */
  .card { padding: 18px; border-radius: 12px; }
  .qr-grid { grid-template-columns: 1fr; gap: 12px; }
  .qr-card { padding: 16px; gap: 14px; }
  .qr-info h3 { font-size: 16px; }
  .qr-info p { font-size: 13.5px; margin-bottom: 12px; }
  .qr img { width: 104px; height: 104px; }

  /* 文档 */
  .doc-head { padding: 16px 0 0; }
  .doc-head h1 { font-size: 26px; }
  .doc-head p { font-size: 14px; }
  .doc { padding: 22px 18px; border-radius: 12px; font-size: 15px; margin-top: 14px; }
  .doc h1 { font-size: 23px; }
  .doc h2 { font-size: 19.5px; margin-top: 28px; }
  .doc h3 { font-size: 17px; }
  .doc h4 { font-size: 15.5px; }
  .doc ul, .doc ol { padding-left: 20px; }
  .doc pre { font-size: 12.5px; padding: 12px; }
  .md-table table { min-width: 420px; }
  .md-table th, .md-table td { padding: 8px 10px; font-size: 13px; }

  /* 表单：输入框 16px 防 iOS 缩放 */
  form .form-row { flex-direction: column; gap: 0; }
  form input[type=text], form input[type=password], form input[type=url],
  form input[type=number], form textarea { font-size: 16px; padding: 11px 12px; }

  /* 探索 */
  .explore-grid { grid-template-columns: 1fr; }
  .ann-item img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: #eef2f8; }

  /* 页脚 */
  .site-footer { margin-top: 30px; padding-bottom: env(safe-area-inset-bottom); }
  .footer-mark { right: -56px; }
  .footer-mark img { width: 210px; height: 210px; }
  .footer-inner { padding-top: 22px; padding-bottom: 22px; font-size: 12.5px; gap: 4px 6px; }
  .footer-inner a { padding: 2px 2px; }

  /* 其他 */
  .notfound { padding: 56px 16px 40px; }
  .notfound-code { font-size: 72px; }
  .notfound h1 { font-size: 21px; }
  .placeholder { padding: 60px 16px; }
  .login-wrap { margin: 40px auto; }
  .toast-wrap { bottom: calc(24px + env(safe-area-inset-bottom)); }
  .ctx-menu button { padding: 11px 12px; font-size: 15px; }
}

/* 小屏手机 */
@media (max-width: 400px) {
  .hero h1 { font-size: 24px; }
  .bar-card .art { aspect-ratio: 4 / 3; }
  .qr-card { flex-direction: column; align-items: flex-start; }
  .qr { align-self: center; }
  .qr img { width: 128px; height: 128px; }
  .btn-row .btn { width: 100%; text-align: center; }
}

/* 触屏设备去掉 hover 位移，避免"点一下跳一下" */
@media (hover: none) {
  .bar-card:hover { transform: none; box-shadow: none; border-color: #ebeef3; }
  .bar-card:hover .art { transform: none; }
  .explore-card:hover, .btn:hover { transform: none; }
}
