/* 全局基础重置与排版 */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 30%, rgba(6, 182, 212, 0.06) 0%, transparent 45%);
  background-attachment: fixed;
  transition: background-color var(--transition-base), color var(--transition-base);
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

/* 导航栏 Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-base), border-color var(--transition-base);
}

.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  transition: opacity var(--transition-fast);
}

.logo:hover {
  opacity: 0.9;
}

.logo-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.1rem;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.35);
}

.logo-text {
  background: linear-gradient(120deg, var(--text-main) 60%, var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-search-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.45rem 0.95rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  min-width: 220px;
}

.header-search-btn:hover {
  border-color: var(--primary-border);
  color: var(--text-main);
  background: var(--bg-surface);
  box-shadow: 0 0 12px var(--primary-light);
}

.search-kbd {
  margin-left: auto;
  font-size: 0.72rem;
  background: var(--bg-badge);
  border: 1px solid var(--border-base);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  color: var(--text-subtle);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-toggle-btn {
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.1rem;
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  color: var(--text-main);
  border-color: var(--border-base);
  background: var(--bg-surface);
}

/* 主容器 */
.page-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  flex: 1;
  width: 100%;
}

/* 面包屑与标题区 */
.tool-header {
  margin-bottom: 2rem;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb-separator {
  color: var(--text-subtle);
}

.tool-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.tool-title {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.badge-privacy {
  background: var(--accent-emerald-light);
  color: var(--accent-emerald);
  border-color: rgba(16, 185, 129, 0.25);
}

.badge-hot {
  background: var(--accent-rose-light);
  color: var(--accent-rose);
  border-color: rgba(244, 63, 94, 0.25);
}

.badge-dev {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-border);
}

.tool-desc {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 800px;
  line-height: 1.6;
}

/* 工具卡片与布局面板 */
.tool-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
  margin-bottom: 2rem;
}

.tool-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
}

.tool-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* 拖拽上传区 */
.dropzone {
  border: 2px dashed var(--border-base);
  border-radius: var(--radius-md);
  padding: 3rem 1.5rem;
  text-align: center;
  cursor: pointer;
  background: var(--bg-surface-alt);
  transition: all var(--transition-fast);
  position: relative;
  user-select: none;
}

.dropzone:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.dropzone.dragover {
  border-color: var(--primary) !important;
  background: var(--primary-light) !important;
  box-shadow: 0 0 24px var(--primary-glow) !important;
  border-style: solid !important;
  transform: scale(1.008);
}

.dropzone * {
  pointer-events: none;
}

.dropzone-icon {
  font-size: 2.8rem;
  margin-bottom: 0.85rem;
  display: inline-block;
  color: var(--primary);
}

.dropzone-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}

.dropzone-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.dropzone input[type="file"] {
  display: none !important;
}

/* 按钮通用组件 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: #fff;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-surface-alt);
  border-color: var(--border-base);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: var(--bg-surface);
  border-color: var(--primary-border);
  color: var(--primary);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.15);
  border-color: rgba(244, 63, 94, 0.3);
  color: var(--accent-rose);
}

.btn-danger:hover {
  background: var(--accent-rose);
  color: #fff;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
}

/* 表单组件 */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
  color: var(--text-main);
}

.form-input, .form-select, .form-textarea, .input-text {
  width: 100%;
  padding: 0.65rem 0.95rem;
  background: var(--bg-input);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
  box-sizing: border-box;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus, .form-select:focus, .form-textarea:focus, .input-text:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

select.form-select, select.input-text {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.25rem;
  cursor: pointer;
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

/* 范围滑动条 Slider */
.slider-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.slider-range {
  flex: 1;
  accent-color: var(--primary);
  height: 6px;
  border-radius: 3px;
  background: var(--bg-surface-alt);
  cursor: pointer;
}

.slider-badge {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-xs);
  min-width: 48px;
  text-align: center;
}

/* 开关 Switch */
.switch-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  font-size: 0.9rem;
}

.switch-input {
  position: relative;
  width: 42px;
  height: 22px;
  appearance: none;
  background: var(--border-base);
  outline: none;
  border-radius: 22px;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.switch-input:checked {
  background: var(--primary);
}

.switch-input::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform var(--transition-fast);
}

.switch-input:checked::before {
  transform: translateX(20px);
}

/* 密码与文本框一键复制栏 */
.copy-input-group {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-md);
  padding: 0.4rem 0.5rem 0.4rem 1rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.copy-input-group:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.copy-input-group input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 1.1rem;
}

/* 栅格与分栏布局 */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

@media (max-width: 860px) {
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* FAQ 模块 (Schema.org 支撑) */
.faq-section {
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border-subtle);
}

.faq-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text-main);
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.faq-item {
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.faq-question {
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.faq-answer {
  padding: 0 1.25rem 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* 底部全站通用 Footer */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 3.5rem 1.5rem 2rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: auto;
}

.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
}

.footer-brand h4 {
  font-size: 1.1rem;
  color: var(--text-main);
  margin-bottom: 0.6rem;
  font-weight: 700;
}

.footer-col h5 {
  font-size: 0.92rem;
  color: var(--text-main);
  margin-bottom: 0.85rem;
  font-weight: 600;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.82rem;
  color: var(--text-subtle);
}

/* 全局吐司提示 Toast */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: var(--bg-surface);
  border: 1px solid var(--border-base);
  box-shadow: var(--shadow-lg);
  color: var(--text-main);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  pointer-events: auto;
  animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 全局 Cmd+K 搜索弹窗 */
.search-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
}

.search-modal-backdrop.active {
  display: flex;
}

.search-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-base);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 620px;
  overflow: hidden;
  animation: modalScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.search-modal-input-wrap {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  gap: 0.75rem;
}

.search-modal-input {
  flex: 1;
  background: transparent;
  border: none;
  font-size: 1.05rem;
  outline: none;
  color: var(--text-main);
}

.search-results-list {
  max-height: 380px;
  overflow-y: auto;
  padding: 0.5rem;
}

.search-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.search-item:hover, .search-item.selected {
  background: var(--primary-light);
  color: var(--text-main);
}

.search-item-icon {
  font-size: 1.2rem;
}

.search-item-info {
  flex: 1;
}

.search-item-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
}

.search-item-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.search-modal-footer {
  padding: 0.6rem 1rem;
  background: var(--bg-surface-alt);
  border-top: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  color: var(--text-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* 响应式适配 */
@media (max-width: 768px) {
  .header-search-btn {
    min-width: auto;
    padding: 0.45rem 0.65rem;
  }
  .header-search-btn .search-text,
  .header-search-btn .search-kbd {
    display: none;
  }
  .footer-top {
    grid-template-columns: 1fr;
  }
  .page-container {
    padding: 1.25rem 1rem 3rem;
  }
  .tool-title {
    font-size: 1.5rem;
  }
}
