/* ============================================================
   信鸽AI · AI 电话外呼平台 控制台样式
   风格：深色科技感（深蓝底 + 青色高亮 + 细边框微光 + 等宽数字）
   ============================================================ */

:root {
  --bg: #070d18;
  --bg-soft: #0b1524;
  --card: rgba(18, 30, 48, 0.86);
  --card-border: rgba(56, 189, 248, 0.16);
  --card-glow: 0 0 0 1px rgba(56, 189, 248, 0.08), 0 18px 40px rgba(0, 0, 0, 0.45);
  --cyan: #22d3ee;
  --blue: #3b82f6;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --text: #e8eefc;
  --text-dim: #93a4c3;
  --text-mute: #64748b;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(34, 211, 238, 0.14), transparent 60%),
    radial-gradient(900px 500px at 95% 0%, rgba(59, 130, 246, 0.16), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  min-height: 100vh;
}

a { color: var(--cyan); text-decoration: none; }

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
/* 左品牌区 + 右表单，跟客户端登录界面保持同一套视觉 */
.login-stage { position: relative; }
/* 卡片背后的一层蓝光，让整块"浮"起来 */
.login-stage::before {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 760px; height: 420px; transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(47, 111, 237, 0.30), rgba(34, 211, 238, 0.10), transparent 72%);
  filter: blur(6px); pointer-events: none;
}
.login-shell {
  position: relative;
  width: 940px; max-width: 100%;
  min-height: 556px;
  display: grid;
  grid-template-columns: 400px 1fr;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(56, 189, 248, 0.20);
  box-shadow:
    0 40px 90px rgba(0, 0, 0, 0.62),
    0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.login-brand {
  position: relative;
  padding: 52px 44px 38px;
  display: flex; flex-direction: column;
  background:
    radial-gradient(560px 360px at 10% 6%, rgba(34, 211, 238, 0.22), transparent 62%),
    linear-gradient(150deg, #0e1b2a 0%, #16304c 55%, #0b1622 100%);
}
/* 淡淡网格 + 顶部光晕，科技感一点但不花 */
.login-brand::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 190, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 190, 255, 0.05) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 78%);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 78%);
}
.login-brand > * { position: relative; }
.login-brand-logo {
  width: 112px; height: 112px; border-radius: 26px;
  background: linear-gradient(160deg, #ffffff, #eef4ff); padding: 11px;
  display: flex; align-items: center; justify-content: center;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.16),
    0 22px 50px rgba(10, 97, 255, 0.5);
}
.login-brand-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.login-brand h1 {
  margin: 28px 0 0; font-size: 36px; font-weight: 700; letter-spacing: 2px; color: #fff;
  text-shadow: 0 2px 18px rgba(34, 211, 238, 0.28);
}
.login-brand-sub { margin: 10px 0 0; font-size: 15px; color: #9fb3cc; letter-spacing: 1px; }
.login-brand-line {
  display: block; width: 52px; height: 3px; border-radius: 3px; margin-top: 24px;
  background: linear-gradient(90deg, var(--cyan), var(--blue));
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.55);
}
.login-brand-desc { margin: 20px 0 0; font-size: 13px; line-height: 1.95; color: #93a8c4; }
.login-brand-foot { margin-top: auto; padding-top: 28px; font-size: 11px; color: #5d728c; letter-spacing: 1px; }

.login-form {
  background: #fff; color: #1f2733;
  padding: 56px 56px 48px;
  display: flex; flex-direction: column; justify-content: center;
}
.login-form h2 { margin: 0; font-size: 27px; letter-spacing: 1px; }
.login-form-sub { margin: 9px 0 0; font-size: 12.5px; color: #7a8698; }
.login-form .login-error {
  margin: 14px 0 0; font-size: 12.5px;
  background: rgba(220, 38, 38, 0.08); color: #b91c1c;
  border: 1px solid rgba(220, 38, 38, 0.25); border-radius: 10px; padding: 9px 12px;
}
.login-form .login-field {
  display: block; margin: 26px 0 8px; font-size: 12.5px; color: #7a8698;
}
.login-input-wrap { position: relative; }
.login-input-wrap svg {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; stroke: #9aa7bb; fill: none;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; pointer-events: none;
}
.login-input-wrap:focus-within svg { stroke: #2f6fed; }
.login-form .login-input {
  width: 100%; height: 46px; padding: 0 15px 0 44px;
  border-radius: 10px; border: 1px solid #d8dfea; background: #fff;
  color: #1f2733; font-size: 14px; outline: none; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.login-form .login-input::placeholder { color: #aab4c4; }
.login-form .login-input:hover { border-color: #c3cede; }
.login-form .login-input:focus {
  border-color: #2f6fed; box-shadow: 0 0 0 4px rgba(47, 111, 237, 0.13);
}
.login-form .login-check {
  display: flex; align-items: center; gap: 8px;
  margin-top: 18px; font-size: 12.5px; color: #7a8698; cursor: pointer;
}
.login-form .login-check input { width: auto; accent-color: #2f6fed; cursor: pointer; }
.login-form .login-submit {
  margin-top: 22px; height: 46px; border-radius: 10px; border: 0; cursor: pointer;
  background: linear-gradient(135deg, #2f6fed 0%, #22a7d8 100%);
  color: #fff; font-size: 15.5px; font-weight: 600; font-family: inherit; letter-spacing: 2px;
  box-shadow:
    0 12px 26px rgba(47, 111, 237, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: filter .15s, transform .15s, box-shadow .15s;
}
.login-form .login-submit:hover {
  filter: brightness(1.06); transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(47, 111, 237, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.login-form .login-submit:active { transform: translateY(0); }
.login-form-foot { margin: 16px 0 0; font-size: 11.5px; color: #9aa7bb; text-align: center; }

/* 小屏：品牌区收成顶部一条，表单往下排 */
@media (max-width: 820px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { padding: 28px 28px 22px; }
  .login-brand-logo { width: 70px; height: 70px; border-radius: 18px; }
  .login-brand h1 { font-size: 25px; margin-top: 18px; }
  .login-brand-desc, .login-brand-line, .login-brand-foot { display: none; }
  .login-form { padding: 28px 28px 32px; }
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  padding: 3px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08);
}
.brand-logo img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}
.brand-name { font-size: 20px; font-weight: 700; letter-spacing: 1px; }
.brand-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

/* ---------- 布局 ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 208px;
  flex: 0 0 208px;
  background: linear-gradient(180deg, rgba(13, 24, 40, 0.95), rgba(9, 16, 28, 0.95));
  border-right: 1px solid var(--card-border);
  padding: 18px 12px;
}
.sidebar .brand { padding: 4px 8px 18px; }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px; margin-bottom: 4px;
  border-radius: 10px; color: var(--text-dim); font-size: 13px;
  transition: .15s;
}
.nav-item:hover { background: rgba(34, 211, 238, 0.08); color: var(--text); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.18), rgba(59, 130, 246, 0.10));
  color: #fff; box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.25);
}
.nav-group { margin: 14px 12px 6px; font-size: 11px; color: var(--text-mute); letter-spacing: 1px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 56px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; border-bottom: 1px solid var(--card-border);
  background: rgba(10, 18, 32, 0.6); backdrop-filter: blur(8px);
}
.page-title { font-size: 16px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--text-dim); }
.content { padding: 20px 22px 40px; }

/* ---------- 卡片 / 表格 / 表单 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--card-glow);
  padding: 18px;
  margin-bottom: 16px;
}
.card-title { font-size: 14px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.card-title::before {
  content: ""; width: 3px; height: 14px; border-radius: 2px;
  background: linear-gradient(180deg, var(--cyan), var(--blue));
}
.grid { display: grid; gap: 14px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid-4, .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.stat-value { font-family: Consolas, "Cascadia Mono", monospace; font-size: 28px; font-weight: 700; color: #fff; }
.stat-label { color: var(--text-dim); font-size: 12px; margin-top: 6px; }
.stat-hint { color: var(--text-mute); font-size: 11px; margin-top: 4px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 10px; border-bottom: 1px solid rgba(148, 163, 184, 0.12); text-align: left; }
th { color: var(--text-dim); font-weight: 500; font-size: 12px; }
tr:hover td { background: rgba(34, 211, 238, 0.04); }

label.field { display: block; color: var(--text-dim); font-size: 12px; margin: 12px 0 6px; }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 9px 11px; border-radius: 9px;
  background: rgba(8, 15, 26, 0.85); color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.22); outline: none; font-family: inherit; font-size: 13px;
}
input:focus, select:focus, textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12); }
/* 单行控件统一高度（下拉框默认比输入框高 2px，排在一起会参差） */
input[type=text], input[type=password], input[type=number], select { height: 38px; box-sizing: border-box; }
textarea { resize: vertical; min-height: 74px; }

/* 话术设置：每句一个框，整行排开，所有框一样宽、一样高 */
.script-list { display: flex; flex-direction: column; gap: 16px; }
.script-item > label.field { margin-top: 0; }
.script-item textarea { min-height: 74px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 9px; border: 1px solid transparent;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #03121f; font-weight: 600; font-size: 13px; cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn-ghost {
  background: rgba(34, 211, 238, 0.08); color: var(--cyan);
  border: 1px solid rgba(34, 211, 238, 0.28);
}
.btn-danger { background: rgba(248, 113, 113, 0.14); color: var(--red); border: 1px solid rgba(248, 113, 113, 0.35); }
.btn-block { width: 100%; justify-content: center; margin-top: 18px; }

/* 时间范围切换（数据大盘的 7 / 15 / 30 天） */
.chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 13px; border-radius: 999px; font-size: 12px;
  color: var(--cyan); text-decoration: none;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.28);
}
.chip:hover { filter: brightness(1.15); }
.chip.on {
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #03121f; font-weight: 700; border-color: transparent;
}

.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; }
.tag-ok { background: rgba(52, 211, 153, 0.14); color: var(--green); }
.tag-warn { background: rgba(251, 191, 36, 0.14); color: var(--amber); }
.tag-bad { background: rgba(248, 113, 113, 0.14); color: var(--red); }
.tag-info { background: rgba(34, 211, 238, 0.12); color: var(--cyan); }

.alert { padding: 10px 12px; border-radius: 10px; margin-bottom: 14px; font-size: 13px; }
.alert-err { background: rgba(248, 113, 113, 0.12); color: #fecaca; border: 1px solid rgba(248, 113, 113, 0.3); }
.alert-ok { background: rgba(52, 211, 153, 0.12); color: #bbf7d0; border: 1px solid rgba(52, 211, 153, 0.3); }

.row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.col { flex: 1; min-width: 180px; }
.muted { color: var(--text-dim); }
.mono { font-family: Consolas, "Cascadia Mono", monospace; }

/* 线路卡片（客户端用不到，这里给"通话设置"页预览用） */
.line-card {
  border: 1px solid var(--card-border); border-radius: 12px; padding: 14px;
  background: linear-gradient(160deg, rgba(23, 37, 58, 0.9), rgba(13, 22, 38, 0.9));
}

/* ---------- 弹窗（所有"新建"都走这里，风格统一） ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(4, 10, 20, 0.66);
  backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-mask.open { display: flex; }
.modal-card {
  width: 620px; max-width: 100%; max-height: 86vh; overflow: auto;
  background: linear-gradient(160deg, rgba(23, 37, 58, 0.98), rgba(12, 20, 34, 0.98));
  border: 1px solid var(--card-border); border-radius: 16px;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.6);
  padding: 20px 22px 18px;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.modal-title::before {
  content: ""; width: 3px; height: 14px; border-radius: 2px;
  background: linear-gradient(180deg, var(--cyan), var(--blue));
}
.modal-close { cursor: pointer; color: var(--text-dim); font-size: 20px; line-height: 1; padding: 0 4px; }
.modal-close:hover { color: #fff; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* 工具条：筛选 + 分页 */
.toolbar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .col { flex: 0 0 auto; }
.pager { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.pager .muted { font-size: 12px; }
