/* RutenCrawler DEMO — 乾淨極簡風 */
:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --line: #e6e8ec;
  --text: #1c2330;
  --muted: #6b7385;
  --brand1: #ff963b;
  --brand2: #f9644c;
  --ok: #0e9f6e;
  --err: #d64545;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 8px 24px rgba(16,24,40,.06);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI",
        "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", sans-serif;
}

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 20px; }

/* ---------------- header ---------------- */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.header-row {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 18px; padding-bottom: 18px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  display: grid; place-items: center;
  width: 46px; height: 46px; font-size: 24px;
  background: linear-gradient(135deg, var(--brand1), var(--brand2));
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(249,100,76,.25);
}
.brand h1 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: .2px; }
.brand .tag {
  font-size: 11px; font-weight: 700; vertical-align: 3px;
  color: var(--brand2); border: 1.5px solid var(--brand2);
  border-radius: 6px; padding: 1px 6px; margin-left: 4px;
}
.brand p { margin: 0; color: var(--muted); font-size: 13px; }
.gh-link {
  color: var(--muted); text-decoration: none; font-size: 13px;
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px;
  transition: .15s;
}
.gh-link:hover { color: var(--text); border-color: #c9cdd6; }

/* ---------------- cards ---------------- */
main { padding: 24px 20px 40px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* search */
.search-card { padding: 20px 22px; }
.search-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.search-row > label { font-weight: 600; white-space: nowrap; }
.input-group { display: flex; flex: 1; min-width: 300px; }
.prefix {
  display: grid; place-items: center;
  padding: 0 12px; color: var(--muted); font-size: 13px;
  background: #f2f3f6; border: 1px solid var(--line); border-right: 0;
  border-radius: 10px 0 0 10px;
}
#storeInput {
  flex: 1; min-width: 0;
  padding: 11px 14px; font: inherit;
  border: 1px solid var(--line); border-right: 0; outline: none;
}
#storeInput:focus { border-color: var(--brand2); }
.input-group .btn { border-radius: 0 10px 10px 0; }
.hint { margin: 12px 0 0; color: var(--muted); font-size: 12.5px; }

/* ---------------- buttons ---------------- */
.btn {
  font: inherit; font-weight: 600; cursor: pointer;
  padding: 10px 22px; border: none; transition: .15s;
  white-space: nowrap;
}
.btn.primary {
  color: #fff; background: linear-gradient(135deg, var(--brand1), var(--brand2));
}
.btn.primary:hover { filter: brightness(1.06); }
.btn.primary:disabled { opacity: .6; cursor: wait; filter: none; }
.btn.ghost {
  background: var(--card); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
}
.btn.ghost:hover { border-color: #c9cdd6; }
.btn.ghost:disabled { opacity: .45; cursor: default; }
.btn.small { padding: 5px 12px; font-size: 12.5px; border-radius: 8px; }

/* ---------------- status ---------------- */
.status-card { margin-top: 16px; padding: 14px 18px; }
.status-row { display: flex; align-items: center; gap: 10px; }
.icon { font-size: 16px; }
.icon.spin { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.icon.done { color: var(--ok); }
.icon.fail { color: var(--err); }
.status-text { flex: 1; font-size: 14px; }
.bar {
  height: 6px; margin-top: 10px; border-radius: 4px;
  background: #eef0f4; overflow: hidden; display: none;
}
.bar.on { display: block; }
.bar .fill {
  height: 100%; width: 0; border-radius: 4px;
  background: linear-gradient(90deg, var(--brand1), var(--brand2));
  transition: width .25s;
}
.bar.indet .fill {
  width: 40% !important;
  animation: slide 1.1s linear infinite;
}
@keyframes slide {
  from { transform: translateX(-100%); }
  to   { transform: translateX(260%); }
}
.log {
  margin: 12px 0 0; padding: 12px 14px;
  max-height: 180px; overflow: auto;
  background: #14181f; color: #c7d0de;
  border-radius: 10px;
  font: 12px/1.7 ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;
  white-space: pre-wrap; word-break: break-all;
}

/* ---------------- chips ---------------- */
.chips {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px;
}
.chip {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 14px;
  box-shadow: var(--shadow);
  font-size: 13px;
}
.chip .k { color: var(--muted); margin-right: 8px; }
.chip .v { font-weight: 600; }
.chip a { color: var(--brand2); text-decoration: none; }
.chip a:hover { text-decoration: underline; }

/* ---------------- data table ---------------- */
.data-card { margin-top: 16px; overflow: hidden; }
.toolbar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
#filter {
  flex: 1; min-width: 220px; max-width: 380px;
  padding: 9px 13px; font: inherit;
  border: 1px solid var(--line); border-radius: 10px; outline: none;
}
#filter:focus { border-color: var(--brand2); }
.count { flex: 1; color: var(--muted); font-size: 13px; text-align: right; }

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  position: sticky; top: 0; z-index: 1;
  background: #fafbfc; color: var(--muted);
  font-weight: 600; font-size: 12.5px; text-align: left;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody td {
  padding: 9px 14px; border-bottom: 1px solid #f0f2f5;
  vertical-align: top;
}
tbody tr:hover { background: #fafbfc; }
tbody tr:last-child td { border-bottom: none; }
tbody tr.cont td.name-cell { color: #a3aab8; }

.w-name   { min-width: 260px; }
.w-spec   { min-width: 180px; }
.w-status { width: 64px; }
.w-id     { width: 150px; }
.num      { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

td.name-cell { font-weight: 500; }
td.spec-cell { color: #4b5568; }
td.spec-cell .none, td.num .none { color: #b6bcc9; }
td.id-cell a { color: var(--brand2); text-decoration: none; font-variant-numeric: tabular-nums; }
td.id-cell a:hover { text-decoration: underline; }
.badge {
  display: inline-block; padding: 1px 8px; border-radius: 6px;
  font-size: 11.5px; font-weight: 600;
  background: #fee4e2; color: #b42318;
}
.badge.ok { background: #d1fadf; color: #067647; }

.empty { padding: 40px; text-align: center; color: var(--muted); }

/* ---------------- pager ---------------- */
.pager {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; padding: 14px; flex-wrap: wrap;
  border-top: 1px solid var(--line);
}
.pager button {
  min-width: 34px; padding: 6px 10px;
  font: inherit; font-size: 13px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card);
}
.pager button:hover:not(:disabled) { border-color: #c9cdd6; }
.pager button.cur {
  background: linear-gradient(135deg, var(--brand1), var(--brand2));
  color: #fff; border-color: transparent; font-weight: 600;
}
.pager button:disabled { opacity: .4; cursor: default; }
.pager .pinfo { color: var(--muted); font-size: 13px; margin: 0 8px; }

/* ---------------- footer ---------------- */
.site-footer {
  border-top: 1px solid var(--line); background: var(--card);
  padding: 16px 0 26px; color: var(--muted); font-size: 12.5px;
}

/* ---------------- RWD ---------------- */
@media (max-width: 640px) {
  .header-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .search-card, .toolbar { padding: 14px; }
  .input-group { min-width: 100%; }
  .w-status, td.status-cell { display: none; }
}
