/* 文件快传：仅本页组件，基础样式沿用 style.css / tool.css */
.ft-start {
  display: grid;
  gap: 12px;
  justify-items: start;
  margin-top: 18px;
}

.ft-pair {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  align-items: flex-start;
  margin-top: 20px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
}
.ft-pair__qr {
  flex: none;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}
.ft-pair__qr img { display: block; width: 222px; height: 222px; }
.ft-pair__scan {
  width: 222px;
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted-fg);
}
.ft-pair__scan b { color: var(--fg, #111); }
.ft-pair__side { flex: 1 1 240px; min-width: 0; }
.ft-pair__label {
  margin: 0;
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--muted-fg);
}
.ft-pair__code {
  margin: 4px 0 0;
  font-family: var(--mono);
  font-size: 40px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: .12em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.ft-pair__ttl { margin: 6px 0 0; font-size: 13px; color: var(--muted-fg); }
.ft-pair__ttl[data-tone="error"] { color: #B42318; font-weight: 600; }
.ft-pair__acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.ft-pair__acts .btn { flex: 0 1 auto; }

.ft-files { margin-top: 20px; }

/* 输入框：沿用项目 input 类，补一个等宽大字版本 */
.ft-code-input {
  max-width: 260px;
  font-family: var(--mono);
  font-size: 22px;
  letter-spacing: .24em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.ft-join { display: grid; gap: 12px; margin-top: 18px; }
.ft-room__code { margin: 0; font-size: 14px; color: var(--muted-fg); }
.ft-room__code b {
  font-family: var(--mono);
  font-size: 18px;
  letter-spacing: .1em;
  color: var(--accent);
}

.ft-warn {
  margin: 16px 0 0;
  padding: 12px 14px;
  border: 1px solid #F0C36D;
  border-radius: 12px;
  background: #FFFAEB;
  font-size: 13px;
  line-height: 1.6;
  color: #7A4B00;
}

/* 配对成功提示：对勾描边 + 弹入 */
.ft-peer {
  display: flex;
  flex: 1 0 100%;
  align-items: center;
  gap: 10px;
  margin: 0 0 4px;
  padding: 10px 12px;
  border: 1px solid rgba(4, 120, 87, .35);
  border-radius: 12px;
  background: rgba(4, 120, 87, .07);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  animation: ft-slide-in .4s var(--ease) both;
}
.ft-peer__badge {
  display: inline-flex;
  flex: none;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  animation: ft-pop .45s var(--ease) both;
}
.ft-peer__badge svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #fff;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  animation: ft-draw .5s .18s var(--ease) forwards;
}

/* 传输通道：自动 / 仅局域网 */
.ft-net {
  margin: 16px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--muted);
}
.ft-net__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.ft-net__label { font-size: 13px; font-weight: 600; color: var(--fg); }
.ft-net__opts { display: inline-flex; gap: 6px; margin-left: auto; }
.ft-net__opt { position: relative; display: inline-flex; }
.ft-net__opt input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.ft-net__opt span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  font-size: 12.5px;
  color: var(--muted-fg);
  cursor: pointer;
  transition: border-color .2s var(--ease), color .2s var(--ease), background .2s var(--ease);
}
.ft-net__opt input:checked + span {
  border-color: var(--accent);
  background: rgba(4, 120, 87, .07);
  font-weight: 600;
  color: var(--accent);
}
.ft-net__opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.ft-net__hint {
  margin: 8px 0 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted-fg);
}

/* 建连后回显实际通道：局域网直连 / 非局域网 */
.ft-lan {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
  padding: 8px 12px;
  border: 1px solid rgba(4, 120, 87, .28);
  border-radius: 10px;
  background: rgba(4, 120, 87, .06);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--accent);
}
.ft-lan__dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(4, 120, 87, .14);
}
.ft-lan__text { min-width: 0; overflow-wrap: anywhere; }
.ft-lan[data-lan="no"] {
  border-color: var(--border);
  background: var(--muted);
  color: var(--muted-fg);
}
.ft-lan[data-lan="no"] .ft-lan__dot { background: var(--muted-fg); box-shadow: none; }

.ft-room__title {
  margin: 14px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted-fg);
}

/* 保存方式选择 */
.ft-save {
  margin: 16px 0 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
}
.ft-save legend {
  padding: 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted-fg);
}
.ft-save__opt {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
}
.ft-save__opt + .ft-save__opt { margin-top: 4px; }
.ft-save__opt:hover { background: var(--muted); }
.ft-save__opt input {
  flex: none;
  margin: 3px 0 0;
  accent-color: var(--accent);
}
.ft-save__body { display: grid; gap: 3px; min-width: 0; }
.ft-save__body b { font-size: 14px; font-weight: 600; }
.ft-save__body span { font-size: 12px; line-height: 1.6; color: var(--muted-fg); }
.ft-save__tag {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--muted);
  font-size: 11px;
  font-weight: 500;
  color: var(--muted-fg);
  vertical-align: 1px;
}
.ft-save__hint {
  margin: 10px 2px 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted-fg);
}
.ft-save__note {
  margin: 6px 2px 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted-fg);
}
.ft-save__note:empty { display: none; }
.ft-save__pick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.ft-save__pick .btn { padding: 6px 12px; font-size: 13px; }
.ft-save__picked {
  min-width: 0;
  font-size: 12px;
  color: var(--muted-fg);
  word-break: break-all;
}
.ft-save__picked[data-state="ok"] { color: var(--accent); font-weight: 600; }

/* 配对成功：居中成功卡片 + 对勾描边 */
.ft-celebrate {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: rgba(15, 23, 42, .14);
  animation: ft-fade-in .18s var(--ease) both;
}
.ft-celebrate[hidden] { display: none; }
.ft-celebrate.is-out { animation: ft-fade-out .24s var(--ease) both; }
.ft-celebrate__card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: 216px;
  padding: 26px 32px 22px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 20px 55px rgba(15, 23, 42, .24);
  animation: ft-pop-card .5s var(--ease) both;
}
.ft-celebrate__ring {
  position: absolute;
  top: 34px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0;
  animation: ft-ring 1s .12s var(--ease) both;
}
.ft-celebrate__badge {
  position: relative;
  display: inline-flex;
  width: 62px;
  height: 62px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 8px 18px rgba(4, 120, 87, .32);
}
.ft-celebrate__badge svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: #fff;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 26;
  stroke-dashoffset: 26;
  animation: ft-draw .45s .2s var(--ease) forwards;
}
.ft-celebrate__card b {
  margin-top: 4px;
  font-size: 17px;
  color: var(--accent);
}
.ft-celebrate__card > span:last-child {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted-fg);
}

/* 完成动效 */
.ft-result__icon {
  display: inline-flex;
  width: 30px;
  height: 30px;
  margin-right: 8px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: -8px;
  animation: ft-pop .45s var(--ease) both;
}
.ft-result__icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #fff;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  animation: ft-draw .5s .16s var(--ease) forwards;
}
.ft-result[data-tone="error"] .ft-result__icon { display: none; }

/* Toast */
.ft-toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  display: grid;
  gap: 8px;
  width: max-content;
  max-width: min(92vw, 420px);
  transform: translateX(-50%);
  pointer-events: none;
}
.ft-toast__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 999px;
  background: #0F172A;
  box-shadow: var(--shadow);
  font-size: 13px;
  line-height: 1.4;
  color: #fff;
  animation: ft-toast-in .32s var(--ease) both;
}
.ft-toast__item[data-tone="ok"] { background: var(--accent); }
.ft-toast__item[data-tone="error"] { background: #B42318; }
.ft-toast__item.is-out { animation: ft-toast-out .26s var(--ease) both; }
.ft-toast__item svg {
  flex: none;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes ft-pop {
  from { transform: scale(.4); opacity: 0; }
  60% { transform: scale(1.12); opacity: 1; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes ft-pop-card {
  from { transform: scale(.86) translateY(8px); opacity: 0; }
  60% { transform: scale(1.03) translateY(0); opacity: 1; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes ft-ring {
  from { transform: scale(.7); opacity: .55; }
  to { transform: scale(1.9); opacity: 0; }
}
@keyframes ft-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes ft-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}
@keyframes ft-draw { to { stroke-dashoffset: 0; } }
@keyframes ft-slide-in {
  from { transform: translateY(-6px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
@keyframes ft-toast-in {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
@keyframes ft-toast-out {
  to { transform: translateY(8px); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .ft-peer,
  .ft-peer__badge,
  .ft-peer__badge svg,
  .ft-result__icon,
  .ft-result__icon svg,
  .ft-toast__item,
  .ft-celebrate,
  .ft-celebrate__card,
  .ft-celebrate__ring,
  .ft-celebrate__badge svg {
    animation: none;
  }
  .ft-peer__badge svg,
  .ft-result__icon svg,
  .ft-celebrate__badge svg { stroke-dashoffset: 0; }
  .ft-celebrate__ring { display: none; }
}

.ft-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--muted);
  overflow: hidden;
}
.ft-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width .18s var(--ease);
}
.ft-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 0;
}
.ft-stats div {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
}
.ft-stats dt { font-size: 12px; color: var(--muted-fg); }
.ft-stats dd {
  margin: 4px 0 0;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}
.ft-current {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--muted-fg);
  word-break: break-all;
}

.ft-result {
  margin-top: 20px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
}
.ft-result[data-tone="ok"] { border-color: rgba(4, 120, 87, .45); background: rgba(4, 120, 87, .05); }
.ft-result[data-tone="error"] { border-color: #F1B5B0; background: #FEF4F3; }
.ft-result__title { margin: 0; font-size: 15px; font-weight: 700; }
.ft-result[data-tone="ok"] .ft-result__title { color: var(--accent); }
.ft-result[data-tone="error"] .ft-result__title { color: #B42318; }
.ft-result__text { margin: 6px 0 0; font-size: 13px; line-height: 1.6; color: var(--muted-fg); }
.ft-result .ts-actions { margin-top: 12px; }

@media (max-width: 640px) {
  .ft-pair { gap: 16px; }
  .ft-pair__qr { width: 100%; }
  .ft-pair__qr img { width: 100%; max-width: 180px; height: auto; margin: 0 auto; }
  .ft-pair__scan { width: auto; }
  .ft-pair__code { font-size: 34px; }
  .ft-stats { grid-template-columns: 1fr; }
  .ft-save { padding: 10px; }
  .ft-toast { bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
}
