/* =============================================================================
 * pt-platform.css — 培婷管理平台「入口 + 统一登录」视觉层（v1，2026-11-12）
 *
 * 唯一源：K:/Workbuddy/PT-websit/deploy/platform-v1/shared/pt-platform.css
 * 部署副本（两份，内容完全相同）：
 *   /opt/office-wifi/tenant-portal/public/shared/pt-platform.css
 *   /opt/office-wifi/qr-saas/public/qr/shared/pt-platform.css
 *
 * 定位：只负责「平台入口页」与「统一登录/注册页」的版式与组件。
 *   - 令牌（颜色/间距/字号/圆角/阴影）一律继承 pt-design.css，不另起一套色板，
 *     保证登录页与二维码控制台内部页面同源同调。
 *   - 命名空间全部 .ptp- 前缀，避免与既有 .pt-（设计系统）、.card/.btn（历史页）冲突。
 *   - 不写 !important；不覆盖 .pt- 既有类；本文件对既有页面零影响（不被引用即无作用）。
 * ========================================================================== */

/* ---------- 平台层私有令牌（在 pt-design 之上少量补充） ---------- */
.ptp-scope {
  --ptp-panel-1: #142238;
  --ptp-panel-2: #0d1626;
  --ptp-panel-ink: #e8eefb;
  --ptp-panel-muted: #93a4c2;
  --ptp-panel-line: rgba(255, 255, 255, .12);
  --ptp-dot: rgba(255, 255, 255, .07);
  --ptp-card: var(--pt-surface, #fff);
  --ptp-r-xl: 22px;
  --ptp-ease: cubic-bezier(.22, .61, .36, 1);
}

/* =============================================================================
 * 1. 统一登录 / 注册页
 * ========================================================================== */
.ptp-auth-body {
  margin: 0;
  min-height: 100vh;
  background: var(--pt-bg, #f6f7f9);
}

.ptp-auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 46%) minmax(0, 54%);
  background: var(--pt-bg, #f6f7f9);
}

/* ---------- 左：品牌面板 ---------- */
.ptp-aside {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 44px 48px;
  color: var(--ptp-panel-ink);
  background:
    radial-gradient(120% 90% at 12% 8%, #1d3252 0%, var(--ptp-panel-1) 42%, var(--ptp-panel-2) 100%);
}
.ptp-aside::after {  /* 点阵纹理：制造纵深，避免大色块发闷 */
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--ptp-dot) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .85), transparent 78%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .85), transparent 78%);
  pointer-events: none;
}
.ptp-aside > * { position: relative; z-index: 1; }

.ptp-aside-brand { display: flex; align-items: center; gap: 12px; }
.ptp-aside-brand .ptp-mark {
  width: 40px; height: 40px; flex: none; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 17px; letter-spacing: -.5px;
  color: #fff; background: linear-gradient(160deg, #4b86f5, #2f6fed 62%, #2358c9);
  box-shadow: 0 6px 18px rgba(47, 111, 237, .38);
}
.ptp-aside-brand b { font-size: 15px; font-weight: 700; letter-spacing: .2px; }
.ptp-aside-brand span { display: block; font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ptp-panel-muted); margin-top: 2px; }

.ptp-aside-mid { margin-top: auto; margin-bottom: auto; padding: 40px 0 32px; }
.ptp-aside h1 {
  font-size: clamp(28px, 2.6vw, 38px);
  line-height: 1.28;
  letter-spacing: -.6px;
  margin: 0 0 14px;
  font-weight: 700;
  text-wrap: pretty;
}
.ptp-aside h1 em { font-style: normal; color: #8fb6ff; }
.ptp-aside-lead {
  margin: 0 0 30px;
  font-size: var(--pt-fs-sm, 13px);
  line-height: 1.75;
  color: var(--ptp-panel-muted);
  max-width: 34ch;
}

.ptp-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.ptp-points li { display: flex; align-items: flex-start; gap: 10px;
  font-size: var(--pt-fs-sm, 13px); color: #cdd9ee; line-height: 1.6; }
.ptp-points svg { flex: none; margin-top: 2px; opacity: .9; }
.ptp-points b { color: #fff; font-weight: 600; }

.ptp-aside-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding-top: 20px; border-top: 1px solid var(--ptp-panel-line);
  font-size: 11.5px; color: var(--ptp-panel-muted); letter-spacing: .02em;
}
.ptp-aside-foot .dot-live {
  width: 7px; height: 7px; border-radius: 50%; background: #35d39a; flex: none;
  box-shadow: 0 0 0 3px rgba(53, 211, 154, .18);
}

/* ---------- 右：表单区 ---------- */
.ptp-main {
  display: flex; align-items: center; justify-content: center;
  padding: 48px 32px;
}
.ptp-auth-card {
  width: 100%; max-width: 392px;
  animation: ptp-rise .42s var(--ptp-ease) both;
}
@keyframes ptp-rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.ptp-ctx {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 11px 5px 7px; margin-bottom: 18px;
  border: 1px solid var(--pt-line, #e3e8ef);
  background: var(--pt-surface, #fff);
  border-radius: var(--pt-r-pill, 999px);
  font-size: var(--pt-fs-xs, 12px); color: var(--pt-ink-2, #46536a);
  box-shadow: 0 1px 2px rgba(20, 30, 50, .04);
}
.ptp-ctx[hidden] { display: none; }
.ptp-ctx .ico {
  width: 20px; height: 20px; border-radius: 6px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--pt-primary-soft, #eaf1ff); color: var(--pt-primary, #2f6fed);
  font-size: 11px; font-weight: 700;
}
.ptp-ctx b { color: var(--pt-ink, #1c2430); font-weight: 600; }

.ptp-auth-title { font-size: var(--pt-fs-2xl, 26px); line-height: 1.3;
  letter-spacing: -.4px; margin: 0 0 6px; font-weight: 700; }
.ptp-auth-sub { margin: 0 0 24px; font-size: var(--pt-fs-sm, 13px);
  color: var(--pt-muted, #6b7686); line-height: 1.65; }

/* 分段控件（比旧 tabs 更贴近「工具型产品」的克制感） */
.ptp-seg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  padding: 4px; margin-bottom: 22px;
  background: #eef1f6; border-radius: 10px;
}
.ptp-seg button {
  min-height: 38px; font: inherit; font-size: var(--pt-fs-sm, 13px); font-weight: 600;
  color: var(--pt-muted, #6b7686); background: transparent;
  border: 0; border-radius: 7px; cursor: pointer;
  transition: color .18s var(--ptp-ease), background .18s var(--ptp-ease), box-shadow .18s var(--ptp-ease);
}
.ptp-seg button:hover { color: var(--pt-ink, #1c2430); }
.ptp-seg button.on {
  color: var(--pt-ink, #1c2430); background: #fff;
  box-shadow: 0 1px 2px rgba(20, 30, 50, .10), 0 3px 10px rgba(20, 30, 50, .06);
}
.ptp-seg button:focus-visible { outline: none; box-shadow: var(--pt-focus, 0 0 0 3px rgba(47,111,237,.18)); }

/* 输入：包一层容器，支持右侧「显示密码」与错误态描边 */
.ptp-field { margin-bottom: 15px; }
.ptp-field-label {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--pt-ink-2, #46536a);
  margin-bottom: 7px;
}
.ptp-field-label .opt { font-weight: 400; color: var(--pt-muted, #6b7686); font-size: 11.5px; }
.ptp-input-wrap { position: relative; display: flex; align-items: center; }
.ptp-input-wrap .pt-input { padding-right: 42px; min-height: 42px; }
.ptp-input-wrap .ptp-eye {
  position: absolute; right: 6px; width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; border-radius: 7px;
  color: var(--pt-muted, #6b7686); cursor: pointer;
  transition: color .16s var(--ptp-ease), background .16s var(--ptp-ease);
}
.ptp-input-wrap .ptp-eye:hover { color: var(--pt-ink, #1c2430); background: #f1f4f8; }
.ptp-input-wrap .ptp-eye:focus-visible { outline: none; box-shadow: var(--pt-focus, 0 0 0 3px rgba(47,111,237,.18)); }

.ptp-field.has-err .pt-input { border-color: var(--pt-danger, #c0392b); }
.ptp-field.has-err .pt-input:focus { box-shadow: 0 0 0 3px rgba(192, 57, 43, .14); }
.ptp-field-err {
  display: none; margin-top: 6px;
  font-size: 12px; color: var(--pt-danger, #c0392b);
}
.ptp-field.has-err .ptp-field-err { display: block; }

/* 密码强度：三段细条，颜色跟随语义色 */
.ptp-meter { display: flex; gap: 4px; margin-top: 8px; }
.ptp-meter i { height: 3px; flex: 1; border-radius: 999px; background: #e6eaf1;
  transition: background .2s var(--ptp-ease); }
.ptp-meter[data-score="1"] i:nth-child(1) { background: var(--pt-danger, #c0392b); }
.ptp-meter[data-score="2"] i:nth-child(-n+2) { background: var(--pt-warn, #b7791f); }
.ptp-meter[data-score="3"] i { background: var(--pt-success, #12805c); }
.ptp-meter-note { margin-top: 6px; font-size: 11.5px; color: var(--pt-muted, #6b7686); }

/* 提交按钮：带 16px 转圈，避免文案跳动 */
.ptp-submit {
  position: relative; width: 100%; min-height: 46px; margin-top: 6px;
  font: inherit; font-size: var(--pt-fs, 14px); font-weight: 600; color: #fff;
  background: var(--pt-primary, #2f6fed); border: 1px solid var(--pt-primary, #2f6fed);
  border-radius: 9px; cursor: pointer;
  transition: background .18s var(--ptp-ease), box-shadow .18s var(--ptp-ease), transform .1s var(--ptp-ease);
}
.ptp-submit:hover { background: var(--pt-primary-hover, #245cd0); border-color: var(--pt-primary-hover, #245cd0); }
.ptp-submit:active { transform: translateY(1px); }
.ptp-submit:focus-visible { outline: none; box-shadow: var(--pt-focus, 0 0 0 3px rgba(47,111,237,.18)); }
.ptp-submit[disabled] { opacity: .68; cursor: progress; }
.ptp-submit .spin { display: none; width: 15px; height: 15px; margin-right: 8px;
  border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%;
  animation: ptp-spin .7s linear infinite; vertical-align: -2px; }
.ptp-submit[aria-busy="true"] .spin { display: inline-block; }
@keyframes ptp-spin { to { transform: rotate(360deg); } }

.ptp-auth-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--pt-line, #e3e8ef);
  font-size: var(--pt-fs-xs, 12px); color: var(--pt-muted, #6b7686);
  flex-wrap: wrap;
}
.ptp-auth-foot a { color: var(--pt-primary, #2f6fed); font-weight: 600; }

.ptp-legal { margin-top: 22px; font-size: 11.5px; color: #97a1b0; line-height: 1.7; }
.ptp-legal a { color: #7b8798; text-decoration: underline; text-underline-offset: 2px; }

/* 已登录：产品选择 */
.ptp-signed { text-align: center; }
.ptp-signed h2 { font-size: var(--pt-fs-xl, 20px); margin: 0 0 6px; }
.ptp-signed p { font-size: var(--pt-fs-sm, 13px); color: var(--pt-muted, #6b7686); margin-bottom: 22px; }
.ptp-signed .pt-product-grid { text-align: left; }
.ptp-signed .pt-btn { margin-top: 18px; }

/* -----------------------------------------------------------------------------
 * 链接态修正（真缺陷，2026-11-12 浏览器验收抓出）
 *
 * 现象：入口页主按钮「蓝底 + 蓝字」文字不可见；产品卡标题被染成主色。
 * 根因：pt-design.css 里的 .pt-scope a { color: var(--pt-primary) } 是 (0,1,1)，
 *       而 .pt-btn-primary { color:#fff } 只有 (0,1,0) —— 元素+类 压过 单类。
 *       卡片 <a class="ptp-prod"> 内的 h3 同理被继承成主色。
 * 修法：在平台层用 a.pt-btn / a.pt-btn-primary（(0,2,1)/(0,2,1)）显式抬回，
 *       不改 pt-design.css（二维码控制台 8 个页面共用，改动面太大）。
 * -------------------------------------------------------------------------- */
.ptp-scope a.pt-btn { color: var(--pt-ink-2); }
.ptp-scope a.pt-btn:hover { color: var(--pt-primary); }
.ptp-scope a.pt-btn-primary,
.ptp-scope a.pt-btn-primary:hover { color: #fff; }
.ptp-scope .ptp-prod,
.ptp-scope .ptp-prod h3 { color: var(--pt-ink); }

/* =============================================================================
 * 2. 平台入口页
 * ========================================================================== */
.ptp-home-body { margin: 0; background: var(--pt-bg, #f6f7f9); }

.ptp-top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 clamp(16px, 4vw, 40px);
  height: 62px;
  background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--pt-line, #e3e8ef);
}
.ptp-top-brand { display: flex; align-items: center; gap: 10px; }
.ptp-top-brand .ptp-mark {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff;
  background: linear-gradient(160deg, #4b86f5, #2f6fed 62%, #2358c9);
}
.ptp-top-brand b { font-size: 14.5px; letter-spacing: .1px; }
.ptp-top-brand span { font-size: 11px; color: var(--pt-muted, #6b7686); }
.ptp-top-right { display: flex; align-items: center; gap: 10px; }
.ptp-who { font-size: 12.5px; color: var(--pt-ink-2, #46536a); display: flex;
  align-items: center; gap: 8px; }
.ptp-who .avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 700; color: #fff; background: #4a5b74;
}

.ptp-shell { max-width: 1040px; margin: 0 auto; padding: clamp(28px, 5vw, 56px) clamp(16px, 4vw, 32px) 56px; }

.ptp-hero { margin-bottom: clamp(26px, 4vw, 40px); }
.ptp-eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--pt-primary, #2f6fed); margin-bottom: 12px;
}
.ptp-hero h1 {
  font-size: clamp(28px, 4vw, 40px); line-height: 1.2; letter-spacing: -.9px;
  margin: 0 0 12px; font-weight: 700; text-wrap: pretty;
}
.ptp-hero p {
  margin: 0; max-width: 64ch;
  font-size: 15px; line-height: 1.8; color: var(--pt-ink-2, #46536a);
  text-wrap: pretty;
}
.ptp-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

.ptp-section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-bottom: 14px;
}
.ptp-section-head h2 { font-size: var(--pt-fs-lg, 16px); margin: 0; letter-spacing: -.2px; }
.ptp-section-head span { font-size: 12px; color: var(--pt-muted, #6b7686); }

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

.ptp-prod {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 22px; background: var(--pt-surface, #fff);
  border: 1px solid var(--pt-line, #e3e8ef); border-radius: 14px;
  text-decoration: none; color: inherit;
  box-shadow: 0 1px 2px rgba(20, 30, 50, .04);
  transition: transform .2s var(--ptp-ease), box-shadow .2s var(--ptp-ease), border-color .2s var(--ptp-ease);
}
.ptp-prod:hover {
  transform: translateY(-2px); border-color: #c5d8fb;
  box-shadow: 0 10px 26px rgba(20, 30, 50, .09);
  text-decoration: none;
}
.ptp-prod:focus-visible { outline: none; box-shadow: var(--pt-focus, 0 0 0 3px rgba(47,111,237,.18)); }
.ptp-prod-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ptp-prod-ico {
  width: 38px; height: 38px; flex: none; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--pt-primary-soft, #eaf1ff); color: var(--pt-primary, #2f6fed);
}
.ptp-prod h3 { font-size: 16px; margin: 2px 0 0; letter-spacing: -.2px; }
.ptp-prod p { margin: 0; font-size: 12.5px; line-height: 1.7;
  color: var(--pt-muted, #6b7686); flex: 1; }
.ptp-prod-go {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; font-weight: 600; color: var(--pt-primary, #2f6fed);
}
.ptp-prod:hover .ptp-prod-go { gap: 8px; }
.ptp-prod-go svg { transition: transform .2s var(--ptp-ease); }
.ptp-prod:hover .ptp-prod-go svg { transform: translateX(2px); }

.ptp-chip {
  font-size: 10.5px; font-weight: 600; letter-spacing: .04em;
  padding: 3px 8px; border-radius: 999px;
  color: var(--pt-muted, #6b7686); background: #f1f4f8; white-space: nowrap;
}
.ptp-chip.platform { color: #8a5a00; background: #fff3dc; }
.ptp-chip.site { color: #1f5c46; background: #e6f6ef; }

/* 超管卡：与产品卡区分（描边+底色微差，不用彩色左边条） */
.ptp-prod.is-admin { background: linear-gradient(180deg, #fbfcff, #fff 40%); }
.ptp-prod.is-admin .ptp-prod-ico { background: #fff3dc; color: #8a5a00; }

.ptp-foot {
  max-width: 1040px; margin: 0 auto; padding: 22px clamp(16px, 4vw, 32px) 40px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; border-top: 1px solid var(--pt-line, #e3e8ef);
  font-size: 11.5px; color: var(--pt-muted, #6b7686);
}

/* =============================================================================
 * 3. 自适应
 * ========================================================================== */
@media (max-width: 900px) {
  .ptp-auth { grid-template-columns: 1fr; }
  .ptp-aside { padding: 26px 24px 24px; }
  .ptp-aside-mid { padding: 22px 0 0; margin: 0; }
  .ptp-aside h1 { font-size: 24px; margin-bottom: 8px; }
  .ptp-aside-lead { margin-bottom: 0; max-width: none; }
  .ptp-points, .ptp-aside-foot { display: none; }
  .ptp-main { padding: 26px 20px 44px; align-items: flex-start; }
  .ptp-auth-card { max-width: 460px; }
  /* iOS 输入框 <16px 会触发整页缩放：窄屏一律抬到 16px，并把触控高度补到 46px。
     注意 .pt-input 自身是 14px（桌面密度），必须在媒体查询里用**更高特异性**覆盖
     （.ptp-input-wrap .pt-input = 0,2,0 > .pt-input = 0,1,0），否则压不回去。 */
  .ptp-input-wrap .pt-input { font-size: 16px; min-height: 46px; }
  .ptp-seg button { min-height: 42px; }
  .ptp-eye { width: 36px; height: 36px; }
}
@media (max-width: 720px) {
  .ptp-grid { grid-template-columns: 1fr; }
  .ptp-top { height: 56px; }
  .ptp-who .name { display: none; }
}
@media (max-width: 420px) {
  .ptp-prod { padding: 18px; }
  .ptp-hero-actions .pt-btn { flex: 1 1 auto; }
}

/* 尊重系统「减少动态效果」 */
@media (prefers-reduced-motion: reduce) {
  .ptp-auth-card { animation: none; }
  .ptp-prod, .ptp-prod-go svg, .ptp-submit { transition: none; }
  .ptp-submit .spin { animation-duration: 1.6s; }
}
