/* ============================================================
 * 导航站管理系统 - 前台样式
 * @liye 制作
 * ============================================================ */
:root { --theme: #4f46e5; --bg: #f5f6fa; --card: #fff; --text: #1f2937; --muted: #6b7280; --border: #e5e7eb; }
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; }
a { color: inherit; text-decoration: none; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.container.narrow { max-width: 560px; }

.preview-bar { background: #fef3c7; color: #92400e; text-align: center; padding: 8px; font-size: 13px; }
.preview-bar a { text-decoration: underline; }

/* 顶部 */
.hero { background: linear-gradient(135deg, var(--theme), #7c3aed); color: #fff; padding: 40px 0 56px; }
.brand { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 24px; }
.brand h1 { margin: 0; font-size: 30px; letter-spacing: 1px; }
.brand-emoji { font-size: 36px; }
.brand-logo { height: 44px; max-width: 200px; object-fit: contain; }
.search-box { max-width: 680px; margin: 0 auto; }
.engine-tabs { display: flex; gap: 6px; justify-content: center; margin-bottom: 10px; flex-wrap: wrap; }
.engine-tab { background: rgba(255,255,255,.15); color: #fff; border: none; padding: 5px 14px; border-radius: 20px; cursor: pointer; font-size: 13px; }
.engine-tab.active { background: #fff; color: var(--theme); font-weight: 600; }
.search-form { display: flex; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.15); }
.search-form input { flex: 1; border: none; padding: 15px 18px; font-size: 16px; outline: none; min-width: 0; }
.search-form button { border: none; background: var(--theme); color: #fff; padding: 0 26px; font-size: 16px; cursor: pointer; }

main.container { margin-top: -28px; padding-bottom: 30px; }

/* 公告 */
.notice-bar { display: flex; gap: 12px; background: var(--card); border-radius: 12px; padding: 14px 18px; margin-bottom: 18px; box-shadow: 0 2px 8px rgba(0,0,0,.05); position: relative; }
.notice-icon { font-size: 20px; }
.notice-list { flex: 1; font-size: 14px; color: #374151; }
.notice-item + .notice-item { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border); }

/* 广告 */
.ad-zone { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-bottom: 18px; }
.ad-item { display: block; border-radius: 10px; overflow: hidden; background: var(--card); box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.ad-item img { display: block; width: 100%; height: auto; max-height: 120px; object-fit: cover; }
.ad-text { display: block; padding: 14px 16px; color: var(--theme); font-weight: 600; }

/* 分类导航 */
.cat-nav { position: sticky; top: 0; z-index: 10; display: flex; gap: 8px; overflow-x: auto; background: var(--card); padding: 10px 12px; border-radius: 12px; margin-bottom: 18px; box-shadow: 0 2px 8px rgba(0,0,0,.05); scrollbar-width: none; }
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav a { white-space: nowrap; padding: 6px 14px; border-radius: 20px; font-size: 14px; background: var(--bg); }
.cat-nav a:hover { background: var(--theme); color: #fff; }

/* 分类区块 */
.cat-section { background: var(--card); border-radius: 12px; padding: 18px; margin-bottom: 18px; box-shadow: 0 2px 8px rgba(0,0,0,.05); scroll-margin-top: 70px; }
.cat-title { font-size: 17px; margin: 0 0 14px; }
.cat-title small { font-size: 12px; color: var(--muted); font-weight: normal; margin-left: 8px; }
.link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.link-card { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 10px; border: 1px solid var(--border); transition: all .15s; min-width: 0; }
.link-card:hover { border-color: var(--theme); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.08); }
.link-icon { flex-shrink: 0; width: 38px; height: 38px; }
.link-icon img { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; }
.link-letter { width: 38px; height: 38px; border-radius: 8px; background: var(--theme); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px; }
.link-text { min-width: 0; display: flex; flex-direction: column; }
.link-text strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-text small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.search-empty { display: none; background: var(--card); border-radius: 12px; padding: 30px; text-align: center; color: var(--muted); margin-bottom: 18px; }
.empty-site { background: var(--card); border-radius: 12px; padding: 50px; text-align: center; color: var(--muted); }

.friend-links { background: var(--card); border-radius: 12px; padding: 16px 18px; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.friend-links h3 { margin: 0 0 10px; font-size: 15px; }
.friend-links div { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; }
.friend-links a { color: var(--muted); }
.friend-links a:hover { color: var(--theme); }

.site-footer { text-align: center; color: var(--muted); font-size: 13px; padding: 24px 0 36px; }
.site-footer p { margin: 4px 0; }
.site-footer a:hover { color: var(--theme); }

.back-top { position: fixed; right: 20px; bottom: 30px; width: 42px; height: 42px; border-radius: 50%; border: none; background: var(--theme); color: #fff; font-size: 18px; cursor: pointer; box-shadow: 0 6px 16px rgba(0,0,0,.2); display: none; }

/* 收录申请页 */
.page-submit { padding: 30px 0; }
.submit-card { background: var(--card); border-radius: 16px; padding: 28px; box-shadow: 0 6px 24px rgba(0,0,0,.06); }
.submit-card h1 { margin: 6px 0; font-size: 22px; }
.muted { color: var(--muted); font-size: 14px; }
.back-link { color: var(--theme); font-size: 14px; }
.submit-form label { display: block; font-size: 14px; color: #4b5563; margin: 14px 0 6px; }
.submit-form input, .submit-form select, .submit-form textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 15px; font-family: inherit; }
.submit-form button { width: 100%; margin-top: 22px; padding: 12px; border: none; border-radius: 8px; background: var(--theme); color: #fff; font-size: 16px; cursor: pointer; }
.alert { padding: 12px 14px; border-radius: 8px; margin: 12px 0; font-size: 14px; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-danger { background: #fee2e2; color: #991b1b; }

@media (max-width: 640px) {
  .hero { padding: 28px 0 48px; }
  .brand h1 { font-size: 24px; }
  .link-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .link-card { padding: 10px 8px; }
  .search-form button { padding: 0 16px; }
}
