/* ===== 小雀聊天面板（照搬模拟微信.html，类名加 xiaque- 前缀） ===== */

/* 聊天面板容器——底色改为 --bg-2（仅聊天面板，不影响其他弹窗） */
.sidebar-panel:has(.xiaque-chat),
.sidebar-panel.xiaque-sub-panel {
  background: var(--bg-2);
}

/* 4.2 聊天容器 */
.xiaque-chat {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-2);
}

/* 4.3 消息滚动区 */
.xiaque-messages {
  flex: 1;
  overflow-y: scroll;          /* 始终占位，防止布局抖动 */
  overflow-x: hidden;
  padding: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-2);
  -webkit-overflow-scrolling: touch;
}
/* 4.4 消息气泡行 */
.xiaque-msg-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 100%;
  animation: xiaque-msgIn 0.25s ease-out;
}
.xiaque-msg-row.self {
  flex-direction: row-reverse;
}
@keyframes xiaque-msgIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 4.5 头像 */
.xiaque-msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--bg-1);
  font-weight: 600;
}

/* 4.6 消息气泡 */
.xiaque-msg-bubble {
  max-width: 68%;
  padding: 7px 14px;
  font-size: 15px;
  line-height: 1.5;
  word-break: break-word;
  position: relative;
  letter-spacing: 0.3px;
  /* 保留消息内的换行（消息文本仍可能内嵌换行，如卡片说明或 LLM 偶发的整段回复，正常分行显示） */
  white-space: pre-line;
}
.xiaque-msg-row.self .xiaque-msg-bubble {
  background: var(--primary-light);
  border-radius: 4px;
  color: var(--primary);
  box-shadow: 0 1px 3px var(--primary-light);
}
.xiaque-msg-row.other .xiaque-msg-bubble {
  background: var(--bg-1);
  border-radius: 4px;
  color: var(--text-1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

/* 三角箭头 */
.xiaque-msg-row.self .xiaque-msg-bubble::after {
  content: '';
  position: absolute;
  right: -5px;
  top: 13px; /* 头像高度 36px，中心 18px；三角形高 10px，中心偏移 5px → 18-5=13 */
  border-left: 6px solid var(--primary-light);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}
.xiaque-msg-row.other .xiaque-msg-bubble::after {
  content: '';
  position: absolute;
  left: -5px;
  top: 13px;
  border-right: 6px solid var(--bg-1);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

/* 4.7 时间分隔线 */
.xiaque-time-divider {
  text-align: center;
  margin: 8px 0;
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.3px;
}

/* 4.7+ 卡片消息（气泡内嵌卡片） */
.xiaque-msg-bubble--card {
  background: transparent !important;
  padding: 0;
  white-space: normal; /* 卡片内部由 DOM 结构排版，不继承气泡的 pre-line */
}
/* 卡片气泡去掉三角箭头 */
.xiaque-msg-row.self .xiaque-msg-bubble--card::after,
.xiaque-msg-row.other .xiaque-msg-bubble--card::after {
  display: none;
}
/* 卡片容器 */
.xiaque-card {
  background: #FFFFFF;
  border-radius: 8px;
  overflow: hidden;
  min-width: 200px;
  max-width: 280px;
}
/* 卡片头部 */
.xiaque-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 14px 4px;
}
.xiaque-card-icon {
  font-size: 18px;
  line-height: 1;
}
.xiaque-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
}
/* 卡片正文 */
.xiaque-card-body {
  padding: 4px 14px 12px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
  white-space: pre-line;
}
/* 卡片按钮区 */
.xiaque-card-footer {
  display: flex;
  border-top: 0.5px solid rgba(0, 0, 0, 0.08);
}
.xiaque-card-btn {
  flex: 1;
  padding: 10px 0;
  border: none;
  background: none;
  font-size: 14px;
  color: #576B95;
  cursor: pointer;
  text-align: center;
  transition: background 0.12s;
}
.xiaque-card-btn:active {
  background: rgba(0, 0, 0, 0.04);
}
.xiaque-card-btn + .xiaque-card-btn {
  border-left: 0.5px solid rgba(0, 0, 0, 0.08);
}
.xiaque-card-btn--disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* 4.8 底部输入栏 */
.xiaque-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px 0;
  flex-shrink: 0;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
}
.xiaque-text-input {
  flex: 1;
  min-height: 36px;
  max-height: 120px;
  border: none;
  border-radius: 18px;
  padding: 8px 16px;
  font-size: 15px;
  font-family: inherit;
  line-height: 1.4;
  background: var(--bg-1);
  outline: none;
  color: var(--text-1);
  letter-spacing: 0.3px;
  resize: none;
}
.xiaque-text-input::placeholder {
  color: var(--text-4);
}
.xiaque-send-btn {
  flex-shrink: 0;
  align-self: flex-end;
  width: 36px;
  height: 36px;
  padding: 0;
  background: var(--primary);
  color: var(--bg-1);
  border: none;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.xiaque-send-btn:active {
  background: var(--primary-hover);
}
.xiaque-send-btn:disabled {
  background: var(--bg-4);
  cursor: not-allowed;
}

/* 4.9 Loading 提示 */
.xiaque-chat-loading {
  text-align: center;
  padding: 8px;
  font-size: 13px;
  color: var(--text-3);
  flex-shrink: 0;
}

/* 4.10 顶部横幅通知 */
.xiaque-banner {
  display: block !important;  /* 覆盖 mountBanner 时设置的 inline display:none */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  transform: translateY(-120%);
  transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
  pointer-events: none;
  padding: 6px 10px;
  padding-top: calc(6px + env(safe-area-inset-top, 0px));
}
.xiaque-banner.show {
  transform: translateY(0);
  pointer-events: auto;
}
.xiaque-banner-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(50, 50, 50, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 14px;
  padding: 11px 14px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  border: 0.5px solid rgba(255, 255, 255, 0.15);
}
.xiaque-notif-avatar {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--bg-1);
  letter-spacing: 0.5px;
}
.xiaque-notif-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.xiaque-notif-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--bg-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.xiaque-notif-msg {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.xiaque-notif-close {
  color: rgba(255, 255, 255, 0.35);
  font-size: 16px;
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}

/* ===== 移动端全屏聊天弹层 ===== */
.xiaque-mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.xiaque-mobile-overlay--open {
  transform: translateX(0);
}

.xiaque-mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  flex-shrink: 0;
}

.xiaque-mobile-back,
.xiaque-mobile-more {
  background: none;
  border: none;
  color: var(--text-1);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.xiaque-mobile-header-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.xiaque-mobile-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 17px;
  font-weight: 600;
  white-space: nowrap;
}

.xiaque-mobile-body {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.xiaque-mobile-page {
  position: absolute;
  inset: 0;
  padding: 0 16px;
}

/* ===== 个人信息页 ===== */
.xiaque-profile {
  padding: 0;
}

.xiaque-profile-card {
  margin: 16px 0;
  padding: 28px 20px 26px;
  background: var(--bg-1, #ffffff);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.xiaque-profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  position: relative;
}

.xiaque-profile-nickname {
  margin: 16px 0 10px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.2;
  outline: none;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

/* 浅灰编辑态：hover/聚焦时变浅灰输入框（参照 /story 标题），padding 常驻防跳动 */
.xiaque-profile-nickname:hover,
.xiaque-profile-nickname:focus {
  background: var(--bg-3);
}

.xiaque-profile-signature {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-2, #707070);
  max-width: 280px;
  outline: none;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.xiaque-profile-signature:hover,
.xiaque-profile-signature:focus {
  background: var(--bg-3);
}

/* 灰色占位态（未设置昵称/签名/地区、作息未设置时） */
.xiaque-profile-placeholder {
  color: var(--text-3, #999999);
}

/* 异步加载骨架占位 */
.xiaque-profile-loading {
  padding: 48px 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-3, #999999);
}

.xiaque-profile-section {
  padding: 0;
}

.xiaque-profile-section-title {
  margin: 0;
  padding: 22px 4px 8px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-3);
}

.xiaque-profile-group {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--bg-1, #ffffff);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  overflow: hidden;
}

.xiaque-profile-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-2, #e8eaee);
}

.xiaque-profile-row:last-child {
  border-bottom: none;
}

.xiaque-profile-row-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--primary);
}

.xiaque-profile-row-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
}

.xiaque-profile-row-value {
  font-size: 15px;
  color: var(--text-3);
  text-align: right;
  max-width: 58%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 有副文字时，由副文字负责右推 */
.xiaque-profile-row:has(.xiaque-profile-row-value) .xiaque-profile-row-value {
  margin-left: auto;
}
.xiaque-profile-row:has(.xiaque-profile-row-value) .xiaque-profile-row-arrow {
  margin-left: initial;
}

.xiaque-profile-row-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-left: auto;  /* 无副文字时，由箭头负责右推 */
  color: var(--text-3, #999);
}
.xiaque-profile-row-arrow svg {
  width: 100%;
  height: 100%;
}

.xiaque-header-save {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  font-family: inherit;
  white-space: nowrap;
}

.xiaque-profile-bottom {
  height: 48px;
  flex-shrink: 0;
}

/* 底部导航·小雀按钮未读消息角标（按钮自身 position:relative 见 mobile.css .nav-item-mobile） */
.top-header-chat-badge,
.nav-fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #ff3b30;
  color: var(--bg-1);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  box-sizing: border-box;
  z-index: 26;
  pointer-events: none;
}

/* ===== 天气卡片 ===== */
.xiaque-card-weather {
  max-width: 320px;
  padding: 16px;
}
/* 天气卡片 SVG 图标 — 线条风格，覆盖全局 fill: currentColor */
.xiaque-card-weather .svg-icon {
  fill: none;
  stroke: currentColor;
}
.xiaque-weather-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.xiaque-weather-top > div {
  display: flex;
  align-items: center;
  gap: 6px;
}
.xiaque-weather-top .xiaque-weather-city {
  font-size: 14px;
  font-weight: 500;
  color: var(--xiaque-weather-text, #212121);
}
.xiaque-weather-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--primary-light, #fff0ee);
  color: var(--primary, #ff8383);
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 500;
}
.xiaque-weather-temp {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  margin-top: 8px;
}
.xiaque-weather-temp .xiaque-weather-temp-value {
  font-size: 48px;
  font-weight: 300;
  line-height: 1;
  color: var(--xiaque-weather-text, #212121);
}
.xiaque-weather-temp .xiaque-weather-temp-feels {
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--xiaque-weather-muted, #8e8e93);
}
.xiaque-weather-info {
  display: flex;
  gap: 16px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--xiaque-weather-muted, #8e8e93);
}
.xiaque-weather-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.06);
  margin: 12px 0;
}
.xiaque-weather-hourly-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.xiaque-weather-hourly {
  display: flex;
  gap: 12px;
  flex-wrap: nowrap;
}
.xiaque-weather-hour {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 36px;
}
.xiaque-weather-hour-time {
  font-size: 10px;
  color: var(--xiaque-weather-muted, #8e8e93);
}
.xiaque-weather-hour-temp {
  font-size: 12px;
  font-weight: 500;
  color: var(--xiaque-weather-text, #212121);
}

/* ===== 待办卡片 ===== */
.xiaque-card-todo {
  max-width: 320px;
  padding: 16px;
  cursor: pointer;
}
.xiaque-todo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.xiaque-todo-header .xiaque-todo-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--xiaque-weather-text, #212121);
}
.xiaque-todo-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--primary-light, #fff0ee);
  color: var(--primary, #ff8383);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
}
.xiaque-todo-progress-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--xiaque-todo-progress-bg, #f0f0f0);
  margin-top: 12px;
  overflow: hidden;
}
.xiaque-todo-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--primary, #ff8383);
  transition: width 0.3s ease;
}
.xiaque-todo-list {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.xiaque-todo-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.xiaque-todo-item .xiaque-todo-item-text {
  font-size: 14px;
  color: var(--xiaque-weather-text, #212121);
  line-height: 1.4;
}
.xiaque-todo-item .xiaque-todo-item-text--done {
  text-decoration: line-through;
  color: var(--xiaque-weather-muted, #8e8e93);
}
.xiaque-todo-item .xiaque-todo-item-status {
  margin-left: auto;
  font-size: 12px;
  color: var(--xiaque-weather-muted, #8e8e93);
  flex-shrink: 0;
}
.xiaque-todo-item .xiaque-todo-item-check {
  flex-shrink: 0;
  cursor: pointer;
  margin-top: 1px;
}
.xiaque-todo-more {
  text-align: center;
  padding: 6px 0 0;
  font-size: 13px;
  color: var(--primary, #ff8383);
  cursor: pointer;
  user-select: none;
}

/* ===== 文章卡片 ===== */
.xiaque-card-article {
  max-width: 320px;
  cursor: pointer;
}
.xiaque-article-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg-2, #f7f7f7);
  min-height: 128px;
}
.xiaque-article-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.xiaque-article-body {
  padding: 16px;
}
.xiaque-article-source {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.xiaque-article-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--xiaque-article-source-bg, #fff0ee);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 500;
  color: var(--primary, #ff8383);
  flex-shrink: 0;
}
.xiaque-article-source-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--xiaque-weather-text, #212121);
}
.xiaque-article-source-dot {
  font-size: 12px;
  color: var(--xiaque-weather-muted, #8e8e93);
}
.xiaque-article-source-time {
  font-size: 12px;
  color: var(--xiaque-weather-muted, #8e8e93);
}
.xiaque-article-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--xiaque-weather-text, #212121);
  margin-bottom: 4px;
}
.xiaque-article-summary {
  font-size: 12px;
  line-height: 1.6;
  color: var(--xiaque-weather-muted, #8e8e93);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== 桌面端聊天浮层（position: fixed，右侧滑入）===== */

.xiaque-desktop-panel {
    position: fixed;
    top: env(safe-area-inset-top, 0px);
    right: 0;
    bottom: 0;
    width: 420px;
    transform: translateX(100%);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 100;
    display: flex;
    flex-direction: column;
    background: var(--bg-2);
    border-left: 1px solid var(--line-3);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0);
}

.xiaque-desktop-panel--open {
    transform: translateX(0);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.06);
}

/* 面板内页面对齐容器（mobile-page 复用 absolute 定位以支持导航栈滑动动画） */
.xiaque-desktop-panel .xiaque-mobile-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    position: relative;
}

.xiaque-desktop-panel .xiaque-mobile-page {
    padding: 0 16px;
}

/* 桌面端面板不需要 safe-area-inset-bottom */
.xiaque-desktop-panel .xiaque-mobile-body::after {
    display: none;
}

/* ===== 面板拖拽分隔条（左侧边缘）===== */

.xiaque-desktop-panel .desktop-panel-divider {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    cursor: col-resize;
    z-index: 10;
}

.xiaque-desktop-panel .desktop-panel-divider::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    transform: translateX(-50%);
    transition: background-color 0.15s;
}

.xiaque-desktop-panel .desktop-panel-divider:hover::after,
.xiaque-desktop-panel .desktop-panel-divider.dragging::after {
    background-color: var(--primary);
}

/* ===== 侧边栏面板返回按钮 ===== */
.sidebar-panel__back-btn {
  background: none;
  border: none;
  color: var(--text-1);
  cursor: pointer;
  padding: 4px;
  margin-right: 4px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

/* 侧边栏面板右侧插槽 */
.sidebar-panel__right-slot {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin-left: auto;
  margin-right: 8px;
}

/* ===== 作息页面 ===== */
.xiaque-schedule-page1,
.xiaque-schedule-page3 {
  padding-top: 24px;
  padding-bottom: 48px;
}

.xiaque-schedule-title {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
  color: var(--text-1, #212121);
}

.xiaque-schedule-subtitle {
  font-size: 13px;
  color: var(--text-3, #999999);
  margin-bottom: 28px;
}

.xiaque-schedule-label {
  font-size: 14px;
  color: var(--primary, #ff8383);
  font-weight: 600;
  margin-bottom: 14px;
  letter-spacing: 0.3px;
}

.xiaque-schedule-block { margin-bottom: 36px; }

/* 步骤指示器 */
.xiaque-schedule-step {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
}
.xiaque-schedule-step-dot {
  width: 24px;
  height: 3px;
  background: var(--line-2, #e8eaee);
  border-radius: 2px;
}
.xiaque-schedule-step-dot.active {
  background: var(--primary, #ff8383);
}

/* 工作日选择 */
.xiaque-schedule-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.xiaque-schedule-day-btn {
  aspect-ratio: 1 / 1.1;
  border: 1px solid var(--line-2, #e8eaee);
  background: var(--bg-1, #ffffff);
  color: var(--text-1, #212121);
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
}
.xiaque-schedule-day-btn.active {
  background: var(--primary, #ff8383);
  color: #fff;
  border-color: var(--primary, #ff8383);
}

/* 时间选择 */
.xiaque-schedule-time-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.xiaque-schedule-time-box {
  flex: 1;
  border: 1px solid var(--line-2, #e8eaee);
  border-radius: 10px;
  padding: 14px 16px;
  background: var(--bg-1, #ffffff);
}
.xiaque-schedule-time-box label {
  display: block;
  font-size: 12px;
  color: var(--text-3, #999999);
  margin-bottom: 6px;
}
.xiaque-schedule-time-box input {
  border: none;
  outline: none;
  font-size: 20px;
  font-weight: 600;
  width: 100%;
  background: transparent;
  color: var(--text-1, #212121);
}
.xiaque-schedule-time-arrow {
  color: var(--text-4, #bfbfbf);
  font-size: 18px;
}

/* 按钮 */
.xiaque-schedule-btn-primary {
  width: 100%;
  background: var(--primary, #ff8383);
  color: #fff;
  border: none;
  padding: 15px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 20px;
  transition: opacity .15s;
}
.xiaque-schedule-btn-primary:active { opacity: 0.85; }
.xiaque-schedule-btn-primary:disabled { background: var(--text-4, #bfbfbf); }

.xiaque-schedule-btn-secondary {
  width: 100%;
  background: var(--bg-1, #ffffff);
  color: var(--text-1, #212121);
  border: 1px solid var(--line-2, #e8eaee);
  padding: 14px;
  border-radius: 12px;
  font-size: 15px;
  cursor: pointer;
  margin-top: 12px;
}

/* 行内编辑输入框 */
.xiaque-schedule-input {
  flex: 1;
  padding: 0;
  border: none;
  outline: none;
  font-size: 15px;
  background: transparent;
  color: var(--text-1, #212121);
  font-family: inherit;
  min-width: 0;
  width: 100%;
}

/* 周条 */
.xiaque-schedule-week-wrap {
  margin-bottom: 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.xiaque-schedule-week-wrap::-webkit-scrollbar { display: none; }
.xiaque-schedule-week-strip {
  display: flex;
  gap: 10px;
  padding-bottom: 4px;
  width: max-content;
}
.xiaque-schedule-week-card {
  flex-shrink: 0;
  width: 72px;
  padding: 12px 0;
  border: none;
  border-radius: 12px;
  text-align: center;
  background: var(--bg-1, #ffffff);
  color: var(--text-1, #212121);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.xiaque-schedule-week-card.work {
  background: var(--primary-light, #fff0ee);
  color: var(--primary, #ff8383);
}
.xiaque-schedule-wd-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.xiaque-schedule-wd-tag { font-size: 11px; opacity: 0.7; }
.xiaque-schedule-week-card.active {
  background: var(--primary, #ff8383);
  color: #fff;
}
.xiaque-schedule-week-card.whole-week {
  border-color: #ff7d00;
  background: #fff3e0;
  color: #ff7d00;
}
.xiaque-schedule-week-card.whole-week.active {
  background: var(--primary, #ff8383);
  color: #fff;
  border-color: var(--primary, #ff8383);
}

/* 作息表格 */
.xiaque-schedule-final {
  border-top: 1px solid var(--line-3, #f0f1f5);
}
.xiaque-schedule-final-row {
  display: flex;
  border-bottom: 1px solid var(--line-3, #f0f1f5);
  padding: 14px 0;
  cursor: pointer;
}
.xiaque-schedule-final-row:active { background: rgba(0, 0, 0, 0.02); }
.xiaque-schedule-final-time {
  width: 110px;
  flex-shrink: 0;
  font-size: 13px;
  color: var(--text-3, #999999);
  font-variant-numeric: tabular-nums;
}
.xiaque-schedule-final-content {
  flex: 1;
  font-size: 15px;
  color: var(--text-1, #212121);
  word-break: break-word;
}
.xiaque-schedule-final-content.empty { color: var(--text-4, #bfbfbf); }
.xiaque-schedule-override-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary, #ff8383);
  margin-left: 6px;
  vertical-align: middle;
  flex-shrink: 0;
}
.xiaque-schedule-edit-hint {
  text-align: center;
  font-size: 12px;
  color: var(--primary, #ff8383);
  margin-top: 18px;
}

/* ===== 阶段 2：文档操作确认卡片（doc-confirm）===== */
.xiaque-card-doc-confirm {
  max-width: 300px;
}
.xiaque-doc-confirm-body {
  padding-top: 6px;
  padding-bottom: 10px;
}
.xiaque-doc-step {
  display: flex;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.05);
}
.xiaque-doc-step:last-child {
  border-bottom: none;
}
.xiaque-doc-step-no {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-2, #f2f3f5);
  color: var(--text-3, #8a8a8a);
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  margin-top: 1px;
}
.xiaque-doc-step-main {
  flex: 1;
  min-width: 0;
}
.xiaque-doc-step-text {
  font-size: 13px;
  color: var(--text-1, #212121);
  line-height: 1.5;
  word-break: break-word;
}
.xiaque-doc-step-detail {
  margin-top: 4px;
  padding: 5px 8px;
  background: var(--bg-1, #f7f7f7);
  border-radius: 6px;
  font-size: 11px;
  color: var(--text-3, #8a8a8a);
  line-height: 1.5;
  word-break: break-all;
}
.xiaque-doc-step-risk {
  display: inline-block;
  margin-top: 4px;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 10px;
  line-height: 16px;
}
.xiaque-doc-step-risk.medium {
  background: rgba(250, 173, 20, 0.12);
  color: #b8860b;
}
.xiaque-doc-step-risk.high,
.xiaque-doc-step-risk.error {
  background: rgba(245, 63, 63, 0.1);
  color: #d93025;
}
.xiaque-doc-confirm-btn.confirm {
  color: #d93025;
  font-weight: 600;
}

/* ===== 阶段 2：聊天面板只读模式开关 ===== */
.xiaque-ro-toggle {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-4, #bfbfbf);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, color 0.12s;
}
.xiaque-ro-toggle:hover {
  background: var(--bg-1, #f2f3f5);
  color: var(--text-3, #8a8a8a);
}
.xiaque-ro-toggle.active {
  background: rgba(245, 63, 63, 0.1);
  color: #d93025;
}
