/* ============================================================
   天穹通话 · 独立后台
   只用在 /th/admin：账号与通话记录两块，不引主站后台的复杂布局
   ============================================================ */

.ta-body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-900);
  font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif);
  -webkit-font-smoothing: antialiased;
}

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

.ta-top {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 60px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.ta-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink-900);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.ta-mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--blue-600);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.ta-mark svg { width: 15px; height: 15px; fill: #fff; }

.ta-brand em {
  font-style: normal;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-400);
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}

.ta-top-right {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.ta-who {
  font-size: 12.5px;
  color: var(--ink-500);
}

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

.ta-main {
  max-width: 1140px;
  margin: 0 auto;
  padding: 26px 28px 64px;
}

.ta-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: #eceef2;
  margin-bottom: 20px;
}

.ta-tab {
  appearance: none;
  border: 0;
  background: transparent;
  height: 32px;
  padding: 0 16px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-500);
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.ta-tab:hover { color: var(--ink-800); }

.ta-tab.active {
  background: var(--surface);
  color: var(--ink-900);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
}

.ta-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.ta-bar-text b {
  display: block;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.ta-bar-text span {
  display: block;
  margin-top: 5px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-400);
  max-width: 640px;
}

/* ------------------------------ 表格 ------------------------------ */

.ta-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.ta-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.ta-table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-400);
  padding: 11px 16px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.ta-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-700);
  vertical-align: middle;
}

.ta-table tr:last-child td { border-bottom: 0; }
.ta-table tr:hover td { background: #fafbfc; }
.ta-table .right { text-align: right; }

.ta-name { font-weight: 500; color: var(--ink-900); }
.ta-account { font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace); font-size: 12.5px; color: var(--ink-500); }

.ta-empty {
  text-align: center;
  color: var(--ink-300);
  padding: 38px 16px !important;
  font-size: 12.5px;
}

.ta-badge {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}

.ta-badge.active { background: var(--green-soft); color: #0d7a3e; }
.ta-badge.pending { background: #fff7e6; color: #9a6400; }
.ta-badge.disabled,
.ta-badge.rejected { background: #f2f3f5; color: var(--ink-400); }
.ta-badge.live { background: #fff0ef; color: var(--red-strong); }
.ta-badge.ended { background: #f2f3f5; color: var(--ink-400); }
.ta-badge.scheduled { background: var(--blue-50); color: var(--blue-700); }

/* 通话记录里的时间与人数：主值一行，补充信息（时长）挂第二行，
   靠字号和颜色拉开层级，不靠加粗堆叠 */
.ta-dim { color: var(--ink-300); }

.ta-sub {
  display: block;
  margin-top: 3px;
  font-style: normal;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--ink-400);
}

.ta-peak {
  font-weight: 600;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
}

.ta-live-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: #0d7a3e;
}

.ta-live-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #12b76a;
  box-shadow: 0 0 0 3px rgba(18, 183, 106, 0.14);
}

/* ------------------------------ 开关 ------------------------------ */

.ta-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.ta-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.ta-track {
  position: relative;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: #d5dae1;
  transition: background 0.18s ease;
}

.ta-track::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.22);
  transition: transform 0.18s ease;
}

.ta-switch input:checked + .ta-track { background: var(--blue-600); }
.ta-switch input:checked + .ta-track::after { transform: translateX(14px); }
.ta-switch input:focus-visible + .ta-track { box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.2); }
.ta-switch input:disabled + .ta-track { opacity: 0.55; }

.ta-switch em {
  font-style: normal;
  font-size: 11.5px;
  color: var(--ink-400);
  white-space: nowrap;
}

.ta-switch input:checked ~ em { color: var(--blue-700); }

/* ------------------------------ 弹窗 ------------------------------ */

.ta-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.ta-modal.hide { display: none; }

.ta-modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(16, 20, 26, 0.44);
  backdrop-filter: blur(2px);
}

.ta-modal-box {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: 0 24px 70px -24px rgba(16, 24, 40, 0.4);
  overflow: hidden;
}

.ta-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
}

.ta-modal-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.ta-modal-body { padding: 2px 18px 6px; }
.ta-modal-body .field { margin-bottom: 13px; }

.ta-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 18px 16px;
  border-top: 1px solid var(--line-soft);
  background: var(--bg-soft);
}

.ta-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg-soft);
  cursor: pointer;
  margin-bottom: 4px;
}

.ta-check input {
  margin: 2px 0 0;
  width: 14px;
  height: 14px;
  accent-color: var(--blue-600);
  flex: 0 0 auto;
}

.ta-check span {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-700);
  line-height: 1.5;
}

.ta-check em {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-weight: 400;
  font-size: 11.5px;
  color: var(--ink-400);
}

/* ------------------------------ 提示 ------------------------------ */

.ta-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 12px);
  z-index: 80;
  max-width: 86vw;
  padding: 10px 16px;
  border-radius: 9px;
  background: rgba(25, 28, 33, 0.92);
  color: #fff;
  font-size: 12.5px;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.ta-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ------------------------------ 账号管理补充 ------------------------------ */

.ta-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

/* 状态直接做成下拉，改完即时生效 */
.ta-status {
  appearance: none;
  -webkit-appearance: none;
  height: 26px;
  width: 86px;
  padding: 0 22px 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2398a2b3' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  font-size: 12px;
  color: var(--ink-700);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.ta-status:hover { border-color: #c3cad4; }
.ta-status:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.16); }
.ta-status.active { background-color: var(--green-soft); border-color: transparent; color: #0d7a3e; }
.ta-status.disabled { background-color: #f2f3f5; border-color: transparent; color: var(--ink-400); }
.ta-status.pending { background-color: #fff7e6; border-color: transparent; color: #9a6400; }

/* 到期时间：主值一行，剩余天数第二行 */
.ta-exp {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.35;
  font-size: 12.5px;
  color: var(--ink-700);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ta-exp em {
  font-style: normal;
  margin-top: 2px;
  font-size: 11px;
  color: var(--ink-400);
}

.ta-exp.forever { color: #0d7a3e; font-weight: 500; }
.ta-exp.warn, .ta-exp.warn em { color: #b25c00; }
.ta-exp.bad, .ta-exp.bad em { color: var(--red-strong); font-weight: 500; }

.ta-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  flex-wrap: nowrap;
}

.ta-scroll-hint { display: none; }

.ta-danger { color: var(--red-strong); }
.ta-danger:hover { background: #fff1f0; }

.ta-mono { font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace); }

.ta-modal-lg { max-width: 540px; }
.ta-modal-note {
  margin: 0 0 13px;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--ink-500);
}
.ta-modal-note b { color: var(--ink-900); }

.ta-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 12px;
}

.ta-batch-preview {
  margin: 2px 0 12px;
  padding: 9px 11px;
  border-radius: 8px;
  background: var(--blue-50);
  color: var(--blue-700);
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 12.5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.ta-exp-choices {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.ta-exp-choice { position: relative; margin: 0; }

.ta-exp-choice input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.ta-exp-choice span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font-size: 13px;
  color: var(--ink-700);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.ta-exp-choice input:checked + span {
  border-color: var(--blue-600);
  background: var(--blue-50);
  color: var(--blue-700);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--blue-600);
}

.ta-exp-choice input:focus-visible + span { box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.18); }

.ta-result {
  width: 100%;
  min-height: 168px;
  resize: vertical;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 12.5px;
  line-height: 1.65;
  white-space: pre;
  overflow: auto;
}

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

@media (max-width: 760px) {
  .ta-top { padding: 0 16px; height: 56px; }
  .ta-brand em { display: none; }
  .ta-who { display: none; }
  .ta-main { padding: 18px 14px 48px; }
  .ta-bar { flex-direction: column; align-items: flex-start; gap: 12px; }
  /* 窄屏让表格横向滚动，而不是把姓名压成两行 */
  .ta-card {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* 右边缘一道渐隐，暗示"右边还有内容" */
    background-image: linear-gradient(to left, rgba(25, 28, 33, 0.06), transparent 22px);
    background-repeat: no-repeat;
    background-position: right;
    background-size: 22px 100%;
  }
  .ta-table { min-width: 1020px; }
  .ta-table th, .ta-table td { white-space: nowrap; }
  .ta-form-grid { grid-template-columns: 1fr; }
  .ta-exp-choices { grid-template-columns: repeat(2, 1fr); }
  .ta-scroll-hint {
    display: block;
    margin-top: 8px;
    font-size: 11.5px;
    color: var(--ink-300);
    text-align: center;
  }
}

.ta-badge.expired { background: #fff0ef; color: var(--red-strong); }

/* ------------------------------ 数据总览 ------------------------------ */

.ov-stamp { font-size: 12px; color: var(--ink-400); font-variant-numeric: tabular-nums; }

.ov-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.ov-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 22px 18px;
}

.ov-card .k { font-size: 12.5px; color: var(--ink-400); }

.ov-card .v {
  margin-top: 12px;
  font-size: 34px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.ov-card .v small {
  margin-left: 6px;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--ink-400);
}

.ov-card .s { margin-top: 10px; font-size: 12px; color: var(--ink-400); }

.ov-today {
  margin-top: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 22px 20px;
}

.ov-today-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--ink-400);
}

.ov-dot { width: 6px; height: 6px; border-radius: 50%; background: #12b76a; }

.ov-today-row { display: flex; margin-top: 14px; }

.ov-today-item { flex: 1; }

.ov-today-item b {
  display: block;
  font-size: 30px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.ov-today-item span { display: block; margin-top: 8px; font-size: 12px; color: var(--ink-400); }

.ov-chart-card {
  margin-top: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 22px 14px;
}

.ov-chart-head { display: flex; align-items: baseline; justify-content: space-between; }
.ov-chart-head b { font-size: 13.5px; font-weight: 600; }
.ov-chart-head span { font-size: 12px; color: var(--ink-400); font-variant-numeric: tabular-nums; }

.ov-chart { display: flex; align-items: flex-end; height: 148px; margin-top: 16px; }

.ov-bar {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.ov-bar i {
  display: block;
  width: 46px;
  max-width: 62%;
  border-radius: 4px 4px 0 0;
  background: #dfe7f5;
  transition: height 0.3s ease;
}

.ov-bar.on i { background: var(--blue-600); }

.ov-bar em {
  font-style: normal;
  font-size: 11.5px;
  color: var(--ink-400);
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

.ov-bar.on em { color: var(--blue-600); font-weight: 600; }

.ov-x { display: flex; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.ov-x span { flex: 1; text-align: center; font-size: 11.5px; color: var(--ink-400); }

@media (max-width: 720px) {
  .ov-grid { grid-template-columns: 1fr; gap: 10px; }
  .ov-card { padding: 16px 18px; }
  .ov-card .v { font-size: 28px; }
  .ov-today { padding: 16px 18px 18px; }
  .ov-today-item b { font-size: 24px; }
  .ov-chart-card { padding: 16px 18px 12px; }
  .ov-chart { height: 118px; }
  .ov-bar i { width: 24px; }
}

/* ------------------------------ 此刻在会 ------------------------------ */

.ov-dot-live {
  background: #12b76a;
  box-shadow: 0 0 0 3px rgba(18, 183, 106, 0.16);
  animation: ovPulse 2.4s ease-in-out infinite;
}

@keyframes ovPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(18, 183, 106, 0.16); }
  50% { box-shadow: 0 0 0 6px rgba(18, 183, 106, 0.06); }
}

.ov-live .ov-today-row { margin-top: 16px; align-items: flex-end; }

.ov-live-note {
  flex: 1;
  align-self: center;
  font-size: 12px;
  line-height: 1.75;
  color: var(--ink-400);
}

/* ------------------------------ 账号到期 ------------------------------ */

.ov-exp-card {
  margin-top: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 22px 20px;
}

.ov-exp-list { margin-top: 16px; }

.ov-exp-row {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 32px;
}

.ov-exp-row .k {
  flex: 0 0 76px;
  font-size: 12.5px;
  color: var(--ink-400);
  font-variant-numeric: tabular-nums;
}

.ov-exp-row .bar {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: var(--line-soft, #f0f3f8);
  overflow: hidden;
}

.ov-exp-row .bar b {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: #b9c8dd;
  transition: width 0.35s ease;
}

.ov-exp-row .n {
  flex: 0 0 54px;
  text-align: right;
  font-size: 13.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.ov-exp-row.bad .k,
.ov-exp-row.bad .n { color: #d92d20; }
.ov-exp-row.bad .bar b { background: #e8625a; }

.ov-exp-row.soon .k,
.ov-exp-row.soon .n { color: #e07a12; }
.ov-exp-row.soon .bar b { background: #f0a23c; }

.ov-exp-row.warn .bar b { background: #e8c05a; }
.ov-exp-row.warn .n { color: #b7791f; }

.ov-exp-row.ok .bar b { background: #cfd9e6; }
.ov-exp-row.ok .n { color: var(--ink-400); font-weight: 500; }

@media (max-width: 720px) {
  .ov-exp-card { padding: 16px 18px 18px; }
  .ov-exp-row { height: 34px; gap: 8px; }
  .ov-exp-row .k { flex-basis: 68px; font-size: 12px; }
  .ov-exp-row .n { flex-basis: 40px; font-size: 13px; }
}

@media (max-width: 720px) {
  .ov-live-note { display: none; }
}
