
:root {
  --bg: #070709;
  --bg-2: #0d0b10;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-2: rgba(255, 250, 246, 0.98);
  --surface-3: rgba(255, 255, 255, 0.98);
  --text: #1b1512;
  --muted: #6f625c;
  --muted-2: #8a7c75;
  --line: rgba(57, 43, 36, 0.13);
  --line-strong: rgba(255, 111, 55, 0.36);
  --brand: #ff6b32;
  --brand-dark: #d94a1c;
  --brand-soft: rgba(255, 107, 50, 0.14);
  --pink: #e23c7d;
  --cyan: #2ac7d8;
  --green: #9cbf42;
  --danger: #ff6b5f;
  --radius: 8px;
  --shadow: 0 18px 50px rgba(36, 22, 14, 0.12);
  --glow: 0 0 32px rgba(255, 107, 50, 0.22);
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% -10%, rgba(255, 107, 50, 0.18), transparent 28%),
    radial-gradient(circle at 84% 2%, rgba(226, 60, 125, 0.12), transparent 24%),
    linear-gradient(180deg, #111014 0%, #0b0a0d 380px, #08080a 100%);
  color: var(--text);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.025), transparent);
  opacity: 0.55;
}

a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 38px;
  background: rgba(12, 11, 14, 0.82);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 38px rgba(0, 0, 0, 0.28);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  color: var(--text);
  font-size: 19px;
  letter-spacing: 0;
}

.brand::before {
  content: "";
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(255, 107, 50, 0.12), var(--glow);
  clip-path: polygon(18% 22%, 74% 10%, 94% 52%, 66% 90%, 14% 78%, 6% 38%);
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar nav a {
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--muted);
  font-weight: 800;
}

.topbar nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  border-color: var(--line);
}

.topbar nav a:last-child {
  color: #1a0b04;
  background: linear-gradient(180deg, #ff7b3e, var(--brand));
  box-shadow: 0 12px 28px rgba(255, 107, 50, 0.28);
}

.page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 42px 32px 56px;
}

.section-head {
  position: relative;
  margin-bottom: 24px;
  padding: 34px 0 30px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.section-head::after {
  content: "";
  position: absolute;
  right: 4%;
  top: 12px;
  width: 320px;
  height: 160px;
  background: radial-gradient(circle, rgba(255, 107, 50, 0.18), transparent 68%);
  filter: blur(6px);
  opacity: 0.85;
}

.section-head h1 {
  position: relative;
  z-index: 1;
  margin: 0 0 12px;
  color: var(--text);
  font-size: 48px;
  line-height: 1.08;
  font-weight: 950;
  letter-spacing: 0;
}

.section-head h1::after {
  content: ".";
  color: var(--brand);
}

.section-head p {
  position: relative;
  z-index: 1;
  max-width: 840px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 26px;
}

.tool-category {
  margin-bottom: 34px;
}

.tool-category-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.tool-category-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 24px;
  line-height: 1.2;
}

.tool-category-head h2::after {
  content: ".";
  color: var(--brand);
}

.tool-category-head p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  text-align: right;
}

.tool-card,
.panel,
.login-box {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.tool-card {
  position: relative;
  display: block;
  min-height: 184px;
  padding: 22px 20px 20px;
  overflow: hidden;
  color: var(--text);
}

.tool-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 84% 8%, rgba(255, 107, 50, 0.14), transparent 32%);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.tool-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow), var(--glow);
}

.tool-card:hover::before { opacity: 1; }

.tool-icon {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 107, 50, 0.16);
  color: #ff8b5a;
  font-size: 13px;
  font-weight: 900;
}

.tool-card[data-tool="external_code_match"] .tool-icon { background: rgba(42, 199, 216, 0.16); color: var(--cyan); }
.tool-card[data-tool="field_backfill"] .tool-icon { background: rgba(226, 60, 125, 0.18); color: #ff6ea6; }
.tool-card[data-tool="duplicate_dedupe"] .tool-icon { background: rgba(156, 191, 66, 0.18); color: var(--green); }
.tool-card[data-tool="table_difference"] .tool-icon { background: rgba(255, 107, 50, 0.18); color: #ff8b5a; }
.tool-card[data-tool="price_discount_check"] .tool-icon { background: rgba(226, 60, 125, 0.2); color: #ff6ea6; }
.tool-card[data-tool="restock_suggestion"] .tool-icon { background: rgba(156, 191, 66, 0.2); color: #bfdc65; }
.tool-card[data-tool="offline_supply_relation_migration"] .tool-icon { background: rgba(255, 107, 50, 0.18); color: #ff9b6d; }
.tool-card[data-tool="online_supply_relation_migration"] .tool-icon { background: rgba(226, 60, 125, 0.18); color: #ff7ab8; }
.tool-card[data-tool="combo_relation_migration"] .tool-icon { background: rgba(156, 191, 66, 0.18); color: #cde86a; }
.tool-card[data-tool="location_relation_migration"] .tool-icon { background: rgba(42, 199, 216, 0.18); color: #58d9e6; }
.tool-card[data-tool="receipt_order"] .tool-icon { background: rgba(42, 199, 216, 0.18); color: #58d9e6; }

.tool-card h2,
.tool-card p,
.tool-action { position: relative; z-index: 1; }

.tool-card h2 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.25;
  color: var(--text);
}

.tool-card p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.6;
}

.tool-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

.tool-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--brand);
  font-weight: 900;
}

.tool-action::after { content: "->"; }
.tool-action.secondary { color: var(--muted); }

.inline-help-link {
  position: relative;
  z-index: 1;
  display: inline-flex;
  margin-top: 16px;
  color: var(--brand);
  font-weight: 900;
}

.guide-brief { margin-bottom: 18px; }

.guide-brief > p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.7;
}

.guide-brief-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.guide-brief h3,
.guide-section h2 {
  margin: 0 0 10px;
  color: var(--text);
}

.guide-brief ol,
.guide-brief ul,
.guide-section ol,
.guide-section ul {
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.8;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.help-card {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.help-card h2 {
  margin: 0 0 8px;
  color: var(--text);
}

.help-card p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.7;
}

.help-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.guide-detail {
  display: grid;
  gap: 22px;
}

.guide-section {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.guide-section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.panel { padding: 22px; }

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.panel-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
  color: var(--text);
}

th {
  color: #3a2d28;
  background: #f1e9e2;
  font-weight: 900;
}

tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) td { background: rgba(255, 107, 50, 0.035); }
tbody tr:hover td { background: rgba(255, 107, 50, 0.09); }

.empty { text-align: center; color: var(--muted); }

.summary-chip,
.status {
  display: inline-block;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.summary-chip {
  margin: 0 6px 6px 0;
  padding: 4px 8px;
  color: #7a3214;
  background: rgba(255, 107, 50, 0.1);
  border: 1px solid rgba(255, 107, 50, 0.18);
}

.status {
  padding: 5px 9px;
  background: rgba(255,255,255,0.08);
  color: var(--text);
}

.status.??? { background: rgba(156, 191, 66, 0.18); color: #cde983; }
.status.??? { background: rgba(255, 107, 95, 0.16); color: #ff9a91; }
.status.?????{ background: rgba(255, 107, 50, 0.16); color: #ffad85; }
.status.??????{ background: rgba(160, 160, 170, 0.18); color: #d8d5d1; }
.status.\5df2\7ec8\6b62 { background: rgba(160, 160, 170, 0.18); color: #d8d5d1; }

.upload-form { max-width: 860px; }

.field { display: block; margin-bottom: 20px; }

.field span {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-weight: 900;
}

.custom-match-fields {
  display: block;
}

.fill-field-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.checkbox-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px 12px;
  margin-bottom: 14px;
}

.checkbox-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--muted);
}

.checkbox-list input { width: auto; min-height: auto; accent-color: var(--brand); }

.match-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.match-choice {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #26232b;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.match-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.match-choice span {
  margin: 0;
  color: inherit;
  font-weight: 850;
}

.match-choice.is-active {
  border-color: rgba(255, 107, 50, 0.76);
  background: rgba(255, 107, 50, 0.16);
  box-shadow: 0 0 0 3px rgba(255, 107, 50, 0.12);
}

.match-choice:hover {
  border-color: rgba(255, 107, 50, 0.52);
  background: rgba(255, 255, 255, 0.06);
}

.nested-field { margin-bottom: 0; }
.custom-match-builder {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}
.custom-match-groups-list { display: grid; gap: 8px; margin: 10px 0; }
.custom-match-group-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
.custom-fill-fields-list { display: grid; gap: 8px; }
.custom-fill-field-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }

input,
select {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(9, 8, 12, 0.92);
  color: var(--text);
  font: inherit;
}

input:focus,
select:focus {
  outline: 3px solid rgba(255, 107, 50, 0.18);
  border-color: rgba(255, 107, 50, 0.78);
}

input[type="file"] { padding: 10px; background: #fffdfb; }
small { display: block; margin-top: 7px; color: var(--muted); line-height: 1.45; }

button,
.button-link {
  display: inline-block;
  border: 0;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ff7d43, var(--brand));
  color: #1a0b04;
  padding: 12px 18px;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 14px 32px rgba(255, 107, 50, 0.26);
}

button:hover,
.button-link:hover {
  background: linear-gradient(180deg, #ff8a57, #ff5f24);
  color: #160803;
  transform: translateY(-1px);
}

.button-link.secondary {
  margin-left: 10px;
  background: rgba(255,255,255,0.055);
  color: var(--text);
  box-shadow: none;
  border: 1px solid var(--line);
}

.button-link.secondary:hover { border-color: var(--line-strong); background: rgba(255, 107, 50, 0.12); }

.add-field-button { margin-top: 8px; background: #137f74; color: #eafffb; }
.remove-field-button { background: rgba(255,255,255,0.12); color: var(--text); box-shadow: none; }
.add-field-button,
.remove-field-button { min-height: 36px; padding: 8px 12px; }

.alert {
  padding: 13px 15px;
  border: 1px solid rgba(255, 107, 95, 0.35);
  background: rgba(255, 107, 95, 0.12);
  color: #ffb0a9;
  border-radius: var(--radius);
  margin-bottom: 14px;
}

.progress-box {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 15px;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 107, 50, 0.26);
  background: rgba(255, 107, 50, 0.08);
  border-radius: var(--radius);
}

.progress-box p { margin: 4px 0 0; color: var(--muted); }
.progress-content { flex: 1 1 auto; min-width: 0; }
.progress-bar {
  width: 100%;
  height: 10px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.progress-bar span {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff6b32, #ffb347);
  transition: width 0.25s ease;
}
.cancel-form { margin-top: 12px; }
.danger-button {
  background: rgba(255, 85, 85, 0.14);
  color: #ffd4d4;
  border: 1px solid rgba(255, 85, 85, 0.42);
  box-shadow: none;
}
.danger-button:hover {
  background: rgba(255, 85, 85, 0.24);
  color: #fff4f4;
}
.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255, 107, 50, 0.18);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex: 0 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.detail dl { display: grid; grid-template-columns: 120px 1fr; gap: 10px 16px; }
.detail dt { color: var(--muted); }
.detail dd { margin: 0; }
.detail dd a { margin-right: 12px; }

.login-page { min-height: 100vh; display: grid; place-items: center; }
.login-box { width: min(420px, calc(100vw - 32px)); padding: 28px; }
.login-box h1 { margin: 0 0 22px; font-size: 25px; }
.login-box label { display: block; margin-bottom: 8px; font-weight: 800; }
.login-box button { width: 100%; margin-top: 16px; }
.error { color: var(--danger); }

@media (max-width: 760px) {
  .topbar { padding: 10px 14px; align-items: flex-start; flex-direction: column; gap: 8px; }
  .topbar nav { gap: 8px; font-size: 14px; flex-wrap: wrap; }
  .page { padding: 22px 14px 36px; }
  .section-head { padding: 26px 0 24px; }
  .section-head h1 { font-size: 34px; }
  .tool-grid { grid-template-columns: 1fr; }
  .custom-match-group-row { grid-template-columns: 1fr; }
  .custom-fill-field-row { grid-template-columns: 1fr; }
  .task-table { font-size: 13px; }
  th, td { padding: 8px 6px; }
}


.section-head h1,
.section-head p {
  color: #fff7f1;
}

.section-head p {
  color: rgba(255, 247, 241, 0.72);
}

.tool-card h2,
.panel-head h2,
.field span,
.login-box h1 {
  color: #1f1714;
}

.tool-card p,
small,
.detail dt {
  color: #70625c;
}

.panel a:not(.button-link),
table a {
  color: #b3471e;
}

.panel,
.tool-card,
.login-box {
  color: #1f1714;
}

th,
td {
  color: #241b17;
}

tbody tr:nth-child(even) td {
  background: rgba(255, 107, 50, 0.035);
}

.fill-field-panel {
  background: #fffaf6;
}


.tool-card {
  background: linear-gradient(180deg, #fffdfb 0%, #fff5ee 100%);
  border-color: rgba(180, 87, 45, 0.22);
  box-shadow: 0 18px 42px rgba(55, 69, 82, 0.12);
}

.tool-card:hover {
  border-color: rgba(255, 107, 50, 0.58);
  box-shadow: 0 20px 56px rgba(55, 69, 82, 0.16), 0 0 28px rgba(255, 107, 50, 0.18);
}

.panel,
.login-box {
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(250,252,254,0.98));
  border-color: rgba(95, 117, 137, 0.18);
}

.page::before {
  content: "";
  position: fixed;
  inset: 330px 0 0;
  z-index: -1;
  background:
    linear-gradient(rgba(26, 38, 50, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 38, 50, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
}


body {
  background:
    radial-gradient(circle at 16% -10%, rgba(255, 107, 50, 0.22), transparent 28%),
    radial-gradient(circle at 84% 2%, rgba(226, 60, 125, 0.18), transparent 24%),
    radial-gradient(circle at 55% 42%, rgba(255, 107, 50, 0.08), transparent 26%),
    linear-gradient(180deg, #111014 0%, #0b0a0d 380px, #08080a 100%);
}

.page::before {
  background:
    linear-gradient(rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px);
  background-size: 34px 34px;
}

.tool-card {
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(255, 107, 50, 0.06);
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 107, 50, 0.78);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.36), 0 0 34px rgba(255, 107, 50, 0.34);
}

.panel,
.login-box {
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.26);
}


/* contrast refinement: soften the work surface while keeping the dark glow backdrop */
:root {
  --surface: rgba(31, 29, 35, 0.96);
  --surface-2: rgba(25, 23, 29, 0.98);
  --surface-3: rgba(38, 35, 42, 0.96);
  --text: #f2eee8;
  --muted: #b2a9a4;
  --line: rgba(255, 255, 255, 0.11);
}

.panel,
.login-box,
.tool-card {
  background: linear-gradient(180deg, rgba(34, 31, 38, 0.96), rgba(24, 22, 28, 0.97));
  color: #f2eee8;
  border-color: rgba(255, 255, 255, 0.11);
}

.tool-card {
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 107, 50, 0.04);
}

.tool-card:hover {
  border-color: rgba(255, 107, 50, 0.52);
  box-shadow: 0 22px 64px rgba(0, 0, 0, 0.36), 0 0 28px rgba(255, 107, 50, 0.22);
}

.tool-card h2,
.panel-head h2,
.field span,
.login-box h1 {
  color: #f6f0ea;
}

.tool-card p,
small,
.detail dt,
.checkbox-list label {
  color: #b6aca6;
}

input,
select,
input[type="file"] {
  background: #26232b;
  color: #f3eee9;
  border-color: rgba(255, 255, 255, 0.14);
}

input::placeholder {
  color: #817873;
}

input:focus,
select:focus {
  background: #2d2932;
  border-color: rgba(255, 107, 50, 0.7);
}

.fill-field-panel {
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.1);
}

th {
  color: #f1e9e2;
  background: rgba(255, 255, 255, 0.07);
}

td {
  color: #ebe5de;
}

tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.025);
}

.panel a:not(.button-link),
table a {
  color: #ff8a58;
}

.summary-chip {
  color: #ffd4c0;
  background: rgba(255, 107, 50, 0.12);
  border-color: rgba(255, 107, 50, 0.22);
}

.button-link.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #f6f0ea;
  border-color: rgba(255, 255, 255, 0.14);
}


/* typography refinement inspired by the reference */
body {
  font-size: 16px;
  line-height: 1.62;
  letter-spacing: 0;
}

.brand {
  font-size: 18px;
  font-weight: 950;
}

.topbar nav a {
  font-size: 15px;
  line-height: 1.2;
}

.site-footer {
  position: relative;
  z-index: 1;
  padding: 22px 16px 28px;
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(246, 240, 234, 0.55);
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  color: rgba(255, 255, 255, 0.82);
}

@media (max-width: 760px) {
  .tool-category-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .tool-category-head p {
    max-width: none;
    text-align: left;
  }
}

.section-head {
  padding-top: 58px;
  padding-bottom: 44px;
}

.section-head h1 {
  max-width: 860px;
  font-size: 52px;
  line-height: 1.05;
  font-weight: 950;
  margin-bottom: 16px;
}

.section-head p {
  max-width: 900px;
  font-size: 18px;
  line-height: 1.78;
  font-weight: 600;
}

.tool-card h2 {
  font-size: 21px;
  line-height: 1.25;
  font-weight: 900;
  margin-bottom: 10px;
}

.tool-card p {
  font-size: 14px;
  line-height: 1.7;
}

.tool-action,
button,
.button-link {
  font-size: 15px;
  line-height: 1.2;
}

.panel-head h2 {
  font-size: 22px;
  line-height: 1.25;
  font-weight: 900;
}

.upload-form {
  padding: 30px;
}

.field {
  margin-bottom: 24px;
}

.field span {
  margin-bottom: 10px;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 950;
}

small {
  margin-top: 9px;
  font-size: 14px;
  line-height: 1.65;
  font-weight: 600;
}

input,
select {
  min-height: 52px;
  padding: 12px 16px;
  font-size: 16px;
  line-height: 1.25;
}

input[type="file"] {
  line-height: 1.35;
}

th {
  font-size: 14px;
  line-height: 1.35;
}

td {
  font-size: 14px;
  line-height: 1.55;
}

.summary-chip {
  font-size: 12px;
  line-height: 1.35;
}

.detail dl {
  font-size: 16px;
}

.detail dt {
  font-weight: 700;
}

.detail dd {
  font-weight: 650;
}

.login-box h1 {
  font-size: 28px;
  line-height: 1.2;
  font-weight: 950;
}

.login-box label {
  font-size: 15px;
}

@media (max-width: 760px) {
  .section-head {
    padding-top: 34px;
    padding-bottom: 28px;
  }

  .section-head h1 {
    font-size: 38px;
  }

  .section-head p {
    font-size: 16px;
    line-height: 1.68;
  }

  .upload-form {
    padding: 20px;
  }

  .field span {
    font-size: 17px;
  }
}


/* site theme switch */
html[data-theme="dark"] {
  color-scheme: dark;
}

.theme-toggle {
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  color: #f6f0ea;
  box-shadow: none;
  font-size: 15px;
  font-weight: 900;
}

.theme-toggle:hover {
  border-color: rgba(255, 107, 50, 0.52);
  background: rgba(255, 107, 50, 0.14);
  color: #fff7f1;
  transform: translateY(-1px);
}

.login-theme-toggle {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 2;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f2eb;
  --bg-2: #fff9f3;
  --surface: rgba(255, 255, 255, 0.96);
  --surface-2: rgba(255, 250, 246, 0.98);
  --surface-3: rgba(255, 255, 255, 0.98);
  --text: #211916;
  --muted: #665b55;
  --muted-2: #887b73;
  --line: rgba(64, 47, 39, 0.14);
  --line-strong: rgba(255, 107, 50, 0.42);
  --shadow: 0 18px 46px rgba(88, 65, 46, 0.12);
  --glow: 0 0 26px rgba(255, 107, 50, 0.16);
}

html[data-theme="light"] body {
  background:
    radial-gradient(circle at 14% -8%, rgba(255, 107, 50, 0.18), transparent 28%),
    radial-gradient(circle at 86% 0%, rgba(226, 60, 125, 0.1), transparent 24%),
    linear-gradient(180deg, #fff8ef 0%, #f7f2eb 390px, #f4eee7 100%);
  color: var(--text);
}

html[data-theme="light"] body::before {
  background: linear-gradient(90deg, transparent, rgba(255, 107, 50, 0.035), transparent);
  opacity: 0.7;
}

html[data-theme="light"] .topbar {
  background: rgba(255, 250, 245, 0.84);
  border-bottom-color: rgba(64, 47, 39, 0.12);
  box-shadow: 0 12px 34px rgba(88, 65, 46, 0.12);
}

html[data-theme="light"] .brand,
html[data-theme="light"] .topbar nav a:hover,
html[data-theme="light"] .section-head h1,
html[data-theme="light"] .tool-category-head h2,
html[data-theme="light"] .tool-card h2,
html[data-theme="light"] .panel-head h2,
html[data-theme="light"] .field span,
html[data-theme="light"] .guide-brief h3,
html[data-theme="light"] .guide-section h2,
html[data-theme="light"] .help-card h2,
html[data-theme="light"] .login-box h1 {
  color: var(--text);
}

html[data-theme="light"] .topbar nav a,
html[data-theme="light"] .section-head p,
html[data-theme="light"] .tool-category-head p,
html[data-theme="light"] .tool-card p,
html[data-theme="light"] .guide-brief > p,
html[data-theme="light"] .guide-brief ol,
html[data-theme="light"] .guide-brief ul,
html[data-theme="light"] .guide-section ol,
html[data-theme="light"] .guide-section ul,
html[data-theme="light"] .help-card p,
html[data-theme="light"] small,
html[data-theme="light"] .detail dt,
html[data-theme="light"] .checkbox-list label,
html[data-theme="light"] .empty {
  color: var(--muted);
}

html[data-theme="light"] .section-head {
  border-bottom-color: rgba(64, 47, 39, 0.12);
}

html[data-theme="light"] .section-head::after {
  background: radial-gradient(circle, rgba(255, 107, 50, 0.16), transparent 70%);
}

html[data-theme="light"] .page::before {
  background:
    linear-gradient(rgba(112, 82, 66, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(112, 82, 66, 0.055) 1px, transparent 1px);
  background-size: 34px 34px;
}

html[data-theme="light"] .tool-card,
html[data-theme="light"] .panel,
html[data-theme="light"] .login-box,
html[data-theme="light"] .help-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 248, 241, 0.98));
  color: var(--text);
  border-color: rgba(180, 87, 45, 0.18);
  box-shadow: var(--shadow);
}

html[data-theme="light"] .tool-card:hover {
  border-color: rgba(255, 107, 50, 0.58);
  box-shadow: 0 20px 58px rgba(88, 65, 46, 0.16), 0 0 26px rgba(255, 107, 50, 0.2);
}

html[data-theme="light"] .tool-card::before {
  background: radial-gradient(circle at 84% 8%, rgba(255, 107, 50, 0.12), transparent 32%);
}

html[data-theme="light"] .theme-toggle {
  background: rgba(255, 107, 50, 0.08);
  color: #7a3214;
  border-color: rgba(255, 107, 50, 0.24);
}

html[data-theme="light"] .theme-toggle:hover {
  background: rgba(255, 107, 50, 0.16);
  color: #431a0a;
}

html[data-theme="light"] input,
html[data-theme="light"] select {
  background: #fffdfb;
  color: var(--text);
  border-color: rgba(64, 47, 39, 0.16);
}

html[data-theme="light"] input::placeholder {
  color: #9a8e86;
}

html[data-theme="light"] input:focus,
html[data-theme="light"] select:focus {
  background: #ffffff;
  border-color: rgba(255, 107, 50, 0.78);
}

html[data-theme="light"] input[type="file"] {
  background: #fffdfb;
  color: var(--text);
}

html[data-theme="light"] .fill-field-panel,
html[data-theme="light"] .match-choice {
  background: rgba(255, 250, 246, 0.9);
  border-color: rgba(64, 47, 39, 0.14);
  color: var(--text);
}

html[data-theme="light"] .match-choice:hover {
  background: rgba(255, 107, 50, 0.08);
}

html[data-theme="light"] .match-choice.is-active {
  background: rgba(255, 107, 50, 0.14);
}

html[data-theme="light"] th {
  color: #33251f;
  background: #f4e7dc;
}

html[data-theme="light"] td {
  color: #2a201b;
}

html[data-theme="light"] tbody tr:nth-child(even) td {
  background: rgba(255, 107, 50, 0.035);
}

html[data-theme="light"] tbody tr:hover td {
  background: rgba(255, 107, 50, 0.09);
}

html[data-theme="light"] .status {
  background: rgba(64, 47, 39, 0.08);
  color: var(--text);
}

html[data-theme="light"] .summary-chip {
  color: #7a3214;
  background: rgba(255, 107, 50, 0.1);
  border-color: rgba(255, 107, 50, 0.2);
}

html[data-theme="light"] .button-link.secondary,
html[data-theme="light"] .remove-field-button {
  background: rgba(64, 47, 39, 0.06);
  color: var(--text);
  border-color: rgba(64, 47, 39, 0.14);
}

html[data-theme="light"] .alert {
  color: #b41712;
  background: rgba(255, 107, 95, 0.1);
  border-color: rgba(255, 107, 95, 0.28);
}

html[data-theme="light"] .progress-box {
  background: rgba(255, 107, 50, 0.08);
}

html[data-theme="light"] .site-footer {
  color: rgba(60, 45, 37, 0.62);
}

html[data-theme="light"] .site-footer a:hover {
  color: rgba(36, 25, 20, 0.9);
}

@media (max-width: 760px) {
  .theme-toggle {
    min-height: 34px;
    padding: 7px 11px;
    font-size: 14px;
  }

  .login-theme-toggle {
    top: 12px;
    right: 12px;
  }
}

/* homepage card readability: keep long tool names/descriptions visible */
.tool-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  align-items: stretch;
}

.tool-card {
  display: flex;
  flex-direction: column;
  min-height: 230px;
  height: auto;
  overflow: visible;
}

.tool-card::before {
  border-radius: inherit;
  pointer-events: none;
}

.tool-card h2 {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.tool-card p {
  flex: 1;
  overflow: visible;
  display: block;
  overflow-wrap: anywhere;
}

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

@media (max-width: 760px) {
  .tool-grid {
    grid-template-columns: 1fr;
  }

  .tool-card {
    min-height: auto;
  }
}
