/* 响应式：移动紧凑 / 桌面居中宽屏布局 */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eff6ff;
  --warn-bg: #fffbeb;
  --warn-border: #fde68a;
  --warn-text: #92400e;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 30px rgba(15, 23, 42, 0.08);
  --shell-max: 1080px;
  --header-h: 64px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}

.hidden {
  display: none !important;
}

.shell {
  width: 100%;
  max-width: var(--shell-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* —— 维护页 —— */
.maintenance {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}

.maintenance-card {
  max-width: 420px;
  text-align: center;
  padding: 48px 36px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.maintenance-icon {
  font-size: 40px;
  margin-bottom: 16px;
}

.maintenance h1 {
  margin: 0 0 10px;
  font-size: 1.35rem;
}

.maintenance p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* —— 应用骨架 —— */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 顶栏 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.header-row {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: var(--header-h);
  padding-top: 10px;
  padding-bottom: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.brand-sub {
  margin: 0;
  font-size: 0.7rem;
  color: var(--text-muted);
  display: none;
}

.search-form {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.search-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  background: var(--surface);
}

.search-field-icon {
  flex-shrink: 0;
  color: var(--text-muted);
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.95rem;
  color: var(--text);
  min-width: 0;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-clear {
  flex-shrink: 0;
  border: none;
  background: var(--border);
  color: var(--text-secondary);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.search-submit {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 18px;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.search-submit:hover:not(:disabled) {
  background: var(--accent-hover);
}

.search-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.search-submit-icon {
  display: none;
}

/* 主内容区 */
.page-wrap {
  flex: 1;
  padding-top: 20px;
  padding-bottom: 24px;
}

.disclaimer {
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius);
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--warn-text);
}

.content-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  min-height: 360px;
}

/* 空态 / 加载 */
.state-panel {
  text-align: center;
  padding: 48px 28px 56px;
  color: var(--text-secondary);
}

.state-panel h2 {
  margin: 12px 0 8px;
  font-size: 1.15rem;
  color: var(--text);
  font-weight: 600;
}

.state-panel p {
  margin: 0;
  font-size: 0.9rem;
}

/* —— 首屏 Hero —— */
.hero-section {
  position: relative;
  overflow: hidden;
  padding: 36px 24px 40px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(37, 99, 235, 0.08), transparent 70%),
    linear-gradient(180deg, #f8fbff 0%, var(--surface) 55%);
}

.hero-bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(48px);
  opacity: 0.55;
}

.hero-bg-blob--1 {
  width: 280px;
  height: 280px;
  top: -80px;
  right: -60px;
  background: rgba(99, 102, 241, 0.18);
}

.hero-bg-blob--2 {
  width: 220px;
  height: 220px;
  bottom: -40px;
  left: -40px;
  background: rgba(37, 99, 235, 0.12);
}

.hero-inner {
  position: relative;
  max-width: 880px;
  margin: 0 auto;
}

.hero-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
  margin-bottom: 32px;
}

.hero-illus {
  position: relative;
  width: 88px;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-illus-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #eff6ff 0%, #e0e7ff 100%);
  border: 1px solid rgba(37, 99, 235, 0.12);
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.12);
  animation: hero-float 4s ease-in-out infinite;
}

.hero-illus-icon {
  position: relative;
  color: var(--accent);
}

@keyframes hero-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

.hero-copy {
  max-width: 560px;
  text-align: center;
}

.hero-title {
  margin: 0 0 10px;
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.hero-desc {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.hero-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 28px;
}

.hero-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 18px 18px 16px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.hero-card:hover {
  border-color: #bfdbfe;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.08);
  transform: translateY(-2px);
}

.hero-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-card-icon--blue {
  background: #eff6ff;
  color: #2563eb;
}

.hero-card-icon--violet {
  background: #f5f3ff;
  color: #7c3aed;
}

.hero-card-icon--emerald {
  background: #ecfdf5;
  color: #059669;
}

.hero-card-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.hero-card-desc {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.state-icon {
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 8px;
}

.loading-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}

.loading-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.2s ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes pulse {
  0%,
  80%,
  100% {
    transform: scale(0.65);
    opacity: 0.45;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.loading-text {
  font-size: 1rem;
  color: var(--text);
  margin: 0 0 6px;
}

.loading-text strong {
  color: var(--accent);
  font-weight: 600;
}

.loading-sub {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* 按钮 */
.btn-outline {
  margin-top: 20px;
  padding: 10px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.btn-outline--sm {
  margin-top: 0;
  padding: 7px 14px;
  font-size: 0.8rem;
}

.btn-accent {
  border: none;
  border-radius: var(--radius);
  padding: 11px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  transition: background 0.15s;
}

.btn-accent:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-accent:disabled {
  opacity: 0.65;
  cursor: wait;
}

/* 结果区 */
.result-section {
  padding: 20px 20px 16px;
}

.result-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.result-summary {
  flex: 1;
  min-width: 0;
}

.result-count {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.result-kw {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-left: 6px;
}

.result-pending {
  display: block;
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--accent);
}

.result-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.card:hover {
  border-color: #bfdbfe;
  box-shadow: var(--shadow-sm);
}

.card-body {
  flex: 1;
  min-width: 0;
}

.card-title {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.card-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 500;
}

.card-meta-sep {
  color: var(--border-strong);
}

.card-action {
  flex-shrink: 0;
}

.card-action .btn-accent {
  width: 100%;
  padding: 10px 16px;
}

.load-more {
  text-align: center;
  padding: 20px 0 8px;
}

.load-more .btn-outline {
  margin-top: 0;
}

.result-foot {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* 页脚 */
.site-footer {
  padding: 16px 0 24px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-sep {
  margin: 0 6px;
  opacity: 0.5;
}

/* 弹窗 */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
}

.modal-dialog {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px 22px 20px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

.modal-title {
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-weight: 600;
}

.modal-sub {
  margin: 0 0 16px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.modal-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0 0 16px;
}

.field-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.link-text {
  margin: 0 0 12px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.8rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 180px;
  overflow: auto;
  font-family: ui-monospace, Consolas, monospace;
}

.link-tip {
  font-size: 0.78rem;
  color: var(--warn-text);
  margin: 0 0 16px;
}

.block-kw {
  display: block;
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 12px;
}

.textarea {
  width: 100%;
  min-height: 88px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 0.9rem;
  resize: vertical;
  font-family: inherit;
}

.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.modal-actions .btn-outline,
.modal-actions .btn-accent {
  flex: 1;
  margin-top: 0;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  z-index: 300;
  padding: 10px 20px;
  background: var(--text);
  color: #fff;
  border-radius: 999px;
  font-size: 0.875rem;
  pointer-events: none;
  box-shadow: var(--shadow-md);
}

/* —— 平板 —— */
@media (min-width: 640px) {
  .brand-sub {
    display: block;
  }

  .brand-name {
    max-width: 200px;
    font-size: 1.05rem;
  }

  .hero-cards {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }

  .hero-title {
    font-size: 1.85rem;
  }

  .result-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .card {
    flex-direction: column;
    height: 100%;
  }

  .card-action {
    margin-top: auto;
  }
}

/* —— 桌面 —— */
@media (min-width: 900px) {
  :root {
    --header-h: 72px;
  }

  .header-row {
    gap: 32px;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .brand-name {
    max-width: none;
    font-size: 1.1rem;
  }

  .search-form {
    max-width: 640px;
    margin-left: auto;
    margin-right: 0;
  }

  .search-submit-text {
    display: inline;
  }

  .page-wrap {
    padding-top: 28px;
    padding-bottom: 32px;
  }

  .content-panel {
    min-height: 420px;
  }

  .hero-section {
    padding: 44px 36px 48px;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-desc {
    font-size: 1rem;
  }

  .result-section {
    padding: 24px 28px 20px;
  }

  /* 宽屏单列列表，横向卡片更易读 */
  .result-list {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .card {
    flex-direction: row;
    align-items: center;
    gap: 20px;
    padding: 16px 20px;
    background: var(--surface);
  }

  .card-action .btn-accent {
    width: auto;
    min-width: 108px;
    white-space: nowrap;
  }
}

/* —— 大屏双列 —— */
@media (min-width: 1200px) {
  :root {
    --shell-max: 1140px;
  }

  .result-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .card {
    flex-direction: column;
    align-items: stretch;
    height: 100%;
  }

  .card-action .btn-accent {
    width: 100%;
  }
}

/* —— 小屏手机 —— */
@media (max-width: 520px) {
  .shell {
    padding-left: 14px;
    padding-right: 14px;
  }

  .header-row {
    flex-wrap: wrap;
    gap: 10px;
  }

  .brand {
    width: 100%;
  }

  .brand-name {
    max-width: none;
  }

  .search-form {
    width: 100%;
  }

  .search-submit {
    padding: 0 14px;
  }

  .search-submit-text {
    display: none;
  }

  .search-submit-icon {
    display: block;
  }

  .hero-section {
    padding: 28px 16px 32px;
  }

  .hero-head {
    gap: 16px;
    margin-bottom: 24px;
  }

  .hero-illus {
    width: 72px;
    height: 72px;
  }

  .hero-illus-icon {
    width: 32px;
    height: 32px;
  }

  .hero-title {
    font-size: 1.35rem;
  }

  .result-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .result-toolbar .btn-outline--sm {
    width: 100%;
  }
}
