:root {
  color-scheme: dark;
  --bg: #0c1117;
  --panel: #161c24;
  --raised: #202833;
  --line: #303a47;
  --text: #e3e9f0;
  --muted: #98a8ba;
  --green: #29bb70;
  --red: #ff7777;
  --blue: #69b5ff;
  --amber: #efbf68;
  font-family: "Microsoft YaHei", system-ui, sans-serif;
  font-size: 14px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
a {
  color: var(--blue);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a.button {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--raised);
  color: var(--text);
  padding: 8px 12px;
  cursor: pointer;
  display: inline-block;
}
button:hover {
  border-color: var(--green);
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.primary {
  background: #16793e;
  color: white;
  border-color: #228e4e;
}
.danger {
  color: var(--red);
}
.quiet {
  background: transparent;
}
input,
select,
textarea {
  background: #0c121a;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 5px;
  padding: 9px;
  max-width: 100%;
}
input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}
input[type="checkbox"] {
  accent-color: var(--green);
  width: 17px;
  height: 17px;
}
textarea {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  line-height: 1.6;
}
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
}
.inline-check {
  flex-direction: row;
  align-items: center;
}
h1 {
  font-size: 22px;
  margin: 0;
}
h2 {
  font-size: 18px;
  margin: 0 0 14px;
}
h3 {
  font-size: 16px;
  margin: 18px 0 10px;
}
p {
  line-height: 1.7;
}
.muted,
small {
  color: var(--muted);
}
small {
  font-size: 12px;
}
.error {
  color: var(--red);
}
.success {
  color: #6ddb98;
}
.warn {
  color: var(--amber);
}
.sidebar {
  width: 210px;
  position: fixed;
  inset: 0 auto 0 0;
  background: var(--panel);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.brand {
  padding: 22px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 21px;
}
.brand strong {
  color: var(--green);
}
.brand small {
  display: block;
  font-size: 14px;
  margin-top: 8px;
}
nav {
  padding: 12px 8px;
}
nav a {
  display: block;
  color: var(--muted);
  padding: 10px 12px;
  border-radius: 5px;
  margin: 2px 0;
  font-size: 16px;
}
nav a.active {
  background: #195b36;
  color: #fff;
}
nav a:hover {
  background: var(--raised);
  text-decoration: none;
}
nav a.nav-top {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  font-size: 17px;
}
.nav-label {
  padding: 18px 12px 5px;
  font-size: 14px;
  color: #718399;
}
.nav-group {
  margin: 4px 0;
  border: none;
  background: transparent;
}
.nav-group > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  padding: 10px 12px;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #8fa3b8;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-group > summary::-webkit-details-marker {
  display: none;
}
.nav-group > summary::before {
  content: "▶";
  font-size: 11px;
  width: 12px;
  color: #6a7f95;
}
.nav-group[open] > summary::before {
  content: "▼";
}
.nav-group > summary:hover {
  background: var(--raised);
  color: var(--text);
}
.nav-group.has-active > summary {
  color: #9fd4b5;
}
.nav-group-body {
  padding: 0 0 4px 6px;
  border-left: 1px solid var(--line);
  margin: 0 0 4px 10px;
}
.nav-group-body a {
  padding: 8px 10px;
  font-size: 15px;
}
.sidebar-foot {
  padding: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
  margin-top: auto;
}
main {
  margin-left: 210px;
  padding: 0 24px 40px;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 100px;
  border-bottom: 1px solid var(--line);
  gap: 20px;
  margin-bottom: 20px;
}
header p {
  margin: 6px 0;
  color: var(--muted);
}
.header-actions,
.actions,
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.toolbar {
  margin-bottom: 16px;
}
.toolbar input {
  max-width: 220px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 20px;
  border-radius: 8px;
  margin: 16px 0;
}
.notice {
  border-left: 3px solid var(--green);
  background: #14251e;
  padding: 12px 16px;
  margin: 16px 0;
  line-height: 1.7;
}
.notice.error {
  border-color: var(--red);
  background: #2b191c;
}
.notice.warning {
  border-color: var(--amber);
  background: #2a2419;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 1fr);
  gap: 20px;
}
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  white-space: nowrap;
}
th {
  background: var(--raised);
  color: #b1bfd0;
  font-weight: 500;
  padding: 12px 10px;
}
td {
  padding: 12px 10px;
  border-top: 1px solid var(--line);
  max-width: 340px;
}
td.wrap {
  white-space: normal;
  min-width: 200px;
  line-height: 1.6;
}
tbody tr:hover {
  background: #18212c;
}
.tag {
  padding: 3px 7px;
  border-radius: 4px;
  background: #25303e;
  font-size: 12px;
  display: inline-block;
}
.tag.complete,
.tag.active,
.tag.published {
  background: #123e2a;
  color: #68d897;
}
.tag.failed,
.tag.incomplete,
.tag.interrupted {
  background: #442727;
  color: #ff9c9c;
}
.tag.stale,
.tag.outdated,
.tag.pending {
  background: #463c22;
  color: #e8c476;
}
.tag.cut,
.tag.price_cut {
  background: #123e2a;
  color: #68d897;
}
.tag.rise {
  background: #3a2430;
  color: #f0a0b8;
}
.tag.changed,
.tag.price_change {
  background: #243044;
  color: #8ec8ff;
}
.pagination {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  align-items: center;
  padding: 16px 0;
}
.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 12px;
  max-height: 480px;
  overflow: auto;
  padding: 3px;
}
.estimate-field-groups {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.estimate-field-groups .field-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px 12px;
  background: rgba(255, 255, 255, 0.02);
}
.estimate-field-groups .field-group > summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 0;
  font-weight: 600;
  color: #6cb6ff;
  user-select: none;
}
.estimate-field-groups .field-group > summary::-webkit-details-marker {
  display: none;
}
.estimate-field-groups .field-group > summary::before {
  content: "▶ ";
  font-size: 12px;
}
.estimate-field-groups .field-group[open] > summary::before {
  content: "▼ ";
}
.estimate-field-groups .field-group > summary .muted {
  font-weight: 400;
  margin-left: 6px;
}
.estimate-field-groups .field-grid {
  max-height: 360px;
}
.field-group-editor .group-row {
  display: grid;
  grid-template-columns: minmax(100px, 140px) minmax(140px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  margin: 8px 0;
}
.field-group-editor .inline-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 13px;
  color: var(--muted, #98a8ba);
}
.field-group-editor .group-move {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.field-grid label {
  font-size: 14px;
}
.field-grid input {
  width: 100%;
}
.price {
  font-size: 32px;
  line-height: 1.5;
  color: #61dc98;
  font-weight: 600;
}
.metrics {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  padding: 20px 0;
}
.metric span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}
.metric strong {
  font-size: 24px;
  font-weight: 500;
}
.tabs {
  display: flex;
  gap: 8px;
  margin: 16px 0;
  flex-wrap: wrap;
}
.tabs button.selected {
  border-color: var(--green);
  color: #74df9f;
}
.asset-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.asset-tabs a.selected {
  border-color: var(--green);
  color: #74df9f;
}
.asset-section {
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px 12px;
  background: rgba(255, 255, 255, 0.02);
}
.asset-section > summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 0;
  font-weight: 600;
  color: #6cb6ff;
  user-select: none;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.asset-section > summary::-webkit-details-marker {
  display: none;
}
.asset-section > summary::before {
  content: "▶ ";
  font-size: 12px;
}
.asset-section[open] > summary::before {
  content: "▼ ";
}
.asset-section .asset-section-title {
  color: inherit;
}
.asset-section > summary .muted {
  font-weight: 400;
}
.asset-section h2 small {
  margin-left: 8px;
  font-weight: 400;
}
.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 12px;
}
.asset-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
  min-width: 0;
}
.asset-card.asset-matched {
  border-color: #286844;
}
.asset-card.asset-pending {
  border-color: #725a2c;
}
.asset-card.asset-empty {
  border-style: dashed;
  opacity: 0.72;
}
.catalog-thumb,
.catalog-preview {
  width: 64px;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #0b1016;
  color: var(--muted);
  font-size: 12px;
}
.catalog-preview {
  width: 120px;
  height: 140px;
  margin: 10px 0;
}
.catalog-thumb img,
.catalog-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
label.button-like {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #121820;
  color: var(--text);
  cursor: pointer;
  font: inherit;
}
.card-pending-actions {
  margin-top: 8px;
}
.card-pending-actions .button,
.asset-card .card-pending-actions button {
  font-size: 12px;
  padding: 4px 8px;
}
.asset-cover {
  height: 126px;
  background: #0b1016;
  display: grid;
  place-items: center;
  color: var(--muted);
  overflow: hidden;
}
.asset-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.asset-card-body {
  display: grid;
  gap: 7px;
  padding: 10px;
}
.asset-card-body strong,
.asset-card-body small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.asset-meta {
  min-height: 30px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.step-row {
  display: grid;
  grid-template-columns: 120px 170px minmax(180px, 1fr) auto auto;
  gap: 8px;
  margin: 8px 0;
  align-items: center;
}
.step-row input {
  width: 100%;
}
.step-row .step-note {
  font-size: 12px;
  color: var(--muted);
  grid-column: 1 / -1;
  margin: -4px 0 4px;
}
.param-row-actions,
.editor-crud-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  align-items: center;
}
.code {
  font-family: Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
}
.images {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.images img {
  width: 180px;
  height: 110px;
  object-fit: contain;
  background: #080b0f;
}
.empty {
  padding: 36px;
  text-align: center;
  color: var(--muted);
}
dialog {
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  width: min(1000px, 92vw);
  max-height: 88vh;
}
dialog::backdrop {
  background: #000a;
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
#login {
  width: 420px;
}
#login form {
  display: grid;
  gap: 14px;
}
#notice:empty {
  display: none;
}
details {
  margin: 14px 0;
}
summary {
  cursor: pointer;
  color: var(--blue);
  padding: 8px 0;
}
.bar-row {
  display: grid;
  grid-template-columns: 130px 1fr 60px;
  gap: 12px;
  align-items: center;
  margin: 12px 0;
}
button.bar-row.bar-drill {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
}
button.bar-row.bar-drill:hover {
  border-color: var(--line);
  background: var(--raised);
  text-decoration: none;
}
.bar-track {
  height: 16px;
  background: var(--raised);
}
.bar {
  height: 100%;
  background: #228f54;
}
.market-filters label {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
}
.market-filters {
  flex-wrap: wrap;
  align-items: flex-end;
}
ul,
ol {
  padding-left: 22px;
  line-height: 1.9;
}
pre {
  overflow: auto;
}
.footer-actions {
  position: sticky;
  bottom: 0;
  padding: 12px;
  background: var(--panel);
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.row-note {
  font-size: 12px;
  margin: 5px 0 0;
  color: var(--muted);
}
.embed-panel {
  min-height: calc(100vh - 160px);
}
.notice-panel {
  border-left: 3px solid var(--blue);
  background: #121a24;
}
.notice-panel strong {
  display: block;
  margin-bottom: 6px;
}
.notice-panel p {
  margin: 0;
}
.account-link {
  color: var(--blue);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.detail-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}
.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.panel-head h2 {
  margin: 0;
  flex: 1 1 auto;
}
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.info-item {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: var(--raised);
}
.info-item.wide {
  grid-column: 1 / -1;
}
.info-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}
.info-value {
  font-weight: 600;
  word-break: break-word;
}
.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.screenshot-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #0c121a;
  color: var(--text);
}
.screenshot-card img {
  display: block;
  width: 100%;
  height: 110px;
  object-fit: cover;
}
.screenshot-card span {
  display: block;
  padding: 8px;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.detail-board .account-board {
  margin-top: 8px;
}
.detail-board .asset-section {
  margin: 12px 0 0;
  padding: 0 12px 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}
.detail-board .asset-section > summary {
  font-size: 15px;
  margin: 0;
}
.upload-box {
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 18px;
  display: grid;
  place-items: center;
  min-height: 110px;
  background: #0c121a;
  color: var(--muted);
  cursor: pointer;
}
.upload-box:hover {
  border-color: var(--green);
  color: var(--text);
}
.tag.unvalued,
.tag.inventory {
  background: #243044;
  color: #b8c7d9;
}
.tag.on_sale {
  background: #1a3a28;
  color: var(--green);
}
.tag.sold {
  background: #3a2430;
  color: #f0a0b0;
}
.tag.hold,
.tag.problem {
  background: #3a3020;
  color: var(--amber);
}
.tag.price-grade.grade-S {
  background: #123e2a;
  color: #68d897;
  font-weight: 600;
}
.tag.price-grade.grade-A {
  background: #1a3348;
  color: #7ec8ff;
}
.tag.price-grade.grade-B {
  background: #463c22;
  color: #e8c476;
}
.tag.price-grade.grade-C {
  background: #442727;
  color: #ff9c9c;
  font-weight: 600;
}
.tag.price-grade.grade-D {
  background: #25303e;
  color: #9aa7b8;
}
@media (max-width: 960px) {
  .detail-cols,
  .info-grid {
    grid-template-columns: 1fr;
  }
}
.legacy-frame {
  display: block;
  width: 100%;
  min-height: calc(100vh - 220px);
  height: 75vh;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0d1117;
}
#modal-content #maint-fields {
  max-height: 45vh;
  overflow: auto;
  margin: 12px 0;
}
@media (max-width: 1050px) {
  .split {
    grid-template-columns: 1fr;
  }
  .sidebar {
    width: 175px;
  }
  main {
    margin-left: 175px;
    padding: 0 16px 24px;
  }
  .step-row {
    grid-template-columns: 100px 120px minmax(120px, 1fr) auto auto;
  }
}
@media (max-width: 700px) {
  .sidebar {
    position: static;
    width: auto;
    height: auto;
  }
  .brand {
    padding: 12px;
  }
  nav {
    display: flex;
    flex-wrap: nowrap;
    overflow: auto;
    gap: 4px;
    align-items: flex-start;
  }
  nav a {
    white-space: nowrap;
  }
  .nav-group {
    flex: 0 0 auto;
    min-width: max-content;
  }
  .nav-group-body {
    border-left: none;
    margin: 0;
    padding: 0;
    display: flex;
  }
  .nav-label,
  .sidebar-foot {
    display: none;
  }
  main {
    margin: 0;
    padding: 0 12px 24px;
  }
  header {
    min-height: 80px;
  }
  h1 {
    font-size: 20px;
  }
  .step-row,
  .asset-row {
    grid-template-columns: 1fr 1fr;
  }
  .metrics {
    gap: 20px;
  }
  button {
    min-height: 36px;
  }
}

/* 新游戏上线配置 */
.onboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.onboard-form .grid.onboard-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.onboard-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.onboard-block {
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.12);
}
.onboard-block summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 8px;
}
.onboard-block textarea,
.onboard-export {
  width: 100%;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.45;
}
.onboard-scheme-hint {
  font-size: 12px;
  line-height: 1.4;
}
.onboard-metrics {
  margin-bottom: 12px;
}
.onboard-result .onboard-export {
  margin-top: 12px;
  min-height: 360px;
}
.onboard-deploy {
  margin-bottom: 16px;
}
.onboard-deploy .onboard-export {
  min-height: 200px;
}
#onboard-deploy-result {
  margin-top: 12px;
  line-height: 1.6;
}
@media (max-width: 960px) {
  .onboard-grid {
    grid-template-columns: 1fr;
  }
  .onboard-form .grid.onboard-fields {
    grid-template-columns: 1fr;
  }
}

/* AI 对话独立窗口 */
.assistant-chat-page {
  --chat-bg: #0e1319;
  --chat-panel: #151c25;
  --chat-raised: #1c2530;
  --chat-line: rgba(255, 255, 255, 0.08);
  --chat-accent: #5b9fd4;
  --chat-accent-soft: rgba(91, 159, 212, 0.14);
  --chat-user-bg: linear-gradient(135deg, #1f4d63 0%, #256b52 100%);
  --chat-bot-bg: rgba(255, 255, 255, 0.045);
  margin: 0;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(91, 159, 212, 0.08), transparent 55%),
    radial-gradient(900px 500px at -10% 100%, rgba(41, 187, 112, 0.06), transparent 50%),
    var(--chat-bg);
  color: #e8eef4;
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
}
.assistant-chat-page textarea:focus,
.assistant-chat-page select:focus,
.assistant-chat-page button:focus-visible {
  outline: 2px solid rgba(91, 159, 212, 0.45);
  outline-offset: 1px;
}
.assistant-chat-app {
  display: grid;
  grid-template-columns: 260px 1fr;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
#assistant-chat-app[hidden],
.assistant-chat-login[hidden] {
  display: none;
}
.assistant-chat-sessions {
  border-right: 1px solid var(--chat-line);
  background: rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  min-height: 0;
  backdrop-filter: blur(8px);
}
.assistant-chat-sessions-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--chat-line);
}
.assistant-chat-sessions-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.assistant-chat-sessions-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--chat-accent-soft);
  font-size: 14px;
  flex-shrink: 0;
}
.assistant-chat-new-btn {
  flex-shrink: 0;
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid var(--chat-line);
  background: var(--chat-raised);
  color: #dce8f2;
}
.assistant-chat-new-btn:hover {
  border-color: var(--chat-accent);
  background: var(--chat-accent-soft);
}
.assistant-chat-session-list {
  list-style: none;
  margin: 0;
  padding: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.assistant-chat-session-row {
  position: relative;
}
.assistant-chat-session-row:hover .assistant-chat-session-actions,
.assistant-chat-session-row:focus-within .assistant-chat-session-actions {
  opacity: 1;
  pointer-events: auto;
}
.assistant-chat-session-item {
  width: 100%;
  text-align: left;
  padding: 11px 72px 11px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.03);
  color: #e8eef4;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.assistant-chat-session-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--chat-line);
}
.assistant-chat-session-actions {
  position: absolute;
  top: 10px;
  right: 8px;
  display: flex;
  gap: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.assistant-chat-session-action {
  min-height: 26px;
  padding: 2px 7px;
  font-size: 11px;
  color: #b8c9d9;
  background: rgba(24, 34, 45, 0.95);
  border: 1px solid var(--chat-line);
  border-radius: 999px;
  cursor: pointer;
}
.assistant-chat-session-action:hover,
.assistant-chat-session-action:focus-visible {
  border-color: var(--chat-accent);
  color: #eff7ff;
}
.assistant-chat-session-action.danger:hover,
.assistant-chat-session-action.danger:focus-visible {
  border-color: #b96868;
  color: #ffd0d0;
}
.assistant-chat-session-item.active {
  border-color: rgba(91, 159, 212, 0.45);
  background: var(--chat-accent-soft);
  box-shadow: inset 0 0 0 1px rgba(91, 159, 212, 0.08);
}
.assistant-chat-session-preview {
  font-size: 13px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.assistant-chat-session-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #8fa0b3;
}
.assistant-chat-session-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.assistant-chat-session-badge.action {
  background: rgba(91, 159, 212, 0.18);
  color: #b8dcff;
}
.assistant-chat-session-badge.guide {
  background: rgba(239, 191, 104, 0.16);
  color: #f0d49a;
}
.assistant-chat-session-empty {
  padding: 24px 12px;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
  color: #8fa0b3;
}
.assistant-chat-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.015) 0%, transparent 120px);
}
.assistant-chat-main-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 20px 10px;
}
.assistant-chat-head-text {
  min-width: 0;
}
.assistant-chat-head-text strong {
  display: block;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.assistant-chat-context {
  display: block;
  font-size: 12px;
  color: #8fa0b3;
  margin-top: 4px;
}
.assistant-mode-badge {
  flex-shrink: 0;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  color: #b8dcff;
  background: rgba(91, 159, 212, 0.12);
  border: 1px solid rgba(91, 159, 212, 0.22);
}
.assistant-chat-body {
  flex: 1;
  overflow: hidden;
  padding: 0 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
}
.assistant-chat-body .assistant-thread {
  max-height: none;
  flex: 1;
  min-height: 160px;
  overflow-y: auto;
  overflow-x: hidden;
  border: none;
  background: transparent;
  padding: 8px 2px 12px;
  mask-image: linear-gradient(180deg, transparent 0, #000 10px, #000 calc(100% - 8px), transparent 100%);
}
.assistant-chat-body .assistant-panel {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  gap: 0;
}
.assistant-chat-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 14px;
  border: 1px solid var(--chat-line);
  background: rgba(0, 0, 0, 0.18);
}
.assistant-chat-toolbar-guide {
  padding-bottom: 8px;
}
.assistant-guide-note {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: #9fb0c3;
}
.assistant-chat-composer {
  margin-top: auto;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--chat-line);
  background: rgba(0, 0, 0, 0.22);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.18);
}
.assistant-chat-composer textarea {
  width: 100%;
  resize: none;
  min-height: 52px;
  max-height: 140px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--chat-line);
  background: rgba(255, 255, 255, 0.03);
  line-height: 1.5;
}
.assistant-chat-composer textarea:focus {
  border-color: rgba(91, 159, 212, 0.45);
  background: rgba(255, 255, 255, 0.045);
}
.assistant-secondary-btn {
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--chat-line);
  background: transparent;
  color: #c5d3e0;
}
.assistant-secondary-btn:hover {
  border-color: rgba(91, 159, 212, 0.35);
  color: #e8f2fa;
}
.assistant-chat-page .primary {
  border-radius: 10px;
  min-height: 36px;
  padding: 8px 18px;
  background: linear-gradient(135deg, #1a7a48 0%, #228e4e 100%);
  border: none;
  box-shadow: 0 4px 14px rgba(34, 142, 78, 0.25);
}
.assistant-chat-login {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #e8eef4;
}
@media (max-width: 720px) {
  .assistant-chat-app {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(112px, 32vh) minmax(0, 1fr);
  }
  .assistant-chat-sessions {
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--chat-line);
  }
  .assistant-chat-main-head,
  .assistant-chat-body {
    padding-left: 14px;
    padding-right: 14px;
  }
}

/* AI 操作助手抽屉（入口改到伙伴右键菜单，不再显示右下角浮标） */
.assistant-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 100vw);
  height: 100vh;
  z-index: 47;
  background:
    radial-gradient(600px 400px at 100% 0%, rgba(91, 159, 212, 0.07), transparent 60%),
    linear-gradient(180deg, #12181f 0%, #182028 100%);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: -12px 0 32px rgba(0, 0, 0, 0.38);
  display: flex;
  flex-direction: column;
  color: #e8eef4;
}
.assistant-drawer[hidden] {
  display: none;
}
.assistant-drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #303a47;
}
.assistant-drawer-head .muted {
  display: block;
  font-size: 12px;
  opacity: 0.7;
  margin-top: 2px;
}
.assistant-drawer-body {
  padding: 12px 16px 24px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
}
.assistant-head-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.assistant-tabs {
  display: flex;
  border-bottom: 1px solid #303a47;
  padding: 0 12px;
  gap: 4px;
}
.assistant-tabs-pill {
  border-bottom: none;
  padding: 0 20px 12px;
  gap: 6px;
}
.assistant-tabs-pill .assistant-tab {
  flex: 0 1 auto;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  margin-bottom: 0;
}
.assistant-tabs-pill .assistant-tab.active {
  color: #eef6ff;
  background: rgba(91, 159, 212, 0.16);
  border-color: rgba(91, 159, 212, 0.28);
  box-shadow: 0 2px 10px rgba(91, 159, 212, 0.12);
}
.assistant-tab {
  flex: 1;
  padding: 10px 8px;
  border: none;
  background: transparent;
  color: #9aa8b8;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.assistant-tab:hover {
  color: #d0dbe8;
}
.assistant-tab.active {
  color: #e8eef4;
  border-bottom-color: #5b9fd4;
}
.assistant-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
}
.assistant-panel[hidden] {
  display: none;
}
.assistant-thread {
  flex: 1;
  min-height: 120px;
  max-height: min(42vh, 360px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 8px 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.12);
}
.assistant-thread-empty {
  margin: auto;
  text-align: center;
  font-size: 13px;
  line-height: 1.6;
  padding: 28px 20px;
  color: #8fa0b3;
  max-width: 280px;
}
.assistant-msg {
  display: flex;
  gap: 10px;
  max-width: min(92%, 640px);
  animation: assistant-msg-in 0.22s ease;
}
@keyframes assistant-msg-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.assistant-msg-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.assistant-msg-assistant {
  align-self: flex-start;
}
.assistant-msg-avatar {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  margin-top: 2px;
}
.assistant-msg-user .assistant-msg-avatar {
  background: linear-gradient(135deg, #2a6b52 0%, #1f5a6a 100%);
  color: #e8fff4;
}
.assistant-msg-assistant .assistant-msg-avatar {
  background: rgba(91, 159, 212, 0.18);
  color: #b8dcff;
  border: 1px solid rgba(91, 159, 212, 0.22);
}
.assistant-msg-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.assistant-msg-label {
  font-size: 11px;
  color: #8fa0b3;
  padding: 0 2px;
}
.assistant-msg-user .assistant-msg-label {
  text-align: right;
}
.assistant-msg-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.55;
  word-break: break-word;
}
.assistant-msg-user .assistant-msg-bubble {
  background: linear-gradient(135deg, #1f4d63 0%, #256b52 100%);
  border-bottom-right-radius: 5px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}
.assistant-msg-assistant .assistant-msg-bubble {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-bottom-left-radius: 5px;
}
.assistant-msg-bubble.error {
  color: #f0a0a0;
  border-color: rgba(185, 104, 104, 0.45);
  background: rgba(106, 48, 48, 0.25);
}
.assistant-composer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.assistant-runs-wrap summary {
  cursor: pointer;
  font-size: 13px;
  color: #9aa8b8;
}
.assistant-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.assistant-quick-scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  scrollbar-width: thin;
}
.assistant-quick-scroll::-webkit-scrollbar {
  height: 4px;
}
.assistant-quick-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}
.assistant-quick button,
.assistant-chip {
  font-size: 12px;
  min-height: 30px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #c5d3e0;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.assistant-quick button:hover,
.assistant-chip:hover {
  border-color: rgba(91, 159, 212, 0.35);
  background: rgba(91, 159, 212, 0.1);
  color: #eef6ff;
}
.assistant-hint {
  margin: 0 0 8px;
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.45;
  color: #e8c476;
  border-radius: 10px;
  background: rgba(239, 191, 104, 0.08);
  border: 1px solid rgba(239, 191, 104, 0.16);
}
.assistant-candidates {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: grid;
  gap: 6px;
}
.assistant-candidates li {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}
.assistant-candidates button {
  font-size: 12px;
}
.assistant-ai-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.assistant-ai-label {
  color: #9fb0c3;
  font-size: 12px;
  flex-shrink: 0;
}
.assistant-ai-row select {
  min-width: 0;
  flex: 1;
  max-width: 220px;
  border-radius: 10px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}
.assistant-actions {
  display: flex;
  gap: 8px;
}
.assistant-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid #303a47;
  border-radius: 10px;
  padding: 10px;
}
.assistant-pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  margin: 0 0 8px;
  max-height: 240px;
  overflow: auto;
}
.assistant-runs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.assistant-runs li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  border: 1px solid #303a47;
  border-radius: 8px;
  font-size: 12px;
}
.assistant-section h4 {
  margin: 8px 0 4px;
  font-size: 13px;
}
#assistant-input {
  width: 100%;
  resize: vertical;
  background: #0e141a;
  color: #e8eef4;
  border: 1px solid #303a47;
  border-radius: 8px;
  padding: 8px;
}

/* 伙伴计划 — 桌宠精灵 */
.pet-fab-root.pet-desktop-ui {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 44;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}
.pet-fab-root.pet-desktop-ui .pet-fab-menu,
.pet-fab-root.pet-desktop-ui .pet-fab-chrome {
  pointer-events: auto;
}
.pet-fab-chrome {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  background: rgba(18, 24, 32, 0.9);
  border: 1px solid #303a47;
  border-radius: 14px;
  padding: 8px 10px;
  backdrop-filter: blur(6px);
  min-width: 160px;
}
.pet-fab-drag-handle {
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.pet-fab-root.pet-fab-dragging .pet-fab-drag-handle {
  cursor: grabbing;
}
.pet-fab-drag-hint {
  font-size: 10px;
  letter-spacing: -1px;
  opacity: 0.45;
  flex-shrink: 0;
}
.pet-sprite {
  position: relative;
}
.pet-sprite.pet-codex {
  image-rendering: auto;
  -webkit-font-smoothing: antialiased;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.22));
}
.pet-desktop-sprite .pet-sprite.pet-codex {
  transition: filter 0.25s ease;
}
.pet-desktop-sprite .pet-sprite.pet-codex:hover {
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.28));
}
.pet-mood-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  font-size: 14px;
  line-height: 1;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}
.pet-mood-badge.is-sleep {
  opacity: 0.85;
}
.pet-bubble-care {
  border-left: 3px solid #6bcf8a;
}
.pet-bubble-analysis {
  border-left: 3px solid #6b9ecf;
}
.pet-bubble-surprise {
  border-left: 3px solid #e8b86d;
}
.pet-fab-chrome-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.pet-fab-chrome-row .pet-fab-caption {
  display: none;
}
.pet-mini-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 8px;
  width: 148px;
}
.pet-mini-metric {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 4px;
  align-items: center;
  font-size: 11px;
  color: #c9d3df;
}
.pet-mini-metric i {
  display: block;
  height: 4px;
  border-radius: 99px;
  background: linear-gradient(90deg, #5aa7ff, #7ad0a5);
  width: var(--v, 50%);
  max-width: 100%;
}
.pet-mini-metric.bad i {
  background: linear-gradient(90deg, #d45d5d, #e08a4f);
}
.pet-mini-metric.warn i {
  background: linear-gradient(90deg, #e0b04f, #e0c96a);
}
.pet-status-line {
  font-size: 15px;
  color: #d7e4f4;
  margin: 4px 0 8px;
}
.pet-meter {
  height: 4px;
  background: #243041;
  border-radius: 99px;
  margin-top: 4px;
  overflow: hidden;
}
.pet-meter i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #5aa7ff, #7ad0a5);
}
.pet-live-metrics .metric.low strong {
  color: #e08a8a;
}
.pet-live-metrics .metric.mid strong {
  color: #e0c96a;
}
.pet-fab-caption {
  font-size: 12px;
  color: #e8eef6;
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pet-fab-alt {
  font-size: 12px;
  padding: 4px 10px;
}
.pet-fab-menu {
  background: #161c24;
  border: 1px solid #303a47;
  border-radius: 10px;
  padding: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  min-width: 220px;
}
.pet-fab-menu[hidden],
.pet-fab-bubble[hidden],
.pet-head-bubble[hidden] {
  display: none !important;
}
.pet-fab-menu a,
.pet-fab-menu button {
  font-size: 12px;
}
.pet-fab-menu .pet-menu-assistant {
  grid-column: 1 / -1;
  background: #1f3a2e;
  color: #d7efe2;
  border: 1px solid #355f4a;
}
.pet-fab-bubble,
.pet-head-bubble {
  max-width: min(280px, calc(100vw - 24px));
  color: #e8eef6;
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 12px;
  cursor: default;
  line-height: 1.45;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
}
.pet-head-bubble {
  position: fixed;
  z-index: 46;
  transform: translate(-50%, -100%);
  margin-top: -10px;
  display: grid;
  gap: 6px;
  animation: pet-head-bubble-in 0.38s ease-out;
}
.pet-head-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 12px;
  height: 12px;
  transform: translateX(-50%) rotate(45deg);
  border-radius: 0 0 3px 0;
  background: inherit;
  box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.12);
}
.pet-bubble-body {
  line-height: 1.5;
}
.pet-bubble-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}
.pet-bubble-actions .quiet {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  cursor: pointer;
}
.pet-bubble-actions .pet-bubble-close {
  min-width: 26px;
  padding-inline: 6px;
}
.pet-bubble-species-cat::after {
  background: #2a2420;
  border-right: 1px solid rgba(255, 196, 140, 0.25);
  border-bottom: 1px solid rgba(255, 196, 140, 0.25);
}
.pet-bubble-species-dog::after {
  background: #2a2418;
  border-right: 1px solid rgba(255, 210, 90, 0.28);
  border-bottom: 1px solid rgba(255, 210, 90, 0.28);
}
.pet-bubble-species-koala::after {
  background: #1c2620;
  border-right: 1px solid rgba(140, 190, 160, 0.22);
  border-bottom: 1px solid rgba(140, 190, 160, 0.22);
}
.pet-bubble-species-cat {
  background: linear-gradient(145deg, #3d2e28 0%, #2a2420 55%, #1f1c1a 100%);
  border: 1px solid rgba(255, 196, 140, 0.35);
  color: #ffe8d4;
  box-shadow: 0 10px 28px rgba(48, 28, 12, 0.42);
}
.pet-bubble-species-cat.pet-bubble-analysis {
  border-color: rgba(255, 180, 120, 0.55);
}
.pet-bubble-species-cat::before {
  content: "喵";
  position: absolute;
  top: -9px;
  right: 10px;
  font-size: 10px;
  opacity: 0.55;
  color: #ffc48c;
}
.pet-bubble-species-dog {
  background: linear-gradient(145deg, #3a2f1a 0%, #2a2418 55%, #1c1810 100%);
  border: 1px solid rgba(255, 210, 90, 0.42);
  color: #fff3d0;
  box-shadow: 0 10px 28px rgba(56, 40, 8, 0.45);
  border-radius: 14px 14px 12px 12px;
}
.pet-bubble-species-dog.pet-bubble-analysis {
  border-color: rgba(255, 196, 64, 0.62);
  animation: pet-head-bubble-in 0.28s ease-out;
}
.pet-bubble-species-dog::before {
  content: "汪!";
  position: absolute;
  top: -10px;
  right: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #ffd054;
  opacity: 0.75;
}
.pet-bubble-species-koala {
  background: linear-gradient(145deg, #243028 0%, #1c2620 55%, #151c18 100%);
  border: 1px solid rgba(140, 190, 160, 0.32);
  color: #dceee4;
  box-shadow: 0 12px 30px rgba(12, 28, 20, 0.4);
  border-radius: 16px;
}
.pet-bubble-species-koala.pet-bubble-analysis {
  border-color: rgba(130, 185, 155, 0.48);
  animation: pet-head-bubble-in 0.55s ease-out;
}
.pet-bubble-species-koala::before {
  content: "～";
  position: absolute;
  top: -8px;
  right: 12px;
  font-size: 12px;
  opacity: 0.5;
  color: #a8d4bc;
}
.pet-head-bubble.pet-bubble-care {
  border-width: 1px;
}
.pet-head-bubble.pet-bubble-surprise {
  animation: pet-head-bubble-pop 0.42s ease-out;
}
@keyframes pet-head-bubble-in {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-100% + 10px)) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -100%) scale(1);
  }
}
@keyframes pet-head-bubble-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -100%) scale(0.85);
  }
  60% {
    transform: translate(-50%, -100%) scale(1.04);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -100%) scale(1);
  }
}
.pet-fab-bubble.pet-bubble-analysis,
.pet-head-bubble.pet-bubble-analysis {
  animation-name: pet-head-bubble-in;
}
.companion-has-insight .pet-head-bubble {
  border-width: 1px;
}
.companion-analysis-section {
  border: 1px solid var(--border, #2a3544);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: #1a2230;
}
.companion-analysis-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.companion-analysis-head h4 {
  margin: 0;
  flex: 1;
}
.companion-headline {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 6px;
}
.companion-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin: 10px 0;
}
.companion-metric {
  background: #121820;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
}
.companion-metric strong {
  display: block;
  font-size: 14px;
}
.companion-section {
  margin: 8px 0;
  font-size: 13px;
}
.companion-section ul {
  margin: 6px 0 0;
  padding-left: 18px;
}
.companion-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.companion-feedback {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
.companion-learning-meta {
  font-size: 12px;
  margin: 6px 0;
}
.companion-suggestion-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.companion-case-detail {
  margin-top: 8px;
  font-size: 12px;
  max-height: 240px;
  overflow: auto;
}
.companion-case-detail pre {
  white-space: pre-wrap;
  font-size: 11px;
}
.companion-static-entry {
  margin-top: 8px;
}
@media (min-width: 900px) {
  .assistant-drawer {
    width: min(480px, 92vw);
  }
}
.pet-desktop-root {
  position: fixed;
  inset: 0;
  z-index: 44;
  pointer-events: none;
  overflow: hidden;
}
.pet-desktop-sprite {
  pointer-events: none;
}
.pet-desktop-sprite .pet-sprite {
  pointer-events: auto;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.45));
}
.pet-desktop-sprite .pet-sprite:hover {
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.55)) brightness(1.03);
}
.pet-avatar,
.pet-stage-host {
  width: 240px;
  height: 260px;
  margin: 0 auto 8px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 30% 28%, rgba(90, 140, 180, 0.28), transparent 55%),
    radial-gradient(circle at 70% 70%, rgba(40, 60, 80, 0.45), #141a22);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.pet-claim-card .pet-claim-sprite {
  width: 140px;
  height: 150px;
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: radial-gradient(circle at 40% 30%, #2a3544, #141a22);
  overflow: hidden;
}
.pet-reduce-motion * {
  animation: none !important;
  transition: none !important;
}
.pet-claim-grid,
.pet-shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.pet-actions {
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
.pet-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.pet-need-banner {
  margin: 8px 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(105, 181, 255, 0.08);
  color: #9ec9ef;
  font-size: 14px;
}
.pet-stage {
  text-align: center;
  margin-bottom: 12px;
}
.pet-avatar .pet-sprite,
.pet-stage-host .pet-sprite {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.4));
  cursor: pointer;
}
.pet-avatar .pet-sprite:hover,
.pet-stage-host .pet-sprite:hover {
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.48)) brightness(1.04);
}
.pet-claim-card .pet-claim-sprite .pet-sprite {
  position: relative !important;
  left: auto !important;
  top: auto !important;
}
