/* ========== 主样式 v3 (extracted from index.html) ========== */



    * { margin: 0; padding: 0; box-sizing: border-box; }


    :root { --user-bg: linear-gradient(135deg, #1565C0, #1976D2); }


    :root.dark-mode { --user-bg: linear-gradient(135deg, #3A7BD5, #5C9CE6); }


    body {


      font-family: -apple-system, 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;


      background: var(--bg);


      height: 100dvh;


      margin: 0;


      padding: 0;


      overflow: hidden;


    }


    ::-webkit-scrollbar { width: 4px; }


    ::-webkit-scrollbar-track { background: transparent; }


    ::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 2px; }





    .app {


      width: 100vw;


      height: 100dvh;


      max-width: none;


      max-height: none;


      background: var(--card);


      display: flex;


      flex-direction: column;


      box-shadow: var(--shadow);


      position: relative;


      /* overflow:hidden removed 2026-06-27: 下拉菜单被裁掉 */


    }


    @media (min-width: 769px) {


      body { background: linear-gradient(135deg, #e8eaf6 0%, #e3f2fd 50%, #f3e5f5 100%); padding: 0; }


      .app { height: 100dvh; width: 100vw; max-width: none; border-radius: 0; }

      /* v98.08 desktop .header flex 收紧 (max-width 防止太挤) */
      .header {
        flex-wrap: nowrap;
        padding: 10px 16px;
        min-height: 60px;
        gap: 10px;
      }
      .header .info { flex: 0 0 auto; }
      .yxh-nav-select { flex: 0 0 auto; }
    }



/* v98.08 fix 2026-09-03 22:25: desktop .header 主块补全 (v98.00 改版漏写) */
.header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  min-height: 56px;
  background: linear-gradient(135deg, var(--user-bg, #1565C0) 0%, #1976D2 100%);
  color: #fff;
  position: relative;
  overflow: visible;
  z-index: 2000;
  flex-wrap: wrap;
}
.header > * { position: relative; z-index: 1; }
.header .nav-btn,
.header select.yxh-nav-select {
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
}

    .header::before {


      content: ''; position: absolute; top: -50%; right: -20%;


      width: 200px; height: 200px; background: rgba(255,255,255,0.05); border-radius: 50%;


    }


    .header::after {


      content: ''; position: absolute; bottom: -40%; left: 10%;


      width: 120px; height: 120px; background: rgba(255,255,255,0.03); border-radius: 50%;


    }


    .header .avatar {


      width: 56px; height: 56px; background: rgba(255,255,255,0.2);



      backdrop-filter: blur(4px); border-radius: 14px;



      display: flex; align-items: center; justify-content: center;



      font-size: 28px; flex-shrink: 0; position: relative; z-index: 1;



      }


    .header .info { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }


    .header h1 { font-size: 17px; font-weight: 700; letter-spacing: 0.5px; }


    .header .subtitle { font-size: 11px; opacity: 0.85; margin-top: 2px; }


    .header .badge {


      margin-left: auto; background: rgba(255,255,255,0.2);


      backdrop-filter: blur(4px); padding: 4px 10px; border-radius: 12px;


      font-size: 10px; font-weight: 600; position: relative; z-index: 1;


    }





    /* ===== 导航按钮 ===== */


    .nav-btn {


      display: inline-flex !important;


      align-items: center !important;


      gap: 3px !important;


      background: rgba(255,255,255,0.15) !important;


      backdrop-filter: blur(4px);


      border: none !important;


      border-radius: 8px !important;


      color: white !important;


      padding: 8px 14px !important;


      font-size: 13px !important;


      cursor: pointer !important;


      white-space: nowrap;


      flex-shrink: 0;


      text-decoration: none !important;


      font-weight: 500;


      letter-spacing: 0.3px;


      transition: all 0.15s;


      line-height: 1;


      position: relative;


      z-index: 5;


      -webkit-tap-highlight-color: transparent;


    }


    .nav-btn:hover { background: rgba(255,255,255,0.25) !important; }


    .nav-btn:active { opacity: 0.8; }


    .nav-icon { font-size: 13px; line-height: 1; pointer-events: none; user-select: none; }


    /* v68-B.weather: 首页定位按钮旁天气徽章 */
    .weather-badge {
      display: inline-flex;
      align-items: center;
      gap: 3px;
      background: rgba(255,255,255,0.18);
      border: 1px solid rgba(255,255,255,0.35);
      color: #fff;
      padding: 4px 10px;
      border-radius: 14px;
      font-size: 12px;
      cursor: default;
      margin-left: 6px;
      line-height: 1;
      white-space: nowrap;
      flex-shrink: 0;
      transition: background 0.2s;
      backdrop-filter: blur(4px);
    }
    .weather-badge:hover { background: rgba(255,255,255,0.28); }
    .weather-badge .wb-emoji { font-size: 14px; line-height: 1; }
    .weather-badge .wb-temp { font-weight: 600; font-size: 13px; }
    .weather-badge .wb-cond { opacity: 0.85; font-size: 11px; }
    .weather-badge.wb-loading { opacity: 0.6; }
    .weather-badge.wb-error { opacity: 0.5; font-style: italic; }





    .chat { flex: 1; overflow-y: auto; padding: 12px 14px; background: var(--chat-bg); scroll-behavior: smooth; }


    .msg { display: flex; gap: 8px; margin-bottom: 14px; animation: msgIn 0.3s ease; }


    @keyframes msgIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }


    .msg.user { flex-direction: row-reverse; }


    .msg-avatar {


      width: 32px; height: 32px; border-radius: 50%;


      display: flex; align-items: center; justify-content: center;


      font-size: 16px; flex-shrink: 0; background: #e3f2fd;


      flex-shrink: 0; box-shadow: 0 1px 3px rgba(0,0,0,0.08);


    }


    .msg.user .msg-avatar { background: #fff3e0; }


    .msg-bubble {


      max-width: 72%; max-width: 680px; padding: 10px 14px; border-radius: 16px;


      font-size: 14px; line-height: 1.7; background: var(--bot-bg);


      box-shadow: 0 1px 4px rgba(0,0,0,0.05); word-break: break-word; position: relative;


    }


    .msg.bot .msg-bubble { border-top-left-radius: 4px; border: 1px solid rgba(0,0,0,0.03); }


    .msg.user .msg-bubble { background: var(--user-bg); color: white; border-top-right-radius: 4px; }


    .msg-bubble code { background: #f0f0f0; padding: 1px 6px; border-radius: 4px; font-size: 12px; }


    .msg.user .msg-bubble code { background: rgba(255,255,255,0.15); }


    .typing { display: flex; gap: 5px; padding: 6px 0; }


    .typing span { width: 7px; height: 7px; background: #bbb; border-radius: 50%; animation: bounce 1.4s infinite ease-in-out; }


    .typing span:nth-child(2) { animation-delay: 0.2s; }


    .typing span:nth-child(3) { animation-delay: 0.4s; }


    @keyframes bounce { 0%,80%,100% { transform: scale(0); } 40% { transform: scale(1); } }


    .msg-bubble strong { color: var(--primary); }


    .msg.user .msg-bubble strong { color: #ffcc02; }


    /* P12-2026-06-14: 主对话气泡 Markdown 段落/列表/标题 视觉强化 */


    .msg-bubble p { margin: 0 0 10px 0; line-height: 1.7; }


    .msg-bubble p:last-child { margin-bottom: 0; }


    .msg-bubble h3 { font-size: 16px; font-weight: 700; margin: 14px 0 8px; color: #1565C0; border-bottom: 2px solid #1565C0; padding-bottom: 4px; }


    .msg-bubble h4 { font-size: 14px; font-weight: 600; margin: 10px 0 6px; color: #1976D2; }


    .msg-bubble h5 { font-size: 13px; font-weight: 600; margin: 8px 0 4px; color: #555; }


    .msg-bubble ul, .msg-bubble ol { margin: 6px 0 8px 24px; padding: 0; }


    .msg-bubble li { margin: 4px 0; line-height: 1.6; }


    .msg-bubble blockquote { border-left: 3px solid #1976D2; padding: 8px 12px; background: #f5f7fa; color: #555; margin: 8px 0; font-size: 13px; }


    .msg-bubble hr { border: none; border-top: 1px solid #e0e0e0; margin: 10px 0; }


    .msg-bubble table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0; background: #fff; }


    .msg-bubble th { background: #1976D2; color: #fff; padding: 6px 10px; text-align: left; font-weight: 600; }


    .msg-bubble td { padding: 6px 10px; border-top: 1px solid #f0f0f0; }


    .msg-bubble pre { background: #f5f5f5; padding: 8px 10px; border-radius: 6px; overflow-x: auto; font-size: 12px; margin: 6px 0; }


    .chat-actions { display: flex; gap: 8px; margin-bottom: 8px; justify-content: center; }


    .chat-action-btn {


      padding: 6px 14px; border: 1px solid #e0e0e0; border-radius: 16px;


      background: white; font-size: 12px; cursor: pointer; color: #666;


      transition: all 0.15s;


    }


    .chat-action-btn:hover { background: white; color: var(--primary); border-color: var(--primary-light); }


    .quick-reply {


      display: flex; gap: 6px; padding: 8px 14px; background: var(--card);


      border-top: 1px solid var(--border-color); overflow-x: auto; flex-shrink: 0;


      -webkit-overflow-scrolling: touch; max-height: 48px;


    }


    .qr-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }


    .qr-btn {


      flex-shrink: 0; padding: 5px 12px; border: 1px solid var(--border-color);


      border-radius: 14px; background: var(--input-bg); font-size: 11px;


      color: var(--text-secondary); cursor: pointer; white-space: nowrap;


      transition: all 0.15s;


    }


    .qr-btn:hover { background: #e3eeff; border-color: var(--primary-light); }


    .input-bar {


      display: flex; align-items: center; gap: 6px; padding: 8px 14px;


      padding-bottom: max(8px, env(safe-area-inset-bottom));


      background: var(--card); border-top: 1px solid var(--border-color); flex-shrink: 0;


    }


    .input-bar input {


      flex: 1; padding: 10px 16px; border: 2px solid #e8e8e8; border-radius: 22px;


      font-size: 14px; outline: none; transition: border-color 0.2s;


    }


    .input-bar input:focus { border-color: var(--primary); }


    .input-bar .input-actions { display: flex; gap: 4px; align-items: center; flex-shrink: 0; }


    .input-bar .action-btn {


      width: 36px; height: 36px; background: #f0f4ff; border: none;


      border-radius: 50%; cursor: pointer; font-size: 16px;


      display: flex; align-items: center; justify-content: center; transition: all 0.15s;


    }


    .input-bar .action-btn:hover { background: #e3eeff; }


    .send-btn {


      width: 42px; height: 42px; border: none; border-radius: 50%;


      background: linear-gradient(135deg, var(--primary), var(--primary-light));


      color: white; font-size: 18px; cursor: pointer;


      display: flex; align-items: center; justify-content: center; flex-shrink: 0;


      transition: all 0.15s;


    }


    .file-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; background: white; border: 1px solid #e0e0e0; border-radius: 12px; font-size: 11px; color: #555; }


    .file-chip .remove-file { cursor: pointer; color: #f44336; font-size: 14px; margin-left: 2px; }


    .msg-bubble .file-info { padding: 6px 0; font-size: 12px; color: #888; }


    .msg-bubble .file-info strong { color: var(--primary); }


    .msg.user .msg-bubble .file-info strong { color: #ffcc02; }


    .status-bar {


      display: flex; align-items: center; gap: 6px; padding: 5px 16px;


      background: #f8f9fc; font-size: 10px; color: #999;


      border-top: 1px solid #f0f0f0; flex-shrink: 0;


    }


    .status-dot { width: 6px; height: 6px; background: #4caf50; border-radius: 50%; animation: pulse 2s infinite; }


    @keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }


    .hidden { display: none !important; }





    :root.dark-mode body, :root.dark-mode .chat { background: var(--chat-bg) !important; }


    :root.dark-mode .app { background: var(--card) !important; }


    :root.dark-mode .quick-reply, :root.dark-mode .input-bar, :root.dark-mode .file-preview { background: var(--card) !important; border-top-color: var(--border-color) !important; }


    :root.dark-mode .msg-avatar { background: var(--input-bg) !important; }


    :root.dark-mode .msg.user .msg-avatar { background: var(--primary-dark) !important; }


    :root.dark-mode .msg-bubble { color: var(--text-primary); border-color: var(--border-color); }


    :root.dark-mode .msg-bubble code { background: var(--code-bg) !important; color: var(--text-primary); }


    :root.dark-mode .typing span { background: var(--text-secondary) !important; }


    :root.dark-mode .chat-action-btn { background: var(--card) !important; border-color: var(--border-color) !important; color: var(--text-secondary) !important; }


    :root.dark-mode .chat-action-btn:hover { background: var(--input-bg) !important; color: var(--primary-light) !important; border-color: var(--primary-light) !important; }


    :root.dark-mode .qr-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }


    .qr-btn { background: var(--input-bg) !important; border-color: var(--border-color) !important; color: var(--text-secondary) !important; }


    :root.dark-mode .qr-btn:hover { background: var(--card) !important; border-color: var(--primary-light) !important; }


    :root.dark-mode .input-bar input { background: var(--input-bg) !important; border-color: var(--border-color) !important; color: var(--text-primary) !important; }


    :root.dark-mode .input-bar input:focus { border-color: var(--primary-light) !important; }


    :root.dark-mode .input-bar input::placeholder { color: var(--text-secondary) !important; }


    :root.dark-mode .input-bar .action-btn { background: var(--input-bg) !important; }


    :root.dark-mode .input-bar .action-btn:hover { background: var(--card) !important; }


    :root.dark-mode .file-chip { background: var(--card) !important; border-color: var(--border-color) !important;}


    :root.dark-mode .msg-bubble .file-info { color: var(--text-secondary) !important; }


    :root.dark-mode .status-bar { background: var(--card) !important; border-top-color: var(--border-color) !important; }


    :root.dark-mode .scroll-top-btn { background: var(--card) !important; color: var(--text-secondary) !important; }


    :root.dark-mode ::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb) !important; }


    :root.dark-mode .toast { background: rgba(0,0,0,0.85) !important; }


    :root.dark-mode .msg.user .msg-bubble { background: var(--user-bg) !important; }





    /* P12-UI-2026-06-13: 下拉菜单 (与 admin.html 统一风格) */


    .yxh-dropdown { position: relative; display: inline-block; }
    /* v59: dropdown 改 <select> 原生元素, 无需 CSS 定位 */


    .yxh-dd-trigger { cursor: pointer; }


    :root.dark-mode .yxh-dd-menu { background: var(--card) !important; border-color: var(--border) !important; }


    .yxh-dd-menu.open { display: block; }


    .yxh-dd-menu a {


      display: block;


      padding: 10px 14px;


      color: #333;


      text-decoration: none;


      font-size: 13px;


      cursor: pointer;


      border-bottom: 1px solid #f5f5f5;


      transition: background 0.15s;


      white-space: nowrap;


    }


    :root.dark-mode .yxh-dd-menu a { color: var(--text) !important; border-color: var(--border) !important; }


    .yxh-dd-menu a:last-child { border-bottom: none; }


    .yxh-dd-menu a:hover { background: #f0f4ff; color: #1565C0; }


    .yxh-dd-highlight { color: #1565C0; font-weight: 600; }
/* v98.10 fix 2026-09-03 22:55: .header 强制浅蓝渐变 (覆盖 :root.dark-mode 深色覆盖) */
.header {
  background: linear-gradient(135deg, #1565C0 0%, #1976D2 100%) !important;
  color: #ffffff !important;
}
.header .info,
.header h1,
.header .subtitle,
.header .brand-logo,
.header a,
.header .nav-btn,
.header button { color: #ffffff !important; }
.header select.yxh-nav-select { color: #ffffff !important; }
.header select.yxh-nav-select option { color: #000000 !important; background: #ffffff !important; }
