/* 泰集 MVP 样式：单文件，无构建步骤。 */

:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #101828;
  --muted: #667085;
  --line: #e4e7ec;
  --brand: #4f46e5;
  --brand-strong: #4338ca;
  --brand-soft: #eef2ff;
  --ok: #0f766e;
  --ok-soft: #ccfbf1;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

a { color: inherit; text-decoration: none; }

/* ---------- 登录页 ---------- */

body.auth {
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 28px 26px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 60px -32px rgba(16, 24, 40, 0.35);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.auth-brand h1 { margin: 0; font-size: 19px; }

.auth-brand p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }

.logo {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(160deg, #6366f1, var(--brand-strong));
  color: #fff;
  font-weight: 700;
  font-size: 17px;
}

.auth-title { margin: 0 0 4px; font-size: 21px; }

.auth-sub { margin: 0 0 18px; font-size: 13px; color: var(--muted); }

label { display: block; margin: 12px 0 6px; font-size: 12.5px; color: var(--muted); }

input, select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  color: var(--text);
}

input:focus, select:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }

.btn-primary {
  width: 100%;
  height: 44px;
  margin-top: 18px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, #5b52f0, var(--brand));
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary:hover { background: var(--brand-strong); }

.btn-primary[disabled] { opacity: 0.6; cursor: default; }

.btn-ghost {
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.alert {
  margin: 0 0 12px;
  padding: 9px 12px;
  border-radius: 9px;
  background: #fef2f2;
  color: #b42318;
  font-size: 13px;
}

.hint { margin: 14px 0 0; font-size: 12px; color: var(--muted); }

.hint-strong { margin-top: 4px; color: var(--warn); }

.auth-prefs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  color: var(--muted);
}

.auth-prefs a:hover { color: var(--brand); }

/* ---------- 顶栏 ---------- */

body.app { display: flex; flex-direction: column; min-height: 100dvh; }

.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 22px;
  height: 62px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; }

.brand-text strong { display: block; font-size: 15px; }

.brand-text em { display: block; font-size: 11px; font-style: normal; color: var(--muted); }

.nav { display: flex; gap: 6px; margin-left: 8px; }

.nav a {
  padding: 7px 12px;
  border-radius: 9px;
  font-size: 13.5px;
  color: var(--muted);
}

.nav a:hover { background: var(--brand-soft); color: var(--brand-strong); }

.nav a.active { background: var(--brand-soft); color: var(--brand-strong); font-weight: 600; }

.topbar-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }

.prefs { display: flex; gap: 6px; }

.prefs select { width: auto; height: 32px; font-size: 12.5px; padding: 0 8px; }

.who { font-size: 13px; color: var(--muted); }

/* ---------- 主体 ---------- */

.main {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 22px 40px;
  flex: 1;
}

.page-head h1 { margin: 0; font-size: 24px; }

.page-head p { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; }

.filters { display: flex; gap: 8px; margin: 18px 0 16px; flex-wrap: wrap; }

.filters a {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 12.5px;
  color: var(--muted);
}

.filters a.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); }

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

.card {
  display: flex;
  flex-direction: column;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.card:hover { box-shadow: 0 14px 34px -22px rgba(16, 24, 40, 0.45); transform: translateY(-1px); }

.thumb {
  display: grid;
  place-items: center;
  height: 108px;
  border-radius: 10px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.thumb-image { background: linear-gradient(140deg, #6366f1, #0ea5e9); }
.thumb-music { background: linear-gradient(140deg, #8b5cf6, #ec4899); }
.thumb-video { background: linear-gradient(140deg, #0f766e, #22c55e); }
.thumb-software { background: linear-gradient(140deg, #475569, #0f172a); }
.thumb-course { background: linear-gradient(140deg, #f59e0b, #ef4444); }
.thumb-doc { background: linear-gradient(140deg, #0ea5e9, #14b8a6); }

.card h3 { margin: 12px 0 4px; font-size: 14.5px; }

.card p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }

.price { font-weight: 700; font-size: 15px; }

.price em { font-style: normal; font-size: 11px; font-weight: 400; color: var(--muted); margin-left: 3px; }

.chips { display: flex; gap: 4px; flex-wrap: wrap; }

.chips i {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 11px;
  font-style: normal;
}

/* ---------- 商品详情 ---------- */

.back { display: inline-block; margin-bottom: 14px; font-size: 13px; color: var(--muted); }

.back:hover { color: var(--brand); }

.detail { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 22px; }

.detail-cover {
  display: grid;
  place-items: center;
  min-height: 200px;
  border-radius: var(--radius);
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.detail-body h1 { margin: 0 0 8px; font-size: 22px; }

.detail-body .desc { margin: 0 0 18px; color: var(--muted); font-size: 13.5px; }

.detail-body h2 { margin: 0 0 10px; font-size: 14px; }

.licenses { width: 100%; border-collapse: collapse; }

.licenses th, .licenses td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.licenses th { color: var(--muted); font-size: 11.5px; font-weight: 600; }

.licenses td em { display: block; font-style: normal; color: var(--muted); font-size: 11.5px; }

.licenses .right { text-align: right; }

.licenses .btn-primary { width: auto; margin: 0; height: 36px; padding: 0 16px; font-size: 13px; }

/* ---------- 列表 / 订单 ---------- */

.section-title { margin: 28px 0 10px; font-size: 15px; }

.table { width: 100%; border-collapse: collapse; }

.table th, .table td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.table th { color: var(--muted); font-size: 11.5px; font-weight: 600; }

.mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 11.5px; color: var(--muted); }

.tag { padding: 2px 8px; border-radius: 999px; font-size: 11.5px; }

.tag.ok { background: var(--ok-soft); color: var(--ok); }

.tag.off { background: #fee2e2; color: #b42318; }

.empty { padding: 22px; text-align: center; color: var(--muted); font-size: 13px; }

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
}

.foot .sep { opacity: 0.5; }

/* ---------- 响应式 ---------- */

@media (max-width: 820px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 14px; gap: 10px; }

  .nav { margin-left: 0; order: 3; width: 100%; }

  .topbar-right { width: 100%; justify-content: space-between; }

  .detail { grid-template-columns: minmax(0, 1fr); }

  .detail-cover { min-height: 140px; }

  .main { padding: 18px 14px 32px; }

  .table th:nth-child(2), .table td:nth-child(2) { display: none; }
}

/* NID 单点登录入口 */
.auth-sep {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.auth-sep::before,
.auth-sep::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

a.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  text-decoration: none;
}
/* ---------- 内容市场：分类、排序、评分、标签 ---------- */

.sortbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  font-size: 12.5px;
  color: var(--muted);
}

.sortbar a {
  padding: 4px 10px;
  border-radius: 999px;
  color: inherit;
  text-decoration: none;
}

.sortbar a.on {
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 600;
}

.card-rating {
  margin-top: 6px;
  font-size: 12px;
  color: #b45309;
}

.card-rating em {
  font-style: normal;
  color: var(--muted);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 6px 0 10px;
  font-size: 12.5px;
  color: var(--muted);
}

.meta-row .rating {
  color: #b45309;
  font-weight: 600;
}

.meta-row .rating em {
  margin-left: 3px;
  font-style: normal;
  font-weight: 400;
  color: var(--muted);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
}

.tag {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 11.5px;
}

.table tbody th {
  width: 200px;
  color: var(--muted);
  font-weight: 600;
}
/* 密码显示/隐藏 */
.input-with-eye {
  position: relative;
}

.input-with-eye input {
  padding-right: 44px;
}

.eye-btn {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.eye-btn:hover {
  background: rgba(100, 116, 139, 0.12);
  color: var(--text);
}