:root {
  --ink: #252a3a;
  --muted: #7a8195;
  --line: rgba(255, 255, 255, .72);
  --glass: rgba(255, 255, 255, .48);
  --glass-strong: rgba(255, 255, 255, .72);
  --pink: #ff98b5;
  --pink-soft: #ffe1e9;
  --blue: #8bc8ff;
  --blue-soft: #e0f1ff;
  --violet: #b8a4ff;
  --mint: #80dcc5;
  --danger: #ef6f82;
  --warning: #eead4a;
  --shadow: 0 22px 60px rgba(91, 121, 158, .16);
  --shadow-soft: 0 10px 28px rgba(95, 116, 146, .12);
  --radius: 28px;
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  color: var(--ink);
  background: #eaf4ff;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 215, 228, .95), transparent 29%),
    radial-gradient(circle at 83% 16%, rgba(179, 221, 255, .9), transparent 32%),
    radial-gradient(circle at 52% 100%, rgba(255, 229, 235, .72), transparent 39%),
    linear-gradient(135deg, #f8eff4 0%, #edf7ff 48%, #dceeff 100%);
  overflow-x: hidden;
}
body::before, body::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(10px);
  opacity: .7;
}
body::before { width: 55vw; height: 22vw; left: -8vw; bottom: -5vw; background: rgba(255,255,255,.7); box-shadow: 24vw -2vw 0 rgba(255,255,255,.45), 45vw 3vw 0 rgba(255,255,255,.35); }
body::after { width: 40vw; height: 18vw; right: -7vw; top: -4vw; background: rgba(255,255,255,.45); box-shadow: -28vw 3vw 0 rgba(255,255,255,.3); }
button, input, textarea, select { font: inherit; }
button { color: inherit; cursor: pointer; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.glass {
  background: linear-gradient(145deg, rgba(255,255,255,.58), rgba(255,255,255,.28));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(120%);
  -webkit-backdrop-filter: blur(24px) saturate(120%);
}
.ambient { position: fixed; z-index: -1; width: 38vw; height: 38vw; border-radius: 50%; filter: blur(90px); opacity: .35; }
.ambient-pink { background: #ffbad0; left: -12vw; top: 25vh; }
.ambient-blue { background: #9bcfff; right: -10vw; bottom: -10vh; }

.app-shell {
  width: calc(100vw - 24px);
  height: calc(100vh - 24px);
  height: calc(100dvh - 24px);
  min-height: 520px;
  margin: 12px auto;
  display: grid;
  grid-template-columns: clamp(220px, 14vw, 250px) minmax(0, 1fr) clamp(270px, 17vw, 308px);
  gap: 12px;
}
.sidebar, .workspace, .context-rail { border-radius: 32px; overflow: hidden; }
.sidebar { display: flex; flex-direction: column; padding: 24px 16px 18px; overflow-y: auto; min-width: 0; }
.brand-block { display: flex; align-items: center; gap: 13px; padding: 3px 8px 25px; }
.brand-block h1 { font-size: 22px; margin: 0 0 2px; letter-spacing: .06em; white-space: nowrap; }
.brand-block p { font-size: 12px; margin: 0; color: var(--muted); }
.mascot { position: relative; width: 68px; height: 68px; flex: none; display: grid; place-items: center; }
.mascot img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 5px 9px rgba(77, 103, 133, .13)); transform-origin: 50% 82%; }
.mascot-mini { border-radius: 0; background: transparent; box-shadow: none; }
.nav-list { display: flex; flex-direction: column; gap: 6px; }
.nav-item {
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 15px;
  text-align: left;
  font-size: 14px;
  color: #5c6273;
  transition: .2s ease;
}
.nav-item span { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid rgba(79,89,113,.15); border-radius: 8px; font-size: 13px; background: rgba(255,255,255,.32); }
.nav-item:hover { transform: translateX(2px); background: rgba(255,255,255,.48); }
.nav-item.active { color: #2b3141; font-weight: 700; background: linear-gradient(100deg, rgba(255,220,230,.78), rgba(220,239,255,.75)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.8), 0 8px 18px rgba(118,147,179,.12); }
.nav-item.active span { background: rgba(255,255,255,.8); color: #ee7f9e; }
.sidebar-bottom { margin-top: 0; flex: none; }
.privacy-note { padding: 16px 12px 2px; font-size: 11px; color: var(--muted); }
.privacy-note span { color: var(--mint); font-size: 9px; }

.companion-zone {
  flex: 1 1 auto;
  min-height: 210px;
  margin: 10px 0 4px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}
.mascot-bubble {
  position: relative;
  width: calc(100% - 10px);
  min-height: 62px;
  max-height: 94px;
  flex: none;
  border: 1px solid rgba(255,255,255,.92);
  border-radius: 18px;
  padding: 11px 12px 9px;
  color: #4d5568;
  text-align: left;
  background: linear-gradient(145deg, rgba(255,255,255,.82), rgba(244,249,255,.6));
  box-shadow: 0 10px 22px rgba(93,121,151,.12);
  overflow: hidden;
  transition: opacity .18s ease, transform .18s ease;
}
.mascot-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 13px;
  height: 13px;
  background: rgba(248,251,255,.9);
  border-right: 1px solid rgba(255,255,255,.95);
  border-bottom: 1px solid rgba(255,255,255,.95);
  transform: translateX(-50%) rotate(45deg);
}
.mascot-bubble span {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
}
.mascot-bubble small { display: block; margin-top: 5px; color: #ed88a6; font-size: 8px; font-weight: 800; }
.mascot-bubble.speak { opacity: .35; transform: translateY(3px) scale(.98); }
.mascot-bubble[hidden] { display: none; }
.mascot-stage {
  position: relative;
  width: 128px;
  height: 128px;
  flex: none;
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  background: transparent;
  border-radius: 40%;
  contain: layout paint;
}
.mascot-stage::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 17%;
  right: 17%;
  bottom: 8px;
  height: 14px;
  border-radius: 50%;
  background: rgba(113,143,174,.1);
  filter: blur(5px);
}
.mascot-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; user-select: none; filter: drop-shadow(0 8px 12px rgba(74,101,129,.12)); transform: none; animation: none; transition: none; background: url("/mascot/idle.png") center/contain no-repeat; }
.mascot-stage canvas.is-ready { background: none; }
.xiaoba-chat { min-width: 0; }
.hero-chat {
  position: relative;
  width: 100%;
  min-height: 238px;
  display: grid;
  grid-template-rows: auto minmax(112px, 1fr) auto auto;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.96);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(255,255,255,.72), rgba(247,251,255,.5));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 18px 38px rgba(91,123,155,.14);
  backdrop-filter: blur(16px);
}
.hero-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.hero-chat-head > div { min-width: 0; }
.hero-chat-head b { display: block; color: #465069; font-size: 14px; }
.hero-chat-head small { display: block; margin-top: 3px; color: #8993a5; font-size: 10px; }
.hero-chat-live {
  flex: none;
  padding: 5px 9px;
  border-radius: 999px;
  color: #4ea98f;
  background: rgba(218,247,238,.82);
  font-size: 9px;
  font-weight: 800;
}
.xiaoba-chat-log {
  min-height: 112px;
  max-height: 168px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 11px;
  border: 1px solid rgba(255,255,255,.88);
  border-radius: 17px;
  background: rgba(255,255,255,.42);
  scrollbar-width: thin;
  scrollbar-color: rgba(124,155,189,.35) transparent;
}
.xiaoba-chat-empty {
  margin: auto;
  color: #8d96a8;
  font-size: 12px;
  text-align: center;
}
.xiaoba-chat-message {
  max-width: 86%;
  padding: 9px 11px;
  border-radius: 14px;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.xiaoba-chat-message.user {
  align-self: flex-end;
  color: #42516a;
  background: rgba(215,236,255,.9);
  border-bottom-right-radius: 4px;
}
.xiaoba-chat-message.assistant {
  align-self: flex-start;
  color: #584b5c;
  background: rgba(255,226,235,.92);
  border-bottom-left-radius: 4px;
}
.xiaoba-chat-form {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 7px;
  padding: 6px;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 18px;
  background: rgba(255,255,255,.72);
  box-shadow: 0 9px 22px rgba(93,121,151,.11);
}
.xiaoba-chat-form textarea {
  width: 100%;
  height: 42px;
  min-height: 42px;
  max-height: 108px;
  resize: none;
  overflow-y: auto;
  border: 0;
  outline: 0;
  padding: 11px 10px 8px;
  color: #485066;
  background: transparent;
  font-size: 12px;
  line-height: 1.45;
}
.xiaoba-chat-form textarea::placeholder { color: #9ca4b2; }
.xiaoba-chat-form button {
  width: 44px;
  height: 42px;
  border: 0;
  border-radius: 14px;
  color: white;
  background: linear-gradient(135deg, #ef91ad, #87c4f4);
  box-shadow: 0 5px 12px rgba(111,153,192,.2);
}
.xiaoba-chat-form button:disabled { opacity: .45; cursor: wait; }
.xiaoba-chat-status {
  display: block;
  min-height: 13px;
  padding: 0 4px;
  color: #949daf;
  font-size: 9px;
}
.xiaoba-chat-status.online { color: #4ca68c; }
.xiaoba-chat-status.error { color: #dd6f8d; }

.workspace { position: relative; min-width: 0; padding: 22px 26px 28px; overflow-y: auto; overflow-x: hidden; background: rgba(255,255,255,.46); scrollbar-width: thin; scrollbar-color: rgba(124,155,189,.35) transparent; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 22px; }
.eyebrow { color: #ef8eaa; text-transform: uppercase; font-size: 11px; font-weight: 800; letter-spacing: .15em; margin: 0 0 5px; }
.topbar h2 { font-size: 22px; margin: 0; letter-spacing: -.02em; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.model-pill { border: 1px solid rgba(255,255,255,.9); background: rgba(255,255,255,.56); border-radius: 18px; padding: 8px 13px; display: grid; grid-template-columns: 10px auto; column-gap: 8px; text-align: left; box-shadow: var(--shadow-soft); }
.model-pill .status-dot { grid-row: span 2; align-self: center; }
.model-pill b { font-size: 11px; }
.model-pill small { font-size: 9px; color: var(--muted); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #aab0bd; box-shadow: 0 0 0 4px rgba(170,176,189,.14); display: inline-block; }
.status-dot.online { background: #54c6a7; box-shadow: 0 0 0 4px rgba(84,198,167,.16); }
.status-dot.demo { background: #ecad59; box-shadow: 0 0 0 4px rgba(236,173,89,.16); }
.avatar-button, .icon-button { border: 1px solid rgba(255,255,255,.9); background: linear-gradient(145deg, #ffdfe7, #d9edff); border-radius: 14px; width: 40px; height: 40px; font-weight: 800; box-shadow: var(--shadow-soft); }
.view { display: none; min-width: 0; animation: fade .24s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.hero-card {
  min-height: 302px;
  padding: 35px 40px;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 22% 15%, rgba(255,255,255,.75), transparent 35%),
    linear-gradient(115deg, rgba(255,221,231,.77), rgba(219,239,255,.75));
  border: 1px solid rgba(255,255,255,.9);
  box-shadow: var(--shadow-soft);
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(400px, 1.1fr);
  gap: clamp(28px, 4vw, 62px);
  align-items: center;
  overflow: hidden;
  position: relative;
}
.soft-chip { display: inline-flex; padding: 7px 11px; border-radius: 999px; background: rgba(255,255,255,.62); color: #df7899; font-size: 11px; font-weight: 800; box-shadow: inset 0 0 0 1px rgba(255,255,255,.8); }
.hero-card h3 { font-size: clamp(25px, 2.4vw, 36px); margin: 16px 0 10px; letter-spacing: -.04em; }
.hero-card p { color: #6d7486; max-width: 600px; margin: 0; line-height: 1.8; font-size: 14px; }
.hero-actions { display: flex; gap: 10px; margin-top: 24px; }
.primary-button, .secondary-button, .soft-button {
  border: 0;
  border-radius: 15px;
  padding: 11px 20px;
  font-weight: 700;
  font-size: 13px;
  transition: .2s ease;
}
.primary-button { color: #fff; background: linear-gradient(135deg, #ee8eaa, #8ebff4); box-shadow: 0 10px 24px rgba(184,133,169,.25); }
.primary-button:hover, .secondary-button:hover, .soft-button:hover { transform: translateY(-1px); filter: saturate(1.08); }
.primary-button.full { width: 100%; padding: 14px; }
.primary-button.small { padding: 9px 14px; }
.secondary-button { background: rgba(255,255,255,.62); border: 1px solid rgba(255,255,255,.9); color: #535b6d; }
.soft-button { background: #f5f8fc; color: #566072; border: 1px solid #e6ebf2; }
.soft-button.accent { background: linear-gradient(135deg, #ffe2e9, #e2f1ff); }
.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 15px 0 24px; }
.metric-card { min-height: 88px; display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 11px; padding: 16px; border-radius: 20px; background: rgba(255,255,255,.58); border: 1px solid rgba(255,255,255,.86); box-shadow: var(--shadow-soft); }
.metric-icon, .task-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; font-style: normal; }
.pink { background: var(--pink-soft); color: #e87999; }.blue { background: var(--blue-soft) !important; color: #6ca8df !important; }.violet { background: #ece7ff; color: #9079de; }.mint { background: #ddf7ef !important; color: #55b99d !important; }
.metric-card b { display: block; font-size: 20px; }.metric-card small { color: var(--muted); font-size: 10px; }.metric-card em { color: #96a0b1; font-size: 9px; font-style: normal; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin: 8px 2px 14px; }
.section-heading span { color: #ec8aa7; font-weight: 800; font-size: 10px; letter-spacing: .12em; }
.section-heading h3 { margin: 3px 0 0; font-size: 18px; }.section-heading p { color: var(--muted); margin: 7px 0 0; font-size: 12px; }
.section-heading.compact { margin-top: 24px; }
.text-button, .rail-title button { border: 0; background: transparent; color: #8892a4; font-size: 11px; }
.task-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.task-card { min-height: 130px; border: 1px solid rgba(255,255,255,.9); border-radius: 21px; background: rgba(255,255,255,.56); box-shadow: var(--shadow-soft); padding: 17px; text-align: left; position: relative; transition: .2s ease; }
.task-card:hover { transform: translateY(-3px); background: rgba(255,255,255,.76); }
.task-card b { display: block; margin: 12px 0 4px; }.task-card small { color: var(--muted); font-size: 10px; }.task-card i { position: absolute; right: 16px; top: 18px; font-style: normal; color: #aab3c3; }
.recent-panel { margin-top: 8px; }
.recent-list { display: grid; gap: 8px; }
.recent-item { display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: center; background: rgba(255,255,255,.48); border: 1px solid rgba(255,255,255,.8); border-radius: 16px; padding: 11px 14px; }
.recent-item .thumb { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: linear-gradient(135deg, #ffe2ea, #e2f2ff); }
.recent-item b { font-size: 12px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }.recent-item small { color: var(--muted); font-size: 9px; }
.empty-state { color: var(--muted); text-align: center; padding: 30px; border: 1px dashed rgba(120,139,166,.24); border-radius: 18px; font-size: 12px; }

.work-grid { display: grid; grid-template-columns: minmax(360px, .9fr) minmax(420px, 1.1fr); gap: 15px; min-height: calc(100vh - 130px); }
.form-card, .result-card, .info-card, .inline-form {
  min-width: 0;
  background: rgba(255,255,255,.58);
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
}
.form-card { padding: 23px; align-self: start; }
.card-heading { display: flex; align-items: center; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid rgba(102,120,145,.09); margin-bottom: 18px; }
.heading-icon { width: 42px; height: 42px; border-radius: 14px; background: var(--pink-soft); color: #e67c9a; display: grid; place-items: center; font-size: 18px; }
.card-heading h3 { margin: 0 0 3px; font-size: 18px; }.card-heading p { margin: 0; color: var(--muted); font-size: 10px; }
label { display: block; color: #5e6576; font-size: 11px; font-weight: 700; margin-bottom: 14px; }
input, textarea, select {
  width: 100%;
  border: 1px solid rgba(121,145,175,.16);
  border-radius: 13px;
  background: rgba(250,252,255,.74);
  color: var(--ink);
  padding: 11px 12px;
  margin-top: 7px;
  outline: none;
  resize: vertical;
  transition: .2s ease;
}
input:focus, textarea:focus, select:focus { border-color: rgba(118,174,227,.65); box-shadow: 0 0 0 4px rgba(120,185,240,.11); background: #fff; }
textarea { line-height: 1.7; }
.field-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.field-row.three { grid-template-columns: repeat(3, 1fr); }
.inline-options, .button-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 15px; }
.button-row.end { justify-content: flex-end; }
.switch-label { display: flex; align-items: center; gap: 8px; margin: 0; cursor: pointer; }
.switch-label input { display: none; }
.switch { width: 34px; height: 20px; border-radius: 999px; background: #d7dce5; position: relative; transition: .2s; }
.switch::after { content: ""; position: absolute; width: 14px; height: 14px; border-radius: 50%; background: white; top: 3px; left: 3px; transition: .2s; box-shadow: 0 2px 5px rgba(0,0,0,.15); }
.switch-label input:checked + .switch { background: linear-gradient(90deg, #ee9bb3, #8cc6f5); }
.switch-label input:checked + .switch::after { left: 17px; }
.hint { color: var(--muted); font-size: 9px; }
.generate-button { margin-top: 5px; }
.result-card { min-height: 580px; display: flex; flex-direction: column; overflow: hidden; position: relative; }
.result-toolbar { min-height: 56px; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 18px; border-bottom: 1px solid rgba(102,120,145,.09); background: rgba(255,255,255,.3); }
.result-toolbar > div { display: flex; align-items: center; gap: 8px; }.result-toolbar b { font-size: 12px; }.result-toolbar button { border: 0; background: transparent; color: #7b8496; font-size: 10px; }
.live-dot { width: 7px; height: 7px; background: #64c8ab; border-radius: 50%; box-shadow: 0 0 0 4px rgba(100,200,171,.13); }
.empty-result { margin: auto; text-align: center; color: var(--muted); padding: 30px; }
.empty-result h3 { color: #515869; margin: 13px 0 6px; }.empty-result p { font-size: 11px; }
.sparkle, .shield { display: grid; place-items: center; width: 58px; height: 58px; margin: auto; border-radius: 20px; background: linear-gradient(135deg, #ffe1e9, #e0f1ff); color: #de84a0; font-size: 24px; box-shadow: var(--shadow-soft); }
.result-editor { border: 0; margin: 0; border-radius: 0; background: rgba(255,255,255,.24); flex: 1; min-height: 500px; padding: 22px; font-family: inherit; font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 13px 16px; border-top: 1px solid rgba(102,120,145,.09); }
.scan-summary { margin: 15px 18px 0; display: flex; gap: 8px; flex-wrap: wrap; }
.risk-pill { border-radius: 999px; padding: 6px 9px; font-size: 10px; font-weight: 800; }
.risk-pill.high { background: #ffe1e5; color: #dc6579; }.risk-pill.medium { background: #fff0d5; color: #c98d35; }.risk-pill.ok { background: #ddf6ef; color: #50a68f; }

.inline-form { padding: 20px; margin-bottom: 14px; }
.filter-bar { display: grid; grid-template-columns: 1fr 170px; gap: 10px; margin-bottom: 12px; }.filter-bar input, .filter-bar select { margin: 0; }
.library-list, .rules-list { display: grid; gap: 9px; }
.library-item, .rule-item { background: rgba(255,255,255,.56); border: 1px solid rgba(255,255,255,.85); border-radius: 18px; padding: 14px 16px; box-shadow: var(--shadow-soft); }
.library-item-head, .rule-item { display: flex; align-items: center; gap: 12px; }
.type-icon { width: 38px; height: 38px; flex: none; border-radius: 12px; background: linear-gradient(135deg, #ffe2ea, #e0f1ff); display: grid; place-items: center; color: #df7e9a; }
.library-item .grow, .rule-item .grow { flex: 1; min-width: 0; }.library-item h4, .rule-item h4 { margin: 0 0 4px; font-size: 12px; }.library-item small, .rule-item small { color: var(--muted); font-size: 9px; }
.library-item p { margin: 11px 0 0 50px; color: #626a7c; font-size: 11px; line-height: 1.65; white-space: pre-wrap; max-height: 74px; overflow: hidden; }
.tag { display: inline-flex; border-radius: 999px; padding: 4px 7px; background: #eef4fb; color: #748398; font-size: 8px; margin-right: 4px; }
.delete-button { border: 0; background: transparent; color: #b0b7c3; padding: 7px; }.delete-button:hover { color: var(--danger); }
.confirm-line { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; color: #737b8d; }.confirm-line input { width: auto; margin: 2px 0 0; }
.trend-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.trend-card { min-height: 155px; background: rgba(255,255,255,.56); border: 1px solid rgba(255,255,255,.9); border-radius: 21px; padding: 17px; box-shadow: var(--shadow-soft); position: relative; }
.trend-card .phrase { font-size: 16px; font-weight: 800; margin: 13px 0 8px; }.trend-card p { color: var(--muted); font-size: 10px; line-height: 1.6; }.trend-card .delete-button { position: absolute; right: 10px; top: 10px; }
.trend-meta { display: flex; gap: 5px; flex-wrap: wrap; }
.expiry { position: absolute; bottom: 14px; left: 17px; font-size: 9px; color: #8d96a8; }
.risk-legend { display: flex; gap: 18px; margin: 10px 2px 14px; font-size: 10px; color: var(--muted); }.risk-legend i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; }.risk-high { background: var(--danger); }.risk-medium { background: var(--warning); }.risk-low { background: var(--mint); }
.rule-item { border-left: 3px solid transparent; }.rule-item.high { border-left-color: var(--danger); }.rule-item.medium { border-left-color: var(--warning); }.rule-item.low { border-left-color: var(--mint); }
.rule-phrase { max-width: 48%; font-size: 10px; color: #626a7c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.settings-grid { display: grid; grid-template-columns: minmax(400px, .9fr) minmax(330px, .7fr); gap: 15px; }
.info-card { padding: 28px; align-self: start; background: linear-gradient(145deg, rgba(255,228,236,.58), rgba(220,240,255,.62)); }
.info-card h3 { font-size: 24px; margin: 17px 0; }.check-list { padding: 0; list-style: none; display: grid; gap: 12px; color: #626b7d; font-size: 12px; }.check-list li::before { content: "✓"; display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 9px; border-radius: 7px; background: rgba(255,255,255,.65); color: #59b69c; font-weight: 900; }
.lan-box, .notice-box { border-radius: 16px; background: rgba(255,255,255,.5); border: 1px solid rgba(255,255,255,.75); padding: 14px; margin-top: 20px; }
.lan-box small { display: block; color: var(--muted); margin-bottom: 5px; }.lan-box b { font-size: 13px; word-break: break-all; }.lan-box p, .notice-box { color: var(--muted); font-size: 10px; line-height: 1.6; }.notice-box code { color: #d97491; }

.context-rail { padding: 24px 17px; overflow-y: auto; }
.rail-section { margin-bottom: 24px; }
.rail-title { display: flex; justify-content: space-between; align-items: center; margin: 0 3px 10px; }.rail-title h3 { font-size: 13px; margin: 0; }
.pulse-badge { font-size: 7px; padding: 4px 7px; border-radius: 999px; color: #4bad91; background: #dcf5ed; font-weight: 900; letter-spacing: .08em; }
.platform-cards { display: grid; gap: 8px; }
.platform-card { display: grid; grid-template-columns: 37px 1fr 15px; align-items: center; gap: 9px; text-align: left; border: 1px solid rgba(255,255,255,.84); background: rgba(255,255,255,.4); border-radius: 16px; padding: 10px; transition: .2s; }
.platform-card:hover { background: rgba(255,255,255,.65); }.platform-card.active { background: linear-gradient(100deg, rgba(255,226,234,.7), rgba(224,241,255,.7)); box-shadow: var(--shadow-soft); }
.platform-mark { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; font-size: 11px; font-weight: 900; }.platform-mark.douyin { background: #252a39; color: white; }.platform-mark.xhs { background: #f05263; color: white; }.platform-mark.wx { background: #4ebb80; color: white; }
.platform-card b { font-size: 11px; display: block; }.platform-card small { font-size: 8px; color: var(--muted); }.platform-card i { font-style: normal; color: transparent; }.platform-card.active i { color: #67bba3; }
.rail-list { display: grid; gap: 7px; }.rail-empty { color: #9098a8; font-size: 9px; line-height: 1.6; padding: 13px; border: 1px dashed rgba(117,138,165,.23); border-radius: 14px; }
.rail-item { background: rgba(255,255,255,.45); border: 1px solid rgba(255,255,255,.8); border-radius: 14px; padding: 10px 11px; }.rail-item b { display: block; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }.rail-item small { color: var(--muted); font-size: 8px; }
.compliance-card { margin-top: auto; border-radius: 19px; background: linear-gradient(135deg, rgba(255,224,232,.75), rgba(219,239,255,.75)); border: 1px solid rgba(255,255,255,.9); padding: 15px; box-shadow: var(--shadow-soft); }
.compliance-card > div { display: flex; gap: 8px; align-items: center; }.compliance-card > div span { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 9px; background: rgba(255,255,255,.74); color: #58b99e; }.compliance-card b { font-size: 11px; }.compliance-card p { color: #747d8f; font-size: 9px; line-height: 1.65; }.compliance-card button { border: 0; background: transparent; padding: 0; font-size: 9px; color: #dc7996; }

.toast { position: fixed; z-index: 30; left: 50%; bottom: 30px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: rgba(43,49,64,.9); color: white; border-radius: 999px; padding: 10px 17px; font-size: 11px; box-shadow: 0 12px 35px rgba(34,41,57,.25); transition: .25s; }.toast.show { opacity: 1; transform: translate(-50%, 0); }
.loading-overlay { position: absolute; z-index: 20; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(242,248,255,.82); backdrop-filter: blur(12px); text-align: center; }.loading-overlay b { margin-top: 18px; }.loading-overlay p { color: var(--muted); font-size: 10px; }
.loader-orbit { width: 76px; height: 76px; position: relative; }.loader-orbit span { position: absolute; inset: 0; border: 2px solid rgba(141,191,235,.2); border-top-color: #e78da7; border-right-color: #8fc7f4; border-radius: 50%; animation: spin 1s linear infinite; }.loader-orbit i { position: absolute; inset: 12px; display: grid; place-items: center; background: white; border-radius: 50%; font-style: normal; font-weight: 900; box-shadow: var(--shadow-soft); }
@keyframes spin { to { transform: rotate(360deg); } }
.mobile-header { display: none; }

@media (max-width: 1500px) {
  .app-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .context-rail { display: none; }
  .hero-card { grid-template-columns: minmax(0, .9fr) minmax(380px, 1.1fr); }
}

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 200px minmax(0, 1fr); }
  .workspace { padding: 20px 20px 24px; }
  .brand-block { gap: 9px; padding-inline: 3px; }
  .brand-block h1 { font-size: 20px; }
  .brand-block p { font-size: 10px; }
  .companion-zone { min-height: 190px; }
  .mascot-stage { width: 112px; height: 112px; }
  .mascot-bubble span { font-size: 10px; }
  .hero-card { grid-template-columns: minmax(0, .88fr) minmax(350px, 1.12fr); gap: 24px; padding: 30px; }
  .metrics-grid, .task-grid { grid-template-columns: repeat(2, 1fr); }
  .work-grid, .settings-grid { grid-template-columns: minmax(0, 1fr); min-height: auto; }
  .result-card { min-height: 540px; }
  .trend-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 980px) {
  .hero-card { grid-template-columns: 1fr; gap: 26px; }
  .hero-chat { width: 100%; min-height: 250px; }
  .xiaoba-chat-log { max-height: 190px; }
}

@media (max-width: 900px) {
  body { background-attachment: fixed; }
  .app-shell { width: 100%; height: auto; min-height: 100vh; min-height: 100dvh; margin: 0; display: block; }
  .mobile-header { position: sticky; top: 0; z-index: 15; height: 58px; display: flex; align-items: center; justify-content: space-between; border-radius: 0 0 18px 18px; padding: 0 14px; }
  .mobile-brand { font-size: 13px; font-weight: 800; }
  .sidebar { position: fixed; z-index: 25; left: 10px; top: 68px; bottom: 10px; width: min(280px, calc(100vw - 32px)); transform: translateX(calc(-100% - 24px)); transition: .25s ease; box-shadow: 0 24px 70px rgba(59,76,103,.28); }
  .sidebar.open { transform: translateX(0); }
  .workspace { min-height: calc(100vh - 58px); min-height: calc(100dvh - 58px); border-radius: 0; padding: 18px 14px 24px; overflow: visible; }
  .topbar { align-items: flex-start; }.topbar h2 { font-size: 18px; }.model-pill small { display: none; }
  .hero-card { grid-template-columns: 1fr; padding: 28px 24px; }
  .metrics-grid, .task-grid, .trend-grid { grid-template-columns: repeat(2, 1fr); }
  .work-grid, .settings-grid { grid-template-columns: 1fr; min-height: auto; }
  .result-card { min-height: 520px; }
  .field-row.three { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
  .top-actions { width: 100%; justify-content: space-between; }
  .model-pill { flex: 1; }
  .section-heading { align-items: flex-start; flex-wrap: wrap; gap: 8px; }
  .recent-item { grid-template-columns: 42px minmax(0, 1fr); }
  .recent-item > :last-child { grid-column: 2; }
  .recent-item b { max-width: 100%; }
  .result-toolbar { align-items: flex-start; flex-wrap: wrap; }
  .library-item-head, .rule-item { align-items: flex-start; flex-wrap: wrap; }
  .rule-phrase { max-width: 100%; width: 100%; }
}

@media (max-width: 520px) {
  .top-actions .avatar-button { display: none; }
  .hero-card h3 { font-size: 25px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-chat { min-height: 244px; padding: 13px; border-radius: 20px; }
  .xiaoba-chat-log { min-height: 108px; max-height: 170px; padding: 9px; }
  .xiaoba-chat-message { max-width: 92%; font-size: 11px; }
  .metrics-grid { gap: 8px; }.metric-card { grid-template-columns: 37px 1fr; padding: 12px; }.metric-card em { display: none; }.metric-icon { width: 37px; height: 37px; }
  .task-grid, .trend-grid { grid-template-columns: 1fr 1fr; gap: 8px; }.task-card { min-height: 118px; padding: 14px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .form-card { padding: 18px 15px; }.result-card { min-height: 480px; }
  .filter-bar { grid-template-columns: 1fr; }.library-item p { margin-left: 0; }
  .rule-phrase { max-width: 100%; }.risk-legend { flex-wrap: wrap; }
  .inline-options { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 380px) {
  .metrics-grid, .task-grid, .trend-grid { grid-template-columns: 1fr; }
  .hero-card { padding: 24px 18px; }
  .result-actions > button { flex: 1 1 100%; }
}

@media (max-height: 680px) and (min-width: 901px) {
  .app-shell { min-height: 500px; }
  .brand-block { padding-bottom: 12px; }
  .nav-list { gap: 2px; }
  .nav-item { padding-block: 9px; }
  .privacy-note { padding-top: 8px; }
  .workspace { padding-top: 16px; }
  .topbar { margin-bottom: 15px; }
  .hero-card { min-height: 210px; padding-block: 24px; }
  .result-card { min-height: 470px; }
}

@media (max-height: 840px) and (min-width: 901px) {
  .brand-block { padding-bottom: 10px; }
  .nav-list { gap: 1px; }
  .nav-item { padding-block: 8px; }
  .companion-zone { display: flex; min-height: 170px; margin-top: 5px; }
  .mascot-stage { width: 72px; height: 72px; }
  .mascot-bubble { min-height: 44px; max-height: 58px; padding: 7px 9px; }
  .mascot-bubble span { -webkit-line-clamp: 2; font-size: 9px; }
  .mascot-bubble small { margin-top: 2px; font-size: 7px; }
  .privacy-note { display: none; }
}

@media (max-height: 680px) and (min-width: 901px) {
  .companion-zone { min-height: 118px; }
  .mascot-stage { width: 58px; height: 58px; }
  .mascot-bubble { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .mascot-stage, .mascot-mini img { animation: none !important; transition: none !important; }
}
