/* assets/tool.css */

/* ── 基础变量 ─────────────────────────────────────────────── */
:root {
  --bog-primary:     #4f46e5;
  --bog-primary-h:   #4338ca;
  --bog-success:     #059669;
  --bog-danger:      #dc2626;
  --bog-warning:     #d97706;
  --bog-bg:          #f8fafc;
  --bog-card:        #ffffff;
  --bog-border:      #e2e8f0;
  --bog-text:        #1e293b;
  --bog-text-muted:  #64748b;
  --bog-radius:      12px;
  --bog-shadow:      0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --bog-shadow-lg:   0 4px 6px rgba(0,0,0,.05), 0 10px 30px rgba(0,0,0,.10);
}

/* ── 容器 ─────────────────────────────────────────────────── */
.bog-container {
  max-width: 860px;
  margin: 40px auto;
  padding: 0 16px 80px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--bog-text);
  box-sizing: border-box;
}

/* ── 标题区 ───────────────────────────────────────────────── */
.bog-header {
  text-align: center;
  margin-bottom: 36px;
}
.bog-header-icon {
  font-size: 52px;
  margin-bottom: 12px;
  line-height: 1;
}
.bog-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--bog-text);
  margin: 0 0 10px;
}
.bog-subtitle {
  font-size: 1rem;
  color: var(--bog-text-muted);
  margin: 0;
  line-height: 1.6;
}

/* ── 卡片 ─────────────────────────────────────────────────── */
.bog-card {
  background: var(--bog-card);
  border: 1px solid var(--bog-border);
  border-radius: var(--bog-radius);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--bog-shadow);
  transition: opacity .3s;
}
.bog-card-dimmed {
  opacity: .5;
  pointer-events: none;
}

/* ── Section ──────────────────────────────────────────────── */
.bog-section {
  margin-bottom: 28px;
}
.bog-section:last-child {
  margin-bottom: 0;
}
.bog-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .95rem;
  font-weight: 600;
  color: var(--bog-text);
  margin-bottom: 16px;
}
.bog-section-icon {
  font-size: 1.1rem;
}

/* ── 徽章 ─────────────────────────────────────────────────── */
.bog-badge {
  font-size: .72rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 20px;
}
.bog-badge-green {
  background: #dcfce7;
  color: #166534;
}
.bog-badge-blue {
  background: #dbeafe;
  color: #1d4ed8;
}

/* ── API密钥三列网格 ──────────────────────────────────────── */
.bog-keys-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}
@media (max-width: 680px) {
  .bog-keys-grid {
    grid-template-columns: 1fr;
  }
}

/* ── 表单字段 ─────────────────────────────────────────────── */
.bog-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bog-label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--bog-text-muted);
}
.bog-required {
  color: var(--bog-danger);
  margin-left: 2px;
}
.bog-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.bog-input,
.bog-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--bog-border);
  border-radius: 8px;
  font-size: .9rem;
  color: var(--bog-text);
  background: #fafafa;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
  box-sizing: border-box;
  font-family: inherit;
}
.bog-input:focus,
.bog-textarea:focus {
  border-color: var(--bog-primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
  background: #fff;
}
.bog-input {
  padding-right: 40px; /* 为眼睛按钮留空间 */
}
.bog-eye-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  line-height: 1;
  opacity: .6;
  transition: opacity .2s;
}
.bog-eye-btn:hover {
  opacity: 1;
}
.bog-textarea {
  resize: vertical;
  min-height: 160px;
  line-height: 1.6;
}
.bog-kw-counter {
  font-size: .8rem;
  color: var(--bog-text-muted);
  text-align: right;
}

/* ── 密钥安全提示 ─────────────────────────────────────────── */
.bog-key-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 14px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  font-size: .8rem;
  color: #166534;
  line-height: 1.5;
}
.bog-notice-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── 提交按钮区 ───────────────────────────────────────────── */
.bog-submit-area {
  text-align: center;
  padding-top: 8px;
}
.bog-submit-note {
  margin-top: 12px;
  font-size: .8rem;
  color: var(--bog-text-muted);
  line-height: 1.7;
}

/* ── 按钮 ─────────────────────────────────────────────────── */
.bog-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: .95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  line-height: 1;
}
.bog-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
}
.bog-btn-icon {
  font-size: 1.1rem;
}
.bog-btn-primary {
  background: var(--bog-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(79,70,229,.3);
}
.bog-btn-primary:hover:not(:disabled) {
  background: var(--bog-primary-h);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79,70,229,.4);
  color: #fff;
  text-decoration: none;
}
.bog-btn-success {
  background: var(--bog-success);
  color: #fff;
  box-shadow: 0 2px 8px rgba(5,150,105,.25);
}
.bog-btn-success:hover {
  background: #047857;
  transform: translateY(-1px);
  color: #fff;
  text-decoration: none;
}
.bog-btn-outline {
  background: transparent;
  color: var(--bog-primary);
  border: 1.5px solid var(--bog-primary);
}
.bog-btn-outline:hover {
  background: rgba(79,70,229,.06);
}
.bog-btn-large {
  padding: 16px 40px;
  font-size: 1.05rem;
}

/* ── 进度卡片 ─────────────────────────────────────────────── */
.bog-progress-card {
  border-color: #c7d2fe;
  background: linear-gradient(135deg, #eef2ff 0%, #fff 100%);
}
.bog-progress-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  font-size: 1rem;
  font-weight: 600;
}

/* ── 步骤指示器 ───────────────────────────────────────────── */
.bog-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.bog-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.bog-step-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bog-border);
  border: 2px solid var(--bog-border);
  transition: all .3s;
}
.bog-step-dot.active {
  background: var(--bog-primary);
  border-color: var(--bog-primary);
  box-shadow: 0 0 0 4px rgba(79,70,229,.2);
  animation: bog-pulse 1.2s ease-in-out infinite;
}
.bog-step-dot.done {
  background: var(--bog-success);
  border-color: var(--bog-success);
}
.bog-step-label {
  font-size: .72rem;
  color: var(--bog-text-muted);
  white-space: nowrap;
}
.bog-step-line {
  flex: 1;
  height: 2px;
  background: var(--bog-border);
  margin: 0 4px;
  margin-bottom: 22px;
  min-width: 20px;
}

/* ── 进度条 ───────────────────────────────────────────────── */
.bog-progress-bar-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.bog-progress-bar {
  flex: 1;
  height: 8px;
  background: var(--bog-border);
  border-radius: 4px;
  overflow: hidden;
}
.bog-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--bog-primary), #818cf8);
  border-radius: 4px;
  transition: width .5s ease;
}
#bog-progress-pct {
  font-size: .85rem;
  font-weight: 600;
  color: var(--bog-primary);
  min-width: 36px;
  text-align: right;
}

/* ── 日志 ─────────────────────────────────────────────────── */
.bog-log {
  max-height: 180px;
  overflow-y: auto;
  background: #f8fafc;
  border: 1px solid var(--bog-border);
  border-radius: 8px;
  padding: 12px;
}
.bog-log-line {
  font-size: .8rem;
  color: var(--bog-text-muted);
  line-height: 1.7;
}
.bog-log-time {
  color: #94a3b8;
  margin-right: 6px;
}

/* ── 结果卡片 ─────────────────────────────────────────────── */
.bog-result-card {
  border-color: #a7f3d0;
  background: linear-gradient(135deg, #f0fdf4 0%, #fff 100%);
}
.bog-result-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.bog-result-icon {
  font-size: 2.4rem;
  line-height: 1;
}
.bog-result-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--bog-success);
}
.bog-result-summary {
  font-size: .9rem;
  color: var(--bog-text-muted);
  margin-top: 4px;
}
.bog-download-area {
  text-align: center;
  padding: 24px 0;
}
.bog-download-note {
  margin-top: 12px;
  font-size: .78rem;
  color: var(--bog-text-muted);
}
.bog-error-list {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: .83rem;
  color: #9a3412;
  margin-bottom: 16px;
}
.bog-error-list ul {
  margin: 6px 0 0;
  padding-left: 20px;
}
.bog-actions {
  text-align: center;
  padding-top: 8px;
}

/* ── 错误卡片 ─────────────────────────────────────────────── */
.bog-error-card {
  border-color: #fecaca;
  background: #fff5f5;
  text-align: center;
}
.bog-error-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}
.bog-error-message {
  font-size: .95rem;
  color: var(--bog-danger);
  margin-bottom: 20px;
  line-height: 1.6;
}

/* ── Spinner动画 ─────────────────────────────────────────── */
.bog-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid #c7d2fe;
  border-top-color: var(--bog-primary);
  border-radius: 50%;
  animation: bog-spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes bog-spin {
  to { transform: rotate(360deg); }
}
@keyframes bog-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(79,70,229,.2); }
  50%       { box-shadow: 0 0 0 7px rgba(79,70,229,.08); }
}

/* ── 滚动条美化 ───────────────────────────────────────────── */
.bog-log::-webkit-scrollbar { width: 4px; }
.bog-log::-webkit-scrollbar-track { background: transparent; }
.bog-log::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }
