/* NexusAI Studio 首页自定义样式
 * 从 index.html 的内联 <style> 外移出来。目的是让首页里不再有任何内联样式，
 * style-src 才有可能收紧。这份文件由 index.html 直接引用，不走 Tailwind 。
 */

  * { box-sizing: border-box; }
  html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
  body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Noto Sans SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    color: #3a4a47;
    background-color: #f7faf9;
    background-image:
      radial-gradient(880px 520px at 6% -14%, rgba(95, 173, 162, .16), transparent 62%),
      radial-gradient(760px 470px at 102% -6%, rgba(123, 157, 195, .14), transparent 60%),
      radial-gradient(720px 540px at 52% 106%, rgba(110, 169, 138, .12), transparent 64%);
    background-attachment: fixed;
    overflow-x: hidden;
    letter-spacing: .002em;
  }
  h1, h2, h3, h4 { letter-spacing: -.012em; }
  ::selection { background: #b8dfd8; color: #1f2e2b; }
  ::-webkit-scrollbar { width: 8px; height: 8px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb {
    background: rgba(141, 157, 154, .34);
    border: 2px solid transparent;
    background-clip: content-box;
    border-radius: 9999px;
  }
  ::-webkit-scrollbar-thumb:hover { background: rgba(63, 138, 128, .5); background-clip: content-box; }
  .no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
  .no-scrollbar::-webkit-scrollbar { display: none; }
  .glass-panel {
    background: rgba(255, 255, 255, .84);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    border: 1px solid rgba(213, 225, 223, .9);
    box-shadow: 0 1px 2px rgba(31, 46, 43, .03), 0 16px 36px -24px rgba(31, 46, 43, .22);
  }
  .glass-card {
    background: rgba(255, 255, 255, .74);
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    border: 1px solid rgba(213, 225, 223, .95);
    box-shadow: 0 1px 2px rgba(31, 46, 43, .03);
    transition: all .22s cubic-bezier(.16, 1, .3, 1);
  }
  .glass-card:hover {
    background: rgba(255, 255, 255, .95);
    border-color: rgba(95, 173, 162, .45);
    transform: translateY(-2px);
    box-shadow: 0 1px 2px rgba(31, 46, 43, .04), 0 18px 38px -22px rgba(31, 46, 43, .26);
  }
  .nav-item-active {
    background: linear-gradient(135deg, rgba(63, 138, 128, .13), rgba(123, 157, 195, .10));
    border: 1px solid rgba(95, 173, 162, .40);
    color: #2c615b;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .75);
  }
  button, a, select, input, textarea {
    transition: background-color .18s ease, color .18s ease, border-color .18s ease,
                box-shadow .18s ease, transform .18s ease;
  }
  button:focus-visible, a:focus-visible, select:focus-visible,
  input:focus-visible, textarea:focus-visible, [data-act]:focus-visible {
    outline: 2px solid rgba(95, 173, 162, .55);
    outline-offset: 2px;
  }
  button { -webkit-tap-highlight-color: transparent; }
  input::placeholder, textarea::placeholder { color: #9fadaa; }
  select option { background: #ffffff; color: #3a4a47; }
  canvas { display: block; }
  @keyframes pulse-ring {
    0% { transform: scale(0.92); opacity: .6; }
    50% { transform: scale(1.1); opacity: .26; }
    100% { transform: scale(0.92); opacity: .6; }
  }
  .voice-ring { animation: pulse-ring 2.6s infinite ease-in-out; }
  @keyframes float-soft {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
  }
  /* ---- 流式输出：正在生成的文字后面跟一个光标 ---- */
  .nx-caret {
    display: inline-block;
    width: .46em; height: 1.02em;
    margin-left: .14em;
    vertical-align: -.16em;
    background: rgba(63, 138, 128, .72);
    border-radius: 1.5px;
    animation: nx-blink 1.05s steps(2, start) infinite;
  }
  @keyframes nx-blink { 0%, 100% { opacity: 1; } 50% { opacity: .12; } }
  @media (prefers-reduced-motion: reduce) { .nx-caret { animation: none; } }

  /* ---- 推理型模型的思考过程：默认折叠，不跟正文抢注意力 ---- */
  .nx-think > summary { cursor: pointer; list-style: none; user-select: none; }
  .nx-think > summary::-webkit-details-marker { display: none; }
  .nx-think[open] > summary { margin-bottom: .4rem; }

  /* ---- 对话里的代码块 / Artifact 卡片 ---- */
  .nx-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Noto Sans Mono CJK SC', monospace;
    font-size: 11.5px;
    line-height: 1.7;
    white-space: pre;
    tab-size: 2;
    overflow-x: auto;
  }

  /* ---- Artifacts 预览面板 ---- */
  .nx-artifact-frame {
    width: 100%;
    height: 100%;
    min-height: 18rem;
    border: 0;
    background: #ffffff;
  }
  .nx-artifact-src {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Noto Sans Mono CJK SC', monospace;
    font-size: 11.5px;
    line-height: 1.7;
    white-space: pre;
    tab-size: 2;
  }
  /* 窄屏：面板改为从底部升起的抽屉，避免把对话挤没 */
  @media (max-width: 1023.98px) {
    .nx-artifact-drawer {
      position: fixed;
      left: 0; right: 0; bottom: 0;
      height: 76vh;
      z-index: 45;
      border-radius: 1rem 1rem 0 0;
      box-shadow: 0 -18px 40px -24px rgba(31, 46, 43, .34);
    }
  }

  /* ── 触摸设备的三条基础体验 ──────────────────────────────────
     ① 去掉 iOS 上点按时的灰色高亮块 —— 它会在深色卡片上糊一块脏斑；
     ② touch-action: manipulation 去掉双击缩放带来的 300ms 延迟，
        按钮「点了没反应」的一半体感问题来自这里；
     ③ 16px 的复选框在手机上只有指甲盖大，统一抬到 20px 起步。
        桌面端不动：鼠标点得到，放大反而破坏排版密度。 */
  button, a, [data-act], input[type="checkbox"], input[type="radio"], select {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  @media (max-width: 1023.98px) {
    input[type="checkbox"], input[type="radio"] {
      width: 1.25rem;
      height: 1.25rem;
      min-width: 1.25rem;
    }
    /* 触屏上把「一行里的小按钮」撑到可点：删会话、删章节这类误触代价高的操作 */
    button[aria-label] {
      min-width: 2.25rem;
      min-height: 2.25rem;
    }
  }

/* 用于 data-h 柱状图：最矮 2px，否则 0 值的日子看不见
   （原来写在内联 style 里，现在集中到这里） */
.nx-bar-min { min-height: 2px; }
