/* ==========================================================================
   海21截屏 - 在线批量网址截屏工具
   全局样式：专业蓝白风格，PC 与移动端完整适配
   ========================================================================== */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #64748b;
  --border: #e2e8f0;
  --success: #16a34a;
  --success-bg: #dcfce7;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --warning: #b45309;
  --warning-bg: #fef3c7;
  --radius: 10px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 6px 24px rgba(15, 23, 42, .08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

/* ---------- 基础重置 ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
button { font-family: inherit; cursor: pointer; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
.section { padding: 60px 0; }
.section-head { text-align: center; max-width: 760px; margin: 0 auto 40px; }
.section-title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: .5px;
  margin-bottom: 12px;
}
.section-intro { color: var(--muted); font-size: 15px; }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.logo-badge {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), #60a5fa);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}
.nav-links { display: flex; gap: 26px; }
.nav-links a {
  color: var(--text-2);
  font-size: 14px;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ---------- Hero 区 ---------- */
.hero {
  padding: 64px 0 52px;
  text-align: center;
  background: linear-gradient(180deg, #eff6ff 0%, var(--bg) 100%);
}
.hero h1 {
  font-size: 40px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 16px;
}
.hero-sub {
  max-width: 720px;
  margin: 0 auto 26px;
  color: var(--text-2);
  font-size: 16px;
}
.hero-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.hero-tags span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 13px;
  color: var(--text-2);
  box-shadow: var(--shadow-sm);
}

/* ---------- 工具主面板 ---------- */
.tool-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-top: 36px;
  overflow: hidden;
  text-align: left;
}
.tool-body {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 0;
}
.tool-input {
  padding: 22px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.tool-input label {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 10px;
}
#urlInput {
  flex: 1;
  min-height: 180px;
  width: 100%;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: Consolas, "Courier New", var(--font);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  background: #fbfdff;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
#urlInput:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.input-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}
.input-meta .valid-count { color: var(--success); font-weight: 600; }
.input-meta .valid-count.error { color: var(--danger); }

/* 参数设置侧栏 */
.tool-settings {
  padding: 22px;
  background: #fafbfe;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.setting-group label, .setting-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-2);
}

/* 设备分段选择 */
.device-switch { display: flex; gap: 8px; }
.device-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 9px 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-2);
  transition: all .2s;
}
.device-btn .device-icon { font-size: 18px; line-height: 1; }
.device-btn:hover { border-color: var(--primary); color: var(--primary); }
.device-btn.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
}

select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13px;
  color: var(--text);
  outline: none;
}
select:focus { border-color: var(--primary); }

.setting-row { display: flex; align-items: center; gap: 14px; }
.setting-row .switch { flex-shrink: 0; }

/* 开关 */
.switch { position: relative; display: inline-flex; }
.switch input { position: absolute; opacity: 0; }
.switch-slider {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #cbd5e1;
  display: inline-block;
  position: relative;
  transition: background .2s;
  cursor: pointer;
}
.switch-slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: left .2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.switch input:checked + .switch-slider { background: var(--primary); }
.switch input:checked + .switch-slider::after { left: 21px; }

/* 自定义分辨率 */
.custom-size { margin-top: 8px; display: none; }
.custom-size.show { display: flex; align-items: center; gap: 6px; }
.custom-size input {
  width: 86px;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
}
.custom-size input:focus { border-color: var(--primary); }
.custom-size-x { color: var(--muted); }

/* 操作区 */
.tool-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  background: #fafbfe;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  transition: all .2s;
  background: var(--surface);
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, .3);
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost {
  border-color: var(--border);
  color: var(--text-2);
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn:disabled { opacity: .6; cursor: not-allowed; }

.run-status { margin-left: auto; font-size: 13px; color: var(--muted); }
.run-status strong { color: var(--primary); }

/* 进度条 */
.tool-progress {
  padding: 0 22px 18px;
  background: #fafbfe;
  display: none;
}
.tool-progress.show { display: block; }
.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--primary), #60a5fa);
  border-radius: 999px;
  transition: width .3s;
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

/* ---------- 截屏结果 ---------- */
.results-section { padding-top: 44px; }
.results-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.results-head h2 { font-size: 20px; }
#resultSummary { font-size: 13px; color: var(--muted); }
.results-head .btn { margin-left: auto; padding: 7px 16px; font-size: 13px; }

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}
.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  animation: fadeUp .3s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #eef2f7 center / cover no-repeat;
  border-bottom: 1px solid var(--border);
}
.card-media a { display: block; height: 100%; }
.card-status {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  z-index: 2;
}
.card-status.pending { background: #e2e8f0; color: var(--text-2); }
.card-status.running { background: var(--warning-bg); color: var(--warning); }
.card-status.success { background: var(--success-bg); color: var(--success); }
.card-status.error { background: var(--danger-bg); color: var(--danger); }
.card-error {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  background: rgba(255, 255, 255, .92);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  color: var(--danger);
}
.card-info {
  padding: 10px 12px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.card-url {
  max-width: 70%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-actions {
  display: flex;
  gap: 8px;
  padding: 0 12px 12px;
}
.card-actions button {
  flex: 1;
  padding: 6px 0;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  transition: all .2s;
}
.card-actions button:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}
.card-actions button:disabled { opacity: .45; cursor: not-allowed; }
.results-empty {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.results-empty strong { display: block; color: var(--text-2); margin-bottom: 6px; }

/* ---------- 核心功能 ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}
.feature-item {
  display: flex;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.feature-icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.feature-item h3 { font-size: 15px; margin-bottom: 4px; }
.feature-item p { font-size: 13px; color: var(--muted); }

/* ---------- 使用方法 ---------- */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
}
.step-item {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: var(--shadow-sm);
}
.step-num {
  position: absolute;
  top: -14px;
  left: 20px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(37, 99, 235, .35);
}
.step-item h3 { font-size: 15px; margin: 8px 0 6px; }
.step-item p { font-size: 13px; color: var(--muted); }

/* ---------- 使用场景 ---------- */
.scene-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}
.scene-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.scene-item h3 { font-size: 15px; margin-bottom: 6px; }
.scene-item p { font-size: 13px; color: var(--muted); }

/* ---------- 常见问题 ---------- */
.faq-list { max-width: 820px; margin: 0 auto; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}
.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  background: none;
  border: none;
  text-align: left;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.faq-arrow { transition: transform .25s; color: var(--muted); flex-shrink: 0; }
.faq-item.open .faq-arrow { transform: rotate(180deg); }
.faq-a {
  display: none;
  padding: 0 20px 16px;
  font-size: 14px;
  color: var(--text-2);
}
.faq-item.open .faq-a { display: block; }

/* ---------- 页脚 ---------- */
.site-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 44px 0 24px;
  margin-top: 20px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 30px;
  padding-bottom: 26px;
  border-bottom: 1px solid rgba(148, 163, 184, .18);
}
.footer-brand { font-size: 17px; font-weight: 700; color: #f1f5f9; margin-bottom: 10px; }
.footer-desc { font-size: 13px; line-height: 1.8; }
.site-footer h4 { color: #e2e8f0; font-size: 14px; margin-bottom: 12px; }
.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: #94a3b8; font-size: 13px; }
.footer-links a:hover { color: #fff; }
/* 友情链接 */
.friend-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px 10px;
  padding: 16px 0 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 13px;
}
.friend-links-title { color: #94a3b8; margin-right: 2px; }
.friend-links a { color: #94a3b8; }
.friend-links a:hover { color: #fff; }
.copyright {
  text-align: center;
  font-size: 12px;
  padding-top: 20px;
  color: #64748b;
}

/* ---------- Toast 提示 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, .92);
  color: #fff;
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 14px;
  z-index: 999;
  opacity: 0;
  transition: opacity .25s;
  pointer-events: none;
  max-width: 86vw;
}
.toast.show { opacity: 1; }

/* ---------- 响应式适配 ---------- */
@media (max-width: 992px) {
  .hero h1 { font-size: 32px; }
  .tool-body { grid-template-columns: 1fr; }
  .tool-input { border-right: none; border-bottom: 1px solid var(--border); }
}

@media (max-width: 768px) {
  .section { padding: 44px 0; }
  .section-title { font-size: 24px; }
  .hero { padding: 44px 0 36px; }
  .hero h1 { font-size: 27px; }
  .hero-sub { font-size: 14px; }
  .nav-links { display: none; }
  .tool-actions { padding: 14px 16px; }
  .tool-input, .tool-settings { padding: 16px; }
  .run-status { margin-left: 0; width: 100%; }
  .results-head .btn { margin-left: 0; }
  .results-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .btn { padding: 9px 18px; }
}

@media (max-width: 480px) {
  .device-btn { font-size: 12px; }
  .custom-size { flex-wrap: wrap; }
}
