/* 第一方亚马逊工具 · 统一样式
   自包含（不依赖导航站 styles.css），与导航站保持同一视觉语言。 */

:root {
  --fpt-bg: #f4f7fa;
  --fpt-panel: #ffffff;
  --fpt-ink: #1c2b36;
  --fpt-ink-2: #43566a;
  --fpt-ink-3: #7d8fa1;
  --fpt-line: #dbe5ee;
  --fpt-accent: #149a6d;
  --fpt-accent-strong: #0e7f59;
  --fpt-accent-soft: #e3f6ee;
  --fpt-danger: #c0392b;
  --fpt-danger-soft: #fdecea;
  --fpt-warning: #9a6a14;
  --fpt-warning-soft: #fdf3e0;
  --fpt-success: #14703f;
  --fpt-success-soft: #e6f6ec;
  --fpt-radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--fpt-bg);
  color: var(--fpt-ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.65;
}

a { color: var(--fpt-accent-strong); }
a:hover { text-decoration: underline; }

/* ---------- 顶栏 ---------- */
.fpt-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 52px;
  padding: 0 20px;
  background: var(--fpt-panel);
  border-bottom: 1px solid var(--fpt-line);
}
.fpt-brand {
  font-weight: 600;
  font-size: 14px;
  color: var(--fpt-ink);
  text-decoration: none;
  white-space: nowrap;
}
.fpt-topnav { display: flex; gap: 6px; margin-left: auto; }
.fpt-topnav a {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--fpt-ink-2);
  text-decoration: none;
}
.fpt-topnav a:hover { background: var(--fpt-bg); color: var(--fpt-ink); }
.fpt-topnav a[aria-current="page"] { background: var(--fpt-accent-soft); color: var(--fpt-accent-strong); font-weight: 600; }

/* ---------- 主体 ---------- */
.fpt-main {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  min-width: 0;
}
.fpt-breadcrumb {
  font-size: 12px;
  color: var(--fpt-ink-3);
  margin-bottom: 10px;
}
.fpt-breadcrumb a { color: var(--fpt-ink-3); text-decoration: none; }
.fpt-breadcrumb a:hover { color: var(--fpt-ink); text-decoration: underline; }
.fpt-title { font-size: 22px; font-weight: 700; margin: 0 0 6px; }
.fpt-desc { font-size: 14px; color: var(--fpt-ink-2); margin: 0 0 18px; }

.fpt-banner {
  margin: 0 0 14px;
  padding: 10px 14px;
  border: 1px solid #f0d9a8;
  border-radius: 10px;
  background: var(--fpt-warning-soft);
  color: var(--fpt-warning);
  font-size: 13px;
}

/* ---------- 卡片（工具首页） ---------- */
.fpt-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.fpt-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  background: var(--fpt-panel);
  border: 1px solid var(--fpt-line);
  border-radius: var(--fpt-radius);
  text-decoration: none;
  min-width: 0;
}
.fpt-card:hover { border-color: var(--fpt-accent); text-decoration: none; }
.fpt-card-name { font-size: 15px; font-weight: 600; color: var(--fpt-ink); }
.fpt-card-desc { font-size: 13px; color: var(--fpt-ink-3); }
.fpt-empty {
  padding: 28px 18px;
  background: var(--fpt-panel);
  border: 1px dashed var(--fpt-line);
  border-radius: var(--fpt-radius);
  color: var(--fpt-ink-3);
  font-size: 14px;
}

/* ---------- 面板（输入区 / 结果区） ---------- */
.fpt-panel {
  background: var(--fpt-panel);
  border: 1px solid var(--fpt-line);
  border-radius: var(--fpt-radius);
  padding: 18px;
  margin-bottom: 16px;
  min-width: 0;
}
.fpt-panel[hidden] { display: none; }

/* ---------- 按钮 ---------- */
.fpt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 16px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease;
}
.fpt-btn:disabled { opacity: .55; cursor: not-allowed; }
.fpt-btn-primary { background: var(--fpt-accent); color: #fff; }
.fpt-btn-primary:hover:not(:disabled) { background: var(--fpt-accent-strong); text-decoration: none; }
.fpt-btn-secondary { background: var(--fpt-panel); color: var(--fpt-ink-2); border-color: var(--fpt-line); }
.fpt-btn-secondary:hover:not(:disabled) { border-color: var(--fpt-ink-3); color: var(--fpt-ink); text-decoration: none; }
.fpt-btn-danger { background: var(--fpt-panel); color: var(--fpt-danger); border-color: #eec5c0; }
.fpt-btn-danger:hover:not(:disabled) { background: var(--fpt-danger-soft); text-decoration: none; }

/* ---------- 表单 ---------- */
.fpt-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.fpt-field > label { font-size: 13px; font-weight: 600; color: var(--fpt-ink-2); }
.fpt-field .fpt-hint { font-size: 12px; color: var(--fpt-ink-3); }
.fpt-input,
.fpt-field input[type="text"],
.fpt-field input[type="number"],
.fpt-field input[type="search"],
.fpt-field select,
.fpt-field textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--fpt-line);
  border-radius: 9px;
  font-size: 14px;
  font-family: inherit;
  color: var(--fpt-ink);
  background: var(--fpt-panel);
}
.fpt-field textarea { min-height: 96px; resize: vertical; }
.fpt-input:focus,
.fpt-field input:focus,
.fpt-field select:focus,
.fpt-field textarea:focus {
  outline: 2px solid var(--fpt-accent);
  outline-offset: 1px;
  border-color: var(--fpt-accent);
}

/* ---------- 表格 ---------- */
.fpt-table-wrap { overflow-x: auto; border: 1px solid var(--fpt-line); border-radius: 10px; }
.fpt-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fpt-table th,
.fpt-table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--fpt-line); white-space: nowrap; }
.fpt-table th { background: var(--fpt-bg); color: var(--fpt-ink-2); font-weight: 600; }
.fpt-table tr:last-child td { border-bottom: 0; }

/* ---------- 文件拖放 ---------- */
.fpt-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 128px;
  padding: 20px;
  border: 2px dashed var(--fpt-line);
  border-radius: var(--fpt-radius);
  background: var(--fpt-panel);
  color: var(--fpt-ink-3);
  font-size: 14px;
  text-align: center;
  cursor: pointer;
}
.fpt-dropzone.is-dragover { border-color: var(--fpt-accent); background: var(--fpt-accent-soft); color: var(--fpt-accent-strong); }
.fpt-dropzone input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* ---------- 提示 ---------- */
.fpt-error,
.fpt-notice {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 14px;
}
.fpt-error { background: var(--fpt-danger-soft); color: var(--fpt-danger); border: 1px solid #f0c4bd; }
.fpt-error[hidden] { display: none; }
.fpt-notice-warning { background: var(--fpt-warning-soft); color: var(--fpt-warning); border: 1px solid #f0d9a8; }
.fpt-notice-success { background: var(--fpt-success-soft); color: var(--fpt-success); border: 1px solid #bfe6cd; }

/* ---------- 数据说明 ---------- */
.fpt-meta {
  background: var(--fpt-panel);
  border: 1px solid var(--fpt-line);
  border-radius: var(--fpt-radius);
  padding: 14px 18px;
  font-size: 12px;
  color: var(--fpt-ink-3);
}
.fpt-meta-title { font-size: 12px; font-weight: 600; margin: 0 0 8px; color: var(--fpt-ink-2); }
.fpt-meta-list { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 28px; }
.fpt-meta-list div { display: flex; gap: 6px; }
.fpt-meta-list dt { font-weight: 600; color: var(--fpt-ink-2); }
.fpt-meta-list dd { margin: 0; }

/* ---------- 页脚 ---------- */
.fpt-footer {
  padding: 22px;
  text-align: center;
  font-size: 12px;
  color: var(--fpt-ink-3);
  border-top: 1px solid var(--fpt-line);
}
.fpt-footer a { color: var(--fpt-ink-3); }

/* ---------- 可访问性 ---------- */
:focus-visible { outline: 2px solid var(--fpt-accent); outline-offset: 2px; }
.fpt-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- 移动端 ---------- */
@media (max-width: 768px) {
  .fpt-topbar { padding: 0 12px; gap: 8px; }
  .fpt-brand { font-size: 13px; }
  .fpt-topnav a { padding: 0 9px; }
  .fpt-main { padding: 18px 14px 40px; }
  .fpt-title { font-size: 19px; }
  .fpt-card-grid { grid-template-columns: 1fr; }
  .fpt-panel { padding: 14px; }
  .fpt-meta-list { flex-direction: column; gap: 4px; }
}
