/*!
 * 哆啦SMS · 哆啦A梦主题皮肤 (doraemon.css)
 * 在 AdminLTE v4 (Bootstrap 5.3) 之上做主题覆写，不修改 vendor 原始文件
 */

/* ============================================================ 主题变量 */

:root {
  --dora-blue: #1ca6e8;
  --dora-blue-rgb: 28, 166, 232;
  --dora-blue-light: #6cc9f5;
  --dora-blue-dark: #0b6fb8;
  --dora-blue-deep: #07304c;
  --dora-red: #e60012;
  --dora-red-rgb: 230, 0, 18;
  --dora-yellow: #ffd100;
  --dora-yellow-rgb: 255, 209, 0;
  --dora-sky: #e9f7ff;
  --dora-ink: #10314a;
  --dora-ink-soft: #4a6b85;
  --dora-surface: rgba(255, 255, 255, 0.92);
  --dora-surface-solid: #ffffff;
  --dora-border: rgba(28, 166, 232, 0.22);
  --dora-shadow: 0 10px 30px rgba(11, 111, 184, 0.12);
  --dora-radius: 1.15rem;

  --bs-primary: #1ca6e8;
  --bs-primary-rgb: 28, 166, 232;
  --bs-link-color: #0b6fb8;
  --bs-link-color-rgb: 11, 111, 184;
  --bs-link-hover-color: #074f85;
  --bs-body-color: #10314a;
  --bs-body-color-rgb: 16, 49, 74;
  --bs-border-color: rgba(28, 166, 232, 0.22);
  --bs-border-radius: 0.7rem;
  --bs-border-radius-lg: 1.15rem;
  --bs-font-sans-serif: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei",
    "Source Han Sans SC", "Noto Sans SC", "Segoe UI", system-ui, -apple-system, sans-serif;
  --bs-body-font-family: var(--bs-font-sans-serif);
}

[data-bs-theme="dark"] {
  --dora-ink: #dbeaf7;
  --dora-ink-soft: #9dbdd6;
  --dora-surface: rgba(12, 38, 60, 0.9);
  --dora-surface-solid: #0d2a42;
  --dora-border: rgba(108, 201, 245, 0.22);
  --dora-shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
  --dora-sky: #061c2c;
  --bs-body-bg: #071f31;
  --bs-body-color: #dbeaf7;
  --bs-body-color-rgb: 219, 234, 247;
  --bs-border-color: rgba(108, 201, 245, 0.22);
  --bs-tertiary-bg: #0a2438;
  --bs-secondary-bg: #0d2a42;
  --bs-emphasis-color: #ffffff;
}

/* ============================================================ 背景层 */

body.dora-body {
  position: relative;
  background-color: var(--dora-sky);
  background-image: linear-gradient(180deg, #dff2ff 0%, #cfeaff 45%, #b6dffb 100%);
  background-attachment: fixed;
}

body.dora-body::before,
body.dora-body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body.dora-body::before {
  background-image: url("../img/doraemon-scene.svg");
  background-size: cover;
  background-position: right bottom;
  background-repeat: no-repeat;
  opacity: 0.72;
}

body.dora-body::after {
  background-image: url("../img/doraemon-tile.svg");
  background-size: 260px 260px;
  opacity: 0.3;
  mix-blend-mode: multiply;
}

[data-bs-theme="dark"] body.dora-body {
  background-image: radial-gradient(circle at 78% 8%, #0f4a72 0%, #082a42 42%, #04121f 100%);
}

[data-bs-theme="dark"] body.dora-body::before {
  opacity: 0.22;
  filter: saturate(0.7) brightness(0.9);
}

[data-bs-theme="dark"] body.dora-body::after {
  opacity: 0.14;
  mix-blend-mode: screen;
}

.app-wrapper {
  position: relative;
  z-index: 1;
}

/* ============================================================ 侧边栏 */

.app-sidebar {
  background: linear-gradient(180deg, #0f86cf 0%, #0a5f97 55%, #07304c 100%);
  --lte-sidebar-color: rgba(255, 255, 255, 0.86);
  --lte-sidebar-hover-color: #ffffff;
  --lte-sidebar-hover-bg: rgba(255, 255, 255, 0.14);
  --lte-sidebar-active-color: #07304c;
  --lte-sidebar-menu-active-bg: var(--dora-yellow);
  --lte-sidebar-menu-active-color: #07304c;
  --lte-sidebar-submenu-bg: rgba(0, 0, 0, 0.16);
  --lte-sidebar-submenu-color: rgba(255, 255, 255, 0.72);
  --lte-sidebar-submenu-hover-color: #ffffff;
  --lte-sidebar-submenu-hover-bg: rgba(255, 255, 255, 0.12);
  --lte-sidebar-submenu-active-color: var(--dora-yellow);
  --lte-sidebar-header-color: rgba(255, 255, 255, 0.55);
  box-shadow: 4px 0 24px rgba(7, 48, 76, 0.22);
}

.app-sidebar .sidebar-brand {
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.02em;
  gap: 0.55rem;
}

.dora-brand-mark {
  width: 2.15rem;
  height: 2.15rem;
  flex: 0 0 auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.sidebar-brand .brand-sub {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.62);
  text-transform: uppercase;
}

.app-sidebar .nav-link {
  border-radius: 0.7rem;
  margin: 0.1rem 0.35rem;
  font-weight: 600;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.app-sidebar .nav-link:hover {
  transform: translateX(2px);
}

.app-sidebar .nav-link.active {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
}

.app-sidebar .nav-link.active .nav-icon {
  color: inherit;
}

.app-sidebar .nav-header {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
}

.app-sidebar .sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.6);
}

/* ============================================================ 顶栏 */

.app-header {
  background: rgba(255, 255, 255, 0.82) !important;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--dora-border);
}

[data-bs-theme="dark"] .app-header {
  background: rgba(9, 34, 52, 0.85) !important;
}

.dora-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--dora-blue);
  object-fit: cover;
}

/* ============================================================ 内容区 */

/* 紧凑页头：标题 ≤20px / 副标题 13px / 总高 ≤60px / 与内容间距 ≤12px
   注意：AdminLTE 用的是 .app-main .app-content-header{...}（特异性 0,2,0），
   这里必须同样带 .app-main 前缀才能覆盖，否则 padding 与面包屑行高会把它撑高。 */
.app-main .app-content-header {
  padding: 0.5rem 0.5rem 0.25rem;
}

.app-main .app-content-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.01em;
  margin-bottom: 0;
}

/* AdminLTE 给面包屑设了 line-height:2.5rem(40px)，会把整个页头撑高，必须覆盖 */
.app-main .app-content-header .breadcrumb {
  line-height: 1.25;
  font-size: 0.8125rem;
  margin-bottom: 0;
}

.app-main .app-content-header .breadcrumb a {
  text-decoration: none;
}

#page-subtitle {
  font-size: 0.8125rem;
  line-height: 1.2;
  color: var(--dora-ink-soft);
  margin-top: 2px;
}

.app-main .app-content {
  padding-top: 0.5rem;
  padding-bottom: 1.5rem;
}

.card {
  border-radius: var(--dora-radius);
  border: 1px solid var(--dora-border);
  background-color: var(--dora-surface-solid);
  backdrop-filter: none;
  box-shadow: var(--dora-shadow);
  overflow: hidden;
}

.card-header {
  background: linear-gradient(90deg, rgba(var(--dora-blue-rgb), 0.14), rgba(var(--dora-blue-rgb), 0.04));
  border-bottom: 1px solid var(--dora-border);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-header .card-title {
  font-weight: 700;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.card-header::before {
  content: "";
  width: 0.32rem;
  align-self: stretch;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--dora-blue), var(--dora-red));
  margin-right: 0.1rem;
}

.card-tools {
  margin-left: auto;
}

/* ============================================================ 统计块 */

.small-box {
  border-radius: var(--dora-radius);
  overflow: hidden;
  border: 1px solid var(--dora-border);
  box-shadow: var(--dora-shadow);
}

/* 四张卡同一深色系；白字对比度分别为 5.51 / 7.25 / 9.74 / 5.24 : 1，均达 WCAG AA */
.small-box.dora-box-blue {
  background: linear-gradient(135deg, #0d6ea8, #0a5b8c);
  color: #fff;
}

.small-box.dora-box-indigo {
  background: linear-gradient(135deg, #3f4fa8, #33409c);
  color: #fff;
}

.small-box.dora-box-yellow {
  background: linear-gradient(135deg, #ffd84d, #f0b800);
  color: #3d2c00;
}

.small-box.dora-box-teal {
  background: linear-gradient(135deg, #0f7a68, #0c6355);
  color: #fff;
}

/* 红色只保留给告警语义，不再用于正常指标 */
.small-box.dora-box-red {
  background: linear-gradient(135deg, #c0121f, #a80f1a);
  color: #fff;
}

.small-box .small-box-icon {
  opacity: 0.32;
}

/* 总览四卡：等高排布，不再有深浅不一的底边条 */
#dash-cards > [class*="col-"] {
  display: flex;
}

#dash-cards .small-box {
  width: 100%;
  margin-bottom: 0;
}

/* AdminLTE 把 .small-box p>small 设成近白色(#f8f9fa)，在黄色卡上不可读，改为继承卡片文字色 */
.small-box p > small {
  display: block;
  margin-top: 4px;
  font-size: 0.76rem;
  color: inherit;
  opacity: 0.82;
}

.small-box h3 {
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* ============================================================ 手机预览 */

.dora-phone {
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  border-radius: 2.2rem;
  padding: 0.85rem 0.7rem 1.1rem;
  background: linear-gradient(160deg, #1b2b3a, #0a1620);
  box-shadow: 0 18px 40px rgba(7, 48, 76, 0.35);
  border: 2px solid rgba(255, 255, 255, 0.12);
}

.dora-phone .dora-phone-notch {
  width: 4.5rem;
  height: 0.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  margin: 0 auto 0.6rem;
}

.dora-phone .dora-phone-screen {
  border-radius: 1.6rem;
  background: linear-gradient(180deg, #eaf7ff, #d3ecfd);
  padding: 0.85rem;
  min-height: 16rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

[data-bs-theme="dark"] .dora-phone .dora-phone-screen {
  background: linear-gradient(180deg, #0b2c44, #071e30);
}

.dora-sms-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #0b6fb8;
}

[data-bs-theme="dark"] .dora-sms-head {
  color: #8fd3f7;
}

.dora-sms-head img {
  width: 1.7rem;
  height: 1.7rem;
}

.dora-bubble {
  position: relative;
  background: #ffffff;
  color: #10314a;
  border-radius: 1rem 1rem 1rem 0.25rem;
  padding: 0.7rem 0.85rem;
  font-size: 0.9rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 4px 12px rgba(11, 111, 184, 0.16);
  flex: 1 1 auto;
  overflow-wrap: anywhere;
}

[data-bs-theme="dark"] .dora-bubble {
  background: #123a58;
  color: #e3f1fb;
}

.dora-bubble mark {
  background: rgba(var(--dora-yellow-rgb), 0.45);
  color: inherit;
  padding: 0 0.15em;
  border-radius: 0.25rem;
}

.dora-bubble mark.dora-var-missing {
  background: rgba(var(--dora-red-rgb), 0.18);
  color: #b3000e;
  font-weight: 700;
}

.dora-sms-foot {
  font-size: 0.72rem;
  color: #4a83ab;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

[data-bs-theme="dark"] .dora-sms-foot {
  color: #7fb4d4;
}

/* ============================================================ 字符计量条 */

.dora-meter {
  height: 0.6rem;
  border-radius: 999px;
  background: rgba(var(--dora-blue-rgb), 0.16);
  overflow: hidden;
}

.dora-meter > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #46d6c0, #1ca6e8);
  transition: width 0.25s ease, background 0.25s ease;
}

.dora-meter.is-warn > span {
  background: linear-gradient(90deg, #ffd100, #f59f00);
}

.dora-meter.is-danger > span {
  background: linear-gradient(90deg, #ff7a86, #d8000f);
}

.dora-stat,
.dora-kpi {
  border: 1px solid var(--dora-border);
  border-radius: 0.9rem;
  padding: 0.6rem 0.75rem;
  background: var(--dora-surface-solid);
  box-shadow: 0 1px 2px rgba(11, 111, 184, 0.08);
  min-width: 0;
}

.dora-stat {
  height: 100%;
}

.dora-kpi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.dora-kpi {
  flex: 1 1 9.5rem;
}

.dora-stat .dora-stat-label,
.dora-kpi .dora-stat-label {
  font-size: 0.72rem;
  color: var(--dora-ink-soft);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dora-stat .dora-stat-value,
.dora-kpi .dora-stat-value {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--dora-ink);
  overflow-wrap: anywhere;
}

.dora-stat .dora-stat-value small,
.dora-kpi .dora-stat-value small {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--dora-ink-soft);
}

/* app-sms.js 的 tile() 用的是 dora-kpi-value/label/hint，此前没有对应样式 */
.dora-kpi .dora-kpi-value {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--dora-ink);
  overflow-wrap: anywhere;
}

.dora-kpi .dora-kpi-label {
  font-size: 0.72rem;
  color: var(--dora-ink-soft);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dora-kpi .dora-kpi-hint {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--dora-ink-soft);
  margin-top: 0.1rem;
}

/* ============================================================ 问题列表 */

.dora-issue {
  display: flex;
  gap: 0.55rem;
  padding: 0.55rem 0.7rem;
  border-radius: 0.75rem;
  font-size: 0.84rem;
  line-height: 1.5;
  border: 1px solid transparent;
}

.dora-issue + .dora-issue {
  margin-top: 0.4rem;
}

.dora-issue i {
  margin-top: 0.12rem;
}

.dora-issue.is-error {
  background: rgba(var(--dora-red-rgb), 0.08);
  border-color: rgba(var(--dora-red-rgb), 0.3);
  color: #a3000d;
}

.dora-issue.is-warn {
  background: rgba(var(--dora-yellow-rgb), 0.16);
  border-color: rgba(214, 158, 0, 0.35);
  color: #7a5a00;
}

.dora-issue.is-info {
  background: rgba(var(--dora-blue-rgb), 0.09);
  border-color: var(--dora-border);
  color: #0b5f96;
}

.dora-issue.is-ok {
  background: rgba(16, 160, 140, 0.1);
  border-color: rgba(16, 160, 140, 0.3);
  color: #0a6d5f;
}

[data-bs-theme="dark"] .dora-issue.is-error { color: #ffa8b0; }
[data-bs-theme="dark"] .dora-issue.is-warn { color: #ffdf7a; }
[data-bs-theme="dark"] .dora-issue.is-info { color: #9ad6f7; }
[data-bs-theme="dark"] .dora-issue.is-ok { color: #7fe3d3; }

/* ============================================================ 小组件 */

.dora-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(var(--dora-blue-rgb), 0.12);
  color: #0b5f96;
  border: 1px solid var(--dora-border);
}

.dora-chip.is-red {
  background: rgba(var(--dora-red-rgb), 0.1);
  color: #b3000e;
  border-color: rgba(var(--dora-red-rgb), 0.28);
}

.dora-chip.is-yellow {
  background: rgba(var(--dora-yellow-rgb), 0.24);
  color: #7a5a00;
  border-color: rgba(214, 158, 0, 0.35);
}

[data-bs-theme="dark"] .dora-chip { color: #9ad6f7; }
[data-bs-theme="dark"] .dora-chip.is-red { color: #ffa8b0; }
[data-bs-theme="dark"] .dora-chip.is-yellow { color: #ffdf7a; }

.dora-code {
  background: #0b2233;
  color: #b9e6ff;
  border-radius: 0.8rem;
  padding: 0.85rem 1rem;
  font-size: 0.8rem;
  line-height: 1.6;
  font-family: "Cascadia Mono", Consolas, "Courier New", monospace;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 22rem;
  overflow: auto;
  border: 1px solid rgba(108, 201, 245, 0.25);
}

.dora-var-row {
  border: 1px solid var(--dora-border);
  border-radius: 0.8rem;
  padding: 0.55rem 0.7rem;
  background: var(--dora-surface-solid);
  box-shadow: 0 1px 2px rgba(11, 111, 184, 0.07);
}

.dora-var-row + .dora-var-row {
  margin-top: 0.5rem;
}

.dora-token {
  cursor: pointer;
  border: 1px dashed var(--dora-blue);
  background: rgba(var(--dora-blue-rgb), 0.1);
  border-radius: 0.45rem;
  padding: 0 0.3rem;
  font-weight: 600;
  color: var(--dora-blue-dark);
}

.dora-template-item {
  cursor: pointer;
  border: 1px solid var(--dora-border);
  border-radius: 0.9rem;
  padding: 0.7rem 0.85rem;
  background: var(--dora-surface-solid);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  height: 100%;
}

.dora-template-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--dora-shadow);
}

.dora-template-item .dora-template-text {
  font-size: 0.82rem;
  color: var(--dora-ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dora-empty {
  text-align: center;
  padding: 2.2rem 1rem;
  color: var(--dora-ink-soft);
}

.dora-empty img {
  width: 4.5rem;
  opacity: 0.55;
  margin-bottom: 0.6rem;
}

.dora-hero {
  border-radius: var(--dora-radius);
  padding: 1.4rem 1.5rem;
  background: linear-gradient(120deg, #ffffff, #eef8ff);
  border: 1px solid var(--dora-border);
  box-shadow: var(--dora-shadow);
  display: flex;
  gap: 1.1rem;
  align-items: center;
  position: relative;
  overflow: hidden;
}

[data-bs-theme="dark"] .dora-hero {
  background: linear-gradient(120deg, #0d2a42, #0a2438);
}

.dora-hero img {
  width: 5.5rem;
  flex: 0 0 auto;
  filter: drop-shadow(0 8px 16px rgba(11, 111, 184, 0.28));
}

.dora-hero h4 {
  font-weight: 800;
  margin-bottom: 0.3rem;
}

.dora-hero p {
  margin-bottom: 0;
  color: var(--dora-ink-soft);
  font-size: 0.88rem;
}

.dora-hero .dora-hero-bell {
  position: absolute;
  right: -2.2rem;
  bottom: -2.6rem;
  width: 9rem;
  height: 9rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(var(--dora-yellow-rgb), 0.55), rgba(var(--dora-yellow-rgb), 0));
  pointer-events: none;
}

/* ============================================================ 表格与表单 */

.table > :not(caption) > * > * {
  background-color: transparent;
}

.table thead th {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dora-ink-soft);
  border-bottom-width: 1px;
}

.form-label {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--dora-blue);
  box-shadow: 0 0 0 0.2rem rgba(var(--dora-blue-rgb), 0.2);
}

.form-control,
.form-select {
  border-radius: 0.7rem;
}

/* 内容文本域用正文字体：运营是在写文案，不是在写代码 */
textarea.dora-editor {
  font-family: var(--bs-body-font-family);
  font-size: 0.9375rem;
  line-height: 1.75;
  min-height: 9rem;
}

/* ---------------------------------------------------------- 提示文字统一
   面向运营：提示一律 13px 常规字重、中文优先，不用等宽字体，
   避免看起来像代码注释。占位符同样处理。 */
.form-text,
.dora-hint,
.form-control::placeholder,
.form-select::placeholder,
textarea::placeholder {
  font-size: 13px;
  line-height: 1.65;
  font-weight: 400;
  color: #5b6b7c;
}

[data-bs-theme="dark"] .form-text,
[data-bs-theme="dark"] .dora-hint,
[data-bs-theme="dark"] .form-control::placeholder,
[data-bs-theme="dark"] textarea::placeholder {
  color: #9dbdd6;
}

/* 表单标签：清晰但不抢眼 */
.form-label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

/* 表头与表格正文：不要过小，保证中文可读 */
.table > :not(caption) > * > * {
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}
.table thead th {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.table tbody td {
  font-size: 13.5px;
}

/* 空状态：统一外观，避免留下空骨架 */
.dora-empty-cell {
  text-align: center;
  padding: 1.6rem 0.5rem;
  color: var(--dora-ink-soft);
  font-size: 13px;
}
.dora-empty-cell i {
  display: block;
  font-size: 1.4rem;
  opacity: 0.4;
  margin-bottom: 0.35rem;
}

.btn {
  border-radius: 0.75rem;
  font-weight: 600;
}

.btn-primary {
  --bs-btn-bg: #1ca6e8;
  --bs-btn-border-color: #1ca6e8;
  --bs-btn-hover-bg: #0f8fd0;
  --bs-btn-hover-border-color: #0f8fd0;
  --bs-btn-active-bg: #0b6fb8;
  --bs-btn-active-border-color: #0b6fb8;
  --bs-btn-disabled-bg: #8fd3f7;
  --bs-btn-disabled-border-color: #8fd3f7;
  box-shadow: 0 6px 16px rgba(var(--dora-blue-rgb), 0.28);
}

.btn-danger {
  --bs-btn-bg: #e60012;
  --bs-btn-border-color: #e60012;
  --bs-btn-hover-bg: #c5000f;
  --bs-btn-hover-border-color: #c5000f;
}

.btn-warning {
  --bs-btn-bg: #ffd100;
  --bs-btn-border-color: #ffd100;
  --bs-btn-color: #4a3400;
  --bs-btn-hover-bg: #f2c000;
  --bs-btn-hover-border-color: #f2c000;
  --bs-btn-hover-color: #4a3400;
}

.nav-pills .nav-link.active {
  background-color: var(--dora-blue);
}

.dora-scroll {
  max-height: 26rem;
  overflow: auto;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(var(--dora-blue-rgb), 0.08);
}

::-webkit-scrollbar-thumb {
  background: rgba(var(--dora-blue-rgb), 0.45);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--dora-blue-rgb), 0.7);
  background-clip: content-box;
}

/* ============================================================ 视图切换 */

.dora-view {
  display: none;
  animation: dora-fade 0.28s ease;
}

.dora-view.is-active {
  display: block;
}

@keyframes dora-fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .dora-view { animation: none; }
  .dora-template-item:hover { transform: none; }
  .app-sidebar .nav-link:hover { transform: none; }
}

/* ============================================================ 运营台 */

.dora-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.dora-filter-bar .form-control,
.dora-filter-bar .form-select {
  width: auto;
  min-width: 9.5rem;
  flex: 1 1 9.5rem;
  max-width: 16rem;
}

.dora-filter-bar input[type="datetime-local"] {
  min-width: 12rem;
  max-width: 13.5rem;
  flex: 0 1 12rem;
}

/* 会话栏输入框：一条输入框兼「搜索会话」与「发起新会话」两种模式 */
.dora-conv-input {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.1rem;
  padding: 0.15rem 0.15rem 0.15rem 1.85rem;
  border: 1px solid var(--dora-border);
  border-radius: 0.65rem;
  background: var(--dora-surface-solid);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dora-conv-input:focus-within {
  border-color: rgba(var(--dora-blue-rgb), 0.55);
  box-shadow: 0 0 0 0.2rem rgba(var(--dora-blue-rgb), 0.14);
}

/* 切到「发起新会话」模式时整条输入框变色，一眼能看出状态 */
.dora-conv-input.is-new {
  border-color: var(--dora-blue);
  box-shadow: 0 0 0 0.18rem rgba(var(--dora-blue-rgb), 0.16);
}

.dora-conv-input-icon {
  position: absolute;
  left: 0.62rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  color: var(--dora-ink-soft);
  pointer-events: none;
}

.dora-conv-input .form-control {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  padding: 0.2rem 0;
  background: transparent;
  box-shadow: none;
  font-size: 0.85rem;
}

.dora-conv-input .form-control:focus {
  box-shadow: none;
}

.dora-conv-seat {
  flex: 0 0 auto;
  max-width: 8rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.72rem;
  color: var(--dora-ink-soft);
}

.dora-conv-input .btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  padding: 0;
  border-radius: 0.5rem;
}

.dora-conv-list {
  flex: 1 1 auto;
  min-height: 6rem;
  max-height: none;
  overflow-y: auto;
  border-top: 1px solid var(--dora-border);
}

/* 聊天页：桌面端撑满可视高度，消除四周大片留白 */
@media (min-width: 992px) {
  #view-chat > .row {
    height: calc(100vh - 11rem);
  }
  /* 消息优先模式没有页头与页脚，行高直接吃掉整个视口 */
  body.dora-chat-first #view-chat > .row {
    /* 上下各 0.9rem 外边距，所以这里扣掉 1.8rem */
    height: calc(100vh - 1.8rem);
    height: calc(100dvh - 1.8rem);
  }
}

/* 会话卡片：筛选区固定高度，不随卡片拉伸（否则列表会被挤到底部留出大片空白） */
.dora-conv-card > .card-body {
  flex: 0 0 auto;
}

/* ---------------------------------------------------------- 空状态不留下骨架
   只要表体里出现空状态标记，就连表头一起隐藏——
   否则"空表头 + 空表体"看起来像没加载完的骨架屏。
   用 :has() 自动判定，新增面板无需额外写 JS。 */
table:has(tbody .dora-empty) thead {
  display: none;
}
table:has(tbody .dora-empty) tbody td {
  border-bottom: 0;
}
table:has(tbody .dora-empty) {
  margin-bottom: 0;
}
/* 兼容不支持 :has() 的旧浏览器：由 JS 打 is-empty 类兜底 */
table.is-empty thead {
  display: none;
}
table.is-empty tbody td {
  border-bottom: 0;
}
table.is-empty {
  margin-bottom: 0;
}
.dora-empty-holder {
  padding: 2rem 1rem;
}
/* 空状态本身：不要撑太高，留白适中 */
.dora-empty {
  padding: 1.6rem 1rem;
}
.dora-empty img {
  margin-bottom: 0.5rem;
}

.dora-conv {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  padding: 0.85rem 0.95rem;
  cursor: pointer;
  border-bottom: 1px solid var(--dora-border);
  transition: background-color 0.15s ease;
}

.dora-conv:hover {
  background: rgba(var(--dora-blue-rgb), 0.07);
}

.dora-conv.is-active {
  background: rgba(var(--dora-blue-rgb), 0.14);
  box-shadow: inset 3px 0 0 var(--dora-blue);
}

.dora-conv-avatar {
  width: 2.55rem;
  height: 2.55rem;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.86rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(140deg, var(--dora-blue-light), var(--dora-blue-dark));
}

.dora-conv-preview {
  font-size: 0.84rem;
  color: var(--dora-ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 13.5rem;
}

.dora-chat-thread {
  flex: 1 1 auto;
  min-height: 18rem;
  max-height: none;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  background: var(--dora-surface-solid);
}

.dora-msg {
  display: flex;
  flex-direction: column;
  max-width: 78%;
}

.dora-msg.is-in {
  align-self: flex-start;
}

.dora-msg.is-out {
  align-self: flex-end;
  align-items: flex-end;
}

.dora-msg-body {
  padding: 0.55rem 0.8rem;
  border-radius: 1rem;
  font-size: 0.88rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--dora-surface-solid);
  border: 1px solid var(--dora-border);
  color: var(--dora-ink);
}

.dora-msg.is-out .dora-msg-body {
  background: linear-gradient(135deg, #0d6ea8, #0a5b8c);
  border-color: transparent;
  color: #fff;
  border-bottom-right-radius: 0.3rem;
}

.dora-msg.is-in .dora-msg-body {
  border-bottom-left-radius: 0.3rem;
}

.dora-msg-time {
  font-size: 0.7rem;
  color: var(--dora-ink-soft);
  margin-top: 0.2rem;
}

.dora-chat-composer {
  border-top: 1px solid var(--dora-border);
  padding: 0.85rem;
  background: var(--dora-surface-solid);
}

/* ============================================================ 消息优先模式
   第一视角只保留「消息列表 + 会话栏」，外壳与其它面板全部收起；
   其余功能通过 + / ⋮ / 设置 三个入口抵达，不改动任何既有功能。 */
body.dora-chat-first .app-sidebar,
body.dora-chat-first .app-header,
body.dora-chat-first .app-footer,
body.dora-chat-first .app-content-header {
  display: none !important;
}

body.dora-chat-first .app-main {
  margin-left: 0 !important;
  padding: 0 !important;
}

/* AdminLTE 用 .app-main .app-content（0,2,0），这里必须同级才能覆盖掉 1.5rem 的底内边距 */
body.dora-chat-first .app-main .app-content {
  padding: 0 !important;
}

body.dora-chat-first .dora-view {
  display: none !important;
}

body.dora-chat-first #view-chat {
  display: block !important;
  height: 100vh;
  height: 100dvh;
}

body.dora-chat-first #view-chat > .row {
  height: 100%;
  --bs-gutter-x: 0;
  --bs-gutter-y: 0;
}

body.dora-chat-first #view-chat .card {
  border-radius: 0;
  border-top: 0;
  border-bottom: 0;
  box-shadow: none;
}

body.dora-chat-first #view-chat .col-lg-4,
body.dora-chat-first #view-chat .col-lg-8 {
  height: 100%;
}

body.dora-chat-first .dora-conv-list {
  max-height: none;
}

/* 面板立体化：留出边距让圆角可见，用阴影托起，而不是靠边框 */
body.dora-chat-first #view-chat > .row {
  /* 两栏之间留出明显空隙，避免贴在一起 */
  gap: 1.25rem;
  padding: 0.9rem 1rem;
  height: 100%;
  /* Bootstrap 行是 wrap；窄屏下强制单行，否则右栏会被挤到屏幕外 */
  flex-wrap: nowrap;
}

body.dora-chat-first #view-chat .col-lg-4,
body.dora-chat-first #view-chat .col-lg-8 {
  height: 100%;
  min-width: 0;
}

/* 左栏给足下限，右栏吃掉剩余空间 */
body.dora-chat-first #view-chat .col-lg-4 {
  flex: 0 0 20rem;
  max-width: 20rem;
}

body.dora-chat-first #view-chat .col-lg-8 {
  flex: 1 1 auto;
  max-width: none;
}

body.dora-chat-first #view-chat .card {
  position: relative;
  border: 0 !important;
  border-radius: 0.9rem !important;
  box-shadow:
    0 1px 1px rgba(7, 48, 76, 0.05),
    0 6px 14px rgba(7, 48, 76, 0.11),
    0 20px 44px rgba(7, 48, 76, 0.15) !important;
  background: var(--dora-surface-solid);
}

[data-bs-theme="dark"] body.dora-chat-first #view-chat .card {
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.3),
    0 6px 16px rgba(0, 0, 0, 0.45),
    0 20px 46px rgba(0, 0, 0, 0.5) !important;
}

/* 悬浮输入栏：发送按钮收进栏内 */
.dora-composer-pill {
  display: flex;
  align-items: flex-end;
  gap: 0.45rem;
  padding: 0.3rem 0.3rem 0.3rem 1rem;
  border: 1px solid var(--dora-border);
  border-radius: 1rem;
  background: var(--dora-surface-solid);
  box-shadow:
    0 10px 26px rgba(7, 48, 76, 0.17),
    0 2px 6px rgba(7, 48, 76, 0.08);
}

.dora-composer-pill:focus-within {
  border-color: rgba(var(--dora-blue-rgb), 0.55);
  box-shadow:
    0 12px 30px rgba(7, 48, 76, 0.2),
    0 0 0 0.2rem rgba(var(--dora-blue-rgb), 0.14);
}

/* 输入栏下方的一行只放必要信息，不抢视线 */
.dora-composer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.28rem 0.5rem 0;
  font-size: 0.72rem;
  line-height: 1.2;
  color: var(--dora-ink-soft);
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.7);
}

.dora-composer-count:empty {
  display: none;
}

.dora-composer-count.is-blocked {
  color: #c1121f;
}

.dora-composer-hint {
  margin-left: auto;
}

.dora-composer-pill textarea {
  border: 0;
  background: transparent;
  box-shadow: none;
  resize: none;
  padding: 0.5rem 0;
  max-height: 8rem;
  overflow-y: auto;
}

.dora-composer-pill textarea:focus {
  border: 0;
  box-shadow: none;
}

.dora-send-btn {
  flex: 0 0 auto;
  width: 2.3rem;
  height: 2.3rem;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* 无边框化：两栏之间不再画分隔线，改用留白 + 阴影分层 */
body.dora-chat-first #view-chat .card-header {
  border-bottom: 0;
  background: transparent;
  padding-top: 0.7rem;
  padding-bottom: 0.35rem;
}

/* 未选会话时右栏没有任何标题可显示：整条顶栏收起，只把更多按钮浮在右上角 */
body.dora-chat-first #view-chat .col-lg-8 > .card > .card-header:has(#chat-title:not(:has(*))) {
  min-height: 0;
  padding: 0;
}

body.dora-chat-first #view-chat .col-lg-8 > .card > .card-header:has(#chat-title:not(:has(*))) .card-tools {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  z-index: 6;
}

body.dora-chat-first #view-chat .card-header:has(#chat-title:not(:has(*))) .dora-chip,
body.dora-chat-first #view-chat .card-header:has(#chat-title:not(:has(*))) #btn-chat-host {
  display: none !important;
}

body.dora-chat-first .dora-conv {
  border-bottom: 0;
}

body.dora-chat-first .dora-conv-list {
  border-top: 0;
}

/* 悬浮输入栏：脱离文档流浮在会话上方，会话内容从其下方穿过 */
body.dora-chat-first .dora-chat-thread {
  padding-bottom: 6.2rem;
}

/* 空态在会话区里居中（略低于几何中心，为底部悬浮输入栏留出视觉重量） */
body.dora-chat-first .dora-chat-thread:has(.dora-empty),
body.dora-chat-first .dora-chat-thread.is-empty {
  justify-content: center;
  padding-top: 2rem;
  padding-bottom: 4rem;
}

/* 空态自身不要再吃上下大内边距，否则文字会被推低 */
body.dora-chat-first .dora-chat-thread .dora-empty,
body.dora-chat-first .dora-chat-thread .dora-empty-holder {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

body.dora-chat-first .dora-chat-composer {
  position: absolute;
  left: max(0.8rem, calc(50% - 32rem));
  right: max(0.8rem, calc(50% - 32rem));
  bottom: 0.85rem;
  z-index: 5;
  border-top: 0;
  background: transparent;
  padding: 0;
}

body.dora-chat-first .dora-conv-list {
  padding-bottom: 0.5rem;
}

/* 隐藏滚动条，滚动完全交给鼠标滚轮 */
body.dora-chat-first {
  overflow: hidden;
}

body.dora-chat-first,
body.dora-chat-first .dora-conv-list,
body.dora-chat-first .dora-chat-thread,
body.dora-chat-first .dora-composer-pill textarea {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body.dora-chat-first::-webkit-scrollbar,
body.dora-chat-first .dora-conv-list::-webkit-scrollbar,
body.dora-chat-first .dora-chat-thread::-webkit-scrollbar,
body.dora-chat-first .dora-composer-pill textarea::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

/* 设置入口：固定在消息列表下方 */
.dora-conv-settings {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 0;
  border-top: 1px solid var(--dora-border);
  background: transparent;
  color: var(--dora-ink-soft);
  font-size: 0.85rem;
  text-align: left;
}

.dora-conv-settings:hover {
  background: rgba(var(--dora-blue-rgb), 0.07);
  color: var(--dora-ink);
}

.dora-chat-menu {
  min-width: 16rem;
  max-width: 20rem;
}

.dora-chart {
  display: flex;
  align-items: flex-end;
  gap: 0.4rem;
  height: 11rem;
  padding: 0.5rem 0.25rem 0;
  border-bottom: 1px solid var(--dora-border);
}

.dora-chart-col {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  min-width: 1.4rem;
}

.dora-chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 100%;
  width: 100%;
  justify-content: center;
}

.dora-chart-bar {
  width: 30%;
  max-width: 1.1rem;
  min-height: 3px;
  border-radius: 0.35rem 0.35rem 0 0;
  transition: height 0.3s ease;
}

.dora-chart-bar.is-sent {
  background: linear-gradient(180deg, #6cc9f5, #1ca6e8);
}

.dora-chart-bar.is-success {
  background: linear-gradient(180deg, #6fe3cd, #10a08c);
}

.dora-chart-label {
  font-size: 0.68rem;
  color: var(--dora-ink-soft);
  margin-top: 0.35rem;
  white-space: nowrap;
}

.nav-pills.nav-sm .nav-link {
  padding: 0.2rem 0.7rem;
  font-size: 0.82rem;
  border-radius: 999px;
}

.modal-content {
  border-radius: var(--dora-radius);
  border: 1px solid var(--dora-border);
}

.modal-header,
.modal-footer {
  border-color: var(--dora-border);
}

.modal-header {
  background: linear-gradient(90deg, rgba(var(--dora-blue-rgb), 0.14), rgba(var(--dora-blue-rgb), 0.04));
}

.modal-title {
  font-weight: 700;
}

[data-bs-theme="dark"] .dora-chat-thread {
  background: rgba(0, 0, 0, 0.18);
}

@media (max-width: 991.98px) {
  .dora-conv-list {
    max-height: 22rem;
  }
  .dora-chat-thread {
    min-height: 18rem;
    max-height: 24rem;
  }
  .dora-conv-preview {
    max-width: 8rem;
  }
}

/* ============================================================ 权限分级 */

.dora-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #c0121f, #a80f1a);
  box-shadow: 0 4px 12px rgba(var(--dora-red-rgb), 0.28);
}

.dora-role-badge.role-agent {
  background: linear-gradient(135deg, #0d6ea8, #0a5b8c);
  box-shadow: 0 4px 12px rgba(var(--dora-blue-rgb), 0.28);
}

.dora-role-badge.role-staff {
  background: linear-gradient(135deg, #0f7a68, #0c6355);
  box-shadow: 0 4px 12px rgba(16, 160, 140, 0.28);
}

.dora-role-menu {
  min-width: 17rem;
  padding: 0.4rem;
}

.dora-role-menu .dropdown-header {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dora-ink-soft);
}

.dora-role-menu .dropdown-item {
  border-radius: 0.6rem;
  white-space: normal;
  line-height: 1.35;
}

.dora-role-menu .dropdown-item.active,
.dora-role-menu .dropdown-item:active {
  background: rgba(var(--dora-blue-rgb), 0.16);
  color: var(--dora-ink);
}

.dora-role-menu .dora-role-name {
  font-weight: 700;
  font-size: 0.86rem;
}

.dora-role-menu .dora-role-desc {
  font-size: 0.74rem;
  color: var(--dora-ink-soft);
}

.dora-matrix td:first-child {
  font-weight: 600;
}

.dora-matrix .form-select {
  min-width: 6.5rem;
  font-size: 0.82rem;
}

.dora-matrix td.dora-matrix-locked .form-select {
  border-color: rgba(var(--dora-red-rgb), 0.5);
  background-color: rgba(var(--dora-red-rgb), 0.06);
}

.dora-scope-tag {
  font-size: 0.72rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(var(--dora-blue-rgb), 0.12);
  color: var(--dora-blue-dark);
  border: 1px solid var(--dora-border);
}

.dora-check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-height: 9rem;
  overflow-y: auto;
  padding: 0.5rem;
  border: 1px solid var(--dora-border);
  border-radius: 0.7rem;
  background: var(--dora-surface-solid);
}

.dora-check-grid .form-check {
  margin: 0;
  padding: 0.25rem 0.6rem 0.25rem 1.9rem;
  border-radius: 0.5rem;
  background: var(--dora-surface-solid);
  border: 1px solid var(--dora-border);
  font-size: 0.82rem;
}

[data-bs-theme="dark"] .dora-check-grid .form-check {
  background: rgba(255, 255, 255, 0.04);
}

.dora-readonly-hint {
  font-size: 0.78rem;
  color: var(--dora-ink-soft);
}

/* ============================================================ 登录面板 */

/* 未登录：应用主体不参与布局（visibility:hidden 仍会占高度，撑出第二个滚动条），
   页面本身也不滚动，只留登录层自己的那一个滚动条 */
body.dora-logged-out {
  overflow: hidden;
}

body.dora-logged-out .app-wrapper {
  display: none;
}

.dora-login {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, #eaf7ff 0%, #d6ecfb 45%, #eef7ee 100%);
  overflow: auto;
}

[data-bs-theme="dark"] .dora-login {
  background: linear-gradient(135deg, #062036 0%, #0a2f4b 50%, #05202c 100%);
}

.dora-login-card {
  display: grid;
  grid-template-columns: 20rem 23rem;
  width: 100%;
  max-width: 43rem;
  background: var(--dora-surface-solid);
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(7, 48, 76, 0.22), 0 2px 8px rgba(7, 48, 76, 0.08);
  border: 1px solid var(--dora-border);
}

/* ---- 左侧动画 ---- */
.dora-login-art {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #8fd6f7, #0d6fb0);
}

.dora-login-art > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---- 右侧表单 ---- */
.dora-login-form {
  padding: 2rem 2rem 1.5rem;
  display: flex;
  flex-direction: column;
}

.dora-login-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.6rem;
}

.dora-login-brand img {
  width: 2.5rem;
  height: 2.5rem;
}

.dora-login-name {
  display: flex;
  flex-direction: column;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.01em;
}

.dora-login-name small {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--dora-ink-soft);
}

.dora-login-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 1.3rem;
}

.dora-field {
  margin-bottom: 1rem;
}

.dora-field > label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--dora-ink-soft);
  margin-bottom: 0.35rem;
}

.dora-input {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.85rem;
  height: 2.9rem;
  border-radius: 0.85rem;
  background: rgba(var(--dora-blue-rgb), 0.07);
  border: 1px solid transparent;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.dora-input:focus-within {
  background: var(--dora-surface-solid);
  border-color: var(--dora-blue);
  box-shadow: 0 0 0 0.2rem rgba(var(--dora-blue-rgb), 0.16);
}

.dora-input > i {
  color: var(--dora-ink-soft);
  font-size: 0.95rem;
  flex: 0 0 auto;
}

.dora-input > input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--dora-ink);
  font-size: 0.92rem;
  height: 100%;
}

.dora-input > input::placeholder {
  color: var(--dora-ink-soft);
  opacity: 0.75;
}

.dora-captcha-text {
  letter-spacing: 0.28em;
}

.dora-eye {
  border: 0;
  background: transparent;
  color: var(--dora-ink-soft);
  padding: 0.2rem;
  line-height: 1;
  cursor: pointer;
}

.dora-eye:hover {
  color: var(--dora-blue-dark);
}

.dora-captcha-row {
  display: flex;
  gap: 0.6rem;
}

.dora-captcha-row .dora-input {
  flex: 1 1 auto;
  min-width: 0;
}

#login-captcha {
  flex: 0 0 auto;
  width: 7rem;
  height: 2.9rem;
  border-radius: 0.85rem;
  border: 1px solid var(--dora-border);
  cursor: pointer;
}

.dora-field-hint {
  font-size: 0.75rem;
  color: var(--dora-ink-soft);
  margin-top: 0.35rem;
}

.dora-field-hint a {
  color: var(--dora-blue-dark);
}

.dora-login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0.2rem 0 1.1rem;
  font-size: 0.82rem;
}

.dora-login-row a {
  color: var(--dora-blue-dark);
}

.dora-check {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  margin: 0;
  color: var(--dora-ink-soft);
}

.dora-check input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--dora-blue);
  cursor: pointer;
}

.dora-login-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  height: 2.9rem;
  border: 0;
  border-radius: 0.85rem;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
  background: linear-gradient(120deg, #46d6c0 0%, #1ca6e8 55%, #e86a9a 100%);
  box-shadow: 0 10px 24px rgba(var(--dora-blue-rgb), 0.32);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.dora-login-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(var(--dora-blue-rgb), 0.4);
  filter: saturate(1.1);
}

.dora-login-submit:disabled {
  opacity: 0.75;
  cursor: default;
}

.dora-user-menu {
  min-width: 15rem;
  padding: 0.35rem;
}

.dora-user-menu .dropdown-item {
  border-radius: 0.6rem;
}

@media (max-width: 767.98px) {
  .dora-login-card {
    grid-template-columns: 1fr;
    max-width: 23rem;
  }
  .dora-login-art {
    height: 13rem;
  }
  /* 竖版 320×480 的图在横条里按 cover 铺满，窗口只装得下约 158 个视图单位；
     纵向偏移 28% 正好框住整张脸（眼、鼻、嘴、胡须） */
  .dora-login-art > img {
    object-position: center 28%;
  }
  .dora-login-form {
    padding: 1.5rem 1.3rem 1.2rem;
  }
}


/* ============================================================ 响应式 */

@media (max-width: 991.98px) {
  body.dora-body::before {
    background-position: right -6rem bottom;
    opacity: 0.45;
  }
  .dora-phone {
    margin-top: 1rem;
  }
}

@media print {
  body.dora-body::before,
  body.dora-body::after,
  .app-sidebar,
  .app-header,
  .app-footer {
    display: none !important;
  }
}

/* 小屏会话列表与消息互斥显示，避免固定双栏挤压回复区。 */
@media (max-width: 767.98px) {
  body.dora-chat-first #view-chat > .row { gap: 0; padding: .5rem; }
  body.dora-chat-first #view-chat .col-lg-4,
  body.dora-chat-first #view-chat .col-lg-8 { flex: 1 1 100%; width: 100%; max-width: 100%; min-width: 0; }
  body.dora-chat-first #view-chat:not(.has-active-chat) .col-lg-8,
  body.dora-chat-first #view-chat.has-active-chat .col-lg-4 { display: none; }
  body.dora-chat-first #view-chat .card-header { flex-wrap: wrap; gap: .25rem; }
  body.dora-chat-first #view-chat .dora-chat-thread { min-height: 0; max-height: none; flex: 1 1 auto; }
  body.dora-chat-first #view-chat .dora-chat-composer { flex-shrink: 0; padding: .5rem; padding-bottom: max(.5rem, env(safe-area-inset-bottom)); }
  body.dora-chat-first #view-chat .dora-composer-pill { width: 100%; min-width: 0; }
  body.dora-chat-first #view-chat .dora-composer-pill textarea { flex: 1 1 auto; min-width: 0; width: 100%; }
  body.dora-chat-first .app-main { height: 100dvh; }
  body.dora-chat-first #view-chat .card-header:has(#chat-title:not(:has(*))) { display: flex; }
}

.dora-save-status { position: fixed; top: 4rem; right: 1rem; z-index: 1054; max-width: calc(100vw - 2rem); padding: .5rem .75rem; background: var(--dora-surface-solid); color: var(--dora-ink); border: 1px solid var(--dora-border); border-radius: .5rem; box-shadow: 0 3px 12px #0002; font-size: .8125rem; }
body.dora-logged-out #save-status { display: none; }
@media(max-width:767.98px) { .dora-save-status { top: .5rem; } }
