* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #1f2329; background: #f6f7f9; line-height: 1.6;
}
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }
a { color: inherit; text-decoration: none; }

.site-header {
  background: #fff; border-bottom: 1px solid #eceef1; padding: 14px 0;
}
.site-header .wrap { display: flex; align-items: baseline; gap: 10px; }
.logo { font-size: 20px; font-weight: 700; color: #2b6cff; }
.tag { font-size: 12px; color: #9aa0a6; }

.hero { text-align: center; padding: 48px 0 24px; }
.hero h1 { font-size: 32px; }
.lead { color: #6b7280; margin-top: 8px; }

.ad { margin: 16px auto; }
.ad-header { text-align: center; }

.tool-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px; padding: 24px 0 40px;
}
.tool-card {
  background: #fff; border: 1px solid #eceef1; border-radius: 12px;
  padding: 18px; transition: .15s; display: block;
}
.tool-card:hover { border-color: #2b6cff; transform: translateY(-2px); }
.tool-card h3 { font-size: 16px; margin-bottom: 6px; }
.tool-card p { font-size: 13px; color: #6b7280; }

.tool-head { padding: 32px 0 12px; }
.back { font-size: 13px; color: #2b6cff; }
.tool-head h1 { font-size: 26px; margin: 10px 0 4px; }
.tool-head .sub { color: #6b7280; }

.tool-form { background: #fff; border: 1px solid #eceef1; border-radius: 12px; padding: 20px; margin: 16px 0; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 14px; margin-bottom: 6px; font-weight: 600; }
.req { color: #e23b3b; }
.field input, .field textarea, .field select {
  width: 100%; padding: 10px 12px; border: 1px solid #d9dde3; border-radius: 8px;
  font-size: 14px; font-family: inherit; background: #fff;
}
.field textarea { resize: vertical; }
.btn {
  background: #2b6cff; color: #fff; border: none; border-radius: 8px;
  padding: 11px 22px; font-size: 15px; cursor: pointer;
}
.btn:hover { background: #1f5be0; }
.btn-ghost { background: #fff; color: #2b6cff; border: 1px solid #2b6cff; }
.btn-ghost:hover { background: #eef3ff; }

.result {
  background: #fff; border: 1px solid #eceef1; border-radius: 12px;
  padding: 20px; margin: 16px 0 40px; white-space: pre-wrap; font-size: 15px; line-height: 1.8;
}

.site-footer { border-top: 1px solid #eceef1; padding: 20px 0; color: #9aa0a6; font-size: 13px; text-align: center; }

/* ---- Markdown 渲染结果 ---- */
.result h1, .result h2, .result h3, .result h4 { margin: 16px 0 8px; line-height: 1.4; }
.result h1 { font-size: 22px; } .result h2 { font-size: 19px; } .result h3 { font-size: 17px; }
.result p { margin: 10px 0; }
.result ul, .result ol { margin: 10px 0 10px 22px; }
.result li { margin: 4px 0; }
.result blockquote { border-left: 4px solid #d9dde3; margin: 10px 0; padding: 6px 14px; color: #6b7280; background: #f8f9fb; border-radius: 0 8px 8px 0; }
.result code { background: #f0f2f5; padding: 2px 6px; border-radius: 4px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.result pre { background: #1e1e2e; color: #e6e6e6; padding: 14px 16px; border-radius: 10px; overflow: auto; margin: 12px 0; }
.result pre code { background: none; padding: 0; color: inherit; }
.result a { color: #2b6cff; text-decoration: underline; }
.result hr { border: none; border-top: 1px solid #eceef1; margin: 16px 0; }
.result .hint { color: #9aa0a6; }
.result .hint.err { color: #e23b3b; }

/* ---- 多媒体（文生图/视频）结果 ---- */
.result .gen-media { width: 100%; max-width: 720px; border-radius: 12px; display: block; background: #000; }
.result .media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.result .media-item { display: block; border-radius: 12px; overflow: hidden; border: 1px solid #eceef1; background: #f5f6f8; }
.result .media-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.result .media-item:hover img { transform: scale(1.04); }

/* ---- 参考图上传（图生图 / 图生视频） ---- */
.upload-field {
  border: 1px dashed #c7cdd6; border-radius: 10px; padding: 14px;
  background: #fafbfd; margin-bottom: 14px;
}
.upload-field label { margin-bottom: 8px; }
.upload-field input[type="file"] {
  width: 100%; padding: 9px 10px; font-size: 13px; cursor: pointer;
  border: 1px solid #d9dde3; border-radius: 8px; background: #fff;
}
.upload-field input[type="file"]::file-selector-button {
  border: none; background: #eef3ff; color: #2b6cff; font-family: inherit;
  padding: 6px 12px; border-radius: 6px; margin-right: 10px; cursor: pointer;
}
.upload-field input[type="file"]::file-selector-button:hover { background: #dfe9ff; }
.ref-preview {
  margin-top: 10px; max-width: 220px; max-height: 220px; display: block;
  border-radius: 10px; border: 1px solid #eceef1; background: #fff; object-fit: contain;
}
.hint-sm { margin: 8px 0 0; font-size: 12px; color: #9aa0a6; }

/* ---- 后台看板 ---- */
.admin { padding: 28px 0 40px; }
.admin h1 { font-size: 26px; }
.admin h2 { font-size: 18px; margin: 28px 0 12px; }
.admin .back { font-size: 13px; color: #2b6cff; }
.stat-row { display: flex; gap: 14px; flex-wrap: wrap; margin: 18px 0 8px; }
.stat { background: #fff; border: 1px solid #eceef1; border-radius: 12px; padding: 16px 20px; min-width: 140px; }
.stat .num { font-size: 26px; font-weight: 700; color: #2b6cff; }
.stat .lbl { font-size: 13px; color: #6b7280; margin-top: 4px; }
.tbl { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #eceef1; border-radius: 12px; overflow: hidden; }
.tbl th, .tbl td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #f0f1f3; font-size: 14px; }
.tbl th { background: #fafbfc; color: #6b7280; font-weight: 600; }
.tbl tr:last-child td { border-bottom: none; }
.tbl .bar { display: inline-block; width: 90px; height: 8px; background: #eef0f3; border-radius: 6px; vertical-align: middle; margin-right: 8px; overflow: hidden; }
.tbl .bar span { display: block; height: 100%; background: #2b6cff; border-radius: 6px; }
.tbl td em { color: #6b7280; font-style: normal; }

/* ===== 站内体验：搜索 + 分类导航 ===== */
.nav-btn {
  margin-left: auto; background: #fff; color: #2b6cff; border: 1px solid #d9dde3;
  border-radius: 8px; padding: 7px 14px; font-size: 13px; cursor: pointer;
}
.nav-btn:hover { background: #eef3ff; }
.explore { padding: 8px 0 4px; }
.search {
  width: 100%; padding: 12px 16px; border: 1px solid #d9dde3; border-radius: 12px;
  font-size: 15px; font-family: inherit; background: #fff; margin-bottom: 12px;
}
.search:focus { outline: none; border-color: #2b6cff; }
.cat-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.cat-btn {
  border: 1px solid #e2e5ea; background: #fff; color: #4b5563; border-radius: 999px;
  padding: 6px 14px; font-size: 13px; cursor: pointer;
}
.cat-btn:hover { border-color: #2b6cff; color: #2b6cff; }
.cat-btn.active { background: #2b6cff; border-color: #2b6cff; color: #fff; }
.sec-title { font-size: 17px; margin: 26px 0 12px; color: #1f2329; }
.fav-section { margin-top: 8px; }

/* ===== 收藏星标 ===== */
.star {
  position: absolute; top: 10px; right: 12px; width: 28px; height: 28px;
  border: none; background: transparent; font-size: 18px; line-height: 1; cursor: pointer; color: #c2c8d0;
}
.star:hover { color: #f5b301; }
.star.on { color: #f5b301; }
.tool-card { position: relative; }
.th-row { display: flex; align-items: center; gap: 12px; }
.star-lg { position: static; font-size: 22px; width: 34px; height: 34px; }

/* ===== 工具页：操作区 / 统计 / 分享 ===== */
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.result-meta { color: #9aa0a6; font-size: 13px; margin: 6px 0 4px; }
.result-actions { display: flex; flex-wrap: wrap; gap: 0; }
.share-box { margin: 14px 0 36px; background: #fff; border: 1px solid #eceef1; border-radius: 12px; padding: 16px; }
.share-box .ok { font-size: 14px; color: #1f2329; margin-bottom: 10px; }
.card-prev { max-width: 100%; border: 1px solid #eceef1; border-radius: 10px; margin-bottom: 10px; }
.share-acts { display: flex; gap: 10px; flex-wrap: wrap; }
.share-link { display: flex; gap: 8px; }
.link-input { flex: 1; padding: 9px 12px; border: 1px solid #d9dde3; border-radius: 8px; font-size: 13px; background: #f8f9fb; }
.share-text { width: 100%; height: 140px; padding: 10px; border: 1px solid #d9dde3; border-radius: 8px; font-family: inherit; font-size: 13px; resize: vertical; }

/* 分享卡片（离屏截屏用） */
.share-card { width: 460px; background: #fff; padding: 22px 24px; border-radius: 14px; box-shadow: 0 6px 24px rgba(0,0,0,.08); font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; color: #1f2329; }
.share-card .sc-head { font-size: 18px; font-weight: 700; color: #2b6cff; margin-bottom: 12px; }
.share-card .sc-body { font-size: 14px; line-height: 1.8; white-space: pre-wrap; word-break: break-word; }
.share-card .sc-foot { margin-top: 16px; padding-top: 10px; border-top: 1px dashed #e2e5ea; font-size: 12px; color: #9aa0a6; }

/* ===== 抽屉（历史 / 收藏） ===== */
.drawer-mask { position: fixed; inset: 0; background: rgba(0,0,0,.35); opacity: 0; visibility: hidden; transition: .2s; z-index: 50; }
.drawer-mask.show { opacity: 1; visibility: visible; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: 380px; max-width: 90vw; background: #fff;
  box-shadow: -6px 0 24px rgba(0,0,0,.12); transform: translateX(100%); transition: transform .22s ease; z-index: 51;
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid #f0f1f3; }
.drawer-tabs { display: flex; gap: 6px; }
.dtab { border: none; background: transparent; font-size: 15px; color: #6b7280; cursor: pointer; padding: 4px 8px; }
.dtab.active { color: #2b6cff; font-weight: 700; border-bottom: 2px solid #2b6cff; }
.drawer-x { border: none; background: transparent; font-size: 22px; line-height: 1; color: #9aa0a6; cursor: pointer; }
.drawer-body { overflow-y: auto; padding: 12px 16px 24px; }
.empty { color: #9aa0a6; font-size: 14px; line-height: 1.7; }
.hist-item { border: 1px solid #f0f1f3; border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.hi-top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.hi-time { color: #9aa0a6; font-size: 12px; white-space: nowrap; }
.hi-prev { color: #6b7280; font-size: 13px; margin: 4px 0; max-height: 38px; overflow: hidden; }
.hi-full { white-space: pre-wrap; font-size: 13px; line-height: 1.7; color: #1f2329; margin: 6px 0; max-height: 240px; overflow: auto; }
.hi-actions { display: flex; gap: 8px; margin-top: 6px; }
.mini { border: 1px solid #d9dde3; background: #fff; border-radius: 6px; padding: 3px 10px; font-size: 12px; cursor: pointer; color: #4b5563; }
.mini:hover { border-color: #2b6cff; color: #2b6cff; }
.fav-link { display: block; padding: 10px 12px; border: 1px solid #f0f1f3; border-radius: 10px; margin-bottom: 8px; font-size: 14px; }
.fav-link span { color: #6b7280; font-size: 12px; margin-left: 6px; }

/* ===== 分享只读页 ===== */
.share-page { background: #fff; border: 1px solid #eceef1; border-radius: 12px; padding: 22px; margin: 16px 0 24px; }
.sp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 8px; }
.sp-badge { background: #eef3ff; color: #2b6cff; font-size: 13px; padding: 4px 12px; border-radius: 999px; }
.sp-time { color: #9aa0a6; font-size: 12px; }
.share-content { white-space: pre-wrap; word-break: break-word; font-size: 15px; line-height: 1.8; }
.sp-btn { display: inline-block; margin-top: 16px; }

/* ===== 后台看板：筛选 / 图表 ===== */
.admin .filter { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0 6px; }
.admin .filter input[type=date] { padding: 8px 10px; border: 1px solid #d9dde3; border-radius: 8px; font-family: inherit; }
.admin .presets a { color: #2b6cff; font-size: 13px; margin: 0 6px; text-decoration: none; }
.admin .export { margin-left: auto; color: #2b6cff; font-size: 13px; text-decoration: none; border: 1px solid #2b6cff; padding: 6px 12px; border-radius: 8px; }
.admin .export:hover { background: #eef3ff; }
.chart-card { background: #fff; border: 1px solid #eceef1; border-radius: 12px; padding: 16px; margin: 14px 0; }
.chart-card h3 { font-size: 15px; margin-bottom: 8px; color: #1f2329; }
.chart-card svg { width: 100%; height: auto; display: block; }
