:root {
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --bg: #f4f6fb;
  --panel: #ffffff;
  --text: #1f2937;
  --muted: #7b8794;
  --line: #e6e9f0;
  --bubble-theirs: #f1f3f8;
  --shadow: 0 12px 32px rgba(23, 43, 99, 0.12);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  height: 100%;
  touch-action: pan-y;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; cursor: pointer; border: 0; }

input {
  font: inherit;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  outline: none;
}

input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }

textarea {
  font: inherit;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  outline: none;
  resize: vertical;
}
textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }

.btn {
  background: var(--brand);
  color: #fff;
  border-radius: 10px;
  padding: 10px 16px;
  transition: background 0.15s;
}
.btn:hover { background: var(--brand-dark); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn.ghost:hover { background: #f6f7fb; color: var(--text); }

/* ------------------------------------------------------- 访客前台 */
.visitor-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background-color: #f3efe6;
  background-image: -webkit-image-set(url("/assets/admin-wallpaper.png") 1x, url("/assets/admin-wallpaper@3x.png") 3x);
  background-image: image-set(url("/assets/admin-wallpaper.png") 1x, url("/assets/admin-wallpaper@3x.png") 3x);
  background-repeat: repeat;
  -webkit-font-smoothing: subpixel-antialiased;
  text-rendering: optimizeLegibility;
  background-position: left top;
  background-size: 600px auto;
}
.visitor-page.has-custom-wallpaper {
  background-image: var(--custom-wallpaper);
  background-repeat: repeat;
  background-position: left top;
  background-size: 358px auto;
}
#wallpaperCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: none;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.chat-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  height: min(720px, 100%);
  background: var(--panel);
  border-radius: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.visitor-page .chat-card {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}
.visitor-page .visitor-info,
.visitor-page .start-form,
.visitor-page .chat-panel {
  background: transparent;
}
.front-banner {
  flex: 0 0 auto;
  width: auto;
  margin: 12px 16px 0;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: transparent;
}
.front-banner img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center;
}
.front-banner-copy { padding: 10px 12px 12px; }
.front-banner-copy h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
}
.front-banner-copy p {
  margin: 6px 0 0;
  color: #5c584f;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 600;
}

.chat-head .title { font-weight: 600; }
.chat-head .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.chat-head .sub.online { color: #16a34a; }

.start-form {
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.start-form label { font-size: 14px; color: var(--muted); }
.start-form .phone-text {
  align-self: flex-start;
  max-width: 100%;
  margin: 0 0 2px;
  padding: 0 4px;
  color: #39362f;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  white-space: pre-wrap;
}
.start-form .phone-text::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 7px;
  border-radius: 50%;
  background: #35df84;
  box-shadow: 0 0 5px #35df84, 0 0 10px rgba(53, 223, 132, .65);
  vertical-align: middle;
}
.phone-entry { display: flex; gap: 8px; min-width: 0; }
.country-picker { position: relative; display: flex; flex: 0 0 auto; }
.country-trigger {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 100%;
  min-height: 42px;
  padding: 0 10px;
  border: 1.5px solid #2ecc71;
  border-radius: 10px;
  background: #fff;
  color: #1f2937;
  font-size: 14px;
}
.country-flag { font-size: 17px; line-height: 1; }
.country-dial { font-weight: 600; }
.country-caret { color: #2ecc71; font-size: 9px; margin-left: 1px; transition: transform .15s; }
.country-picker.open .country-caret { transform: rotate(180deg); }
.country-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 40;
  width: min(300px, calc(100vw - 40px));
  padding: 10px;
  background: #fff;
  border: 1px solid rgba(46, 204, 113, .35);
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(20, 40, 30, .16);
}
.country-search {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  margin-bottom: 8px;
  border: 1.5px solid #2ecc71;
  border-radius: 10px;
}
.country-search-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  fill: none;
  stroke: #9aa0a6;
  stroke-width: 2;
  stroke-linecap: round;
}
.country-search input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 13px;
  outline: none;
}
.country-list { list-style: none; margin: 0; padding: 0; max-height: 230px; overflow-y: auto; }
.country-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 8px;
  border-radius: 8px;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
}
.country-item:hover, .country-item.active { background: #eafaf0; }
.country-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.country-code { color: #6b7280; font-size: 12px; }
.country-empty { padding: 14px 8px; text-align: center; color: #9ca3af; font-size: 12px; }
.phone-entry input { flex: 1; min-width: 0; }

.chat-panel { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-notice-list {
  flex: 0 0 auto;
  max-height: 140px;
  overflow-y: auto;
  padding: 12px 16px 0;
}
.chat-notice-list[hidden] { display: none !important; }
.visitor-page .chat-notice-list .notice-item {
  border: 1px solid rgba(202, 193, 174, .6);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, .88);
}
.chat-notice-list .info-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 100px;
  object-fit: contain;
}

.messages { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.visitor-page .messages {
  background-color: transparent;
  background-image: none;
}

.msg {
  max-width: 78%;
  padding: 9px 12px;
  border-radius: 12px;
  line-height: 1.5;
  font-size: 14px;
  word-break: break-word;
  white-space: pre-wrap;
}
.msg.mine { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.msg.theirs { align-self: flex-start; background: var(--bubble-theirs); border-bottom-left-radius: 4px; }
.visitor-page .msg.theirs { background: rgba(248, 246, 240, .88); border: 1px solid rgba(202, 193, 174, .45); }
.msg.system { align-self: center; background: transparent; color: var(--muted); font-size: 12px; padding: 2px; }
.msg .meta { display: block; font-size: 11px; opacity: 0.65; margin-top: 4px; }
.msg-image {
  display: block;
  max-width: 220px;
  max-height: 200px;
  width: auto;
  border-radius: 10px;
  margin-bottom: 6px;
}

.composer { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.composer input { flex: 1; }
.visitor-composer {
  flex: 0 0 auto;
  background: rgba(248, 246, 240, .96);
  border-top: 1px solid rgba(202, 193, 174, .65);
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}
.visitor-composer input { min-width: 0; background: #fff; }
.visitor-composer .btn { flex: 0 0 auto; }
.visitor-page .phone-entry input {
  background: rgba(255, 255, 255, .88);
}

.visitor-info {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}
.welcome-box {
  background: rgba(248, 246, 240, .5);
  border: 1px solid rgba(202, 193, 174, .4);
  color: #5c584f;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
}
.welcome-title { display: block; margin-bottom: 5px; color: #39362f; font-weight: 600; }
.background-copy {
  padding: 10px 12px;
  border: 1px solid rgba(202, 193, 174, .4);
  border-radius: 12px;
  background: rgba(248, 246, 240, .72);
  color: #5c584f;
  line-height: 1.6;
}
.background-copy[hidden] { display: none !important; }
.background-copy strong { display: block; margin-bottom: 3px; color: #39362f; }
.info-heading { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.notice-list { display: flex; flex-direction: column; gap: 8px; }
.chat-card > .notice-list { flex: 0 0 auto; padding: 12px 16px 0; }
.notice-item {
  border: 1px solid rgba(202, 193, 174, .5);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(248, 246, 240, .42);
}
.notice-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.notice-body { font-size: 13px; color: #4b5563; line-height: 1.6; white-space: pre-wrap; }
.faq-list { display: flex; flex-direction: column; gap: 6px; }
.faq-item {
  border: 1px solid rgba(202, 193, 174, .5);
  border-radius: 10px;
  padding: 8px 12px;
  background: rgba(248, 246, 240, .5);
}
.faq-item summary { cursor: pointer; font-size: 14px; font-weight: 500; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before { content: "Q "; color: var(--brand); font-weight: 700; }
.faq-answer { margin-top: 8px; font-size: 13px; color: #4b5563; line-height: 1.6; white-space: pre-wrap; }

/* ------------------------------------------------------- 客服工作台（悬浮胶囊 · 浮动面板） */
.admin-page {
  display: flex;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background-color: #f5f1e8; background-image: url("/assets/admin-wallpaper.png"); background-repeat: repeat; background-size: 420px auto;
}
.admin-page [hidden] { display: none !important; }

.shell {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 20px 20px;
  background: transparent;
}

/* 顶部：左侧品牌、居中胶囊导航、右侧连接状态，全部漂浮在灰色画布上 */
.top {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
}

.brand {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 16px 5px 5px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(24, 32, 48, .1);
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #4f46e5;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}
.brand b { font-size: 15px; color: #1f2530; white-space: nowrap; }

.nav-tabs {
  display: flex;
  gap: 4px;
  padding: 5px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(24, 32, 48, .1);
}
.nav-tab {
  padding: 9px 26px;
  border-radius: 999px;
  background: transparent;
  color: #7b8794;
  font-size: 14px;
  transition: background .15s, color .15s;
}
.nav-tab:hover { color: #2c3441; }
.nav-tab.active { background: #4f46e5; color: #fff; font-weight: 600; }

.top-right {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(24, 32, 48, .1);
  color: #7b8794;
  font-size: 13px;
}
.dot-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, .14);
}
.agent-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 提示音选择 */
.tone-control {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}
.tone-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(24, 32, 48, .1);
  color: #3d4653;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s;
}
.tone-toggle:hover { background: #f6f7fa; }
.tone-ico { font-size: 15px; line-height: 1; }
.tone-name { font-weight: 600; color: #2c3441; }
.tone-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 280px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 14px 40px rgba(24, 32, 48, .18);
  padding: 12px;
  z-index: 60;
}
.tone-pop-title { font-size: 13px; font-weight: 700; color: #1f2530; margin-bottom: 8px; }
.tone-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 4px 10px;
  font-size: 13px;
  color: #3d4653;
  border-bottom: 1px solid #eef0f5;
  margin-bottom: 6px;
}
.tone-switch input { width: 18px; height: 18px; accent-color: #4f46e5; }
.tone-list { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; }
.tone-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 6px;
  border-radius: 10px;
  cursor: pointer;
}
.tone-row:hover { background: #f4f6fb; }
.tone-row input { accent-color: #4f46e5; }
.tone-row .t-name { flex: 1; font-size: 13px; color: #2c3441; }
.tone-row .t-play {
  border: 1px solid #e2e5ec;
  background: #fff;
  color: #4f46e5;
  border-radius: 8px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
}
.tone-row .t-play:hover { background: #eef0ff; }
.tone-hint { font-size: 11px; color: #98a2b3; padding: 8px 4px 2px; line-height: 1.5; }

/* 浮动主体面板 */
.shell-body {
  flex: 1;
  min-height: 0;
  display: flex;
  padding: 10px;
  background: transparent;
  border-radius: 22px;
  box-shadow: 0 16px 40px rgba(24, 32, 48, .12);
  overflow: hidden;
}
.view { flex: 1; display: flex; min-width: 0; min-height: 0; gap: 10px; }

.pane-list {
  flex: 0 0 340px;
  width: 340px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 2px solid rgba(160, 145, 118, .85);
  border-radius: 16px;
  background: transparent;
}
.pane-types { flex: 0 0 240px; width: 240px; }
.pane-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 2px solid rgba(160, 145, 118, .85);
  border-radius: 16px;
  background: transparent;
}

.list-head { padding: 18px 20px 12px; }
.list-head h2 { margin: 0; font-size: 15.5px; color: #1f2530; }
.list-head p { margin: 5px 0 0; color: #4b5563; font-size: 12.5px; }

.seg {
  display: flex;
  gap: 4px;
  margin: 0 16px 12px;
  padding: 4px;
  border-radius: 11px;
  background: #f1f3f7;
}
.seg button {
  flex: 1;
  padding: 7px 0;
  border-radius: 8px;
  background: transparent;
  color: #4b5563;
  font-size: 12.5px;
}
.seg button:hover { color: #2c3441; }
.seg button.active {
  background: #fff;
  color: #4f46e5;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(23, 32, 48, .1);
}

/* 会话列表 */
.conv-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.stat-card {
  padding: 8px 6px;
  border-radius: 10px;
  border: 1px solid rgba(202, 193, 174, .45);
  background: rgba(255, 255, 255, .72);
  text-align: center;
}
.stat-card b { display: block; font-size: 16px; color: #1f2530; line-height: 1.3; }
.stat-card span { font-size: 11px; color: #4b5563; }

.conv-list { flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: 0 10px 12px; }
.conv-list li {
  position: relative;
  padding: 12px 12px 12px 14px;
  margin-bottom: 6px;
  border-radius: 12px;
  cursor: pointer;
  transition: background .15s;
}
.conv-list li:hover { background: #f2f3f7; }
.conv-list li.active { background: #eef0ff; }
.conv-list li.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 3px;
  background: #4f46e5;
}
.conv-list li.preview { padding: 22px 12px; text-align: center; color: #5b6573; font-size: 12.5px; }
.conv-list .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.conv-list .name { color: #22293a; font-size: 13.5px; font-weight: 600; }
.conv-list .time { color: #5b6573; font-size: 11px; }
.conv-list .preview {
  margin-top: 5px;
  color: #4b5563;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conv-list .badge { background: #ef4444; color: #fff; font-size: 11px; border-radius: 999px; padding: 1px 7px; }
.conv-list .tag { border: 1px solid #e6e8ee; border-radius: 6px; padding: 0 6px; color: #566070; font-size: 11px; }

/* 主区头部与按钮 */
.subhead {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 24px;
  border-bottom: 1px solid #eef0f4;
}
.subhead h2 { margin: 0; font-size: 17px; color: #1f2530; }
.subhead p { margin: 5px 0 0; color: #4b5563; font-size: 12.5px; }
.chat-heading { display: flex; align-items: center; gap: 8px; }
.copy-btn {
  padding: 2px 9px;
  font-size: 11px;
  color: #374151;
  background: rgba(255, 255, 255, .72);
  border: 2px solid rgba(160, 145, 118, .85);
  border-radius: 7px;
}
.copy-btn:hover { background: #fff; color: #1f2530; }
.subhead-actions { display: flex; gap: 8px; }

.admin-page .btn { min-height: 36px; border-radius: 10px; font-size: 13px; font-weight: 550; }
.admin-page .btn:not(.ghost) { background: #4f46e5; }
.admin-page .btn:not(.ghost):hover { background: #4338ca; }
.admin-page .btn.ghost { background: #fff; border: 1px solid #e2e5ec; color: #3d4653; }
.admin-page .btn.ghost:hover { background: #f6f7fa; color: #232a37; }
.admin-page .btn:disabled { background: #f3f4f7; border-color: #eaecef; color: #a7aeb9; }
.admin-page .add-mark { margin-right: 2px; font-weight: 700; }

/* 会话区 */
.stage { flex: 1; display: flex; min-height: 0; background: transparent; }
.placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #5b6573;
  font-size: 12px;
  text-align: center;
}
.placeholder strong { color: #4d5766; font-size: 15px; font-weight: 600; }
.placeholder-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 4px;
  border: 1px solid #e9ecf1;
  border-radius: 16px;
  background: #fff;
  color: #4b5563;
  font-size: 13px;
  font-weight: 600;
}
.stage .messages { width: 100%; padding: 24px 28px; gap: 12px; }
.admin-page .msg { border-radius: 13px; }
.admin-page .msg.mine { background: #4f46e5; color: #fff; }
.admin-page .msg.theirs { background: #fff; border: 1px solid #e9ecf1; }

.quick-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px 2px;
  border-top: 0;
  background: transparent;
}
.quick-scroller {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.quick-scroller::-webkit-scrollbar { display: none; }
.quick-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  max-width: 120px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .96);
  border: 1px solid rgba(60, 60, 67, .12);
  box-shadow: 0 1px 2px rgba(25, 32, 52, .06);
  color: #2c3444;
  font-size: 11px;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.quick-chip img {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border-radius: 4px;
  object-fit: cover;
}
.quick-chip span { overflow: hidden; text-overflow: ellipsis; }
.quick-chip:hover {
  background: #eef0ff;
  border-color: #c9cbf7;
  color: #4f46e5;
}
.quick-chip:disabled { opacity: .5; cursor: default; }

.quick-add {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px dashed rgba(79, 70, 229, .38);
  background: rgba(255, 255, 255, .72);
  color: #4f46e5;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.quick-add:hover,
.quick-add.open { background: #eef0ff; border-color: #a5a8f5; }
.quick-add-panel {
  position: absolute;
  right: 20px;
  bottom: calc(100% + 8px);
  z-index: 30;
  width: 320px;
  padding: 12px;
  border: 1px solid rgba(60, 60, 67, .1);
  border-radius: 14px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 16px 40px rgba(25, 32, 52, .18);
  backdrop-filter: blur(18px);
}
.quick-add-input {
  width: 100%;
  min-height: 64px;
  resize: vertical;
  padding: 9px 10px;
  border: 1px solid rgba(60, 60, 67, .14);
  border-radius: 10px;
  background: #fff;
  color: #22293a;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
}
.quick-add-input:focus { outline: none; border-color: #4f46e5; }
.quick-add-file { display: flex; align-items: center; gap: 8px; margin-top: 9px; }
.quick-add-file label {
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: 8px;
  background: #eef0ff;
  color: #4f46e5;
  font-size: 12px;
  cursor: pointer;
}
.quick-add-file input { display: none; }
.quick-add-file span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11.5px;
  color: #5b6573;
}
.quick-add-error { min-height: 0; margin-top: 6px; font-size: 12px; color: #d92d20; }
.quick-add-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.quick-add-actions button {
  height: 30px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.quick-add-actions .save { background: #007aff; color: #fff; }
.quick-add-actions .save:disabled { opacity: .6; cursor: default; }
.quick-add-actions .cancel { background: #f2f2f7; color: #3a3a3c; }

.admin-page .composer {
  gap: 10px;
  padding: 6px 20px 14px;
  border-top: 0;
  background: transparent;
}
.admin-page .composer input { flex: 1; height: 42px; border-radius: 11px; border-color: #e3e6ec; }

/* 内容分类 */
.type-list { flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: 0 10px 12px; }
.type-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 12px;
  margin-bottom: 4px;
  border-radius: 11px;
  color: #3d4653;
  font-size: 13.5px;
  cursor: pointer;
}
.type-list li:hover { background: #f2f3f7; }
.type-list li.active { background: #eef0ff; color: #4f46e5; font-weight: 600; }
.type-list .count {
  min-width: 26px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #f2f4f7;
  color: #4b5563;
  font-size: 11px;
  text-align: center;
}
.type-list li.active .count { background: #fff; color: #4f46e5; }

/* 内容列表 */
.scroll {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 24px;
  background: transparent;
}
.content-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.content-list li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 17px;
  border: 1px solid #e7e9ef;
  border-radius: 13px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.content-list li:hover { border-color: #cfd3f0; box-shadow: 0 6px 16px rgba(25, 32, 52, .06); }
.content-list li.disabled { opacity: .55; }
.content-main { min-width: 0; }
.content-title { margin-bottom: 4px; color: #22293a; font-size: 14px; font-weight: 600; }
.content-body {
  color: #3f4854;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.content-side { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; }
.content-side .order,
.content-side .time { color: #5b6573; font-size: 11px; }
.content-side .tag {
  padding: 0 7px;
  border: 1px solid #f3d9a4;
  border-radius: 6px;
  background: #fffaeb;
  color: #b7791f;
  font-size: 11px;
}

/* 编辑器（右侧栏） */
.editor {
  flex: 0 0 380px;
  width: 380px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-left: 1px solid rgba(60, 60, 67, .12);
  background: rgba(242, 242, 247, .95);
  backdrop-filter: blur(18px);
}
.editor-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(60, 60, 67, .08);
}
.editor-head h2 { margin: 0; font-size: 16px; color: #1f2530; }
.editor-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  padding: 16px;
}
.editor-form > * { flex-shrink: 0; }

/* iOS 风格分组表单 */
.ios-group {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, .92);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
  overflow: hidden;
}
.ios-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 14px;
  color: #6b7280;
  font-size: 12.5px;
}
.ios-field + .ios-field { border-top: 1px solid rgba(60, 60, 67, .1); }
.editor-form .ios-field input,
.editor-form .ios-field textarea {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 2px 0 0;
  color: #111827;
  font-size: 15px;
  line-height: 1.45;
  resize: none;
}
.editor-form .ios-field input:focus,
.editor-form .ios-field textarea:focus {
  outline: none;
  border-color: transparent;
  box-shadow: none;
}
.ios-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  color: #111827;
  font-size: 14px;
}
.ios-row + .ios-row { border-top: 1px solid rgba(60, 60, 67, .1); }
.editor-form .ios-row input[type="number"] {
  width: 84px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  text-align: right;
  color: #6b7280;
  font-size: 15px;
}
.ios-switch-row input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex: 0 0 auto;
  width: 51px;
  height: 31px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #e5e5ea;
  cursor: pointer;
  transition: background .2s ease;
}
.ios-switch-row input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .2);
  transition: transform .2s ease;
}
.ios-switch-row input[type="checkbox"]:checked { background: #34c759; }
.ios-switch-row input[type="checkbox"]:checked::after { transform: translateX(20px); }

.editor-actions { display: flex; gap: 10px; }
.editor-actions .btn { flex: 1; min-height: 46px; border-radius: 12px; font-size: 15px; }
.editor-actions .btn:not(.ghost) { background: #007aff; }
.editor-actions .btn:not(.ghost):hover { background: #0069d9; }
.editor-actions .btn.ghost {
  background: rgba(255, 255, 255, .9);
  color: #007aff;
  border: 1px solid rgba(0, 122, 255, .28);
}
.editor-actions #deleteContentBtn {
  color: #ff3b30;
  border-color: rgba(255, 59, 48, .28);
}

/* 登录兜底页 */
.login-wrap { margin: auto; width: 100%; max-width: 340px; padding: 20px; }
.login-card {
  padding: 26px 24px;
  border: 1px solid #e6e8ee;
  border-radius: 18px;
  background: #fff;
}
.login-tag {
  margin-bottom: 10px;
  color: #5b6573;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.login-card h1 { margin: 0 0 8px; font-size: 19px; font-weight: 650; }
.login-card p { margin: 0 0 20px; color: #4b5563; font-size: 13px; }
.error-text { color: #e5484d; font-size: 12.5px; min-height: 18px; }

/* ------------------------------------------------------- 内容配图上传与展示 */
.image-field { position: relative; padding: 11px 14px; gap: 8px; }
.image-field > label { color: #6b7280; font-size: 12.5px; }
.image-field input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.image-pick-row { display: flex; align-items: center; gap: 10px; }
.image-pick {
  flex: 0 0 auto;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(0, 122, 255, .1);
  color: #007aff;
  font-size: 13px;
  cursor: pointer;
}
.image-pick:active { opacity: .65; }
.image-pick-name {
  min-width: 0;
  color: #8e8e93;
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.image-help { color: #5b6573; font-size: 11px; }

.msg-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  white-space: normal;
}
.msg-button {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(90, 74, 44, .25);
  background: #fff;
  color: #3d4653;
  font-size: 12px;
  line-height: 1.3;
  cursor: pointer;
}
.msg-button:active:not(:disabled) { transform: scale(.97); }
.msg-button:disabled { opacity: .65; cursor: default; }
.msg-slogan {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  margin: 0 0 6px;
  padding: 0 0 5px;
  border-bottom: 1px dashed rgba(160, 145, 118, .45);
  font-size: 11px;
  line-height: 1.35;
  color: rgba(70, 60, 40, .72);
  white-space: normal;
}
.msg-slogan-image {
  display: block;
  width: auto;
  max-width: 132px;
  max-height: 22px;
  border-radius: 4px;
}
.msg-slogan-text { flex: 1; word-break: break-word; }
.button-field .button-row { display: flex; gap: 8px; }
.button-field .button-row input { flex: 1; min-width: 0; }
.button-field > label { display: block; margin: 8px 0 6px; }
.button-field > label:first-child { margin-top: 0; }
.image-preview-wrap { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.image-preview-wrap img {
  max-width: 100%;
  max-height: 190px;
  border-radius: 12px;
  object-fit: contain;
  background: #f2f2f7;
}
.content-thumb { display: block; width: 100%; max-height: 190px; margin-bottom: 10px; border-radius: 10px; object-fit: cover; }
.info-image { display: block; width: 100%; max-height: 230px; margin: 8px 0; border-radius: 9px; object-fit: cover; }
.welcome-copy { white-space: pre-wrap; }

@media (max-width: 1000px) {
  .shell { padding: 12px 14px 14px; gap: 11px; }
  .pane-list { flex-basis: 270px; width: 270px; }
  .pane-types { flex-basis: 200px; width: 200px; }
  .editor { flex-basis: 330px; width: 330px; }
  .nav-tab { padding: 9px 18px; }
  .brand { padding: 5px; }
  .brand b { display: none; }
}

@media (max-width: 720px) {
  .top-right { display: none; }
  .tone-name { display: none; }
  .tone-toggle { padding: 9px 11px; }
  .nav-tab { padding: 8px 14px; font-size: 13px; }
  .view { flex-direction: column; overflow-y: auto; }
  .pane-list,
  .pane-types,
  .editor,
  .pane-main { flex: 0 0 auto; width: 100%; }
  .pane-list { border-right: 0; border-bottom: 1px solid #e9ecf1; max-height: 42vh; }
  .pane-types { max-height: 34vh; }
  .pane-main { flex: 1 0 auto; min-height: 380px; }
  .editor { border-left: 0; border-top: 1px solid #e9ecf1; }
  .content-side { display: none; }
}

/* 访客前台：手机端铺满全屏 */
@media (max-width: 720px) {
  .visitor-page {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
  }
  .visitor-page .chat-card {
    width: 100%;
    max-width: none;
    height: 100%;
    height: 100dvh;
    border-radius: 0;
  }
  .visitor-page .front-banner {
    margin: 0;
    border-radius: 0;
  }
  .visitor-page .chat-card > .notice-list {
    padding: 0;
    gap: 0;
  }
  .visitor-page .notice-item {
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
  }
  .visitor-page .notice-item .info-image {
    margin: 0;
    border-radius: 0;
    max-height: none;
    width: 100%;
    height: auto;
    aspect-ratio: 490 / 90;
    object-fit: contain;
  }
  .visitor-page .chat-notice-list {
    max-height: none;
    overflow: visible;
    padding: 0;
    gap: 0;
  }
  .visitor-page .chat-notice-list .notice-item {
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
  }
  .visitor-page .chat-notice-list .notice-item .info-image {
    width: 100%;
    height: auto;
    max-height: none;
    aspect-ratio: auto;
    object-fit: contain;
  }
  .visitor-page .chat-notice-list .notice-title,
  .visitor-page .chat-notice-list .notice-body {
    padding-right: 12px;
    padding-left: 12px;
  }
  .visitor-page .start-form {
    padding-top: 0;
  }
}
