/* 普通用户在线解析工具页：沿用 app.css 设计变量与 site.css 导航 */

.tp-main {
  padding-top: 30px;
  padding-bottom: 40px;
}

/* ---------- 顶部介绍 ---------- */
.tp-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.tp-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(91, 140, 255, 0.12);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.tp-hero h1 {
  margin: 12px 0 8px;
  font-size: clamp(25px, 3.2vw, 32px);
  font-weight: 800;
  letter-spacing: -1px;
}

.tp-hero p {
  max-width: 620px;
  margin: 0;
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.7;
}

.tp-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.tp-chips span {
  padding: 4px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
}

.tp-hero-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- 提示条 ---------- */
.tp-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 14px;
  border: 1px solid rgba(91, 140, 255, 0.24);
  border-radius: 12px;
  background: rgba(91, 140, 255, 0.06);
  color: var(--accent);
  font-size: 12.5px;
}

.tp-banner[hidden] {
  display: none;
}

.tp-banner p {
  flex: 1;
  margin: 0;
  line-height: 1.6;
}

.tp-banner a,
.tp-banner button {
  flex: none;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.tp-banner-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
}

.tp-banner.is-warn {
  border-color: rgba(217, 119, 6, 0.28);
  background: rgba(217, 119, 6, 0.07);
  color: #a16207;
}

/* ---------- 输入区 ---------- */
.tp-input-card {
  margin-bottom: 22px;
}

.tp-counter {
  flex: none;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.05);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
}

.tp-counter.is-ready {
  background: rgba(91, 140, 255, 0.12);
  color: var(--accent);
}

.tp-textarea {
  min-height: 156px;
  line-height: 1.75;
  font-size: 13.5px;
}

.tp-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.tp-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tp-start {
  height: 42px;
  padding: 0 22px;
  border-radius: 11px;
}

/* ---------- 结果区 ---------- */
.tp-results-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.tp-results-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.tp-results-head p {
  margin: 4px 0 0;
  color: var(--text-faint);
  font-size: 12px;
}

.tp-result-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tp-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--text-muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.tp-progress[hidden] {
  display: none;
}

.tp-progress .progress {
  flex: 1;
}

.tp-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.tp-grid:empty {
  display: none;
}

/* ---------- 任务卡片 ---------- */
.tp-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}

.tp-card:hover {
  transform: translateY(-2px);
  border-color: rgba(91, 140, 255, 0.34);
  box-shadow: var(--shadow-card);
}

.tp-cover {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, #e8eefc, #dcecfb);
}

.tp-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tp-cover-fallback,
.tp-cover-loading,
.tp-cover-error {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  text-align: center;
  color: rgba(53, 101, 232, 0.42);
  font-size: 12.5px;
}

.tp-cover-error {
  color: var(--danger);
  background: rgba(220, 38, 38, 0.05);
}

.tp-cover-loading {
  color: var(--text-muted);
}

.tp-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(91, 140, 255, 0.2);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: tp-spin 0.7s linear infinite;
}

@keyframes tp-spin {
  to { transform: rotate(360deg); }
}

.tp-dur,
.tp-qbadge,
.tp-demo-badge {
  position: absolute;
  z-index: 1;
  padding: 2px 7px;
  border-radius: 6px;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(4px);
}

.tp-dur {
  right: 8px;
  bottom: 8px;
}

.tp-qbadge {
  left: 8px;
  bottom: 8px;
  background: rgba(53, 101, 232, 0.86);
}

.tp-demo-badge {
  top: 8px;
  left: 8px;
  background: rgba(217, 119, 6, 0.9);
}

.tp-card-body {
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1;
  padding: 14px;
}

.tp-title {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.45;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.tp-author {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
  font-size: 12px;
}

.tp-avatar {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: none;
  border-radius: 50%;
  background: rgba(91, 140, 255, 0.14);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.tp-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tp-meta span {
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.045);
  color: var(--text-muted);
  font-size: 11px;
}

.tp-qualities {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tp-q {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 4px 9px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 11.5px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.16s, color 0.16s, background 0.16s;
}

.tp-q small {
  font-size: 10px;
  color: var(--text-faint);
}

.tp-q:hover {
  border-color: rgba(91, 140, 255, 0.45);
  color: var(--accent);
}

.tp-q.is-active {
  border-color: rgba(91, 140, 255, 0.5);
  background: rgba(91, 140, 255, 0.1);
  color: var(--accent);
  font-weight: 700;
}

.tp-q.is-active small {
  color: rgba(53, 101, 232, 0.72);
}

.tp-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}

.tp-download {
  flex: 1;
  height: 36px;
  border-radius: 9px;
  font-size: 12.5px;
}

.tp-icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.16s, border-color 0.16s, background 0.16s;
}

.tp-icon-btn:hover {
  color: var(--accent);
  border-color: rgba(91, 140, 255, 0.45);
  background: rgba(91, 140, 255, 0.08);
}

.tp-icon-btn.is-danger:hover {
  color: var(--danger);
  border-color: rgba(220, 38, 38, 0.3);
  background: rgba(220, 38, 38, 0.06);
}

.tp-url {
  overflow: hidden;
  margin: 0;
  color: var(--text-faint);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tp-error {
  margin: 0;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.6;
}

/* 骨架屏 */
.tp-sk {
  height: 10px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.05), rgba(15, 23, 42, 0.1), rgba(15, 23, 42, 0.05));
  background-size: 220% 100%;
  animation: tp-shimmer 1.3s ease-in-out infinite;
}

.tp-sk.is-title {
  width: 78%;
  height: 14px;
}

.tp-sk.is-short {
  width: 56%;
}

.tp-sk.is-button {
  height: 36px;
  margin-top: 6px;
  border-radius: 9px;
}

@keyframes tp-shimmer {
  0% { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}

/* ---------- 空状态 ---------- */
.tp-empty {
  padding: 24px 20px 20px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.62);
}

.tp-empty[hidden] {
  display: none;
}

.tp-steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.tp-step {
  display: flex;
  gap: 12px;
}

.tp-step > span {
  flex: none;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.tp-step b {
  display: block;
  font-size: 13px;
}

.tp-step p {
  margin: 3px 0 0;
  color: var(--text-faint);
  font-size: 12px;
}

.tp-empty-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.tp-empty-foot p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.tp-empty-foot > div {
  display: flex;
  gap: 8px;
}

/* ---------- 页脚 ---------- */
.tp-footer {
  margin-top: 10px;
  border-top: 1px solid var(--border);
  padding: 20px 0 26px;
}

.tp-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  width: min(1200px, calc(100% - 48px));
  margin: 0 auto;
  color: var(--text-faint);
  font-size: 12px;
}

.tp-footer-inner a {
  margin-left: 14px;
  color: var(--text-muted);
}

.tp-footer-inner a:hover {
  color: var(--accent);
}

/* ---------- 设置弹窗 ---------- */
.tp-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 15, 28, 0.44);
  backdrop-filter: blur(4px);
}

.tp-modal[hidden] {
  display: none;
}

.tp-dialog {
  width: 100%;
  max-width: 430px;
  max-height: calc(100vh - 40px);
  overflow: auto;
  border-radius: var(--radius-xl);
  background: #fff;
  box-shadow: 0 28px 72px rgba(8, 15, 28, 0.28);
}

.tp-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 0;
}

.tp-dialog-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
}

.tp-dialog-head p {
  margin: 4px 0 0;
  color: var(--text-faint);
  font-size: 12px;
}

.tp-close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.06);
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.tp-close:hover {
  background: rgba(15, 23, 42, 0.12);
}

.tp-dialog-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 22px 18px;
}

.tp-dialog-body .label {
  margin-top: 6px;
}

.tp-key-row {
  display: flex;
  gap: 8px;
}

.tp-key-row .input {
  flex: 1;
  min-width: 0;
}

.tp-dialog-body .help a {
  color: var(--accent);
}

.tp-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elev);
  cursor: pointer;
}

.tp-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.tp-check b {
  display: block;
  font-size: 12.5px;
}

.tp-check small {
  display: block;
  margin-top: 2px;
  color: var(--text-faint);
  font-size: 11px;
}

.tp-dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 22px 22px;
}

/* ---------- 登录账号 ---------- */
.tp-account {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 200px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(91, 140, 255, 0.1);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tp-account em {
  flex: none;
  font-style: normal;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.tp-account-box {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elev);
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.tp-account-box b {
  color: var(--ink);
  font-size: 13px;
}

.tp-account-box p {
  margin: 4px 0 0;
}

.tp-account-box code {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.07);
  color: var(--ink);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11.5px;
}

.tp-account-box a {
  color: var(--accent);
}

/* ---------- 轻提示 ---------- */
.tp-toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(380px, calc(100vw - 32px));
}

.tp-toast {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(8, 15, 28, 0.14);
  color: var(--text);
  font-size: 12.5px;
  animation: tp-toast-in 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.tp-toast-dot {
  width: 7px;
  height: 7px;
  flex: none;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.tp-toast p {
  flex: 1;
  margin: 0;
  line-height: 1.55;
  word-break: break-word;
}

.tp-toast.is-success .tp-toast-dot { background: var(--success); }
.tp-toast.is-warning .tp-toast-dot { background: var(--warning); }
.tp-toast.is-error .tp-toast-dot { background: var(--danger); }

@keyframes tp-toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 响应式 ---------- */
@media (min-width: 640px) {
  .tp-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
  }
}

@media (min-width: 760px) {
  .tp-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .tp-account {
    max-width: 120px;
    padding: 0 9px;
    font-size: 12px;
  }

  .tp-main {
    padding-top: 20px;
  }

  .tp-hero-actions {
    width: 100%;
  }

  .tp-hero-actions .btn {
    flex: 1;
  }

  .tp-toolbar {
    align-items: stretch;
  }

  .tp-start {
    width: 100%;
  }

  .tp-empty-foot {
    flex-direction: column;
    align-items: flex-start;
  }

  .tp-empty-foot > div {
    width: 100%;
  }

  .tp-empty-foot .btn {
    flex: 1;
  }

  .tp-footer-inner {
    width: calc(100% - 32px);
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .tp-footer-inner a {
    margin-left: 0;
    margin-right: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tp-spinner,
  .tp-sk,
  .tp-toast {
    animation: none;
  }
}
