/* ============================================================
   站长工具页（zhanzhang.html）样式
   复用主站 design token；仅本页私有组件。
   ============================================================ */

.zt-main {
  padding: calc(var(--header-h) + 16px) 0 56px;
  min-height: 70vh;
}

/* ---- 页头 ---- */
.zt-hero {
  padding: 28px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--bg-soft), var(--surface));
  margin-bottom: 20px;
}
.zt-hero-eyebrow {
  font-size: 12px;
  letter-spacing: 4px;
  color: var(--brand);
  font-weight: 700;
  margin-bottom: 6px;
}
.zt-title {
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 8px;
  letter-spacing: 1px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.zt-ico { font-size: 24px; }
.zt-subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.7;
  max-width: 720px;
}
.zt-subtitle code {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 12px;
  font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace;
}

/* ---- 工具卡片网格 ---- */
.zt-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 1200px) { .zt-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px)  { .zt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px)  { .zt-grid { grid-template-columns: 1fr; } }

.zt-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.zt-card:hover { border-color: var(--brand); box-shadow: var(--shadow); transform: translateY(-1px); }
.zt-card-head { display: flex; align-items: center; gap: 8px; }
.zt-card-ico {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  display: grid;
  place-items: center;
  font-size: 16px;
  flex-shrink: 0;
}
.zt-card-name { font-size: 15px; font-weight: 700; color: var(--text); }
.zt-card-desc { font-size: 12px; color: var(--text-3); line-height: 1.5; margin: 0; }
.zt-card-links { display: flex; flex-direction: column; gap: 6px; margin-top: auto; }
.zt-link-btn {
  display: block;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--text);
  font-size: 12px;
  text-decoration: none;
  text-align: center;
  transition: all .12s;
}
.zt-link-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--surface); }
.zt-open-btn {
  margin-top: auto;
  padding: 8px 0;
  border: 1px solid var(--brand);
  background: transparent;
  color: var(--brand);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.zt-open-btn:hover { background: var(--brand); color: #fff; }

/* ---- Modal ---- */
.zt-modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(20, 23, 27, .55);
  display: grid;
  place-items: center;
  z-index: 300;
  padding: 16px;
}
.zt-modal {
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%;
  max-width: 680px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  position: relative;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .25);
  padding: 24px 24px 20px;
}
.zt-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 0;
  background: var(--bg-soft);
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  z-index: 2;
}
.zt-close:hover { background: var(--brand-soft); color: var(--brand); }
.zt-modal-title { margin: 0 0 4px; font-size: 18px; font-weight: 700; }
.zt-modal-sub { margin: 0 0 14px; font-size: 12px; color: var(--text-3); line-height: 1.6; }

/* ---- 表单元素 ---- */
.zt-input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14px;
  background: var(--bg-soft);
  color: var(--text);
  outline: none;
  font-family: inherit;
}
.zt-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.zt-area {
  width: 100%;
  min-height: 120px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace;
  font-size: 13px;
  background: var(--bg-soft);
  color: var(--text);
  outline: none;
  resize: vertical;
}
.zt-area:focus { border-color: var(--brand); }
.zt-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 10px 0;
  flex-wrap: wrap;
}
.zt-lbl {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
  flex: 1;
  min-width: 0;
}
.zt-lbl .zt-input { flex: 1; }
.zt-color {
  width: 44px; height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px;
  background: var(--surface);
  cursor: pointer;
}
.zt-chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.zt-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}
.zt-btn:hover { border-color: var(--brand); color: var(--brand); }
.zt-btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.zt-btn-primary:hover { background: var(--brand-strong); color: #fff; }

/* ---- 结果区 ---- */
.zt-result { margin-top: 8px; }
.zt-loading { text-align: center; color: var(--text-3); padding: 24px 0; font-size: 13px; }
.zt-error {
  text-align: center;
  color: #f1404b;
  background: #fff5f5;
  border: 1px solid #fcd9dc;
  border-radius: 8px;
  padding: 16px;
  font-size: 13px;
  line-height: 1.8;
}
[data-theme='dark'] .zt-error { background: rgba(241, 64, 75, .08); border-color: rgba(241, 64, 75, .3); }
.zt-note { font-size: 12px; color: var(--text-3); margin: 10px 0 0; line-height: 1.6; }
.zt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 6px 0;
}
.zt-table th {
  text-align: left;
  width: 110px;
  color: var(--text-3);
  font-weight: 500;
  padding: 7px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.zt-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  word-break: break-all;
}
.zt-pill {
  display: inline-block;
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-2);
  margin: 1px 3px 1px 0;
}
.zt-pre {
  margin: 10px 0 0;
  padding: 12px;
  border-radius: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace;
  font-size: 12px;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 300px;
  overflow-y: auto;
}
.zt-fav-preview {
  width: 48px; height: 48px;
  border-radius: 10px;
  background: #1e73be;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 700;
  font-family: sans-serif;
}

/* ---- 死链检测 ---- */
.zt-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-3);
  margin: 8px 0;
}
.zt-progress-bar {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  width: 0;
  transition: width .15s;
}
.dl-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.dl-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dl-item.is-ok .dl-dot { background: #22c55e; }
.dl-item.is-dead .dl-dot { background: #ef4444; }
.dl-url {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.dl-tag {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 999px;
}
.dl-item.is-ok .dl-tag { color: #16a34a; background: rgba(34, 197, 94, .12); }
.dl-item.is-dead .dl-tag { color: #ef4444; background: rgba(239, 68, 68, .12); }

/* ---- 生成器子页签 ---- */
.zt-subtabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}
.zt-subtabs::-webkit-scrollbar { display: none; }
.zt-subtab {
  background: none;
  border: 0;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  position: relative;
  bottom: -1px;
  white-space: nowrap;
  font-family: inherit;
}
.zt-subtab:hover { color: var(--brand); }
.zt-subtab.is-active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

/* ---- 移动端 ---- */
@media (max-width: 640px) {
  .zt-hero { padding: 20px 16px; }
  .zt-title { font-size: 22px; }
  .zt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .zt-card { padding: 12px; }
  .zt-modal { padding: 18px 14px 14px; }
}
@media (max-width: 400px) {
  .zt-grid { grid-template-columns: 1fr; }
}