@import url("/static/css/xc-design-tokens.css?v=20261011-m16");
@import url("/static/css/xc-hide-scroll.css?v=20261004-scrollbars-1");
/* 独立页复用星宸原顶栏（对照 xingchen/packages/shell/css/shell.css） */
:root {--xc-header-h:62px;--xc-topbar-h:86px;--xc-sidebar-w:0px;}
html.auth-non-admin .admin-only { display: none !important; }

html.studio-shell-on body {
  padding-top: var(--xc-topbar-h);
  padding-inline-start: var(--xc-sidebar-w);
  box-sizing: border-box;
}
html.studio-shell-on body.studio-shell-tool,
body.studio-shell-tool {
  overflow: hidden;
  height: 100vh;
  margin: 0;
  padding: 0;
  background: var(--xc-bg, #f4f1e9);
}

html:not(.studio-has-auth) .xc-nav-item[data-page="team"] {
  display: none !important;
}
.studio-xc-wrap {
  font-size:var(--xc-body);
  line-height:1.5;
  position: fixed;
  top: 0;
  left: var(--xc-sidebar-w);
  right: 0;
  z-index: 10000;
  padding: 12px 20px 8px;
  pointer-events: none;
  font-family: var(--xc-font);
  background: var(--xc-bg);
  overflow: visible;
}
.studio-xc-wrap .xc-header { pointer-events: auto; overflow: visible; }
#userMenu.xc-user-menu {
  position: relative !important;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  overflow: visible;
}
.studio-xc-wrap .xc-user-dd,
#userMenu .xc-user-dd {
  z-index: 10050;
}

.xc-header {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--xc-line);
  border-radius: 16px;
  background: var(--xc-header-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  position: relative;
  z-index: 30;
  flex-shrink: 0;
  box-sizing: border-box;
  color: var(--xc-text);
  overflow: visible;
}
html.theme-dark .xc-header,
html.studio-theme-dark .xc-header {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
}

.xc-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
}
.xc-brand-logo-svg { display: block; flex-shrink: 0; }
.xc-brand-word {
  display: inline-block;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.16em;
  padding-right: 0.18em;
  line-height: 1.1;
  font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: linear-gradient(180deg, #6d5416 10%, #8a6d1f 55%, #a3863e 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
html.theme-dark .xc-brand-word,
html.studio-theme-dark .xc-brand-word {
  background: linear-gradient(180deg, #fbf3dd 10%, #e6cf94 50%, #c9a45e 90%);
  -webkit-background-clip: text;
  background-clip: text;
}
.xc-starlet {
  font-size: 10px;
  color: #8a6d1f;
  margin-left: 1px;
  align-self: flex-start;
  margin-top: 2px;
  filter: drop-shadow(0 0 5px rgba(255, 227, 173, 0.9));
  animation: xcStarTw 2.6s ease-in-out infinite;
}
html.theme-dark .xc-starlet,
html.studio-theme-dark .xc-starlet { color: #fff3cd; }
@keyframes xcStarTw {
  0%, 100% { opacity: 0.55; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.06); }
}
.xc-brand-badge {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--xc-muted);
  border-left: 1px solid var(--xc-line-strong);
  padding-left: 12px;
  margin-left: 2px;
  text-transform: uppercase;
  font-weight: 600;
}

.xc-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 26px;
  min-width: 0;
  overflow: visible;
  scrollbar-width: none;
}
.xc-nav::-webkit-scrollbar { display: none; }
.xc-nav-dropdown { position: relative; flex: 0 0 auto; }
.xc-nav-dropdown > summary { list-style: none; }
.xc-nav-dropdown > summary::-webkit-details-marker { display: none; }
.xc-nav-dropdown > summary::marker { content: ''; }
.xc-nav-caret { color: currentColor; font-size: 13px; transition: transform .16s ease; }
.xc-nav-dropdown[open] > summary .xc-nav-caret { transform: rotate(180deg); }
.xc-nav-dropdown[open] > summary { color: var(--xc-gold); }
.xc-pill-menu {
  position: absolute;
  z-index: 10020;
  top: calc(100% + 8px);
  left: 0;
  display: none;
  width: min(256px, calc(100vw - 32px));
  max-height: min(420px, calc(100vh - 110px));
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--xc-line);
  border-radius: 14px;
  background: rgba(20, 20, 27, .97);
  box-shadow: 0 18px 46px rgba(0,0,0,.38), inset 0 1px 0 rgba(255,255,255,.05);
  backdrop-filter: blur(18px);
  color: #f4f2ec;
}
.xc-nav-dropdown[open] .xc-pill-menu { display: grid; gap: 3px; animation: studio-workshop-menu-in .3s cubic-bezier(.2, .85, .25, 1.25) both; transform-origin: top left; }
.xc-pill-menu-head { display: grid; gap: 3px; padding: 8px 10px 10px; border-bottom: 1px solid rgba(255,255,255,.09); margin-bottom: 3px; }
.xc-pill-menu-head b { font-size: 12px; }
.xc-pill-menu-head small,
.xc-pill-menu > a small { color: rgba(244,242,236,.56); font-size: 10px; }
.xc-pill-menu > a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: inherit;
  text-decoration: none;
  transition: background .14s ease, border-color .14s ease, transform .14s ease;
}
.xc-pill-menu > a:hover,
.xc-pill-menu > a:focus-visible { border-color: rgba(242,227,173,.25); background: rgba(242,227,173,.1); outline: none; }
.xc-pill-menu > a:active { transform: scale(.985); }
.xc-pill-menu > a > i { display: grid; width: 28px; height: 28px; flex: 0 0 28px; place-items: center; border: 1px solid rgba(242,227,173,.24); border-radius: 8px; background: rgba(242,227,173,.08); color: #f2d98c; font-style: normal; font-weight: 700; }
.xc-pill-menu > a > span { display: grid; gap: 3px; }
.xc-pill-menu > a b { font-size: 11px; }
@keyframes studio-workshop-menu-in {
  0% { opacity: 0; transform: translateY(-7px) scale(.94, .88); }
  62% { opacity: 1; transform: translateY(1px) scale(1.025, 1.045); }
  82% { transform: translateY(0) scale(.99, .985); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.xc-header-actions .xc-activity-btn { display: inline-flex; align-items: center; gap: 7px; border-color: rgba(224,179,77,.34); background: rgba(224,179,77,.08); color: var(--xc-text); }
.xc-header-actions .xc-activity-btn .xc-activity-icon { color: var(--xc-gold); }
.xc-header-actions .xc-activity-btn small { padding: 2px 5px; border-radius: 5px; background: rgba(224,179,77,.16); color: var(--xc-gold); font-size: 9px; font-weight: 800; }
.xc-header-actions .xc-activity-btn:hover { border-color: rgba(224,179,77,.56); background: rgba(224,179,77,.17); }
@media (prefers-reduced-motion: reduce) {
  .xc-nav-caret { transition: none; }
  .xc-nav-dropdown[open] .xc-pill-menu { animation: none; }
}
.xc-nav-item {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  color: var(--xc-muted);
  padding: 7px 17px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 13.5px;
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.25s cubic-bezier(0.22, 0.61, 0.36, 1), background 0.25s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.xc-nav-item svg { display: none; }
.xc-nav-item:hover {
  color: var(--xc-text);
  background: var(--xc-line-soft);
}
.xc-nav-item.is-active {
  color: var(--xc-on-gold);
  background: var(--xc-gold-grad);
  font-weight: 800;
  box-shadow: 0 5px 16px var(--xc-gold-soft-bg);
}

.xc-header-actions,
.xc-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}
.xc-top-btn {
  border: 1px solid var(--xc-line-soft);
  background: transparent;
  color: var(--xc-muted);
  border-radius: 999px;
  padding: 7px 13px;
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.xc-top-btn:hover {
  color: var(--xc-gold);
  border-color: var(--xc-line);
  background: var(--xc-hover);
}
#topbar-agent-btn.xc-tool-agent,
.xc-tool-agent,
#theme-toggle-btn.xc-tool-theme,
#theme-toggle-btn {
  border: 0;
  background: transparent;
  color: var(--xc-muted);
  font-weight: 400;
  padding: 7px 13px;
  border-radius: 999px;
}
.xc-tool-agent:hover,
#theme-toggle-btn:hover {
  border: 0;
  color: var(--xc-text);
  background: var(--xc-line-soft);
}
#topbar-agent-btn.active,
#topbar-agent-btn.agent-toggle-active {
  background: var(--xc-line-soft);
  color: var(--xc-gold);
  font-weight: 700;
}

#accountBtn.xc-avatar {
  position: relative;
  width: 30px;
  height: 30px;
  min-width: 30px;
  max-width: 30px;
  min-height: 30px;
  max-height: 30px;
  padding: 0;
  margin-left: 2px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6b5d3f, var(--xc-gold-3));
  border: 1px solid var(--xc-gold-soft-line);
  color: #0c0b08;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  overflow: hidden;
}
#accountBtn.xc-avatar [data-user-name],
#accountBtn.xc-avatar .xc-user-caret { display: none; }
#accountBtn.xc-avatar .xc-user-av {
  position: relative;
  background: transparent !important;
  border: 0 !important;
  color: inherit !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  padding: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: 100% !important;
  max-height: 100% !important;
  overflow: hidden !important;
  border-radius: 50%;
}
#accountBtn.xc-avatar .xc-user-av > img,
#accountBtn.xc-avatar img.xc-av-img {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block;
  pointer-events: none;
}

.xc-credits {
  display:inline-flex;align-items:center;gap:12px;padding:3px 4px 3px 10px;
  border:1px solid var(--xc-line-soft);border-radius:12px;background:var(--xc-surface);
  color:var(--xc-muted);font-size:11px;flex-shrink:0;cursor:pointer;
}
.xc-credits-personal,.xc-credits-team { display:flex;flex-direction:column;align-items:flex-start;gap:1px;line-height:1.2;min-width:0; }
.xc-credits-label { max-width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px;font-weight:400; }
.xc-credits strong { color:var(--xc-text);font-size:14px;font-weight:650;font-variant-numeric:tabular-nums;white-space:nowrap;letter-spacing:.01em; }
.xc-credits-team { border-left:1px solid var(--xc-line-soft);padding-left:12px; }
.xc-credits-team strong { color:var(--xc-gold); }
.xc-credits-team[hidden] { display:none!important; }
.xc-credits-collab button,.xc-credits-collab select { margin:0; padding:0; border:0; background:transparent; color:inherit; font:inherit; cursor:pointer; text-align:left; box-shadow:none; }
.xc-credits-collab button { display:flex; flex-direction:column; gap:1px; }
.xc-credits-collab [hidden] { display:none; }
.xc-credits-collab .xc-credits-label,.xc-credits-collab select { max-width:130px; }
.xc-credits-collab select { font-size:10px; text-overflow:ellipsis; }
.xc-credits-collab select option { background:var(--xc-surface); color:var(--xc-text); }
.xc-credits-collab-values { color:var(--xc-gold); font-size:12px; font-weight:600; font-variant-numeric:tabular-nums; white-space:nowrap; }
.xc-credits-collab-common::before { content:' · '; }
.xc-credits-collab :focus-visible { outline:2px solid var(--xc-gold); outline-offset:2px; }
.xc-credits-collab :disabled { cursor:wait; }
@media(max-width:640px){ .xc-credits-team { padding-left:7px; } .xc-credits-collab .xc-credits-label,.xc-credits-collab select { max-width:85px; } .xc-credits-collab-values { font-size:10px; } .xc-credits-collab-common { display:block; } .xc-credits-collab-common::before { content:none; } }
.xc-credits .xc-credits-recharge { display:inline-flex;align-items:center;justify-content:center;min-width:58px;min-height:32px;margin:0 2px 0 4px;padding:7px 14px;border:1px solid var(--xc-line-strong);border-radius:999px;background:var(--xc-primary);color:var(--xc-on-gold);font:600 12px/1.3 var(--xc-font);letter-spacing:.04em;box-shadow:none;cursor:pointer;flex-shrink:0; }
.xc-credits-recharge:hover { filter:brightness(.96); }
.xc-credits-recharge:focus-visible { outline:2px solid var(--xc-gold);outline-offset:2px; }
@media(max-width:640px){ .xc-header-actions .xc-credits { gap:7px;padding:3px 4px 3px 7px; } .xc-credits-label { max-width:80px; } }

html.studio-shell-on body.c05-v2,
html.studio-shell-on body.xc-canvas {
  padding: 0;
}
html.studio-shell-on body.c05-v2 .shell,
html.studio-shell-on body.xc-canvas .shell {
  position: fixed;
  left: var(--xc-sidebar-w);
  top: var(--xc-topbar-h);
  right: 0;
  bottom: 0;
  width: auto;
  height: auto;
}
/* 无限画布编辑态（studio-canvas-full）：壳层顶栏隐藏让位，画布自身 c05-topbar 接管顶部。
   右上角「智能助手」悬浮球(#agentPanelPill)也随之露出，不再被壳顶栏盖住。 */
html.studio-shell-on.studio-canvas-full {
  --xc-topbar-h: 0px;
}
html.studio-canvas-full .studio-xc-wrap {
  display: none !important;
}
/* 画布顶栏内借宿的积分卡与主题按钮 */
html.studio-canvas-full #c05Topbar .c05-top-right {
  /* 给右上角智能助手悬浮球(#agentPanelPill)留位，避免积分/主题被压住 */
  padding-right: 104px;
}
#c05Topbar .c05-top-theme {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex: 0 0 auto;
  height: 32px;
  padding: 0 12px;
}
#c05Topbar .c05-top-theme svg {
  width: 15px;
  height: 15px;
  display: block;
  flex: 0 0 auto;
}
#c05Topbar .xc-credits.c05-top-credits {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--c05-line, rgba(15, 23, 42, 0.12));
  background: var(--c05-hover, rgba(15, 23, 42, 0.04));
  color: var(--c05-text, #111827);
  font-size: 12px;
}
#c05Topbar .xc-credits.c05-top-credits:hover { color: var(--c05-text, #111827); border-color: var(--xc-gold-soft-line); }
#c05Topbar .c05-top-theme {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
#c05Topbar .c05-top-theme svg { display: block; }
/* 门禁/列表是 position:fixed; inset:0，相对视口而不是 .shell，会被顶栏盖住 */
html.studio-shell-on .canvas-gate,
html.studio-shell-on .as-gate {
  top: var(--xc-topbar-h) !important;
  right: 0 !important;
  bottom: 0 !important;
  left: var(--xc-sidebar-w) !important;
}
html.studio-shell-on .studio-tool-frame,
body.studio-shell-tool .studio-tool-frame,
iframe.studio-tool-frame {
  position: fixed !important;
  left: var(--xc-sidebar-w) !important;
  right: 0 !important;
  top: var(--xc-topbar-h, 86px) !important;
  bottom: 0 !important;
  width: calc(100% - var(--xc-sidebar-w)) !important;
  height: calc(100vh - var(--xc-topbar-h, 86px)) !important;
  border: 0 !important;
  display: block !important;
  background: var(--xc-stage, #f4f1e9);
}

@media (max-width: 1100px) {
  .xc-nav { margin-left: 8px; }
  .xc-nav-item { padding: 7px 10px; }
  .xc-brand-badge { display: none; }
}

/* Shared announcement ticker: one compositor animation, no polling. */
#studioXcHeader .xc-header-ticker {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 160px;
  min-width: 90px;
  max-width: 280px;
  color: var(--xc-gold);
}
#studioXcHeader .xc-header-ticker[hidden] { display: none; }
.xc-header-ticker > svg { flex: none; width: 14px; height: 14px; }
.xc-header-ticker button { border: 0; background: none; color: inherit; cursor: pointer; padding: 0; font: inherit; }
.xc-header-ticker .xc-ticker-message { display: block; flex: 1; min-width: 0; overflow: hidden; text-align: left; font-size: 12px; line-height: 30px; }
.xc-ticker-track { display: flex; width: max-content; }
.xc-ticker-track > span { flex: none; padding-right: 48px; white-space: nowrap; }
.xc-header-ticker .xc-ticker-pause { display: grid; place-items: center; flex: none; width: 22px; height: 28px; }
.xc-header-ticker .xc-ticker-pause[hidden] { display: none; }
.xc-header-ticker button:focus-visible { outline: 2px solid var(--xc-gold); outline-offset: -2px; }
.xc-header-ticker.is-scrolling .xc-ticker-track { animation: xcNoticeScroll var(--ticker-duration,35s) linear infinite; }
.xc-header-ticker:is(:hover,:focus-within,.is-paused,.is-background) .xc-ticker-track { animation-play-state: paused; }
@keyframes xcNoticeScroll { to { transform: translateX(-50%); } }
@media (min-width: 1501px) and (max-width: 1900px) {
  #studioXcHeader .xc-header:has(.xc-header-ticker:not([hidden])) { flex-wrap: wrap; }
  #studioXcHeader .xc-header:has(.xc-header-ticker:not([hidden])) .xc-nav { order: 3; flex-basis: 100%; margin-left: 0; }
  #studioXcHeader .xc-header-ticker { margin-left: auto; }
}
@media (max-width: 1500px) { #studioXcHeader .xc-header-ticker { margin-left: auto; } }
@media (max-width: 1100px) {
  #studioXcHeader .xc-header-ticker { order: 4; flex-basis: 100%; max-width: none; min-width: 0; }
  .xc-header-ticker .xc-ticker-message { line-height: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .xc-header-ticker.is-scrolling .xc-ticker-track { animation: none; }
  .xc-header-ticker .xc-ticker-pause { display: none; }
}
