/* QUANTA app — screen-specific layout
   Reuses tokens.css + shell.css design language */

/* ============ shared bits ============ */
.scroll-y { overflow-y: auto; }
.row-flex { display: flex; align-items: center; gap: var(--pad-3); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--pad-3); }
.muted { color: var(--fg-2); }
.h1 { font-size: var(--t-3xl); font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.h2 { font-size: var(--t-xl); font-weight: 600; margin: 0; }
.h3 { font-size: var(--t-md); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--fg-2); margin: 0; }
.mono { font-family: var(--font-mono); font-feature-settings: 'tnum' 1; }
.pill { display: inline-flex; align-items: center; padding: 1px 6px; font-size: var(--t-xs); border-radius: var(--r-1);
        background: var(--bg-3); color: var(--fg-1); font-family: var(--font-mono); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.pill-pos { background: var(--pos-bg); color: var(--pos); }
.pill-neg { background: var(--neg-bg); color: var(--neg); }
.pill-warn { background: rgba(255,184,77,0.12); color: var(--warn); }
.pill-info { background: rgba(90,200,250,0.12); color: var(--info); }
.pill-accent { background: var(--accent-soft); color: var(--accent); }

.btn { font-family: var(--font-sans); font-size: var(--t-md); font-weight: 600; padding: 6px 12px;
       background: var(--bg-3); color: var(--fg-0); border: 1px solid var(--line-2); border-radius: var(--r-2); cursor: pointer;
       display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { background: var(--bg-4); border-color: var(--line-3); }
.btn-primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 3px 8px; font-size: var(--t-sm); }

.input { font-family: var(--font-sans); font-size: var(--t-md); padding: 6px 10px;
         background: var(--bg-3); color: var(--fg-0); border: 1px solid var(--line-2); border-radius: var(--r-2); width: 100%; outline: none; }
.input:focus { border-color: var(--accent); }
.textarea { min-height: 280px; resize: vertical; line-height: 1.55; padding: 10px 12px; font-family: var(--font-sans); }

/* page padding */
.page { padding: var(--pad-5) var(--pad-5); height: 100%; box-sizing: border-box; overflow: hidden; display: flex; flex-direction: column; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--pad-4); margin-bottom: var(--pad-4); }
.page-body { flex: 1; min-height: 0; }

/* ============ News screen ============ */
.news-layout { display: grid; grid-template-columns: 1fr 380px; gap: var(--pad-4); height: 100%; min-height: 0; }
.news-list { background: var(--bg-1); border: 1px solid var(--line-1); border-radius: var(--r-card); overflow: hidden; display: flex; flex-direction: column; }
.news-toolbar { display: flex; align-items: center; gap: var(--pad-2); padding: var(--pad-3); border-bottom: 1px solid var(--line-1); }
.news-tab-row { display: flex; gap: 0; padding: 0 var(--pad-3); border-bottom: 1px solid var(--line-1); }
.news-tab { padding: 8px 14px; font-size: var(--t-md); color: var(--fg-2); cursor: pointer; border-bottom: 2px solid transparent;
            font-weight: 500; }
.news-tab:hover { color: var(--fg-1); }
.news-tab.is-active { color: var(--fg-0); border-bottom-color: var(--accent); }
.news-tab-count { color: var(--fg-3); margin-left: 6px; font-size: var(--t-sm); }
.news-rows { flex: 1; overflow-y: auto; }
.news-row { padding: 12px 16px; border-bottom: 1px solid var(--line-1); cursor: pointer; }
.news-row:hover { background: var(--bg-3); }
.news-row.is-active { background: var(--bg-3); border-left: 3px solid var(--accent); padding-left: 13px; }
.news-row-time { font-size: var(--t-xs); color: var(--fg-3); font-family: var(--font-mono); margin-bottom: 4px; }
.news-row-title { font-size: var(--t-md); color: var(--fg-0); line-height: 1.45; margin-bottom: 4px; font-weight: 500; }
.news-row-original { font-size: var(--t-xs); color: var(--fg-3); font-style: italic; line-height: 1.4; margin-bottom: 6px; }
.news-row-meta { display: flex; align-items: center; gap: var(--pad-2); font-size: var(--t-sm); color: var(--fg-2); flex-wrap: wrap; }

.news-detail { background: var(--bg-1); border: 1px solid var(--line-1); border-radius: var(--r-card); padding: var(--pad-4); display: flex; flex-direction: column; gap: var(--pad-3); overflow-y: auto; }
.news-detail-empty { display: flex; align-items: center; justify-content: center; color: var(--fg-2); font-size: var(--t-md); height: 100%; }
.news-detail-title { font-size: var(--t-2xl); font-weight: 600; line-height: 1.35; }

/* ============ Workspaces ============ */
.ws-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--pad-3); padding-right: var(--pad-2); }
.ws-card { background: var(--bg-1); border: 1px solid var(--line-1); border-radius: var(--r-card); padding: var(--pad-4); cursor: pointer;
           display: flex; flex-direction: column; gap: 8px; min-height: 130px; }
.ws-card:hover { border-color: var(--line-3); background: var(--bg-2); }
.ws-card-ticker { font-family: var(--font-mono); font-weight: 700; font-size: var(--t-xl); color: var(--accent); }
.ws-card-name { font-size: var(--t-md); color: var(--fg-1); }
.ws-card-meta { display: flex; align-items: center; gap: var(--pad-2); font-size: var(--t-sm); color: var(--fg-2); margin-top: auto; }
.ws-card-empty { border-style: dashed; align-items: center; justify-content: center; color: var(--fg-2); }
.ws-card-empty:hover { color: var(--accent); border-color: var(--accent); }

.dialog-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.55); display: flex; align-items: center; justify-content: center; z-index: 100; }
.dialog { background: var(--bg-1); border: 1px solid var(--line-2); border-radius: var(--r-card); width: 480px; padding: var(--pad-5); display: flex; flex-direction: column; gap: var(--pad-3); box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.dialog h2 { margin: 0; font-size: var(--t-xl); font-weight: 600; }
.dialog-row { display: flex; flex-direction: column; gap: 4px; }
.dialog-label { font-size: var(--t-xs); color: var(--fg-2); text-transform: uppercase; letter-spacing: 0.08em; }
.suggest { background: var(--bg-2); border: 1px solid var(--line-1); border-radius: var(--r-2); max-height: 200px; overflow-y: auto; margin-top: 2px; }
.suggest-row { padding: 6px 10px; cursor: pointer; display: flex; gap: 10px; align-items: center; font-size: var(--t-md); }
.suggest-row:hover { background: var(--bg-3); }
.suggest-row .mono { color: var(--accent); min-width: 90px; }

/* ============ Workspace detail ============ */
.wd-layout { display: grid; grid-template-rows: auto 1fr; gap: var(--pad-3); height: 100%; min-height: 0; }
.wd-hero { background: var(--bg-1); border: 1px solid var(--line-1); border-radius: var(--r-card); padding: var(--pad-4); display: grid;
           grid-template-columns: minmax(220px, 1fr) auto; gap: var(--pad-4); align-items: center; }
.wd-hero-title { display: flex; align-items: baseline; gap: var(--pad-3); }
.wd-hero-ticker { font-family: var(--font-mono); font-weight: 700; font-size: var(--t-3xl); color: var(--accent); }
.wd-hero-name { font-size: var(--t-md); color: var(--fg-1); }
.wd-hero-price { font-family: var(--font-mono); font-size: var(--t-3xl); font-weight: 600; color: var(--fg-0); }
.wd-hero-change { font-family: var(--font-mono); font-size: var(--t-md); font-weight: 600; }
.wd-hero-stats { display: flex; gap: var(--pad-4); margin-top: 8px; }
.wd-hero-stats .stat-label { font-size: var(--t-xs); color: var(--fg-2); text-transform: uppercase; }
.wd-hero-stats .stat-value { font-family: var(--font-mono); font-size: var(--t-md); color: var(--fg-0); }

.wd-tabs { display: flex; gap: 0; padding: 0 var(--pad-3); border-bottom: 1px solid var(--line-1); margin-bottom: var(--pad-3); }
.wd-tab { padding: 8px 14px; font-size: var(--t-md); color: var(--fg-2); cursor: pointer; border-bottom: 2px solid transparent; font-weight: 500; }
.wd-tab:hover { color: var(--fg-1); }
.wd-tab.is-active { color: var(--fg-0); border-bottom-color: var(--accent); }

.wd-grid { display: grid; grid-template-columns: 1fr 320px; gap: var(--pad-3); height: 100%; min-height: 0; }
.wd-grid-3 { display: grid; grid-template-columns: 1fr 1fr 320px; gap: var(--pad-3); height: 100%; min-height: 0; }
.wd-panel { background: var(--bg-1); border: 1px solid var(--line-1); border-radius: var(--r-card); padding: var(--pad-4); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.wd-panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--pad-3); }
.wd-panel-body { flex: 1; min-height: 0; overflow-y: auto; }

.range-seg { display: inline-flex; gap: 0; background: var(--bg-3); border: 1px solid var(--line-2); border-radius: var(--r-2); }
.range-seg button { background: transparent; color: var(--fg-2); border: none; padding: 4px 10px; font-size: var(--t-sm); cursor: pointer; font-family: var(--font-mono); }
.range-seg button.is-active { background: var(--bg-4); color: var(--fg-0); }

.kv-list { display: flex; flex-direction: column; gap: 8px; font-size: var(--t-md); }
.kv-list .kv-row { display: flex; justify-content: space-between; gap: var(--pad-3); padding: 6px 0; border-bottom: 1px dashed var(--line-1); }
.kv-list .kv-row:last-child { border-bottom: 0; }
.kv-list .kv-key { color: var(--fg-2); }
.kv-list .kv-val { font-family: var(--font-mono); color: var(--fg-0); font-weight: 500; }

.saved-row { padding: 10px 0; border-bottom: 1px solid var(--line-1); display: flex; flex-direction: column; gap: 4px; }
.saved-row:last-child { border-bottom: 0; }
.saved-row-title { font-size: var(--t-md); color: var(--fg-0); font-weight: 500; line-height: 1.45; }
.saved-row-meta { font-size: var(--t-sm); color: var(--fg-2); display: flex; gap: var(--pad-2); align-items: center; }

/* ============ Skills ============ */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--pad-3); }
.skill-card { background: var(--bg-1); border: 1px solid var(--line-1); border-radius: var(--r-card); padding: var(--pad-4); display: flex; flex-direction: column; gap: var(--pad-2); cursor: pointer; }
.skill-card:hover { border-color: var(--accent); }
.skill-card.is-disabled { opacity: 0.55; cursor: not-allowed; }
.skill-card.is-disabled:hover { border-color: var(--line-1); }
.pill-muted { background: var(--bg-2); color: var(--fg-2); }
.skill-card-cat { font-family: var(--font-mono); color: var(--accent); font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.08em; }
.skill-card-name { font-size: var(--t-lg); color: var(--fg-0); font-weight: 600; }
.skill-card-desc { font-size: var(--t-md); color: var(--fg-2); line-height: 1.5; }

/* report block */
.report { display: flex; flex-direction: column; gap: var(--pad-4); }
.report-section h3 { color: var(--fg-2); font-size: var(--t-xs); text-transform: uppercase; margin-bottom: 8px; letter-spacing: 0.1em; }
.report-section p { color: var(--fg-0); font-size: var(--t-md); line-height: 1.6; margin: 0; }
.report-section ul { padding-left: 16px; margin: 0; color: var(--fg-0); }
.report-section li { font-family: var(--font-mono); font-size: var(--t-sm); margin-bottom: 4px; }
.report-headlines li { font-family: var(--font-sans); font-size: var(--t-md); margin-bottom: 8px; line-height: 1.45; }

/* slide deck */
.deck { display: flex; flex-direction: column; gap: var(--pad-3); }
.slide { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-card); padding: var(--pad-5); min-height: 240px; display: flex; flex-direction: column; gap: var(--pad-3); }
.slide-title { font-size: var(--t-2xl); font-weight: 600; color: var(--fg-0); }
.slide-sub { font-size: var(--t-md); color: var(--fg-2); }
.slide-num { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--fg-3); align-self: flex-end; }
.slide-cover { background: linear-gradient(135deg, var(--bg-2), var(--bg-1)); border-color: var(--accent); }
.slide-cover .slide-title { font-size: var(--t-4xl); color: var(--accent); font-family: var(--font-mono); letter-spacing: 0.04em; }

/* chart */
.chart-host { width: 100%; height: 100%; min-height: 280px; position: relative; }
.chart-host canvas { display: block; width: 100%; height: 100%; }
.chart-tip { position: absolute; pointer-events: none; padding: 6px 10px; background: var(--bg-2); border: 1px solid var(--line-3); border-radius: var(--r-2); font-family: var(--font-mono); font-size: var(--t-sm); color: var(--fg-0); white-space: nowrap; box-shadow: 0 4px 12px rgba(0,0,0,0.4); }

/* ============ Folder tree ============ */
.folder-tree { background: var(--bg-1); border: 1px solid var(--line-1); border-radius: var(--r-card); padding: var(--pad-2) 0; }
.folder-row { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line-1); transition: background 0.1s; }
.folder-row:last-child { border-bottom: 0; }
.folder-row:hover { background: var(--bg-2); }
.folder-row-disclosure { background: transparent; border: 0; color: var(--fg-2); cursor: pointer; padding: 2px; display: flex; align-items: center; }
.folder-row-icon { display: flex; align-items: center; justify-content: center; min-width: 56px; }
.folder-ticker { font-family: var(--font-mono); font-weight: 700; color: var(--accent); font-size: var(--t-md); white-space: nowrap; flex-shrink: 0; }
.folder-row-main { flex: 1; display: flex; align-items: center; cursor: pointer; min-width: 0; }
.folder-row-name { font-size: var(--t-md); color: var(--fg-0); font-weight: 500; }
.folder-row-actions { display: flex; align-items: center; gap: 2px; opacity: 0.4; transition: opacity 0.1s; }
.folder-row:hover .folder-row-actions { opacity: 1; }

/* ============ Chat ============ */
.chat-host { display: flex; flex: 1; min-height: 0; gap: var(--pad-3); width: 100%; }
.chat-history { width: 240px; flex-shrink: 0; background: var(--bg-1); border: 1px solid var(--line-1); border-radius: var(--r-card); display: flex; flex-direction: column; min-height: 0; }
.chat-history-head { padding: var(--pad-3); border-bottom: 1px solid var(--line-1); display: flex; align-items: center; justify-content: space-between; }
.chat-history-body { flex: 1; overflow-y: auto; padding: 4px; }
.chat-history-row { padding: 8px 10px; cursor: pointer; border-radius: var(--r-2); display: flex; flex-direction: column; gap: 2px; position: relative; }
.chat-history-row:hover { background: var(--bg-3); }
.chat-history-row.is-active { background: var(--bg-3); border-left: 2px solid var(--accent); }
.chat-history-row .iconbtn { position: absolute; right: 6px; top: 6px; opacity: 0; }
.chat-history-row:hover .iconbtn { opacity: 1; }
.chat-history-title { font-size: var(--t-sm); color: var(--fg-0); font-weight: 500; line-height: 1.3; padding-right: 24px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chat-main { flex: 1; min-width: 0; background: var(--bg-1); border: 1px solid var(--line-1); border-radius: var(--r-card); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.chat-toolbar { padding: var(--pad-2) var(--pad-3); border-bottom: 1px solid var(--line-1); display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.chat-stream { flex: 1; overflow-y: auto; padding: var(--pad-4); display: flex; flex-direction: column; gap: var(--pad-3); }

.chat-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; text-align: center; color: var(--fg-2); padding: 40px 20px; }
.chat-empty-title { font-size: var(--t-2xl); color: var(--fg-1); font-weight: 600; margin-bottom: 8px; }
.chat-empty-hint { font-size: var(--t-md); max-width: 460px; line-height: 1.55; margin-bottom: 24px; }
.chat-empty-suggestions { display: flex; flex-direction: column; gap: 8px; max-width: 480px; width: 100%; }
.chat-suggestion { background: var(--bg-2); border: 1px solid var(--line-1); color: var(--fg-1); padding: 10px 14px; border-radius: var(--r-2); cursor: pointer; text-align: left; font-size: var(--t-md); transition: all 0.1s; }
.chat-suggestion:hover { border-color: var(--accent); color: var(--fg-0); background: var(--bg-3); }

.chat-msg { display: flex; gap: var(--pad-3); align-items: flex-start; }
.chat-msg-avatar { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: var(--t-xs); font-weight: 700; flex-shrink: 0; }
.chat-msg-user .chat-msg-avatar { background: var(--bg-3); color: var(--fg-1); }
.chat-msg-assistant .chat-msg-avatar { background: var(--accent); color: var(--accent-fg); }
.chat-msg-body { flex: 1; min-width: 0; }
.chat-msg-text { color: var(--fg-0); font-size: var(--t-md); line-height: 1.6; word-wrap: break-word; }
.chat-msg-meta { color: var(--fg-3); font-family: var(--font-mono); font-size: var(--t-xs); margin-top: 4px; }
.chat-msg-user .chat-msg-text { color: var(--fg-1); }

.chat-thinking { display: inline-flex; align-items: center; padding: 6px 0; }
.chat-thinking .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--fg-2); margin-right: 4px; animation: chat-bounce 1.2s infinite; }
.chat-thinking .dot:nth-child(2) { animation-delay: 0.2s; }
.chat-thinking .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes chat-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

.chat-composer { padding: var(--pad-3); border-top: 1px solid var(--line-1); display: flex; gap: var(--pad-2); flex-shrink: 0; align-items: flex-end; }
.chat-composer-input { flex: 1; min-height: 44px; max-height: 160px; resize: none; line-height: 1.5; padding: 10px 12px; }
.chat-composer-send { height: 44px; flex-shrink: 0; }

/* ============ Skill editor ============ */
.skill-inputs { display: flex; flex-direction: column; gap: 6px; padding: 8px; background: var(--bg-2); border: 1px solid var(--line-1); border-radius: var(--r-2); }
.skill-input-row { display: flex; gap: 6px; align-items: center; }
.skill-input-row .input { padding: 4px 8px; font-size: var(--t-sm); }
.skill-input-row select.input { padding: 4px 8px; }
code.mono { background: var(--bg-3); padding: 1px 5px; border-radius: 2px; color: var(--accent); font-size: var(--t-xs); }

/* ============ Login ============ */
.login-page {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,159,28,0.05), transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(34,197,115,0.04), transparent 50%),
    var(--bg-0);
}
.login-card {
  width: 420px; padding: 32px; background: var(--bg-1);
  border: 1px solid var(--line-2); border-radius: var(--r-card);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  display: flex; flex-direction: column; gap: 16px;
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.login-brand-name { font-family: var(--font-mono); font-weight: 700; font-size: var(--t-2xl); letter-spacing: 0.04em; color: var(--accent); }
.login-brand-tag { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--fg-2); letter-spacing: 0.08em; text-transform: uppercase; }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-error { color: var(--error); font-size: var(--t-sm); padding: 6px 8px; background: var(--error-bg); border-radius: var(--r-2); }
.login-submit { width: 100%; justify-content: center; padding: 10px; font-size: var(--t-md); }
.login-hint {
  font-size: var(--t-xs); color: var(--fg-2); line-height: 1.6;
  padding: 10px 12px; background: var(--bg-2); border-radius: var(--r-2);
  border-left: 2px solid var(--warn);
}
.login-hint code { background: var(--bg-3); padding: 1px 5px; border-radius: 2px; color: var(--accent); }
.login-foot { font-size: var(--t-xs); text-align: center; margin-top: 4px; }

/* ============ User menu (anchored to nav-rail) ============ */
.user-menu { position: relative; }
.user-menu-trigger { border: none; cursor: pointer; }
.user-menu-pop {
  position: absolute;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  min-width: 220px;
  padding: 6px;
  box-shadow: var(--shadow-card);
  z-index: 50;
}
.user-menu-head { padding: 10px 12px 8px; }
.user-menu-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; width: 100%;
  background: transparent; border: none; color: var(--text-body);
  cursor: pointer; font-size: var(--t-sm); font-family: var(--font-sans);
  text-align: left; border-radius: var(--r-2);
}
.user-menu-row:hover { background: var(--primary-soft); color: var(--primary); }
.user-menu-sep { height: 1px; background: var(--border); margin: 4px 0; }

/* ============ Admin user table ============ */
.user-table { width: 100%; border-collapse: collapse; }
.user-table th, .user-table td {
  padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line-1);
  font-size: var(--t-sm);
}
.user-table th {
  font-weight: 600; color: var(--fg-2); text-transform: uppercase;
  letter-spacing: 0.06em; font-size: var(--t-xs);
  background: var(--bg-2);
}
.user-table tr.is-suspended { opacity: 0.5; }
.user-table tr:hover { background: var(--bg-2); }

/* Admin tab strip (用户 / 审计 / 反馈) */
.admin-tabs { display: flex; gap: 0; padding: 0 var(--pad-3); border-bottom: 1px solid var(--line-1); margin-bottom: var(--pad-3); }
.admin-tab { padding: 8px 14px; font-size: var(--t-md); color: var(--fg-2); cursor: pointer; border-bottom: 2px solid transparent; background: none; }
.admin-tab:hover { color: var(--fg-1); }
.admin-tab.is-active { color: var(--fg-0); border-bottom-color: var(--accent); }

/* Markdown rendered content (chat assistant msg, meeting summary, skill output).
   Scoped to .md so plain prose elsewhere is unaffected. */
.md { line-height: 1.55; }
.md > *:first-child { margin-top: 0; }
.md > *:last-child  { margin-bottom: 0; }
.md p { margin: 0 0 8px; }
.md h1, .md h2, .md h3, .md h4 { margin: 14px 0 6px; line-height: 1.3; color: var(--fg-0); font-family: var(--font-serif); }
.md h1 { font-size: var(--t-2xl); }
.md h2 { font-size: var(--t-xl); }
.md h3 { font-size: var(--t-lg); font-weight: 600; }
.md h4 { font-size: var(--t-md); font-weight: 600; }
.md ul, .md ol { margin: 6px 0 8px; padding-left: 22px; }
.md li { margin-bottom: 3px; }
.md li > p { margin: 0; }
.md strong { color: var(--fg-0); font-weight: 600; }
.md em { font-style: italic; color: var(--fg-1); }
.md a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.md a:hover { filter: brightness(1.15); }
.md code {
  background: var(--bg-3);
  color: var(--fg-0);
  padding: 1px 5px;
  border-radius: var(--r-1);
  font-family: var(--font-mono);
  font-size: 0.92em;
}
.md pre {
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  border-radius: var(--r-2);
  padding: 8px 10px;
  margin: 8px 0;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--t-sm);
  line-height: 1.45;
}
.md pre code { background: none; padding: 0; border-radius: 0; font-size: inherit; }
.md blockquote {
  border-left: 3px solid var(--accent);
  margin: 8px 0;
  padding: 2px 0 2px 10px;
  color: var(--fg-1);
}
.md hr { border: none; border-top: 1px solid var(--line-1); margin: 10px 0; }
.md table { border-collapse: collapse; margin: 8px 0; }
.md th, .md td { border: 1px solid var(--line-1); padding: 4px 8px; font-size: var(--t-sm); }
.md th { background: var(--bg-2); color: var(--fg-1); font-weight: 600; }

/* Global loading bar — animated stripe across the top while Q.* is busy */
.loading-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 200;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
  background-size: 200% 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
}
.loading-bar.is-active {
  opacity: 0.85;
  animation: loading-bar-slide 1.2s linear infinite;
}
@keyframes loading-bar-slide {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Floating 意见反馈 FAB — visible on every screen above the StatusBar */
.feedback-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.32);
  z-index: 100;
  border: none;
  cursor: pointer;
  transition: transform 80ms ease, box-shadow 80ms ease;
}
.feedback-fab:hover { transform: scale(1.06); box-shadow: 0 12px 32px rgba(37, 99, 235, 0.4); }
.feedback-fab:active { transform: scale(0.98); }

/* Notifications bell — sits inside the nav-rail; popover opens to the right */
.notif-bell { position: relative; display: inline-block; }
.notif-bell .iconbtn {
  width: 52px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  background: transparent;
}
.notif-bell .iconbtn:hover { background: var(--primary-soft); color: var(--primary); }
.notif-bell .iconbtn svg { width: 18px; height: 18px; }
.notif-dot {
  position: absolute;
  top: 2px; right: 4px;
  min-width: 14px; height: 14px;
  padding: 0 3px;
  border-radius: 7px;
  background: var(--error);
  color: #fff;
  font-size: 9px;
  font-family: var(--font-mono);
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--bg-panel);
}
.notif-pop {
  position: absolute;
  left: calc(var(--sidebar-w) - 8px);
  top: -8px;
  width: 360px;
  max-height: 480px;
  overflow-y: auto;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  z-index: 90;
}
.notif-head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  color: var(--text-strong);
}
.notif-row {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
}
.notif-row:last-child { border-bottom: none; }
.notif-row:hover { background: var(--bg-subtle); }

/* Feedback dialog — screenshot drop zone + thumbnail */
.feedback-drop {
  border: 1px dashed var(--line-2);
  border-radius: var(--r-2);
  padding: 18px 12px;
  text-align: center;
  cursor: pointer;
  background: var(--bg-2);
  transition: border-color 80ms, background 80ms;
}
.feedback-drop:hover { border-color: var(--accent); background: var(--bg-3); }
.feedback-thumb { position: relative; display: inline-block; }
.feedback-thumb img {
  max-width: 100%;
  max-height: 160px;
  border-radius: var(--r-2);
  border: 1px solid var(--line-2);
  display: block;
}
.feedback-thumb-x {
  position: absolute;
  top: 4px; right: 4px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border-radius: 50%;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
}

/* Admin feedback expanded row — screenshot inline */
.feedback-admin-img {
  max-width: 100%;
  max-height: 480px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  margin-top: 12px;
  display: block;
  cursor: zoom-in;
}

/* Feedback admin row colors by status */
.fb-status-new      { background: var(--accent-soft); color: var(--accent); }
.fb-status-triaged  { background: var(--bg-3); color: var(--fg-1); }
.fb-status-resolved { background: var(--pos-bg); color: var(--pos); }
.fb-status-wontfix  { background: var(--bg-3); color: var(--fg-3); }

/* ============ Calendar ============ */
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--pad-3); height: 100%; min-height: 0; }
.cal-month { background: var(--bg-1); border: 1px solid var(--line-1); border-radius: var(--r-card); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.cal-month-head { padding: var(--pad-3); display: flex; align-items: center; justify-content: space-between; gap: var(--pad-3); border-bottom: 1px solid var(--line-1); flex-shrink: 0; }
/* user1 feedback: at --font-scale=1.5 (标准) the chrome (TopBar +
   page-head) eats enough vertical space that the 6×min-110px grid
   overflows the panel without a scrollbar — calendar got visually
   clipped + un-scrollable. min-height: 0 lets the grid shrink in the
   flex column; overflow-y: auto gives it its own scrollbar when content
   still exceeds available height. Each cell keeps its 110-px floor so
   chips inside stay readable rather than collapsing to nothing. */
.cal-grid { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: minmax(110px, 1fr); }
.cal-weekday { padding: 6px 8px; text-align: right; font-size: var(--t-xs); color: var(--fg-2); border-bottom: 1px solid var(--line-1); font-family: var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase; }
.cal-cell { padding: 4px 4px 4px 4px; border-right: 1px solid var(--line-1); border-bottom: 1px solid var(--line-1); cursor: pointer; display: flex; flex-direction: column; gap: 2px; transition: background 0.05s; min-height: 0; overflow: hidden; }
.cal-cell:hover { background: var(--bg-2); }
.cal-cell.is-out .cal-cell-day { color: var(--fg-3); }
.cal-cell.is-out { background: rgba(0,0,0,0.15); }
.cal-cell.is-today .cal-cell-day { background: var(--accent); color: var(--accent-fg); border-radius: 50%; font-weight: 700; }
.cal-cell.is-selected { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-cell-day {
  align-self: flex-end;
  font-family: var(--font-mono); font-size: var(--t-sm);
  width: 22px; height: 22px; line-height: 22px; text-align: center;
}
.cal-cell-events { display: flex; flex-direction: column; gap: 2px; min-height: 0; padding: 0 2px; }
.cal-cell-chip {
  display: flex; align-items: baseline; gap: 4px;
  padding: 2px 6px; border-radius: 3px;
  color: #0a0a0a; font-size: 11px; line-height: 1.35;
  white-space: nowrap; overflow: hidden;
  font-weight: 500;
}
.cal-cell-chip-time { font-family: var(--font-mono); font-size: 10px; opacity: 0.75; flex-shrink: 0; }
.cal-cell-chip-title { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cal-cell-more { font-size: 10px; color: var(--fg-2); padding: 0 6px; font-weight: 500; }

/* List view */
.cal-list-view { flex: 1; display: flex; flex-direction: column; min-height: 0; background: var(--bg-1); border: 1px solid var(--line-1); border-radius: var(--r-card); overflow: hidden; }
.cal-list-body { flex: 1; overflow-y: auto; padding: var(--pad-3); display: flex; flex-direction: column; gap: var(--pad-3); }
.cal-list-group { display: grid; grid-template-columns: 80px 1fr; gap: var(--pad-3); padding: var(--pad-2) 0; border-bottom: 1px solid var(--line-1); }
.cal-list-group:last-child { border-bottom: 0; }
.cal-list-group.is-past { opacity: 0.55; }
.cal-list-group.is-today .cal-list-date-num { color: var(--accent); }
.cal-list-date { display: flex; flex-direction: column; align-items: flex-end; padding-right: 8px; border-right: 2px solid var(--line-1); }
.cal-list-group.is-today .cal-list-date { border-right-color: var(--accent); }
.cal-list-date-num { font-family: var(--font-mono); font-size: var(--t-3xl); font-weight: 600; line-height: 1; }
.cal-list-date-meta { text-align: right; margin-top: 4px; }
.cal-list-events { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.cal-side { background: var(--bg-1); border: 1px solid var(--line-1); border-radius: var(--r-card); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.cal-side-head { padding: var(--pad-3); border-bottom: 1px solid var(--line-1); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.cal-side-list { flex: 1; overflow-y: auto; padding: var(--pad-2); display: flex; flex-direction: column; gap: 8px; }
.cal-event { display: flex; gap: 8px; padding: 10px; background: var(--bg-2); border-radius: var(--r-2); position: relative; }
.cal-event-bar { width: 3px; border-radius: 2px; flex-shrink: 0; }
.cal-event-body { flex: 1; min-width: 0; }
.cal-event-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; flex-wrap: wrap; }
.cal-event-title { font-size: var(--t-md); color: var(--fg-0); margin-bottom: 4px; word-wrap: break-word; }
.cal-event-actions { display: flex; gap: 2px; align-items: flex-start; opacity: 0.4; }
.cal-event:hover .cal-event-actions { opacity: 1; }

/* ============ Meetings ============ */
.meeting-grid { display: grid; grid-template-columns: 300px 1fr 340px; gap: var(--pad-3); height: 100%; min-height: 0; }
.meeting-record-panel { align-self: flex-start; }

.meeting-transcript {
  font-size: var(--t-md); line-height: 1.7; color: var(--fg-0);
  white-space: pre-wrap; word-wrap: break-word;
  padding: 8px;
}
.speaker-pill {
  display: inline-block; padding: 1px 6px; border-radius: 3px;
  background: var(--accent-soft); color: var(--accent);
  font-family: var(--font-mono); font-size: var(--t-sm); font-weight: 600;
  cursor: pointer; user-select: none;
  transition: background 0.1s;
}
.speaker-pill:hover { background: var(--accent); color: var(--accent-fg); }

.meeting-summary {
  background: var(--bg-2); border: 1px solid var(--line-1); border-radius: var(--r-2);
  padding: 14px;
}

/* ============ New-meeting dialog (self / bot 2-mode picker) ============ */
@keyframes nm-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes nm-dialog-in {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
@keyframes nm-row-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dialog-backdrop { animation: nm-backdrop-in 0.18s ease-out; }
.new-meeting-dialog {
  width: 520px;
  animation: nm-dialog-in 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.new-meeting-dialog form > * {
  animation: nm-row-in 0.28s ease-out both;
}
.new-meeting-dialog form > *:nth-child(1) { animation-delay: 0.02s; }
.new-meeting-dialog form > *:nth-child(2) { animation-delay: 0.06s; }
.new-meeting-dialog form > *:nth-child(3) { animation-delay: 0.10s; }
.new-meeting-dialog form > *:nth-child(4) { animation-delay: 0.14s; }
.new-meeting-dialog form > *:nth-child(5) { animation-delay: 0.18s; }
.new-meeting-dialog form > *:nth-child(6) { animation-delay: 0.22s; }
.new-meeting-dialog form > *:nth-child(7) { animation-delay: 0.26s; }

/* Loosen the row spacing — default .dialog gap was visually too tight here.
   Chinese text is information-dense, so rows need more vertical breathing room. */
.new-meeting-dialog { width: 560px; gap: 24px; padding: 32px 32px 28px; }
.new-meeting-dialog h2 { font-size: 22px; letter-spacing: 0.5px; margin-bottom: 4px; }
.new-meeting-dialog form { display: flex; flex-direction: column; gap: 24px; }
.new-meeting-dialog .dialog-row { gap: 12px; }
.new-meeting-dialog .dialog-label {
  font-size: var(--t-xs); color: var(--fg-2);
  letter-spacing: 0.1em; font-weight: 500;
}
.new-meeting-dialog .input {
  padding: 12px 14px; font-size: var(--t-md);
  line-height: 1.4;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.new-meeting-dialog .input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 18%, transparent);
  outline: none;
}
.new-meeting-dialog .input::placeholder { color: var(--fg-2); }
.new-meeting-dialog .range-seg { padding: 4px; gap: 2px; }
.new-meeting-dialog .range-seg button { padding: 9px 16px; transition: background 0.12s ease, color 0.12s ease; }
/* Small hint line below an input — push it down + extra leading so it doesn't crowd. */
.new-meeting-dialog .dialog-row > .muted { margin-top: 6px; line-height: 1.7; }

/* Toggle option card (e.g. 实时字幕). Visually distinct from input rows. */
.nm-toggle {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 18px;
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  border-radius: var(--r-2);
  cursor: pointer;
  margin-top: 8px;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}
.nm-toggle:hover { border-color: var(--line-2); background: var(--bg-3); }
.nm-toggle input[type=checkbox] {
  margin: 2px 0 0;
  width: 16px; height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}
.nm-toggle-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.nm-toggle-title { font-size: var(--t-md); color: var(--fg-0); font-weight: 500; }
.nm-toggle-hint  { font-size: var(--t-xs); color: var(--fg-2); line-height: 1.7; }
.nm-toggle.is-on {
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent) 10%, var(--bg-2));
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 18%, transparent);
}
.nm-toggle.is-on .nm-toggle-title { color: var(--accent); }

.nm-hint {
  margin-top: 16px; padding-top: 18px;
  border-top: 1px dashed var(--line-1);
  font-size: var(--t-xs); color: var(--fg-2);
  line-height: 1.7;
}
.nm-actions {
  display: flex; justify-content: flex-end; gap: 12px;
  margin-top: 12px;
}
.nm-actions .btn {
  min-width: 84px; flex-shrink: 0;
  transition: transform 0.08s ease, box-shadow 0.16s ease;
}
.nm-actions .btn-primary:not(:disabled):hover { transform: translateY(-1px); }
.nm-actions .btn-primary:not(:disabled):active { transform: translateY(0); }

/* Respect reduced motion. */
@media (prefers-reduced-motion: reduce) {
  .dialog-backdrop, .new-meeting-dialog, .new-meeting-dialog form > * { animation: none !important; }
}

/* ============ Bot recording panel (left column for bot-source meetings) ============ */
.bot-panel-body { display: flex; flex-direction: column; gap: 10px; }

.bot-meta-row {
  display: flex; gap: 6px; align-items: center;
  font-size: var(--t-xs); color: var(--fg-2);
  font-family: var(--font-mono);
  min-width: 0;
}
.bot-meta-row .bot-meta-platform { flex-shrink: 0; }
.bot-meta-row .bot-meta-sep { flex-shrink: 0; opacity: 0.5; }
.bot-meta-row .bot-meta-url {
  color: var(--fg-2); text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0; flex: 1;
}
.bot-meta-row a.bot-meta-url:hover { color: var(--accent); }

.bot-media { display: flex; flex-direction: column; gap: 4px; }
.bot-audio { width: 100%; height: 36px; }
.bot-video {
  width: 100%; max-height: 220px;
  background: #000; border-radius: var(--r-1);
  display: block; outline: none;
}
.bot-downloads {
  display: flex; gap: 10px; justify-content: flex-end;
  font-size: var(--t-xs);
}
.bot-downloads a {
  color: var(--fg-2); text-decoration: none;
  font-family: var(--font-mono);
}
.bot-downloads a:hover { color: var(--accent); }

.bot-status-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; margin-right: 5px; vertical-align: 1px;
  animation: bot-status-pulse 1.4s ease-in-out infinite;
}
@keyframes bot-status-pulse {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%      { opacity: 0.35; transform: scale(0.85); }
}

.bot-events { display: flex; flex-direction: column; gap: 0; }
.bot-events-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0;
  border-top: 1px solid var(--line-1);
  cursor: pointer; user-select: none;
}
.bot-events-head:hover { color: var(--fg-1); }
.bot-events-head .bot-events-caret { transition: transform 0.15s; opacity: 0.6; }
.bot-events-head.is-open .bot-events-caret { transform: rotate(90deg); }
.bot-events-list {
  display: flex; flex-direction: column;
  max-height: 280px; overflow-y: auto;
  padding: 4px 0;
}
.bot-event {
  display: flex; gap: 8px;
  padding: 3px 0; line-height: 1.45;
  font-size: var(--t-xs);
}
.bot-event-time { font-family: var(--font-mono); color: var(--fg-2); flex-shrink: 0; }
.bot-event-msg  { color: var(--fg-1); word-break: break-word; min-width: 0; }
.bot-event-warning { color: var(--warn); }
.bot-event-error   { color: var(--error); }

/* ============ Meeting detail screen: enter animations + polish ============ */
@keyframes wd-hero-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes wd-panel-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
@keyframes wd-line-in {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes wd-pulse-soft {
  0%, 100% { box-shadow: 0 0 0 0   color-mix(in oklab, var(--accent) 28%, transparent); }
  50%      { box-shadow: 0 0 0 6px color-mix(in oklab, var(--accent) 0%,  transparent); }
}

.wd-hero { animation: wd-hero-in 0.32s cubic-bezier(0.16, 1, 0.3, 1) both; }

.wd-grid > .wd-panel,
.wd-grid-3 > .wd-panel {
  animation: wd-panel-in 0.42s cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.wd-grid > .wd-panel:nth-child(1),
.wd-grid-3 > .wd-panel:nth-child(1) { animation-delay: 0.05s; }
.wd-grid > .wd-panel:nth-child(2),
.wd-grid-3 > .wd-panel:nth-child(2) { animation-delay: 0.12s; }
.wd-grid-3 > .wd-panel:nth-child(3) { animation-delay: 0.19s; }

.wd-panel:hover { border-color: var(--line-2); }
.wd-panel-head { padding-bottom: 14px; border-bottom: 1px solid var(--line-1); }
.wd-panel-head .h2 { letter-spacing: 0.3px; }
.wd-panel-head .h2::before {
  content: ""; display: inline-block;
  width: 3px; height: 14px;
  background: var(--accent); border-radius: 2px;
  margin-right: 10px; vertical-align: -2px;
}
.wd-panel-body { padding-top: 14px; }

/* Empty / placeholder body text: more presence, less wall-of-text feel. */
.wd-panel-body > .muted[style*="text-align: center"],
.wd-panel-body > .muted[style*="textAlign"] {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 160px; line-height: 1.9; letter-spacing: 0.2px;
  opacity: 0; animation: wd-hero-in 0.5s ease-out 0.25s forwards;
}

/* Live transcript card — make it feel like a focused, alive subpanel. */
.live-transcript-card {
  display: flex; flex-direction: column;
  background: linear-gradient(180deg,
    color-mix(in oklab, var(--accent) 6%, var(--bg-2)) 0%,
    var(--bg-2) 100%);
  border: 1px solid color-mix(in oklab, var(--accent) 22%, var(--line-1));
  border-radius: var(--r-2);
  padding: 14px 16px;
  animation: wd-panel-in 0.32s ease-out both;
}
.live-transcript-card .h3 {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--fg-0); text-transform: none; letter-spacing: 0.5px;
  font-size: var(--t-md);
}
.live-transcript-card .h3::before {
  content: ""; width: 8px; height: 8px;
  background: var(--accent); border-radius: 50%;
  animation: wd-pulse-soft 1.6s ease-in-out infinite;
}
.live-transcript-stream { scroll-behavior: smooth; }
.live-transcript-line {
  padding: 4px 4px;
  border-left: 2px solid transparent;
  animation: wd-line-in 0.24s ease-out both;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.live-transcript-line:hover {
  border-left-color: var(--accent);
  background: color-mix(in oklab, var(--accent) 6%, transparent);
}

/* Event flow entries — subtle hover; new entries fade in. */
.bot-event {
  padding: 4px 0; border-radius: 4px;
  animation: wd-line-in 0.2s ease-out both;
  transition: background 0.15s ease;
}
.bot-event:hover { background: color-mix(in oklab, var(--fg-2) 6%, transparent); }

/* Respect reduced motion. */
@media (prefers-reduced-motion: reduce) {
  .wd-hero, .wd-panel, .live-transcript-card, .live-transcript-line, .bot-event {
    animation: none !important;
  }
  .live-transcript-card .h3::before { animation: none !important; }
}

/* ============ Bot card: needs_login auto-sync hint ============ */
@keyframes bot-login-dot-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50%      { opacity: 1;   transform: scale(1.15); }
}
.bot-login-hint {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px; padding: 8px 12px;
  background: color-mix(in oklab, var(--accent) 8%, var(--bg-2));
  border: 1px solid color-mix(in oklab, var(--accent) 20%, var(--line-1));
  border-radius: var(--r-2);
  font-size: var(--t-xs); color: var(--fg-1); line-height: 1.5;
}
.bot-login-hint-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0;
  animation: bot-login-dot-pulse 1.4s ease-in-out infinite;
}

/* ============ Settings warning banner ============ */
.settings-warn {
  background: rgba(255,184,77,0.1); border-left: 3px solid var(--warn);
  color: var(--warn); padding: 12px 16px; border-radius: var(--r-2);
  font-size: var(--t-md); margin-bottom: 16px;
}

/* ============ Skill platform: chat slash UX + run card (v0.7+) ============ */

/* Floating typeahead overlay above the chat composer. Anchored by the
   composer's wrapper having position:relative. */
.skill-picker {
  position: absolute; bottom: 100%; left: 0; right: 0;
  margin-bottom: 8px; max-height: 320px; overflow-y: auto;
  background: var(--bg-1); border: 1px solid var(--line-2);
  border-radius: var(--r-card); box-shadow: 0 -8px 24px rgba(0,0,0,0.4);
  z-index: 20;
}
.skill-picker-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 12px; border-bottom: 1px solid var(--line-1);
}
.skill-picker-body { padding: 4px; }
.skill-picker-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; border-radius: var(--r-2); cursor: pointer; gap: 12px;
}
.skill-picker-row.is-active, .skill-picker-row:hover { background: var(--bg-2); }
.skill-picker-row-main { display: flex; align-items: baseline; min-width: 0; flex: 1; overflow: hidden; }
.skill-picker-row-main .mono { color: var(--accent); }
.skill-picker-row-meta { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

/* SkillRunCard appears inline in the chat timeline. Mirrors chat-msg styling. */
.skill-run-card {
  border: 1px solid var(--line-2); border-radius: var(--r-card);
  margin: 8px 0; background: var(--bg-1); overflow: hidden;
}
.skill-run-card-running { border-left: 3px solid var(--accent); }
.skill-run-card-done    { border-left: 3px solid var(--pos); }
.skill-run-card-error   { border-left: 3px solid var(--error); }
.skill-run-card-cancelled { border-left: 3px solid var(--fg-2); }
/* 等下一条事件时的呼吸圆点 — 比卡住的静态 spinner 体感更"还活着" */
@keyframes skill-pulse {
  0%   { opacity: 0.35; transform: scale(0.85); }
  50%  { opacity: 1;    transform: scale(1.1); }
  100% { opacity: 0.35; transform: scale(0.85); }
}
.skill-run-card-head {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  border-bottom: 1px solid var(--line-1);
}
.skill-run-card-logs {
  margin: 0; padding: 8px 12px; background: var(--bg-2);
  font-size: var(--t-xs); font-family: var(--font-mono);
  max-height: 240px; overflow: auto; white-space: pre-wrap;
  color: var(--fg-1); border-bottom: 1px solid var(--line-1);
}
.skill-run-card-error { padding: 12px; color: var(--error); }
.skill-run-card-output { padding: 12px; }

/* ============ Toast (replaces window.alert for fire-and-forget) ============ */
.toast-host {
  position: fixed; top: 16px; right: 16px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: var(--bg-1); border: 1px solid var(--line-2);
  border-radius: var(--r-2); padding: 10px 14px;
  font-size: var(--t-sm); color: var(--fg-1);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  max-width: 360px; min-width: 200px;
  cursor: pointer;
  animation: toast-in 180ms ease-out;
}
.toast-error   { border-left: 3px solid var(--error); color: var(--fg-0); }
.toast-success { border-left: 3px solid var(--pos); }
.toast-info    { border-left: 3px solid var(--info, var(--fg-2)); }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Generic layout utilities — added 2026-05-19 with the 网页路演 admin tab,
   sized for reuse by future admin/detail sections. */
.card {
  background: var(--bg-1);
  border: 1px solid var(--line-1);
  border-radius: var(--r-card);
  padding: var(--pad-4);
}
.stack {
  display: flex;
  flex-direction: column;
  gap: var(--pad-3);
}
.stack-lg {
  display: flex;
  flex-direction: column;
  gap: var(--pad-5);
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th, .table td {
  padding: 6px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line-1);
  font-size: var(--t-sm);
}
.table th { font-weight: 600; color: var(--fg-2); }
