:root {
  --app-height: 100vh;
  --mobile-topbar-height: 58px;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: #14243a;
  background: #eef8ff;
}
@supports (height: 100dvh) { :root { --app-height: 100dvh; } }
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
button { font: inherit; }
.mobile-topbar, .drawer-header, .nav-backdrop { display: none; }
.portal { width: 100%; height: var(--app-height); min-height: 0; display: grid; grid-template-columns: 232px minmax(0, 1fr); overflow: hidden; background: #eef8ff; }
.sidebar { position: relative; z-index: 2; display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 28px 17px 22px; overflow: hidden; background: linear-gradient(180deg, #f8fcff 0%, #fff 30%); border-right: 1px solid #d8e9f7; box-shadow: 8px 0 28px rgba(10, 91, 158, .06); }
.sidebar::before { content: ""; position: absolute; z-index: -1; width: 190px; height: 190px; left: -72px; top: -92px; border-radius: 50%; background: radial-gradient(circle, rgba(57, 181, 238, .22), rgba(57, 181, 238, 0) 70%); }
.sidebar-brand { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; padding: 0 5px 30px; color: inherit; text-decoration: none; border-radius: 14px; }
.sidebar-brand:focus-visible, .tool-link:focus-visible, .mobile-menu-toggle:focus-visible, .mobile-home-link:focus-visible, .drawer-close:focus-visible { outline: 3px solid #168fe6; outline-offset: 3px; }
.brand-icon { width: 48px; height: 48px; display: grid; place-items: center; flex: 0 0 auto; overflow: hidden; border: 1px solid #cfeafa; border-radius: 16px; background: linear-gradient(145deg, #eefaff, #d9f2ff); box-shadow: 0 9px 22px rgba(13, 125, 205, .16); }
.brand-icon img { width: 115%; height: 115%; object-fit: contain; }
.sidebar-brand h1 { margin: 0; color: #0c2038; font-size: 1.28rem; letter-spacing: .02em; }
.sidebar-brand p { margin: 5px 0 0; color: #728196; font-size: .78rem; }
.nav-section { flex: 1 1 auto; min-width: 0; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #bdd7e9 transparent; }
.nav-section::-webkit-scrollbar { width: 6px; }
.nav-section::-webkit-scrollbar-thumb { border-radius: 999px; background: #bdd7e9; }
.nav-label { display: block; margin: 0 10px 10px; color: #486078; font-size: .74rem; font-weight: 800; letter-spacing: .08em; }
.tool-nav { display: grid; gap: 7px; }
.tool-link { width: 100%; min-height: 62px; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: #516276; text-align: left; cursor: pointer; transition: background-color .18s ease, color .18s ease, box-shadow .18s ease; }
.tool-link:hover { background: #f0f8ff; color: #075fae; }
.tool-link.active { border-color: #c8e4f9; background: linear-gradient(90deg, #e5f4ff, #f2f9ff); color: #0874cd; box-shadow: inset 3px 0 #168fe6, 0 8px 20px rgba(17, 126, 205, .08); }
.tool-link svg { width: 22px; height: 22px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tool-link span, .tool-link strong, .tool-link small { display: block; min-width: 0; }
.tool-link > .tool-short-label { display: none; }
.tool-link strong { font-size: .91rem; }
.tool-link small { margin-top: 3px; color: #8693a3; font-size: .69rem; font-weight: 500; }
.tool-link.active small { color: #5889bf; }
.tool-icon { width: 22px; text-align: center; font-weight: 900; }
.sidebar-note { display: flex; align-items: flex-start; gap: 9px; flex: 0 0 auto; margin-top: 12px; padding: 13px 11px; border: 1px solid #d7eaf8; border-radius: 11px; background: #f1f9ff; }
.sidebar-note span { width: 8px; height: 8px; margin-top: 4px; flex: 0 0 auto; border-radius: 50%; background: #14a6c9; box-shadow: 0 0 0 4px rgba(20, 166, 201, .12); }
.sidebar-note p { margin: 0; color: #718094; font-size: .68rem; line-height: 1.55; }
.tool-stage { min-width: 0; min-height: 0; height: 100%; padding: 8px; overflow: hidden; background: radial-gradient(circle at 100% 0, rgba(60, 186, 238, .14), transparent 32rem), #eef8ff; }
.tool-stage iframe { display: block; width: 100%; height: 100%; border: 1px solid #cfe3f3; border-radius: 15px; background: #f2f9ff; box-shadow: 0 16px 44px rgba(8, 90, 158, .10); }
.tool-stage iframe[hidden] { display: none !important; }

@media (max-height: 760px) and (min-width: 901px) {
  .sidebar { padding-top: 18px; padding-bottom: 16px; }
  .sidebar-brand { padding-bottom: 18px; }
  .sidebar-note { display: none; }
}

@media (min-width: 901px) and (max-width: 1279px) {
  .portal { grid-template-columns: 84px minmax(0, 1fr); }
  .sidebar { padding: 20px 10px; }
  .sidebar-brand { justify-content: center; padding: 0 0 20px; }
  .brand-icon { width: 46px; height: 46px; }
  .sidebar-brand > div:not(.brand-icon), .nav-label, .sidebar-note, .tool-link > span:not(.tool-icon):not(.tool-short-label) { display: none; }
  .tool-link { min-height: 64px; flex-direction: column; justify-content: center; gap: 4px; padding: 8px 4px; text-align: center; }
  .tool-link > .tool-short-label { display: block; font-size: .75rem; font-weight: 650; line-height: 1.3; white-space: nowrap; }
  .tool-link.active { box-shadow: inset 3px 0 #168fe6, 0 7px 18px rgba(17, 126, 205, .08); }
}

@media (max-width: 900px) {
  :root { --mobile-topbar-height: calc(58px + env(safe-area-inset-top, 0px)); }
  .mobile-topbar { position: fixed; z-index: 40; inset: 0 0 auto; height: var(--mobile-topbar-height); display: flex; align-items: center; gap: 10px; padding: env(safe-area-inset-top, 0px) 12px 0; border-bottom: 1px solid #d7e6f2; background: rgba(248, 252, 255, .97); box-shadow: 0 6px 24px rgba(10, 91, 158, .08); backdrop-filter: blur(16px); }
  .mobile-menu-toggle, .drawer-close { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; padding: 0; border: 1px solid #cfe3f3; border-radius: 12px; background: #fff; color: #155b8e; cursor: pointer; }
  .mobile-menu-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
  .mobile-page-heading { min-width: 0; flex: 1; }
  .mobile-page-heading span, .mobile-page-heading strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-page-heading span { color: #72879a; font-size: .68rem; }
  .mobile-page-heading strong { margin-top: 2px; color: #153b59; font-size: .94rem; }
  .mobile-home-link { flex: 0 0 auto; padding: 8px 9px; border-radius: 9px; color: #0874cd; font-size: .76rem; font-weight: 800; text-decoration: none; }
  .portal { display: block; height: var(--app-height); }
  .sidebar { position: fixed; z-index: 60; inset: 0 auto 0 0; width: min(86vw, 320px); height: var(--app-height); padding: calc(14px + env(safe-area-inset-top, 0px)) 14px calc(14px + env(safe-area-inset-bottom, 0px)); border-right: 1px solid #cfe3f3; transform: translateX(-104%); visibility: hidden; transition: transform .24s ease, visibility 0s linear .24s; box-shadow: 18px 0 46px rgba(5, 51, 87, .22); }
  .portal.nav-open .sidebar { transform: translateX(0); visibility: visible; transition-delay: 0s; }
  .drawer-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: 0 0 auto; margin-bottom: 10px; color: #23465f; }
  .drawer-close { font-size: 1.7rem; line-height: 1; }
  .sidebar-brand { padding: 0 2px 16px; }
  .brand-icon { width: 42px; height: 42px; border-radius: 13px; }
  .sidebar-brand h1 { font-size: 1.05rem; }
  .sidebar-brand p { margin-top: 2px; font-size: .7rem; }
  .nav-label { margin-left: 8px; }
  .tool-nav { gap: 6px; }
  .tool-link { min-height: 54px; padding: 8px 10px; }
  .tool-link small { display: none; }
  .sidebar-note { display: none; }
  .nav-backdrop { position: fixed; z-index: 50; inset: 0; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: rgba(5, 27, 44, .46); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .24s ease, visibility 0s linear .24s; }
  .portal.nav-open .nav-backdrop { opacity: 1; visibility: visible; pointer-events: auto; transition-delay: 0s; }
  .tool-stage { position: fixed; inset: var(--mobile-topbar-height) 0 0; width: 100%; height: auto; padding: 0; }
  .tool-stage iframe { border: 0; border-radius: 0; box-shadow: none; }
}

@media (max-width: 480px) {
  .mobile-topbar { gap: 8px; padding-left: 8px; padding-right: 8px; }
  .mobile-home-link { padding-left: 6px; padding-right: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar, .nav-backdrop, .tool-link { transition: none; }
}
 [hidden]{display:none!important}

/* Shared outline home control. */
.sidebar-brand .brand-icon svg,.mobile-home-link svg{width:28px;height:28px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}.sidebar-brand .brand-icon{color:#0877bf}.mobile-home-link{display:grid;place-items:center;min-width:42px;min-height:42px}
