:root {
  --bg: #ffffff;
  --surface: #fff7ed;
  --primary: #1e293b;
  --text: #1e293b;
  --text2: #64748b;
  --text3: #94a3b8;
  --link: #c2410c;
  --link-hover: #c2410c;
  --link-visited: #9a3412;
  --accent: #f97316;
  --border: #e5e7eb;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body { font-family: -apple-system, 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; font-display: swap; }
a { color: var(--link); text-decoration: none; }

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

/* ===== HEADER ===== */
.search-header { display: flex; align-items: center; gap: 16px; padding: 16px 0; }
.search-logo { display: flex; align-items: center; }
.search-header-form { display: flex; flex: 1; max-width: 560px; border: 1px solid var(--border); border-radius: 50px; background: #fff; transition: all 0.2s; padding: 3px; }
.search-header-form:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(249,115,22,0.12); }
.search-header-form input { flex: 1; padding: 7px 16px; border: none; outline: none; font-size: 14px; background: transparent; }
.search-header-form button { background: var(--accent); border: none; border-radius: 50px; cursor: pointer; color: #fff; display: flex; align-items: center; gap: 4px; padding: 7px 16px; flex-shrink: 0; font-size: 13px; font-weight: 500; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); position: relative; overflow: hidden; }
.search-header-form button::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%); border-radius: 50px; pointer-events: none; }
.search-header-form button:hover { background: #ea580c; transform: scale(1.04); box-shadow: 0 3px 10px rgba(249,115,22,0.3); }
.search-header-form button:active { transform: scale(0.96); transition-duration: 0.08s; }
.search-submit { font-size: 13px; color: var(--text3); white-space: nowrap; transition: color 0.15s; margin-left: auto; }
.search-submit:hover { color: var(--accent); text-decoration: none; }

/* ===== INDEX PAGE ===== */
.index-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 15vh 24px 24px; }
.index-logo { margin-bottom: 36px; }
.index-search { width: 100%; max-width: 640px; }
.index-search-box { display: flex; border: 2px solid var(--border); border-radius: 50px; box-shadow: var(--shadow-sm); transition: all 0.2s; background: #fff; padding: 4px; }
.index-search-box:hover { box-shadow: var(--shadow-md); border-color: #d1d5db; }
.index-search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(249,115,22,0.15); }
.index-search-box input { flex: 1; padding: 11px 20px; border: none; outline: none; font-size: 16px; background: transparent; }
.index-search-box button { border: none; border-radius: 50px; background: var(--accent); cursor: pointer; color: #fff; display: flex; align-items: center; justify-content: center; transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); flex-shrink: 0; padding: 11px 24px; gap: 6px; font-size: 15px; font-weight: 500; position: relative; overflow: hidden; }
.index-search-box button::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%); border-radius: 50px; pointer-events: none; }
.index-search-box button:hover { background: #ea580c; transform: scale(1.03); box-shadow: 0 4px 12px rgba(249,115,22,0.35); }
.index-search-box button:active { transform: scale(0.97); box-shadow: 0 2px 6px rgba(249,115,22,0.25); transition-duration: 0.08s; }

.index-hot-list { margin-top: 36px; width: 100%; max-width: 620px; }
.index-hot-list h2 { font-size: 12px; color: var(--text3); letter-spacing: 2px; font-weight: 600; margin-bottom: 14px; text-align: left; }
.index-hot-items { display: flex; gap: 24px; }
.index-hot-col { list-style: none; flex: 1; min-width: 0; }
.index-hot-col li { font-size: 13px; padding: 5px 0; display: flex; align-items: center; gap: 6px; }
.index-hot-col li a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.index-hot-col a { color: var(--text); }
.index-hot-col a:hover { color: var(--link); }
.index-hot-col .num { display: inline-block; width: 18px; height: 18px; text-align: center; line-height: 18px; font-size: 11px; font-weight: 600; color: #fff; background: var(--accent); border-radius: 4px; flex-shrink: 0; }
.index-hot-col .num.off { background: var(--border); color: var(--text3); }

/* ===== TWO-COLUMN SEARCH LAYOUT ===== */
.search-page { display: flex; flex-direction: column; min-height: 100vh; overflow-x: hidden; }
.search-page .container { flex: 1; display: flex; flex-direction: column; min-width: 0; max-width: 100vw; overflow-x: hidden; }
.search-layout { display: flex; gap: 50px; padding: 20px 0 40px; align-items: flex-start; width: 1100px; margin: 0 auto; min-width: 0; }
.search-main { flex: 1; min-width: 0; overflow: hidden; }
.search-side { width: 280px; flex-shrink: 0; min-width: 0; }

/* results list */
.result-item { padding: 15px 0; overflow: hidden; min-width: 0; max-width: 100%; box-sizing: border-box; }
.result-item:last-of-type { border-bottom: none; }
.result-item h2 { font-size: 18px; font-weight: 400; line-height: 1.4; margin: 0; min-width: 0; max-width: 100%; width: 100%; overflow: hidden; box-sizing: border-box; }
.result-item h2 a { color: var(--text); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; max-width: 100%; width: 100%; box-sizing: border-box; }
.result-item h2 a:visited { color: var(--text); }
.result-item h2 a:hover { color: var(--link); }
.result-item .desc { font-size: 14px; color: var(--text2); line-height: 1.58; margin: 4px 0; overflow: hidden; }
.result-item .url { font-size: 13px; color: #94a3b8; margin: 6px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.result-item .url a { color: inherit; }
.result-item .url a:hover { text-decoration: none; }

/* sidebar */
.side-card { padding: 0; margin-bottom: 24px; }
.side-list { list-style: none; }
.side-list li { padding: 6px 0; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.side-list li a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.hot-badge { font-size: 11px; color: var(--text3); white-space: nowrap; flex-shrink: 0; }
.side-list a { color: var(--text); }
.side-list a:hover { color: var(--link); text-decoration: none; }
.side-list .num { display: inline-block; width: 18px; height: 18px; text-align: center; line-height: 18px; font-size: 11px; font-weight: 600; color: #fff; background: var(--accent); border-radius: 4px; flex-shrink: 0; }
.side-list .num.off { background: var(--border); color: var(--text3); }
.side-ad { border-radius: var(--radius-lg); margin-bottom: 20px; overflow: hidden; }
.side-ad a { display: block; }
.side-ad img { width: 100%; display: block; }

/* pagination */
.pagination { display: flex; align-items: center; justify-content: center; gap: 4px; margin: 28px 0 40px; }
.pagination a, .pagination span { display: inline-flex; align-items: center; gap: 4px; padding: 7px 13px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; color: var(--text2); background: #fff; transition: 0.12s; }
.pagination a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.pagination .active { background: var(--accent); color: #fff; border-color: var(--accent); }
.pagination .active:hover { color: #fff; }
.pagination .disabled { color: var(--text3); border-color: var(--border); opacity: 0.4; cursor: default; background: transparent; }

/* empty */
.result-empty { text-align: center; padding: 80px 24px; width: 100%; box-sizing: border-box; }
.result-empty svg { margin-bottom: 16px; opacity: 0.5; }
.result-empty .msg { font-size: 15px; color: var(--text2); margin-bottom: 6px; }
.result-empty .hint { font-size: 13px; color: var(--text3); }
.result-empty .hint a { color: var(--link); }

/* footer */
.search-footer { text-align: center; padding: 20px 0 28px; font-size: 12px; color: var(--text3); }
.search-footer a { color: var(--text3); }
.search-footer a:hover { color: var(--text2); text-decoration: none; }

/* semantic elements */
.index-page h1, .result-stat { font-size: 13px; font-weight: 400; color: var(--text3); margin-bottom: 8px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.side-card h2 { font-size: 13px; font-weight: 700; color: var(--primary); margin-bottom: 14px; }
.side-card h2 svg { vertical-align: -2px; margin-right: 6px; }
article.result-item { display: block; }

/* ===== DETAIL ===== */
.detail-wrap { max-width: 800px; margin: 0 auto; padding: 28px 0 40px; }
.detail-back { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--text3); margin-bottom: 20px; }
.detail-back:hover { color: var(--link); text-decoration: none; }
.detail-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px; }
.detail-card h1 { font-size: 24px; font-weight: 700; margin-bottom: 24px; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
.detail-grid .dt { font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
.detail-grid .dd { font-size: 15px; font-weight: 500; margin-top: 4px; }
.detail-grid .dd a { color: var(--link); }
.detail-grid .dd a:visited { color: var(--link-visited); }
.detail-desc { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border); }
.detail-desc .dt { font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
.detail-desc p { font-size: 15px; line-height: 1.8; color: var(--text2); margin-top: 8px; }

.tag-rec { font-size: 11px; padding: 2px 10px; border-radius: 10px; background: #fef3c7; color: #d97706; font-weight: 600; margin-left: 6px; vertical-align: middle; }
.tag-ok { color: #059669; }
.tag-off { color: #dc2626; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .search-page { overflow-x: hidden; }
  .container { padding: 0 16px; }

  /* 首页 */
  .index-page { padding: 10vh 16px 24px; }
  .index-logo img { height: 36px; }
  .index-hot-items { flex-direction: column; gap: 0; }
  .index-hot-col:last-child { display: none; }
  .index-search-box input { padding: 10px 16px; font-size: 16px; }
  .index-search-box button { padding: 10px 18px; font-size: 14px; }

  /* 搜索页头部 */
  .search-header { flex-wrap: wrap; gap: 8px; padding: 12px 0; overflow: hidden; }
  .search-logo { flex-shrink: 0; margin: 4px 0; }
  .search-logo img { height: 22px; }
  .search-submit { flex-shrink: 0; font-size: 12px; }
  .search-header-form { flex: 1 1 100%; max-width: 100%; order: 1; min-width: 0; overflow: hidden; }
  .search-header-form input { padding: 9px 14px; font-size: 15px; min-width: 0; }
  .search-header-form button { padding: 9px 14px; flex-shrink: 0; }

  /* 搜索结果布局 - 单列 */
  .search-layout { flex-direction: column; gap: 0; padding: 8px 0 24px; width: 100%; max-width: 100vw; overflow-x: hidden; }
  .search-main { width: 100%; max-width: 100%; min-width: 0; overflow-x: hidden; }
  .search-side { width: 100%; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); overflow-x: hidden; }

  /* 搜索结果 */
  .result-item { padding: 12px 0; width: 100%; max-width: 100vw; overflow: hidden; box-sizing: border-box; }
  .result-item h2 { width: 100%; max-width: 100%; overflow: hidden; box-sizing: border-box; }
  .result-item h2 a { font-size: 16px; width: 100%; max-width: 100%; box-sizing: border-box; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
  .result-item .desc { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; max-width: 100%; overflow: hidden; }
  .result-item .url { font-size: 12px; max-width: 100%; overflow: hidden; }
  .result-stat { font-size: 12px; }

  /* 分页 */
  .pagination { gap: 3px; margin: 20px 0 28px; }
  .pagination a, .pagination span { padding: 6px 10px; font-size: 12px; }

  /* 空结果 */
  .result-empty { padding: 48px 16px; }
  .result-empty svg { width: 40px; height: 40px; }
  .result-empty .msg { font-size: 14px; }
  .result-empty .hint { font-size: 12px; }

  /* 底部 */
  .search-footer { padding: 16px 0 20px; font-size: 11px; }
}

@media (max-width: 480px) {
  .index-page { padding: 8vh 12px 20px; }
  .index-logo img { height: 30px; }
  .index-search-box { padding: 3px; }
  .index-search-box input { padding: 9px 14px; font-size: 15px; }
  .index-search-box button { padding: 9px 14px; font-size: 13px; }
  .index-hot-list { margin-top: 24px; }
  .index-hot-col li { font-size: 12px; padding: 4px 0; }

  .search-header { gap: 10px; }
  .search-header-form input { padding: 8px 12px; font-size: 14px; }
  .search-header-form button { padding: 8px 12px; font-size: 12px; }

  .result-item h2 { font-size: 15px; max-width: 100%; overflow: hidden; }
  .result-item h2 a { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
  .result-item .desc { font-size: 12px; line-height: 1.5; max-width: 100%; overflow: hidden; }

  .pagination a, .pagination span { padding: 5px 8px; font-size: 11px; }
}
