/* 证期操盘手网址导航 */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --blue: #1a66ff; --blue-d: #0e4fd1; --bg: #f4f6fa; --card: #fff;
  --tx: #26303e; --tx2: #7b8794; --line: #e8ecf3; --radius: 12px;
}
html { scroll-behavior: smooth; scroll-padding-top: 128px; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif; background: var(--bg); color: var(--tx); font-size: 14px; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 20px; }

/* 顶栏 */
.topbar { position: sticky; top: 0; z-index: 50; background: linear-gradient(135deg, #0e3fae, #1a66ff); box-shadow: 0 2px 10px rgba(14,63,174,.25); }
.topbar-in { display: flex; align-items: center; gap: 24px; padding: 12px 20px; flex-wrap: wrap; }
.logo { display: flex; align-items: baseline; gap: 6px; color: #fff; white-space: nowrap; }
.logo-ico { font-size: 24px; align-self: center; }
.logo b { font-size: 21px; letter-spacing: 1px; }
.logo i { font-style: normal; font-size: 13px; opacity: .85; }

/* 搜索 */
.search-box { flex: 1; min-width: 300px; max-width: 620px; }
.engines { display: flex; gap: 2px; margin-bottom: 6px; }
.engines button { background: rgba(255,255,255,.14); color: #dfe9ff; border: 0; padding: 3px 12px; border-radius: 6px 6px 0 0; cursor: pointer; font-size: 13px; }
.engines button.on { background: #fff; color: var(--blue); font-weight: 600; }
#searchForm { display: flex; background: #fff; border-radius: 8px; overflow: hidden; }
#searchInput { flex: 1; border: 0; outline: 0; padding: 10px 14px; font-size: 15px; }
#searchForm button { border: 0; background: var(--blue); color: #fff; padding: 0 26px; font-size: 15px; cursor: pointer; }
#searchForm button:hover { background: var(--blue-d); }

/* 工具条（独占一行） */
.tools-bar { background: rgba(0,0,0,.14); border-top: 1px solid rgba(255,255,255,.12); }
.tools-in { display: flex; gap: 8px; flex-wrap: wrap; padding: 7px 20px; align-items: center; }
.tools-in .tool-btn { background: rgba(255,255,255,.12); color: #eaf1ff; border: 1px solid rgba(255,255,255,.28); border-radius: 8px; padding: 5px 13px; font-size: 13px; cursor: pointer; transition: .15s; }
.tools-in .tool-btn:hover { background: #fff; color: var(--blue); }

/* 主区 */
.main { padding: 18px 20px 40px; display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }
.cat-block { background: var(--card); border-radius: var(--radius); padding: 16px 18px; box-shadow: 0 1px 4px rgba(30,50,90,.06); }
.cat-head { display: flex; align-items: center; gap: 8px; padding-bottom: 10px; border-bottom: 2px solid var(--blue); margin-bottom: 12px; }
.cat-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cat-title:hover h2 { text-decoration: underline; }
.cat-more { margin-left: 6px; font-size: 12px; color: #fff; background: var(--blue); border-radius: 10px; padding: 2px 9px; white-space: nowrap; }
.cat-more:hover { background: var(--blue-d); }

/* 分类子页 */
.crumb { color: #dfe9ff; font-size: 13px; }
.crumb a { color: #dfe9ff; text-decoration: underline; }
.crumb b { font-size: 15px; }
.muted-inline { opacity: .8; font-size: 12px; margin-left: 4px; }
.catpage { padding: 18px 20px 40px; }
.catpage-block { max-width: 100%; }
.site-list-full li { width: 25%; }
.site-list-full a { justify-content: flex-start; gap: 6px; }
.site-list-full .ds { font-style: normal; font-size: 11.5px; color: #9aa5b5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-others { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.cat-others .cn-item { padding: 8px 14px; font-size: 13px; }

@media (max-width: 768px) {
  .site-list-full li { width: 50%; }
  .crumb { order: 3; min-width: 100%; }
}
.cat-ico { font-size: 18px; }
.cat-head h2 { font-size: 16px; color: var(--blue); }
.cat-count { margin-left: auto; font-size: 12px; color: var(--tx2); background: var(--bg); padding: 2px 8px; border-radius: 10px; }
.site-list { display: flex; flex-wrap: wrap; }
.site-list li { width: 33.33%; }
.site-list a { display: flex; align-items: center; gap: 4px; padding: 6px 4px; border-radius: 6px; color: #3a4656; font-size: 13.5px; transition: .12s; }
.site-list a:hover { color: var(--blue); background: #f0f5ff; }
.site-list .lk { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pin { font-style: normal; font-size: 11px; }

/* 分类快捷导航 */
.cat-nav { position: fixed; right: 12px; top: 50%; transform: translateY(-50%); z-index: 40; display: flex; flex-direction: column; gap: 4px; }
.cat-nav-in { display: flex; flex-direction: column; gap: 4px; padding: 0; }
.cn-item { background: #fff; border: 1px solid var(--line); color: #55627a; font-size: 12px; padding: 6px 8px; border-radius: 8px; text-align: center; box-shadow: 0 1px 3px rgba(30,50,90,.08); transition: .15s; }
.cn-item:hover, .cn-item.on { background: var(--blue); border-color: var(--blue); color: #fff; }
@media (max-width: 1500px) { .cat-nav { display: none; } }

/* 页脚 */
.footer { background: #fff; border-top: 1px solid var(--line); padding: 22px 0 26px; text-align: center; color: var(--tx2); font-size: 13px; }
.footer a { color: var(--blue); }
.footer .tip { margin-top: 6px; font-size: 12px; }

/* 返回顶部 */
.back-top { position: fixed; right: 24px; bottom: 40px; width: 44px; height: 44px; line-height: 44px; text-align: center; background: #fff; color: var(--blue); border: 1px solid var(--line); border-radius: 50%; box-shadow: 0 2px 8px rgba(30,50,90,.15); display: none; font-size: 12px; z-index: 60; }
.back-top.show { display: block; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(10,20,40,.45); z-index: 100; display: none; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 520px; max-height: 82vh; overflow: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 16px; }
.modal-close { border: 0; background: none; font-size: 15px; cursor: pointer; color: var(--tx2); }
.modal-body { padding: 16px 18px 20px; }
.frm-row { display: flex; gap: 10px; margin-bottom: 10px; }
.frm-row label { width: 74px; align-self: center; color: var(--tx2); font-size: 13px; flex-shrink: 0; }
.frm-row input, .frm-row select { flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 14px; outline: none; }
.frm-row input:focus, .frm-row select:focus { border-color: var(--blue); }
.btn { display: inline-block; border: 0; border-radius: 8px; padding: 9px 22px; font-size: 14px; cursor: pointer; background: var(--blue); color: #fff; }
.btn.full { width: 100%; }
.btn.ghost { background: #eef2f9; color: var(--tx); }
.result { background: #f6f9ff; border: 1px solid #dbe7ff; border-radius: 10px; padding: 12px 14px; margin-top: 8px; font-size: 13.5px; line-height: 1.9; }
.result b { color: #e03426; font-size: 16px; }

/* 设为主页引导 */
.home-tip { font-size: 13.5px; line-height: 1.7; color: var(--tx2); margin-bottom: 10px; }
.home-tip b { color: #e03426; }
.drag-home { display: block; text-align: center; border: 2px dashed var(--blue); color: var(--blue); background: #f0f5ff; border-radius: 10px; padding: 12px 10px; font-size: 14px; font-weight: 600; cursor: move; margin-bottom: 12px; }
.drag-home:active { background: var(--blue); color: #fff; }
.browser-card { background: #f0f6ff; border: 1px solid #c9dbff; border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.browser-card b { color: var(--blue); }
.browser-card ol, .modal-body details ol { margin: 8px 0 0 20px; padding: 0; }
.browser-card li, .modal-body details li { margin: 5px 0; font-size: 13.5px; line-height: 1.75; }
.browser-card kbd, .modal-body details kbd { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; font-size: 12.5px; color: var(--blue); font-family: inherit; }
.home-more { font-size: 13px; color: var(--tx2); margin: 6px 0; }
.modal-body details { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 6px 0; }
.modal-body summary { cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--tx); }

/* AI 助手聊天 */
.modal.wide { max-width: 780px; }
.ai-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.ai-chip { border: 1px solid var(--line); background: #f6f8fc; color: var(--tx); border-radius: 18px; padding: 5px 14px; font-size: 13px; cursor: pointer; transition: .12s; }
.ai-chip.on { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
.ai-chip.nokey { opacity: .55; }
.ai-clear { margin-left: auto; border: 0; background: none; color: var(--tx2); font-size: 12.5px; cursor: pointer; }
.ai-clear:hover { color: #e5484d; }
.chat-list { height: 56vh; overflow-y: auto; background: #f7f9fc; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.chat-hello { color: var(--tx2); font-size: 13.5px; line-height: 2; text-align: center; padding-top: 18vh; }
.bubble { margin-bottom: 10px; display: flex; }
.bubble.me { justify-content: flex-end; }
.bubble .bbody { max-width: 86%; padding: 9px 13px; border-radius: 12px; font-size: 13.5px; line-height: 1.75; word-break: break-word; }
.bubble.me .bbody { background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.bubble.ai .bbody { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble.ai p { margin: 0 0 4px; }
.bubble.ai ul { margin: 2px 0 6px 18px; }
.bubble.ai li { margin: 2px 0; }
.bubble.ai table.ai-tb { border-collapse: collapse; margin: 6px 0; font-size: 12.5px; }
.bubble.ai table.ai-tb td { border: 1px solid var(--line); padding: 4px 8px; }
.bubble.ai code { background: #f0f3f9; border-radius: 4px; padding: 1px 5px; font-size: 12.5px; }
.typing { color: var(--blue); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0; } }
.chat-input-row { display: flex; gap: 8px; margin-top: 10px; align-items: flex-end; }
.chat-input-row textarea { flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font-size: 13.5px; font-family: inherit; resize: none; outline: none; }
.chat-input-row textarea:focus { border-color: var(--blue); }
.chat-input-row .btn { padding: 9px 20px; }
.err { color: #e5484d; }
@media (max-width: 768px) { .chat-list { height: 50vh; } .modal.wide { max-width: 100%; } }

/* ============ 移动端 ============ */
@media (max-width: 768px) {
  .topbar-in { padding: 10px 12px; gap: 10px; }
  .logo b { font-size: 17px; }
  .search-box { order: 3; min-width: 100%; }
  .tools-in { padding: 6px 12px; }
  .tools-in .tool-btn { padding: 5px 9px; font-size: 12px; }
  .main { grid-template-columns: 1fr; padding: 12px; gap: 12px; }
  .cat-block { padding: 12px 14px; }
  .site-list li { width: 33.33%; }
  .site-list a { font-size: 13px; padding: 7px 2px; }
  .back-top { right: 14px; bottom: 20px; }
  .frm-row { flex-wrap: wrap; }
  .frm-row label { width: 100%; margin-bottom: -4px; }
}
@media (max-width: 380px) { .site-list li { width: 50%; } }
