/* =========================================================================
   NYK 运营后台 · 全局样式
   设计 Token：主色 #0ea5a4，圆角 6px，间距 8/16/24，卡片仅 1px 边框、无投影
   ========================================================================= */

:root {
  /* Element Plus 主色覆写（含派生色，避免 el-switch / el-radio 浅色态仍是官方蓝） */
  --el-color-primary: #0ea5a4;
  --el-color-primary-rgb: 14, 165, 164;
  --el-color-primary-light-3: #3fbcbb;
  --el-color-primary-light-5: #71d0cf;
  --el-color-primary-light-7: #a3e2e1;
  --el-color-primary-light-8: #bdeceb;
  --el-color-primary-light-9: #e6f7f7;
  --el-color-primary-dark-2: #0c8f8e;

  --c-primary: #0ea5a4;
  --c-primary-hover: #0c8f8e;
  --c-primary-soft: #e6f7f7;
  --c-text: #1f2937;
  --c-text-sub: #6b7280;
  --c-text-light: #909399;
  --c-border: #e5e7eb;
  --c-bg: #f7f9f9;
  --c-danger: #d9534f;
  --c-radius: 6px;
  --c-gap-1: 8px;
  --c-gap-2: 16px;
  --c-gap-3: 24px;
  --side-w: 220px;
  --side-bg: #1f2d3d;
  --side-bg-active: #16222e;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-size: 14px;
  color: var(--c-text);
  background: var(--c-bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--c-primary); text-decoration: none; }

/* ---------------- 整体布局 ---------------- */
.nyk-app { display: flex; min-height: 100vh; background: var(--c-bg); }

.nyk-side {
  width: var(--side-w);
  flex: 0 0 var(--side-w);
  background: var(--side-bg);
  color: #c8d3de;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 20;
}

.nyk-brand {
  height: 56px;
  line-height: 56px;
  padding: 0 20px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  letter-spacing: .5px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nyk-brand small { display: block; font-size: 11px; font-weight: 400; color: #8fa3b6; line-height: 12px; margin-top: -18px; }

.nyk-menu { flex: 1; overflow-y: auto; padding: 8px 0 24px; }

.nyk-main {
  margin-left: var(--side-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.nyk-top {
  height: 56px;
  background: #fff;
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.nyk-crumb { font-size: 13px; color: var(--c-text-sub); }
.nyk-crumb b { color: var(--c-text); font-weight: 500; }
.nyk-crumb .sep { margin: 0 8px; color: #c0c4cc; }

.nyk-top-right { display: flex; align-items: center; gap: 16px; }

.nyk-bell { cursor: pointer; color: var(--c-text-sub); display: flex; align-items: center; }
.nyk-bell:hover { color: var(--c-primary); }

.nyk-user { cursor: pointer; display: flex; align-items: center; gap: 8px; color: var(--c-text); font-size: 13px; }
.nyk-user .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--c-primary-soft); color: var(--c-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}

.nyk-content { padding: 24px; flex: 1; min-width: 0; }

/* ---------------- 页面骨架 ---------------- */
.nyk-page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  min-height: 56px; margin-bottom: 24px;
}
.nyk-page-head h1 { font-size: 20px; font-weight: 600; margin: 0; line-height: 28px; color: var(--c-text); }
.nyk-page-head p { margin: 4px 0 0; font-size: 13px; color: var(--c-text-light); }

.nyk-card {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--c-radius);
  padding: 20px;
}
.nyk-card + .nyk-card { margin-top: 16px; }

/* 筛选卡：全站列表页统一「单行」形态。
   32px 控件 + 12px 下边距 + 12px 上内边距 = 56px，1680 下不换行，
   比原来 16px 上下留白更紧凑，也不会让按钮和输入框看起来分家。 */
.nyk-filter { padding: 12px 16px 0; }
.nyk-filter .el-form-item { margin-right: 16px; margin-bottom: 12px; }
.nyk-filter .el-form-item:last-child { margin-right: 0; }

.nyk-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin: 16px 0 0; min-height: 32px;
}
.nyk-toolbar .left { font-size: 13px; color: var(--c-text-light); }
.nyk-toolbar .right { display: flex; gap: 8px; }

.nyk-table-card { padding: 16px 16px 8px; margin-top: 16px; }

.nyk-pager { display: flex; justify-content: flex-end; padding: 16px 0 8px; }

/* 数字列右对齐 */
.num { text-align: right; font-variant-numeric: tabular-nums; }
.time { color: var(--c-text-sub); font-variant-numeric: tabular-nums; }

/* ---------------- 仪表盘 ---------------- */
.nyk-stat-row .el-col { margin-bottom: 16px; }
.nyk-stat {
  background: #fff; border: 1px solid var(--c-border); border-radius: var(--c-radius);
  padding: 14px 20px; height: 88px; display: flex; flex-direction: column; justify-content: center;
}
.nyk-stat .label { font-size: 12px; color: var(--c-text-light); line-height: 20px; }
.nyk-stat .value { font-size: 26px; font-weight: 600; color: #303133; line-height: 32px; }
.nyk-stat .sub { font-size: 12px; color: var(--c-text-light); line-height: 20px; }

.nyk-chart-card { background: #fff; border: 1px solid var(--c-border); border-radius: var(--c-radius); padding: 16px 20px; }
.nyk-chart-card h3 { font-size: 14px; font-weight: 600; margin: 0 0 8px; color: var(--c-text); }
.nyk-chart { width: 100%; height: 320px; }

/* ---------------- 登录页（左表单 + 右插画，参考 2026-11-17 改版） ---------------- */
.nyk-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(560px 420px at 12% 8%, rgba(163, 226, 225, 0.55), transparent 65%),
    radial-gradient(640px 480px at 88% 88%, rgba(163, 226, 225, 0.45), transparent 65%),
    linear-gradient(135deg, #eef8f8 0%, #f7fbfb 45%, #eef5f8 100%);
}
.nyk-login-box {
  display: flex;
  align-items: center;
  gap: 64px;
  width: 100%;
  max-width: 1060px;
  padding: 48px 32px;
}
.nyk-login-left { width: 360px; flex: 0 0 360px; }
.nyk-login-left h1 { font-size: 22px; font-weight: 700; margin: 0 0 6px; color: var(--c-text); letter-spacing: 1px; }
.nyk-login-left p.sub { font-size: 12px; color: var(--c-text-sub); margin: 0 0 28px; }
.nyk-login-left .el-input { margin-bottom: 16px; }
/* 验证码行：输入框 + 可点击图片（点击换一张） */
.nyk-login-captcha { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.nyk-login-captcha .el-input { flex: 1; margin-bottom: 0; }
.nyk-login-captcha img {
  flex: 0 0 118px; width: 118px; height: 40px; display: block;
  border-radius: 4px; cursor: pointer; background: #fff;
}
.nyk-captcha-reload { flex: 0 0 118px; height: 40px; line-height: 40px; text-align: center; font-size: 12px; color: var(--c-primary); background: #fff; border-radius: 4px; cursor: pointer; }
/* 输入框：白底实体感，贴近参考图 */
.nyk-login .el-input__wrapper {
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 0 0 1px #e2ebee inset;
  padding: 4px 12px;
}
.nyk-login .el-input__wrapper.is-focus { box-shadow: 0 0 0 1.5px var(--c-primary) inset; }
.nyk-login .el-input__inner { height: 36px; }
.nyk-login .btn {
  width: 100%; height: 44px; font-size: 15px; letter-spacing: 6px;
  background: linear-gradient(90deg, #0ea5a4, #3fbcbb);
  border: none;
}
.nyk-login .btn:hover, .nyk-login .btn:focus {
  background: linear-gradient(90deg, #0c8f8e, #35b1b0);
}
.nyk-login-foot { text-align: center; font-size: 12px; color: #b6c2c9; margin-top: 20px; }
.nyk-login-err { color: var(--c-danger); font-size: 12px; margin: -8px 0 12px; min-height: 16px; }
.nyk-login-right { flex: 1; display: flex; justify-content: center; }
.nyk-login-right img {
  width: 100%; max-width: 560px; display: block;
  filter: drop-shadow(0 18px 32px rgba(14, 165, 164, 0.16));
}
/* 窄屏：插画隐藏，表单居中 */
@media (max-width: 900px) {
  .nyk-login-right { display: none; }
  .nyk-login-box { justify-content: center; }
  .nyk-login-left { width: 340px; flex: 0 0 340px; }
}

/* ---------------- 其他 ---------------- */
.nyk-empty { padding: 32px 0; }
.nyk-hint { font-size: 12px; color: var(--c-text-light); line-height: 20px; }
.nyk-thumb { width: 96px; height: 54px; border-radius: 4px; object-fit: cover; border: 1px solid var(--c-border); display: block; }
.nyk-img-160 { width: 160px; height: 90px; border-radius: 4px; object-fit: cover; border: 1px solid var(--c-border); display: block; }
.nyk-desc { display: grid; grid-template-columns: 96px 1fr; row-gap: 12px; font-size: 13px; }
.nyk-desc .k { color: var(--c-text-light); }
.nyk-desc .v { color: var(--c-text); word-break: break-all; }

.nyk-drawer-foot {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 12px 20px; border-top: 1px solid var(--c-border); background: #fff;
  text-align: right;
}
.nyk-drawer-body { padding-bottom: 64px; }

.el-table th.el-table__cell { background: #f7f9f9; color: var(--c-text-sub); font-size: 13px; font-weight: 500; }
.el-table .el-table__row { height: 48px; }
.el-table td.el-table__cell { font-size: 13px; }

/* 表格数据统一居中：表头与数据单元格都居中，后续新增表格自动继承（无需逐列写 align） */
.el-table th.el-table__cell .cell,
.el-table td.el-table__cell .cell { text-align: center; }

/* 例外：长文本列左对齐（多行/长句居中会参差不齐），模板里用 class-name="cell-left" 标记 */
.el-table th.cell-left .cell,
.el-table td.cell-left .cell { text-align: left; }

/* 卡片与表格容器边框统一 #e5e7eb，圆角 6px，无阴影 */
.el-table { --el-table-border-color: var(--c-border); --el-table-border: 1px solid var(--c-border); box-shadow: none; }
.el-table th.el-table__cell,
.el-table td.el-table__cell { border-bottom-color: var(--c-border); }
.el-table--border,
.el-table--group { border-color: var(--c-border); }
.nyk-card, .nyk-chart-card, .nyk-stat { border-color: var(--c-border); box-shadow: none; }
.el-drawer, .el-dialog { border-radius: var(--c-radius); }

.el-drawer__header { margin-bottom: 16px; padding: 16px 20px 0; color: var(--c-text); font-weight: 600; }
.el-drawer__body { padding: 0 20px; }

/* 手机号等定长数字：等宽字体，纵向扫读时位数对齐 */
.nyk-mono { font-family: Consolas, "Courier New", ui-monospace, monospace; font-size: 13px; letter-spacing: .2px; }
/* 长文本单行省略：网关地址 / 路径这类不换行更好读，避免把卡片撑破 */
.nyk-ellipsis { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }

/* 空值占位（—），不抢注意力 */
.nyk-muted { color: #c0c4cc; }

/* 凭证只读展示：标签 + 一句说明，不用输入框（避免看起来「能改」） */
.nyk-cred { display: flex; align-items: center; gap: 10px; min-height: 32px; }
.nyk-cred-hint { font-size: 12px; color: var(--c-text-light); }

/* 侧栏菜单（深色） */
.nyk-menu .el-menu { border-right: none; background: transparent; }
.nyk-menu .el-sub-menu__title,
.nyk-menu .el-menu-item {
  color: #c8d3de; height: 46px; line-height: 46px; font-size: 13px;
  background: transparent;
}
.nyk-menu .el-menu-item.is-active { color: #fff; background: var(--c-primary); }
.nyk-menu .el-sub-menu__title:hover,
.nyk-menu .el-menu-item:hover { background: var(--side-bg-active); color: #fff; }
.nyk-menu .el-sub-menu .el-menu-item { padding-left: 44px !important; background: transparent; }
.nyk-menu .el-sub-menu.is-active > .el-sub-menu__title { color: #fff; }
.nyk-menu .el-icon { vertical-align: middle; }
.nyk-group-title {
  padding: 16px 20px 6px; font-size: 11px; letter-spacing: 1px;
  color: #6b7f93; text-transform: uppercase;
}

/* 表格滚动条、空态 */
.el-empty__description p { font-size: 13px; color: var(--c-text-light); }

@media (max-width: 1279px) {
  .nyk-content { padding: 16px; }
}

/* 侧栏菜单激活态（覆盖 Element Plus 默认内联色） */
.nyk-menu .el-menu-item.is-active {
  background-color: var(--c-primary) !important;
  color: #fff !important;
}
.nyk-menu .el-menu-item.is-active:hover { background-color: var(--c-primary-hover) !important; }
.nyk-menu .el-sub-menu .el-menu { background-color: transparent !important; }
.nyk-menu .el-menu-item, .nyk-menu .el-sub-menu__title { background-color: transparent !important; }
.nyk-menu .el-menu--inline { background-color: rgba(0, 0, 0, .12) !important; }
.nyk-head-actions { display: flex; gap: 8px; }

/* ---------------- 设置页（全部 Element Plus 原生组件，仅补必要间距） ---------------- */

/* 卡片间 24px 呼吸；卡片头白底 14px/600 + 1px 分隔线，四张卡不再粘连成一片 */
.nyk-setting-card { border-radius: var(--c-radius); }
.nyk-setting-card + .nyk-setting-card { margin-top: 24px; }
.nyk-setting-card .el-card__header {
  padding: 16px 20px;
  background: #fff;
  border-bottom: 1px solid #ebeef5;
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text);
}
/* el-row :gutter="32" 会带 -16px 负边距，故左右留 36px 使内容实际对齐卡片头 20px */
.nyk-setting-card .el-card__body { padding: 20px 36px 0; }
.nyk-setting-card .el-form-item { margin-bottom: 20px; }

/* 卡片头：标题 + 右侧操作（发送测试邮件 / 接口状态 + 刷新） */
.nyk-card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.nyk-card-header-ops { display: flex; align-items: center; gap: 8px; }

.nyk-dirty { font-size: 12px; color: #b26a00; margin-right: 8px; }

/* 营业时间：两个输入框 + 「至」 */
.nyk-time-range { display: flex; align-items: center; gap: 8px; width: 100%; }
.nyk-time-range .el-input { flex: 1 1 0; min-width: 0; }
.nyk-time-range > span { flex: none; font-size: 13px; color: var(--c-text-light); }

.nyk-unit { margin-left: 8px; font-size: 13px; color: var(--c-text-sub); }

/* 开关 + 右侧一句话说明（说明用业务语言，不出现字段名） */
.nyk-switch-line { display: flex; align-items: center; gap: 12px; min-height: 32px; }
.nyk-switch-tip { font-size: 12px; line-height: 18px; color: var(--c-text-light); }

/* 邮件网关地址下方的补充说明 */
.nyk-field-note { margin-top: 4px; font-size: 12px; line-height: 18px; color: var(--c-text-light); }

/* 环境图：无图时整行虚线投放区；有图时缩略图横向排开 + 末尾小方块追加 */
.nyk-img-field { width: 100%; }
.nyk-img-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  width: 100%; min-height: 104px;
  border: 1px dashed var(--c-border); border-radius: 6px;
  color: var(--c-text-light); cursor: pointer;
  transition: border-color .2s, color .2s;
}
.nyk-img-drop > span { font-size: 13px; line-height: 18px; }
.nyk-img-drop .nyk-img-drop-sub { font-size: 12px; color: #a8abb2; }
.nyk-img-drop:hover { border-color: var(--c-primary); color: var(--c-primary); }
.nyk-img-drop.is-disabled { cursor: not-allowed; opacity: .55; }
.nyk-img-grid { display: flex; flex-wrap: wrap; gap: 12px; min-height: 104px; }
.nyk-img-item { width: 112px; }
.nyk-img-thumb { width: 112px; height: 76px; display: block; border: 1px solid var(--c-border); border-radius: 4px; }
.nyk-img-ops { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; min-height: 24px; }
.nyk-img-ops .el-button + .el-button { margin-left: 0; }
.nyk-img-add {
  width: 112px; height: 76px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 1px dashed var(--c-border); border-radius: 4px;
  font-size: 12px; line-height: 16px;
  color: var(--c-text-light); cursor: pointer;
}
.nyk-img-add:hover { border-color: var(--c-primary); color: var(--c-primary); }
.nyk-img-add.is-disabled { cursor: not-allowed; opacity: .55; }
.nyk-img-note {
  margin: 8px 0 0;
  font-size: 12px; line-height: 20px; color: var(--c-text-light);
}
/* 1366 及以下（笔记本 / 小屏）两列太挤，强制单列；1680 以上保持两列 */
@media (max-width: 1439px) {
  .nyk-setting-card .el-col-md-12 { flex: 0 0 100%; max-width: 100%; }
}

/* -------------------------------------------------------------------------
   患者状态「新用户」专用色
   primary 型 tag 会被主题渲染成薄荷绿（#0ea5a4），和「到诊」的 success 草绿
   在浅底上太接近，一列排下来分不清。这里把新用户单独压成蓝，五档变成
   蓝 / 橙 / 灰 / 绿 / 红，色阶一眼可辨。
   只挂在 nyk-status-tag 的 auth&0 档上，不影响其它 primary 型 tag。
   ------------------------------------------------------------------------- */
.el-tag.nyk-tag-new {
  --el-tag-bg-color: #ecf5ff;
  --el-tag-border-color: #d9ecff;
  --el-tag-text-color: #3b82f6;
}
