/* ══════════════════════════════════════════════
   Echo 回响 · css/settings.css
   设置/Profile 页 + API loop 卡片(模型链/人格/MCP)
   ══════════════════════════════════════════════ */
  /* ── Profile page (full-screen settings) ── */
  .profile-panel{
    position: fixed;
    inset: 0;
    z-index: 200;
    pointer-events: none;
    transform: translateX(100%);
    opacity: 0;
    transition: transform .34s var(--ease-soft), opacity .26s ease;
  }
  .profile-panel.open{ transform: none; opacity: 1; pointer-events: auto; }
  /* own wallpaper layer so the chat behind is fully covered, theme-matched */
  .profile-page{
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    background-color: var(--bg);
    background-image: var(--wall-default);
    background-size: cover;
    background-position: center;
    overflow: hidden;
  }
  .profile-page::before{
    content:""; position:absolute; inset:0; background: var(--scrim); pointer-events:none;
  }
  .profile-topbar{
    position: relative; z-index:1;
    flex: 0 0 auto;
    display:flex; align-items:center; gap:10px;
    height: calc(56px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) var(--side-pad) 0;
  }
  .profile-back{
    width:40px; height:40px; flex:none;
    border:0; border-radius:50%; padding:0; margin-left:-6px;
    background: transparent; color: var(--text);
    display:grid; place-items:center; cursor:pointer;
    transition: transform .15s ease;
  }
  .profile-back:active{ transform: scale(.9); }
  .profile-back svg{ width:24px; height:24px; display:block; }
  .profile-scroll{
    position: relative; z-index:1;
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 10px var(--side-pad) calc(30px + env(safe-area-inset-bottom));
    display:flex; flex-direction:column; gap:24px;
  }
  .profile-scroll::-webkit-scrollbar{ width:0; height:0; }

  /* identity */
  .profile-identity{
    display:grid;
    grid-template-columns: auto 1fr;
    gap:18px; align-items:center;
    padding: 4px 4px 16px;
  }
  .profile-avatar{
    width:78px; height:78px; border-radius:50%;
    border:0; padding:0; overflow:hidden;
    -webkit-appearance:none; appearance:none;
    background-color:transparent;
    background-image: var(--avatar-default);
    background-size:cover; background-position:center;
    box-shadow: 0 12px 28px rgba(24,46,67,0.16);
    cursor:pointer; transition: transform .15s ease;
  }
  .profile-avatar:active{ transform: scale(.96); }
  .profile-id-copy{ min-width:0; }
  .profile-name-row{ display:flex; align-items:center; gap:9px; margin:0 0 5px; }
  .profile-name-row h3,
  #profileNameInput{
    margin:0;
    font-family: var(--font-en), var(--font-cn);
    font-size:23px; font-weight:500; letter-spacing:0;
    color: var(--text); line-height:1.1;
  }
  #profileNameInput{
    width:6.6em; max-width:62%;
    border:0; border-radius:10px;
    background: var(--seg-track); outline:none;
    padding:3px 11px; margin:-3px 0;
  }
  .profile-name-edit{
    width:26px; height:26px; flex:none;
    border:0; border-radius:50%; padding:0;
    background:transparent; color: var(--text-soft);
    display:grid; place-items:center; cursor:pointer;
    transition: color .2s ease, transform .15s ease;
  }
  .profile-name-edit:active{ transform: scale(.88); }
  .profile-name-edit svg{ width:15px; height:15px; display:block; }
  .profile-handle{
    display:flex; align-items:center; gap:7px; margin:0 0 8px;
    color: var(--text-soft);
    font-family: var(--font-en), var(--font-cn); font-size:13.5px;
  }
  .profile-bio{ margin:0; color: var(--text-soft); font-size:13px; line-height:1.55; }

  /* setting card */
  .settings-card{
    background: var(--card-bg);
    border: 1px solid var(--card-line);
    border-radius:18px;
    box-shadow: var(--card-shadow);
    padding:15px 16px;
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }
  .settings-label{
    display:flex; align-items:center; gap:6px;
    color: var(--text-soft); font-size:12.5px;
    margin-bottom:11px; letter-spacing:.01em;
  }
  .info-i{
    width:14px; height:14px; flex:none; border-radius:50%;
    border:1px solid var(--info-ring); color: var(--text-faint);
    display:inline-grid; place-items:center;
    font-size:9px; font-style:normal; line-height:1;
    font-family: var(--font-en), var(--font-cn);
    cursor:help; user-select:none;
  }
  .push-hint{
    margin-top:9px; font-size:11.5px; line-height:1.55;
    color: var(--text-faint); letter-spacing:.01em;
  }

  /* ── API loop cards(模型链 / 上文 / 人格 / MCP)── */
  .loop-rows{ display:flex; flex-direction:column; gap:8px; }
  .loop-row{ display:grid; grid-template-columns: 1fr auto; gap:6px; align-items:start; }
  .loop-row .loop-inputs{ display:grid; gap:6px; min-width:0; }
  .loop-field{ display:flex; flex-direction:column; gap:4px; font-size:11.5px; color: var(--text-faint); min-width:0; }
  .loop-field.wide{ grid-column: 1 / -1; }
  .loop-field input, .loop-field select, .loop-textarea, .loop-row input{
    width:100%; box-sizing:border-box; border:1px solid var(--card-line); border-radius:10px;
    background: var(--seg-track); color: var(--text); font: inherit; font-size:13px;
    padding:8px 10px; outline:none; -webkit-appearance:none; appearance:none;
  }
  .loop-field input:focus, .loop-field select:focus, .loop-textarea:focus, .loop-row input:focus{ border-color: var(--slider-thumb); }
  .loop-textarea{ resize:vertical; min-height:130px; line-height:1.5; font-size:12.5px; }
  .loop-grid{ display:grid; grid-template-columns: 1fr 1fr; gap:8px; }
  .loop-actions{ display:flex; gap:8px; margin-top:10px; flex-wrap:wrap; }
  .loop-btn{
    border:1px solid var(--card-line); background: var(--seg-track); color: var(--text-soft);
    border-radius:10px; padding:7px 12px; font: inherit; font-size:12.5px; cursor:pointer; white-space:nowrap;
  }
  .loop-btn.primary{ background: var(--seg-thumb); color: var(--text); box-shadow: var(--seg-thumb-shadow); font-weight:500; }
  .loop-btn.danger{ color:#c0392b; }
  .loop-btn:disabled{ opacity:.55; cursor:default; }
  .loop-row-del{ align-self:center; padding:7px 9px; }
  .loop-mcp-item{ display:flex; align-items:center; gap:8px; padding:8px 10px; border:1px solid var(--card-line); border-radius:10px; background: var(--seg-track); }
  .loop-mcp-item .mcp-main{ flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
  .loop-mcp-item .mcp-name{ font-size:13px; color: var(--text); }
  .loop-mcp-item .mcp-meta{ font-size:11px; color: var(--text-faint); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .loop-mcp-item .loop-btn{ padding:5px 8px; font-size:11.5px; }
  .mcp-dot{ width:8px; height:8px; border-radius:50%; background:#b8b8b8; flex:none; }
  .mcp-dot.online{ background:#3cb371; } .mcp-dot.error{ background:#e0553d; } .mcp-dot.connecting{ background:#e8b23a; }
  .loop-mcp-form{ margin-top:10px; }

  /* segmented control */
  .segmented{
    display:grid; grid-auto-flow:column; grid-auto-columns:1fr;
    gap:3px; background: var(--seg-track);
    border-radius:13px; padding:3px;
  }
  .segmented button{
    border:0; background:transparent; color: var(--text-soft);
    border-radius:10px; padding:8px 3px;
    font: inherit; font-size: clamp(10.5px, 2.9vw, 12.5px);
    letter-spacing:0; white-space:nowrap; cursor:pointer;
    transition: background .22s ease, color .22s ease, box-shadow .22s ease;
  }
  .segmented button.active{
    background: var(--seg-thumb); color: var(--text);
    box-shadow: var(--seg-thumb-shadow); font-weight:500;
  }

  /* context slider */
  .context-slider-wrap{ padding:4px 2px 2px; }
  .context-slider{
    -webkit-appearance:none; appearance:none;
    width:100%; height:4px; border-radius:999px;
    background: var(--slider-track);
    outline:none; cursor:pointer; margin:6px 0;
  }
  .context-slider::-webkit-slider-thumb{
    -webkit-appearance:none; appearance:none;
    width:21px; height:21px; border-radius:50%;
    background: var(--slider-thumb);
    border:2.5px solid var(--card-bg);
    box-shadow: 0 3px 10px rgba(24,46,67,.26); cursor:pointer;
  }
  .context-slider::-moz-range-thumb{
    width:21px; height:21px; border-radius:50%;
    background: var(--slider-thumb);
    border:2.5px solid var(--card-bg);
    box-shadow: 0 3px 10px rgba(24,46,67,.26); cursor:pointer;
  }
  .context-scale{
    display:flex; justify-content:space-between; margin-top:9px;
    color: var(--text-faint);
    font-family: var(--font-en), var(--font-cn); font-size:11.5px;
  }

  /* action rows */
  .action-row{
    display:flex; align-items:center; gap:13px;
    width:100%; text-align:left;
    background: var(--card-bg);
    border:1px solid var(--card-line);
    border-radius:16px; box-shadow: var(--card-shadow);
    padding:13px 16px; color: var(--text); font: inherit; cursor:pointer;
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    transition: background .18s ease, transform .12s ease;
  }
  button.action-row:active{ background: var(--row-press); transform: scale(.992); }
  .action-icon{ width:21px; height:21px; flex:none; color: var(--accent); display:grid; place-items:center; }
  .action-icon svg{ width:19px; height:19px; display:block; }
  .action-name{ font-family: var(--font-en), var(--font-cn); font-size:14.5px; color: var(--text); flex:none; }
  .action-value{
    margin-left:auto; color: var(--text-soft); font-size:12.5px;
    text-align:right; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  }
  .action-chevron{ flex:none; color: var(--text-faint); display:grid; place-items:center; margin-left:2px; }
  .action-chevron svg{ width:16px; height:16px; display:block; }
  .action-row.status{ cursor:default; }
  .action-row.status .status-main{ margin-left:auto; display:flex; flex-direction:column; align-items:flex-end; gap:2px; min-width:0; }
  .status-used{ color: var(--text); font-family: var(--font-en), var(--font-cn); font-size:13px; }
  .status-sid{ display:flex; align-items:center; gap:6px; color: var(--text-faint); font-size:11.5px; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
  .status-copy{
    width:24px; height:24px; flex:none; border:0; border-radius:8px; padding:0;
    background:transparent; color: var(--text-soft);
    display:grid; place-items:center; cursor:pointer;
    transition: color .2s ease, transform .15s ease;
  }
  .status-copy:active{ transform: scale(.85); }
  .status-copy svg{ width:15px; height:15px; display:block; }

  /* toast */
  .toast{
    position: fixed; left:50%; bottom: calc(40px + env(safe-area-inset-bottom));
    transform: translate(-50%, 12px); z-index:300;
    background: rgba(20,34,48,.92); color:#eef5fb; font-size:14px;
    padding:10px 18px; border-radius:999px;
    box-shadow: 0 14px 34px rgba(0,0,0,.28);
    opacity:0; pointer-events:none;
    transition: opacity .24s ease, transform .24s ease;
  }
  .toast.show{ opacity:1; transform: translate(-50%, 0); }

  @media (max-width: 520px){
    :root{
      --side-pad: 16px;
      --header-h: 56px;
      --avatar-size: 32px;
    }
    .peerpill{ padding: 0 44px; }
    .peerpill .name{ font-size: 18px; }
    .peerpill .status{ font-size: 12px; margin-top: 3px; }
    .backbtn{ left: 16px; top: calc(env(safe-area-inset-top) + 16px); width: 32px; height: 32px; }
    .backbtn svg{ width: 20px; height: 20px; }
    .header-actions{ right: 16px; top: calc(env(safe-area-inset-top) + 16px); gap: 26px; height:32px; }
    .topbtn{ width:32px; height:32px; }
    .topbtn svg{ width:22px; height:22px; }
    .topbtn.more svg{ width:20px; height:20px; }
    .avatar{ right: 16px; top: calc(env(safe-area-inset-top) + 16px); }
    .row{ margin-top: 18px; }
    .row.grouped{ margin-top: 8px; }
    .row.ai{ padding-left: 42px; }
    .bubble{ max-width: min(63vw, 520px); font-size: 13.5px; line-height: 1.56; padding: 8px 13px 8px; }
    .meta{ font-size: 11px; margin-left: 8px; }
    .day{ font-size: 12px; }
    .new-divider{ font-size: 12px; margin: 14px 0 10px; }
    .composer{ gap: 5px; padding-left: 16px; padding-right: 16px; }
    .floatbtn{ width: 36px; height: 36px; }
    .floatbtn svg{ width: 20px; height: 20px; }
    .composer .field{ min-height: 42px; padding: 4px 8px 4px 12px; }
    textarea{ font-size: 15px; }
    .emojibtn{ width: 28px; height: 28px; }
    .emojibtn svg{ width: 22px; height: 22px; }
    .row.think{ padding-left: 42px; padding-right: 0; }
    .think-block{ width: min(63vw, 520px); max-width: min(63vw, 520px); }
    .think-block.open{ width: 100%; max-width: 100%; }
    .row.think.think-open{ padding-left: 0; padding-right: 0; }
    .think-caption{ font-size: 12.5px; letter-spacing: .07em; }
    .think-caption-star, .think-state{ font-size: 1.2em; }
    .think-body{ margin-top: 12px; }
    .think-text{ width: min(86%, 360px); font-size: 12px; line-height: 1.66; }
    .think-star svg{ width: 22px; height: 22px; }
    .profile-identity{ gap:15px; padding-bottom:14px; }
    .profile-avatar{ width:72px; height:72px; }
    .profile-name-row h3, #profileNameInput{ font-size:21px; }
    .profile-handle{ font-size:13px; }
    .profile-bio{ font-size:12.5px; }
    .settings-card{ padding:14px 15px; }
    .action-row{ padding:12px 15px; }
    .profile-scroll{ gap:22px; }
  }

