/* 颜色变量（暗色默认） */
:root {
  color-scheme: dark;
  --bg: #151515;
  --bg-2: #1f1f1f;
  --text: #e8e8e8;
  --muted: #a0a0a0;
  --border: #3a3a3a;
  --line: #2f2f2f;
  --accent: #fff;
  --scroll-track: #242424;
  --scroll-thumb: #595959;
  --scroll-thumb-hover: #6e6e6e;
  --select-checked: #2a2a2a;
}

* { box-sizing: border-box; }
html, body, .app { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Inter,system-ui,Arial,sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow: hidden; /* 桌面端隐藏页面滚动条，由编辑区承载滚动 */
}

.app { display: flex; flex-direction: column; min-height: 100dvh; }

.header {
  position: relative;
  display: flex; align-items: center; gap: .75rem;
  max-width: 1200px; width: min(92vw, 1200px); margin: 0 auto; padding: .75rem .25rem .5rem;
}
.title { font-size: 1.5rem; font-weight: 800; margin: 0; }
.badge { margin-left: auto; font-size: .85rem; color: var(--muted); background: var(--bg-2); border: 1px solid var(--border); padding: .25rem .5rem; border-radius: .5rem; }
.hidden { display: none !important; }

.btn { border: none; border-radius: .5rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: .5ch; transition: background-color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: var(--bg); padding: .4rem .8rem; font-size: .9rem; font-weight: 600; }
.header > .btn-primary { margin-left: auto; }

/* 分享按钮样式（替代文字按钮） */
.btn-share { width: 36px; height: 36px; border-radius: 10px; margin-left: auto; background: var(--bg-2); border: 1px solid var(--border); color: var(--text); }
.btn-share:hover { background: var(--bg); }
.share-icon { position: relative; width: 18px; height: 18px; display: inline-block; }
.share-icon::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 8px; border: 2px solid currentColor; border-top: 0; border-radius: 0 0 4px 4px; }
.share-icon::after { content: ""; position: absolute; left: 50%; transform: translateX(-50%); bottom: 6px; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 8px solid currentColor; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.btn-secondary { background: var(--bg-2); color: var(--text); border: 1px solid var(--border); padding: .4rem .8rem; font-size: .9rem; transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; }
.btn-secondary:hover { background: #252525; border-color: var(--muted); }
.btn-secondary:active { transform: scale(0.98); }
.btn-secondary.copied { position: relative; animation: pop .4s ease-out, glowLight .6s ease-out; border-color: var(--accent); }
@keyframes glowLight { 0% { box-shadow: 0 0 0 0 rgba(0,0,0,0); } 50% { box-shadow: 0 0 0 4px rgba(0,0,0,.22); } 100% { box-shadow: 0 0 0 0 rgba(0,0,0,0); } }
@media (prefers-color-scheme: dark) { .btn-secondary.copied { animation: pop .4s ease-out, glowDark .6s ease-out; } @keyframes glowDark { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,0); } 50% { box-shadow: 0 0 0 4px rgba(255,255,255,.35); } 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); } } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.03); } 100% { transform: scale(1); } }
.icon-btn { background: transparent; border: 0; color: var(--muted); font-size: 1.25rem; cursor: pointer; }

/* 分享按钮加载中状态（明/暗主题自适应） */
.btn-share.loading { position: relative; pointer-events: none; opacity: .85; }
.btn-share.loading .share-icon { opacity: 0; }
.btn-share.loading::after { content: ""; position: absolute; top: 50%; left: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--text); animation: spin .7s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.main { flex: 1; min-height: 0; display: flex; flex-direction: column; padding-bottom: .5rem; animation: mainFadeIn 0.28s ease-out both; }
@keyframes mainFadeIn { from { opacity: 0; } to { opacity: 1; } }
.main, .modal-card { max-width: 1200px; width: min(92vw, 1200px); margin: 0 auto; }

/* 字符计数器 */
.char-counter {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: .25rem;
  padding: 0;
  font-size: .8rem;
  color: var(--muted);
  font-family: ui-monospace,SFMono-Regular,Menlo,monospace;
}
.char-counter.warning { color: #e67e22; }
.char-counter.danger { color: #e74c3c; font-weight: 600; }

.editor-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 40dvh;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.editor-wrap > .editor {
  min-height: 0;
}
.remote-cursors {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: .75rem;
  box-sizing: border-box;
  z-index: 2;
}
.caret-mirror {
  position: absolute;
  left: 0;
  top: 0;
  right: auto;
  bottom: auto;
  pointer-events: none;
  overflow: hidden;
  visibility: hidden;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  z-index: 0;
}
@keyframes remote-caret-blink {
  0%, 49% { opacity: .55; }
  50%, 100% { opacity: 0; }
}
.remote-caret {
  position: absolute;
  left: 0;
  top: 0;
  width: 2px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 1px;
  pointer-events: none;
  animation: remote-caret-blink 1.06s step-end infinite;
  will-change: transform, opacity;
}

.editor {
  width: 100%; 
  height: 100%; 
  min-height: 40dvh;
  padding: 1rem; 
  border: 2px solid var(--border); 
  border-radius: .75rem; 
  resize: none;
  font-size: 1rem; 
  line-height: 1.5; 
  background: var(--bg); 
  color: var(--text);
  overflow: auto;
  flex: 1 1 auto;
  box-sizing: border-box;
  font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Inter,system-ui,Arial,sans-serif;
  
  /* 确保块级元素 */
  display: block;
  
  /* 确保一致的行高和字体渲染 */
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  
  /* 重置可能影响间距的属性 */
  margin: 0;
  
  /* 优化光标显示（Safari） */
  caret-color: var(--text);
}
.editor:focus { 
  outline: none; 
  border-color: var(--muted); 
  box-shadow: 0 0 0 2px rgba(0,0,0,.05);
  caret-color: #fff; /* 聚焦时光标变白，更明显 */
}
.editor::placeholder { 
  color: var(--muted); 
}

/* 美化编辑区滚动条（WebKit & Safari优化） */
.editor::-webkit-scrollbar { 
  width: 10px; 
  height: 10px; 
}

.editor::-webkit-scrollbar-track { 
  background: transparent; /* 轨道透明 */
  border-radius: 10px;
  margin: 4px 0; /* 给滚动条留出圆角空间 */
}

.editor::-webkit-scrollbar-thumb { 
  background: var(--scroll-thumb); 
  border-radius: 10px; 
  border: 3px solid var(--bg); /* 使用背景色作为边框，营造浮动效果 */
  background-clip: padding-box;
  /* 添加最小高度，避免滚动条太小 */
  min-height: 48px;
}

.editor::-webkit-scrollbar-thumb:hover { 
  background: var(--scroll-thumb-hover); 
  background-clip: padding-box;
  border-width: 2px; /* hover时边框变小，滚动条变粗 */
}

/* 隐藏滚动条箭头按钮（Safari特有） */
.editor::-webkit-scrollbar-button {
  display: none;
}

/* Firefox 滚动条颜色 */
.editor { 
  scrollbar-width: thin; 
  scrollbar-color: var(--scroll-thumb) transparent; /* 轨道透明 */
}

/* 滚动条角落透明 */
.editor::-webkit-scrollbar-corner {
  background: transparent;
}

/* 页脚容器 */
.footer-container {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center; /* 默认居中 */
  max-width: 1200px;
  width: min(92vw, 1200px);
  margin: 0 auto;
  padding: 0 .25rem;
}

/* 当字符计数器可见时，使用 space-between 布局 */
.footer-container:has(.char-counter:not(.hidden)) {
  justify-content: space-between;
}

/* 页脚 */
.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: .9rem;
  cursor: help;
  transition: color 0.2s ease;
}
.footer:hover {
  color: var(--text);
}
.brand-mark {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .22em;
  line-height: 1;
  padding-right: .04em;
  margin-right: -.22em;
}

.toast { 
  position: absolute; 
  top: 50%; 
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-2); 
  color: var(--text); 
  border: 1px solid var(--border); 
  padding: 0.5rem 0.75rem;  /* 从 0.75rem 1rem 缩小 */
  border-radius: .5rem; 
  box-shadow: 0 8px 20px rgba(0,0,0,.25);  /* 增强阴影 */
  max-width: 280px;  /* 从 320px 缩小 */
  z-index: 10000; 
  display: flex; 
  align-items: center; 
  gap: .5rem;
  font-size: 0.9rem;  /* 新增：缩小字体 */
  animation: toastEnter 0.2s ease-out both;
}
@keyframes toastEnter {
  from { opacity: 0; }
  to { opacity: 1; }
}
.toast.error { border-color: #e74c3c; background: rgba(231, 76, 60, 0.1); }
.toast.warning { border-color: #e67e22; background: rgba(230, 126, 34, 0.1); }
.toast.success { border-color: #27ae60; background: rgba(39, 174, 96, 0.1); }
.toast-icon { font-size: 1.1rem; flex-shrink: 0; }  /* 从 1.2rem 缩小 */
/* 移动端优化：固定顶部居中 */
@media (max-width: 768px) {
  .toast { 
    max-width: calc(100vw - 2rem);
    padding: 0.4rem 0.65rem;  /* 移动端进一步缩小 */
    font-size: 0.85rem;  /* 移动端字体更小 */
  }
  .toast-icon { font-size: 1rem; }  /* 移动端图标缩小 */
}

/* 离线提示条 */
.offline-banner {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: .5rem;
  background: var(--bg-2); color: var(--text);
  border: 1px solid var(--border); border-left: 0; border-right: 0;
  padding: .5rem .75rem; margin: 0 0 .5rem 0;
  font-size: .9rem;
}
.offline-banner .dot { width: 8px; height: 8px; border-radius: 50%; background: #e67e22; animation: pulse-dot 1.6s ease-in-out infinite; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; padding: 1rem; z-index: 9999; overflow-y: auto; animation: modalFadeIn 0.18s ease-out both; }
.modal-card { background: var(--bg); border: 1px solid var(--border); border-radius: .75rem; overflow: visible; width: min(560px, 92vw); box-shadow: 0 24px 80px rgba(0,0,0,.35); animation: modalFadeIn 0.18s ease-out both; }
.modal-card-small { width: min(420px, 92vw); }

/* 弹窗只淡入，避免位移和缩放在结束时把文字震一下 */
@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: .75rem 1rem; border-bottom: 1px solid var(--border); }
.modal-title { margin: 0; font-size: 1.1rem; display: flex; align-items: center; }

/* 退出确认弹窗标题 */
#exitConfirmTitle {
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* 只放大标题前面的图标 */
#exitConfirmTitle .title-icon {
  font-size: 1.8rem; 
  display: inline-flex;
  align-items: center;
  line-height: 1;
}
.modal-body { padding: 1rem; display: grid; gap: .75rem; }
.share-row { display: grid; grid-template-columns: 1fr auto; gap: .5rem; }
.share-input { width: 100%; border: 1px solid var(--border); background: var(--bg-2); color: var(--text); border-radius: .5rem; padding: .6rem .75rem; font-family: ui-monospace,SFMono-Regular,Menlo,monospace; outline: none; }
.share-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,0,0,.08); }
.muted { color: var(--muted); font-size: .9rem; margin: 0; text-align: center; }
/* QR 区域 */
.qr-wrap { display: grid; place-items: center; padding-top: .5rem; padding-bottom: 1rem; position: relative; min-height: 240px; }
.qr-wrap canvas { border: 0; border-radius: 16px; background: transparent; box-shadow: 0 12px 32px rgba(0,0,0,.18); }
/* 允许移动端在二维码图片上长按呼出保存菜单，仅在该区域开放 */
.qr-wrap img#qrImg { 
  -webkit-touch-callout: default; 
  -webkit-user-select: auto; 
  user-select: auto; 
  -webkit-user-drag: auto;
  /* 禁用指针事件保护，允许长按交互 */
  pointer-events: auto;
  /* 确保不会被其他样式覆盖 */
  touch-action: auto;
}

/* 二维码加载动画 */
.qr-spinner { display: none; position: absolute; top: 50%; left: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--text); animation: spin .7s linear infinite; }
.qr-wrap.loading .qr-spinner { display: block; }
/* 加载时完全隐藏 canvas 和 img，只显示转圈动画，但保持占位空间 */
.qr-wrap.loading canvas { display: none !important; }
.qr-wrap.loading img#qrImg { display: none !important; }

/* 二维码加载失败降级方案 */
.qr-fallback { display: flex; flex-direction: column; align-items: center; padding: 2rem 1rem; text-align: center; }
.qr-fallback-icon { font-size: 3rem; margin-bottom: .75rem; opacity: .6; }
.qr-fallback-text { margin: 0 0 .5rem; font-size: 1rem; color: var(--text); }
.qr-fallback-hint { margin: 0; font-size: .85rem; color: var(--muted); }

/* OTP 输入增强（与 share-input 同风格） */
#twoFACode { text-align: center; letter-spacing: .35ch; font-weight: 700; }

/* 2FA 分段输入样式 */
.otp-group { display: flex; gap: 8px; justify-content: center; align-items: center; }
.otp-input { width: 42px; height: 42px; text-align: center; font-weight: 700; font-size: 1.1rem; border: 1px solid var(--border); background: var(--bg-2); color: var(--text); border-radius: .5rem; outline: none; }
.otp-input:focus { border-color: var(--muted); box-shadow: 0 0 0 3px rgba(0,0,0,.08); }
@media (max-width: 768px) { .otp-input { width: 36px; height: 36px; font-size: 1rem; } }
.otp-group.shake { animation: otp-shake .25s ease; }
@keyframes otp-shake { 10% { transform: translateX(-3px); } 30% { transform: translateX(3px); } 50% { transform: translateX(-2px); } 70% { transform: translateX(2px); } 100% { transform: translateX(0); } }

/* 自定义下拉框样式 */
.custom-select {
  position: relative;
  width: 100%;
}

.select-trigger {
  width: 100%;
  padding: .75rem 1rem;
  border: 1px solid var(--border);
  border-radius: .75rem;
  background-color: var(--bg-2);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.5;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}

.select-trigger:hover {
  border-color: var(--muted);
  background-color: #252525;
}

.select-trigger:focus, .custom-select.open .select-trigger {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.1);
}

.select-trigger::after {
  content: '';
  width: 1.25rem;
  height: 1.25rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23a0a0a0'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M6 9l6 6 6-6'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  transition: transform 0.2s;
}

.custom-select.open .select-trigger::after {
  transform: rotate(180deg);
}

.select-options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 6px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: .75rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
  overflow: hidden;
  padding: 10px 0;
}
.select-options-scroll {
  max-height: 260px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 6px 2px 6px 6px;
  scrollbar-width: thin;
  scrollbar-color: #5a5a5a transparent;
}

.custom-select.open .select-options {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s;
}

.custom-option {
  padding: .6rem 1rem;
  margin-bottom: 2px;
  border-radius: .5rem;
  cursor: pointer;
  color: var(--text);
  transition: background 0.1s;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.custom-option:last-child {
  margin-bottom: 0;
}

/* 选中项/悬停项样式：使用深灰色背景 */
.custom-option:hover, .custom-option.selected {
  background-color: #383838; /* 深灰色选中背景 */
  color: #fff;
}

/* 选中项添加对勾图标 */
.custom-option.selected::after {
  content: '';
  width: 1rem;
  height: 1rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M5 13l4 4L19 7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

/* 滚动条收在圆角内侧，上下不顶出容器 */
.select-options-scroll::-webkit-scrollbar { width: 10px; }
.select-options-scroll::-webkit-scrollbar-button { display: none; height: 0; width: 0; }
.select-options-scroll::-webkit-scrollbar-track {
  background: transparent;
  margin: 6px 0;
}
.select-options-scroll::-webkit-scrollbar-thumb {
  background: #5a5a5a;
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: padding-box;
}
.select-options-scroll::-webkit-scrollbar-thumb:hover { background: #707070; background-clip: padding-box; }

/* 兼容移动端 */
@media (max-width: 768px) {
  .select-options {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    width: 100%;
    margin: 0;
    border-radius: 16px 16px 0 0;
    border-bottom: 0;
    transform: translateY(100%);
    box-shadow: 0 -4px 30px rgba(0,0,0,0.5);
    padding: 14px 0 0;
    overflow: hidden;
  }
  .select-options-scroll {
    max-height: 45vh;
    padding: 8px 8px max(12px, env(safe-area-inset-bottom));
  }
  .custom-select.open .select-options {
    transform: translateY(0);
  }
  .custom-option {
    padding: 12px 16px;
    font-size: 1.1rem;
  }
}

/* 遮罩层（用于移动端点击外部关闭，或者PC端也可以用） */
.select-overlay {
  position: fixed;
  inset: 0;
  z-index: 99;
  display: none;
}
.custom-select.open .select-overlay {
  display: block;
}

/* 弹窗底部统一按钮区域 */
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; }
.modal-actions .btn { min-width: 96px; height: 36px; border-radius: 8px; }

@media (max-width: 768px) {
  .title { font-size: 1.2rem; }
  .btn-primary { padding: .35rem .7rem; font-size: .85rem; }
  .modal-card { width: min(92vw, 480px); }
  /* 移动端文本框聚焦时降低高亮感 */
  .editor:focus { box-shadow: none; border-color: var(--muted); }
  
  /* 移动端协作密码弹窗稍微靠上显示，避免键盘遮挡 */
  #syncModal { 
    align-items: flex-start; 
    padding-top: 20vh; /* 使用视口高度的20%，更灵活适配不同屏幕 */
  }
}

/* ========== 实时同步样式 ========== */

/* 同步状态指示器 */
.sync-trigger {
  position: relative;
  cursor: pointer;
  transition: color 0.2s ease;
  user-select: none;
  display: inline-block;
}

.sync-trigger:hover {
  color: #fff;
}

.sync-trigger:active {
  color: #cfcfcf;
}

/* 优化：更明显的同步指示器 */
.sync-trigger.syncing::after {
  content: '';
  position: absolute;
  top: 0;
  right: -12px;
  width: 8px;
  height: 8px;
  background: #00d26a;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(0, 210, 106, 0.3);
  animation: pulse-dot 1.6s ease-in-out infinite;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .sync-trigger.syncing::after {
    right: -10px;
    width: 7px;
    height: 7px;
  }
}

/* 退出房间按钮（复用分享按钮样式） */
.btn-exit-room {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  margin-left: auto;
  background: #e74c3c;
  border: 1px solid #c0392b;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-exit-room:hover {
  background: #c0392b;
}

.btn-exit-room .exit-icon {
  font-size: 20px;
  font-weight: bold;
  display: inline-block;
  line-height: 1;
}

/* 同步弹窗样式 */
.sync-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--bg-2);
  border-radius: 6px;
  margin-top: 0.75rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #00d26a;
  border-radius: 50%;
  animation: pulse-dot 1.6s ease-in-out infinite;
}

#syncPassword {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text);
  border-radius: 0.5rem;
  font-size: 1rem;
  outline: none;
  margin-bottom: 0.5rem;
}

#syncPassword:focus {
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* ========== 退出确认弹窗样式 ========== */

/* 弹窗头部图标 */
.modal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.3rem;
  margin-right: 0.75rem;
  flex-shrink: 0;
  line-height: 1;
  /* 确保 emoji 完美居中 */
  text-align: center;
  vertical-align: middle;
}

.modal-icon.warning {
  background: rgba(230, 126, 34, 0.15);
}

.modal-head:has(.modal-icon) {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-head:has(.modal-icon) .modal-title {
  margin: 0;
  flex: 1;
}

/* 警告框 */
.alert-box {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  border-radius: 0.75rem;
  margin-bottom: 1rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  align-items: flex-start;
}

.alert-box.warning {
  background: rgba(230, 126, 34, 0.08);
  border-color: rgba(230, 126, 34, 0.3);
}

.alert-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  font-size: 1.5rem;
  flex-shrink: 0;
  line-height: 1;
  /* 确保 emoji 完美居中 */
  text-align: center;
  vertical-align: middle;
}

.alert-content {
  flex: 1;
}

.alert-title {
  margin: 0 0 0.25rem 0;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.alert-text {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

/* 信息框 */
.info-box {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.info-label {
  color: var(--muted);
  min-width: 90px;
}

.info-value {
  color: var(--text);
  font-weight: 500;
}

/* 提示框 */
.notice-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(52, 152, 219, 0.08);
  border: 1px solid rgba(52, 152, 219, 0.2);
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.notice-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 1.2rem;
  flex-shrink: 0;
  line-height: 1;
  text-align: center;
}

.notice-text {
  font-size: 0.9rem;
  color: var(--text);
}

/* 危险按钮 */
.btn-danger {
  background: #e74c3c;
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 4px rgba(231, 76, 60, 0.2);
}

.btn-danger:hover {
  background: #c0392b;
  box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
}

.btn-danger:active {
  transform: scale(0.98);
  box-shadow: 0 2px 4px rgba(231, 76, 60, 0.2);
}

/* 确认消息样式 */
.confirm-message {
  font-size: 0.95rem;
  color: var(--muted);
  text-align: center;
  margin: 0 0 1.5rem 0;
  line-height: 1.6;
  padding: 1rem;
  background: var(--bg-2);
  border-radius: 0.5rem;
  border-left: 3px solid #e67e22;
}

/* 移动端优化 */
@media (max-width: 768px) {
  .alert-box {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .alert-icon {
    font-size: 1.8rem;
  }
  
  .info-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  
  .info-label {
    min-width: auto;
  }
  
  .modal-card-small {
    width: min(360px, 92vw);
  }
}
