/* AItop搜 · 通用样式 */

:root {
  --bg: #F5F6FA;
  --surface: #FFFFFF;
  --surface-2: #FAFBFE;
  --line: #E9EBF2;
  --line-2: #F2F3F8;
  --text: #171A22;
  --text-2: #5A6172;
  --text-3: #8A91A3;
  --text-4: #B6BCCB;
  --brand: #4F46E5;
  --brand-2: #7C3AED;
  --brand-soft: rgba(79, 70, 229, .08);
  --red: #EF4444;
  --orange: #F59E0B;
  --green: #10B981;
  --blue: #3B82F6;
  --purple: #8B5CF6;
  --cyan: #06B6D4;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 20, 40, .04), 0 8px 24px rgba(16, 20, 40, .06);
  --shadow-lg: 0 16px 48px rgba(16, 20, 40, .16);
  --head-h: 60px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.wrap {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- 通用控件 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: .18s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}
.btn-primary:hover { color: #fff; filter: brightness(1.06); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-danger { color: var(--red); border-color: rgba(239, 68, 68, .3); }
.btn-danger:hover { background: var(--red); border-color: var(--red); color: #fff; }

input, select, textarea {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: .18s;
}
textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

.field { margin-bottom: 14px; }
.field > label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- 顶栏 ---------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--head-h);
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.head-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--head-h);
  gap: 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.3px;
}
.logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 700;
}
.logo span { color: var(--brand); }
.head-nav { display: flex; align-items: center; gap: 6px; }
.head-nav a {
  height: 34px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-2);
}
.head-nav a:hover { background: var(--surface-2); color: var(--brand); }
.head-nav a.on { color: var(--brand); background: var(--brand-soft); font-weight: 600; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: #0E1020;
  color: #fff;
  padding: 54px 0 46px;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(700px 320px at 12% 0%, rgba(124, 58, 237, .55), transparent 70%),
    radial-gradient(600px 300px at 85% 20%, rgba(6, 182, 212, .35), transparent 70%),
    linear-gradient(180deg, #141734, #0E1020);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, .6), transparent 85%);
}
.hero > .wrap { position: relative; z-index: 2; }
.hero h1 {
  margin: 0 0 12px;
  font-size: 34px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -.5px;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(120deg, #A78BFA, #22D3EE);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  margin: 0 0 26px;
  color: rgba(255, 255, 255, .68);
  font-size: 15px;
}

.searchbar {
  display: flex;
  gap: 10px;
  max-width: 640px;
}
.searchbar input {
  height: 48px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  border-radius: 12px;
  font-size: 15px;
}
.searchbar input::placeholder { color: rgba(255, 255, 255, .45); }
.searchbar input:focus {
  border-color: rgba(167, 139, 250, .8);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, .25);
}
.searchbar .btn {
  height: 48px;
  padding: 0 24px;
  border-radius: 12px;
  font-size: 15px;
}

.stats {
  display: flex;
  gap: 34px;
  margin-top: 28px;
  flex-wrap: wrap;
}
.stat b {
  display: block;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
}
.stat span { font-size: 13px; color: rgba(255, 255, 255, .55); }

/* ---------- 工具条 ---------- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 22px 0 16px;
  flex-wrap: wrap;
}
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab {
  height: 34px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 14px;
  color: var(--text-2);
  cursor: pointer;
  transition: .18s;
}
.tab:hover { border-color: var(--brand); color: var(--brand); }
.tab.on {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}
.tab .n { font-size: 12px; opacity: .65; }
.filters { display: flex; gap: 10px; }
.filters select { width: auto; min-width: 118px; height: 34px; font-size: 13px; }

/* ---------- 卡片 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 14px;
  padding-bottom: 40px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: .2s;
  overflow: hidden;
}
.card:hover {
  border-color: rgba(79, 70, 229, .35);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.card-icon {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 20px;
}
.card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-org {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--text-3);
}
.card-summary {
  margin: 0 0 12px;
  font-size: 13.5px;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 42px;
}
.benefit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px;
  font-weight: 600;
  max-width: 100%;
}
.benefit span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  font-size: 12px;
  color: var(--text-3);
}
.deadline {
  flex: none;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-3);
  white-space: nowrap;
}
.deadline.urgent { color: var(--red); }
.deadline.soon { color: var(--orange); }
.deadline.open { color: var(--green); }
.deadline.over { color: var(--text-4); }

.badge-featured {
  position: absolute;
  top: 0;
  right: 0;
  padding: 3px 10px;
  border-radius: 0 var(--radius) 0 10px;
  background: linear-gradient(135deg, var(--orange), #FB7185);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
}

.skeleton {
  height: 208px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, #EEF0F6 25%, #F6F7FB 37%, #EEF0F6 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ---------- 空状态 / 提示 ---------- */
.empty {
  padding: 70px 20px;
  text-align: center;
  color: var(--text-3);
}
.empty .ico { font-size: 40px; margin-bottom: 10px; }

.notice {
  margin: 16px 0;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  color: #92400E;
  font-size: 13.5px;
}
.notice.err { background: #FEE2E2; border-color: #FECACA; color: #991B1B; }

/* ---------- 详情弹层 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(14, 16, 32, .5);
  backdrop-filter: blur(3px);
}
.modal-mask.on { display: flex; }
.modal {
  width: 100%;
  max-width: 560px;
  max-height: 86vh;
  overflow: auto;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 26px;
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.modal-head h2 { margin: 0; font-size: 20px; line-height: 1.4; }
.modal-close {
  flex: none;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 18px;
  cursor: pointer;
}
.modal-meta {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 8px 12px;
  margin: 16px 0;
  padding: 16px 0;
  border-top: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
  font-size: 14px;
}
.modal-meta dt { color: var(--text-3); font-size: 13px; }
.modal-meta dd { margin: 0; color: var(--text); }
.modal-body { font-size: 14.5px; color: var(--text-2); white-space: pre-wrap; }
.modal-actions { display: flex; gap: 10px; margin-top: 22px; }

/* ---------- 后台 ---------- */
.admin-shell { padding: 28px 0 60px; }
.page-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.page-title h1 { margin: 0; font-size: 22px; }
.page-title p { margin: 4px 0 0; font-size: 13.5px; color: var(--text-3); }

.login-box {
  max-width: 400px;
  margin: 60px auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 30px;
  box-shadow: var(--shadow);
}
.login-box h2 { margin: 0 0 6px; font-size: 20px; }
.login-box .tip { margin: 0 0 22px; font-size: 13.5px; color: var(--text-3); }
.otp-row { display: flex; gap: 8px; }
.otp-row input { flex: 1; }
.otp-row .btn { flex: none; width: 108px; }

.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.stat-card b { display: block; font-size: 25px; font-weight: 800; }
.stat-card span { font-size: 13px; color: var(--text-3); }

.admin-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.admin-bar input { max-width: 260px; }
.admin-bar select { width: auto; min-width: 130px; }
.admin-bar .spacer { flex: 1; }

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
}
th {
  background: var(--surface-2);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-3);
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
td .t { font-weight: 600; }
td .s { font-size: 12.5px; color: var(--text-3); }
.nowrap { white-space: nowrap; }
.ops { display: flex; gap: 6px; }

.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.pill.pub { background: #DCFCE7; color: #15803D; }
.pill.draft { background: #F1F3F8; color: #6B7280; }
.pill.closed { background: #FEE2E2; color: #B91C1C; }

.cat-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: 1px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-2);
}
.user-chip b { color: var(--text); }

/* ---------- 页脚 ---------- */
.site-foot {
  border-top: 1px solid var(--line);
  padding: 26px 0 40px;
  color: var(--text-3);
  font-size: 13px;
}
.site-foot p { margin: 0 0 6px; }

/* ---------- AI 工具导航 ---------- */
.nav-hero {
  background: #0E1020;
  color: #fff;
  padding: 46px 0 38px;
}
.nav-hero h1 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.4px;
}
.nav-hero > .wrap > p {
  margin: 0 0 20px;
  color: rgba(255, 255, 255, .62);
  font-size: 14.5px;
}
.nav-search { max-width: 560px; }
.nav-search input {
  height: 46px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  border-radius: 12px;
  font-size: 14.5px;
}
.nav-search input::placeholder { color: rgba(255, 255, 255, .45); }
.nav-search input:focus {
  border-color: rgba(167, 139, 250, .8);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, .25);
}
.nav-meta {
  margin: 16px 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, .5);
}
.nav-meta b { color: #fff; font-weight: 700; }

.nav-sec { padding: 30px 0 6px; }
.nav-sec-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.nav-sec-head h2 { margin: 0; font-size: 19px; font-weight: 800; }
.nav-sec-head span { font-size: 13px; color: var(--text-3); }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 14px;
}
.tool-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  transition: .18s;
}
.tool-card:hover {
  border-color: rgba(79, 70, 229, .35);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.tc-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.tc-icon {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}
.tc-id { display: flex; flex-direction: column; min-width: 0; }
.tc-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tc-sub { font-size: 12px; color: var(--text-3); }
.tc-desc {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tc-go { margin-top: auto; font-size: 12.5px; font-weight: 600; color: var(--brand); }

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  .hero { padding: 38px 0 34px; }
  .hero h1 { font-size: 25px; }
  .stats { gap: 22px; margin-top: 22px; }
  .stat b { font-size: 21px; }
  .grid { grid-template-columns: 1fr; }
  .toolbar { padding: 16px 0 12px; }
  .filters { width: 100%; }
  .filters select { flex: 1; }
  .field-row { grid-template-columns: 1fr; }
  .table-wrap { overflow-x: auto; }
  .head-nav a { padding: 0 8px; }
}
