/* Xiaoyu white desktop system. Business modules retain their own states. */
:root {
  color-scheme: light;
  --side: #fff;
  --rail: #fff;
  --radius: 18px;
  --xy-paper: #fff;
  --xy-canvas: #fff;
  --xy-radius: 22px;
  font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: #fff;
}
html { -webkit-font-smoothing: auto; }
body, .application, .app-workspace { background: #fff; }
body { line-height: 1.6; }
input, textarea { caret-color: #242529; }
input, select, textarea, time, td { font-variant-numeric: tabular-nums; }
:where(button, a, input, select, textarea, summary) { -webkit-tap-highlight-color: transparent; }
:where(button, a, input, select, textarea, summary):focus-visible {
  outline: 2px solid #697e77;
  outline-offset: 3px;
}
button, a, summary { touch-action: manipulation; }
button, a, input, textarea, select, summary {
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
button:disabled { opacity: .42; }
button:not(:disabled):active { transform: translateY(1px); }
button svg { flex-shrink: 0; stroke-width: 1.65; }
h1, h2, h3 { color: #242529; letter-spacing: -.025em; font-weight: 600; text-wrap: balance; }
h1 { font-size: clamp(25px, 2.5vw, 32px); line-height: 1.35; }
h2 { font-size: 20px; line-height: 1.45; }
h3 { font-size: 16px; line-height: 1.5; }
strong { font-weight: 600; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d9dce0; border: 2px solid #fff; border-radius: 12px; }
::-webkit-scrollbar-thumb:hover { background: #b8bdc4; }
.application { grid-template-columns: 244px minmax(0, 1fr); min-height: 0; }
.application > .rail { display: none; }
.application > .sidebar {
  background: #fff; border-right: 1px solid #eceef0; padding: 22px 16px 14px;
  overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  transition: padding 220ms var(--xy-ease);
}
.sidebar .workspace-brand { background: none; gap: 10px; padding: 0 8px; margin-bottom: 24px; }
.sidebar .workspace-brand strong { font-size: 23px; color: #25282c; letter-spacing: -.04em; }
.sidebar .workspace-brand small { color: #5c646a; font-size: 12px; }
.sidebar .company-switch {
  padding: 12px 8px; margin: 0 0 14px; border: 0; background: #fff;
  border-radius: 16px; gap: 10px;
}
.sidebar .company-switch strong { color: #3c4046; font-size: 12px; font-weight: 500; max-width: 158px; }
.sidebar .company-switch small { color: #737981; font-size: 12px; }
.sidebar .company-initial, .sidebar .avatar-initial { background: #f0f2f3; color: #50565e; border-radius: 13px; }
.sidebar .business-picker { margin: 0 2px 12px; }
.sidebar .business-picker label > span { color: #737981; font-size: 12px; }
.sidebar .business-picker select { min-height: 38px; border-color: #eceef0; border-radius: 13px; background: #fff; font-size: 12px; }
.sidebar .nav-list { gap: 4px; }
.sidebar .nav-item { min-height: 42px; border-radius: 13px; padding: 10px 12px; color: #555b63; font-size: 13px; gap: 11px; }
.sidebar .nav-item.active { font-weight: 600; box-shadow: none; }
.sidebar .nav-item.active::before { display: none; }
.sidebar .nav-item svg { color: #737981; }
.sidebar .xy-nav-group-head {
  min-height: 40px; margin-top: 10px; padding: 9px 10px; border: 0;
  color: #5c646a; background: #fff; border-radius: 12px; font-size: 12px;
}
.sidebar .xy-nav-group-head:hover { background: #f7f8f9; }
.sidebar .xy-nav-group-head svg { color: #5c646a; }
.sidebar .xy-nav-group-head::after { border-color: #91979e; }
.sidebar .sidebar-section-label { color: #5c646a; font-size: 12px; margin-top: 22px; }
.sidebar .recent-item { border-radius: 12px; padding: 9px 11px; color: #656b73; font-size: 12px; }
.sidebar .recent-item:hover { background: #f5f6f7; }
.sidebar .recent-dot { background: #b2b8bd; }
.sidebar .sidebar-bottom { margin-top: auto; padding-top: 18px; border-top: 1px solid #f0f1f3; }
.sidebar .local-status { color: #5c646a; font-size: 12px; }
.sidebar .status-dot { background: #608879; box-shadow: none; }
.sidebar .account-row { color: #464c54; font-size: 12px; }
.sidebar .pet-nav { margin: 8px 0 0; }
.sidebar .sidebar-empty { color: #5c646a; font-size: 12px; }
.topbar {
  min-height: 72px; height: 72px; padding: 0 30px; background: #fff;
  border-bottom: 1px solid #f0f1f3; box-shadow: none; gap: 14px;
}
.topbar-leading, .topbar-trailing { gap: 10px; }
.topbar .view-title { color: #3d4249; font-size: 14px; font-weight: 500; }
.topbar .mode-label, .topbar .saved-label { color: #5c646a; }
.topbar .desktop-search-toggle, .xy-shell-more > summary { background: #fff; color: #5c646a; border: 0; border-radius: 13px; min-height: 38px; }
.topbar kbd { background: #f5f6f7; color: #5c646a; border: 0; font: inherit; font-size: 12px; border-radius: 5px; }
.ui-sidebar-toggle { width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 11px; background: #fff; color: #737981; }
.ui-sidebar-toggle:hover { color: #242529; background: #f4f5f6; }
.main-content { background: #fff; scroll-behavior: auto; overscroll-behavior-y: contain; scrollbar-gutter: stable; }
.page-body { max-width: 1240px; margin: 0 auto; padding: 34px 42px 48px; }
.ui-business-brief { margin: 0 0 20px; padding: 0 0 12px; border-bottom: 1px solid #f0f1f3; }
.ui-business-brief > summary { display: flex; align-items: center; gap: 12px; list-style: none; min-height: 36px; padding: 6px 10px; color: #5c646a; font-size: 12px; cursor: pointer; }
.ui-business-brief > summary::-webkit-details-marker { display: none; }
.ui-business-brief > summary strong { color: #4c535b; font-size: 12px; font-weight: 500; }
.ui-business-brief .ui-business-change { margin-left: auto; }
.ui-business-brief > summary > svg { color: #8a9097; transition: transform 160ms ease; }
.ui-business-brief[open] > summary > svg { transform: rotate(90deg); }
.ui-business-brief > .business-home { margin: 12px 0 0; box-shadow: none; border: 0; border-radius: 16px; }
.button { min-height: 42px; border-radius: 15px; padding: 10px 17px; font-weight: 500; box-shadow: none; font-size: 13px; }
.button.primary:hover:not(:disabled) { transform: none; }
.button.secondary:hover:not(:disabled) { transform: none; }
.button.quiet { background: transparent; color: #5c646a; border-color: transparent; }
.button.compact { min-height: 34px; padding: 6px 11px; border-radius: 11px; font-size: 12px; }
.icon-button { border-radius: 12px; color: #737981; }
.icon-button:hover { color: #25282d; background: #f3f4f6; }
.field-label, .field > label { color: #4f5660; font-size: 13px; font-weight: 500; }
.field input:not([type=checkbox]):not([type=radio]):not([type=file]), .field select, .field textarea {
  border: 1px solid #e3e6ea; border-radius: 14px; background: #fff; color: #2b3037; min-height: 44px; padding: 11px 14px;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: #929d99; box-shadow: 0 0 0 3px rgb(100 120 111 / 7%); }
input::placeholder, textarea::placeholder { color: #5c646a; opacity: 1; }
input[type=checkbox], input[type=radio] { accent-color: #454e4a; }
details > summary { border-radius: 12px; }
details > summary:hover { background-color: #f7f8f9; }
.segmented { padding: 4px; background: #f5f6f7; border-radius: 16px; border-color: #eceef0; }
.segment { border-radius: 12px; color: #69717b; }
.segment.selected { background: #fff; color: #282e35; border-color: #dce1e5; box-shadow: 0 2px 5px rgb(28 34 42 / 4%); }
.tag { border-radius: 9px; background: #f3f5f5; color: #5f6663; font-weight: 400; }
.notice { border-radius: 16px; }
.notification, .toast { background: #fff; color: #333941; border: 1px solid #e7eaed; border-radius: 17px; box-shadow: var(--xy-shadow-2); }
dialog, .desktop-search-dialog, .model-picker-dialog { background: #fff; color: #30363d; border: 0; border-radius: 26px; padding: 28px; box-shadow: var(--xy-shadow-3); max-height: min(86dvh, 900px); }
.model-picker-dialog .model-picker-card { border-radius: 17px; border-color: #eceef0; background: #fff; }
.ui-scroll-top {
  position: fixed; right: 30px; bottom: 26px; z-index: 35; width: 42px; height: 42px;
  display: grid; place-items: center; padding: 0; border: 1px solid #e7eaed; border-radius: 16px;
  background: #fff; color: #6b737c; box-shadow: 0 5px 18px rgb(28 34 42 / 6%);
}
.ui-scroll-top[hidden] { display: none; }
.ui-scroll-top:hover { color: #252b33; background: #f7f8f9; }
.ui-scroll-top svg { transform: rotate(-90deg); }
.initial-state::before { background: none; box-shadow: none; }
@media (min-width: 961px) {
  html[data-ui-sidebar='collapsed'] body:not(.social-mode) .application { grid-template-columns: 80px minmax(0, 1fr); }
  html[data-ui-sidebar='collapsed'] .application > .sidebar { padding: 22px 10px 14px; }
  html[data-ui-sidebar='collapsed'] .sidebar .workspace-brand { padding: 0; justify-content: center; }
  html[data-ui-sidebar='collapsed'] .sidebar .workspace-brand > span:not(.xiaoyu-pet),
  html[data-ui-sidebar='collapsed'] .sidebar .company-switch,
  html[data-ui-sidebar='collapsed'] .sidebar .business-picker,
  html[data-ui-sidebar='collapsed'] .sidebar .sidebar-section-label,
  html[data-ui-sidebar='collapsed'] .sidebar .recent-items,
  html[data-ui-sidebar='collapsed'] .sidebar .sidebar-empty,
  html[data-ui-sidebar='collapsed'] .sidebar .xy-nav-compact-row,
  html[data-ui-sidebar='collapsed'] .sidebar .local-status,
  html[data-ui-sidebar='collapsed'] .sidebar .nav-item > span:not(.xiaoyu-pet),
  html[data-ui-sidebar='collapsed'] .sidebar .xy-group-label,
  html[data-ui-sidebar='collapsed'] .sidebar .xy-group-count,
  html[data-ui-sidebar='collapsed'] .sidebar .xy-nav-group-head::after,
  html[data-ui-sidebar='collapsed'] .sidebar .account-row > span:not(.avatar-initial) { display: none; }
  html[data-ui-sidebar='collapsed'] .sidebar .nav-item,
  html[data-ui-sidebar='collapsed'] .sidebar .xy-nav-group-head { justify-content: center; padding: 10px 0; min-width: 44px; }
  html[data-ui-sidebar='collapsed'] .sidebar .account-row { flex-wrap: wrap; justify-content: center; padding: 6px 0; gap: 12px; }
  html[data-ui-sidebar='collapsed'] .sidebar .account-row .icon-button { margin: 0; }
}
@media (max-width: 1100px) and (min-width: 761px) {
  .application { grid-template-columns: 214px minmax(0, 1fr); }
  .application > .sidebar { padding-right: 12px; padding-left: 12px; }
  .topbar { padding: 0 22px; }
  .page-body { padding: 28px 26px 40px; }
  .desktop-search-toggle kbd, .topbar .mode-label { display: none; }
}
@media (max-width: 960px) { .ui-sidebar-toggle { display: none; } }
@media (max-width: 760px) {
  .application { grid-template-columns: minmax(0, 1fr); }
  .application > .sidebar { width: min(286px, calc(100vw - 56px)); border-radius: 0 26px 26px 0; z-index: 60; }
  .application > .sidebar.open { box-shadow: 18px 0 64px rgb(28 34 42 / 12%); }
  .drawer-backdrop { background: rgb(28 34 42 / 22%); backdrop-filter: blur(2px); z-index: 55; }
  .topbar { height: 62px; min-height: 62px; padding: 0 14px; gap: 6px; }
  .topbar-leading, .topbar-trailing { gap: 5px; }
  .topbar .desktop-search-toggle { width: 34px; padding: 7px; }
  .topbar .desktop-search-toggle > span, .topbar .desktop-search-toggle kbd { display: none; }
  .topbar .view-title { font-size: 13px; max-width: 100px; text-overflow: ellipsis; overflow: hidden; }
  .topbar .xy-home-link-text, .topbar .mode-label, .topbar .top-divider, .topbar .saved-label { display: none; }
  .xy-shell-more > summary { padding: 6px 8px; min-height: 34px; }
  .page-body { padding: 25px 18px 36px; }
  .button { min-height: 42px; }
  dialog, .desktop-search-dialog, .model-picker-dialog { border-radius: 24px; padding: 22px; max-height: 88dvh; }
  .ui-scroll-top { right: 16px; bottom: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
html[data-motion='off'] *, html[data-motion='off'] *::before, html[data-motion='off'] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
