:root {
  /* —— 画布与表面 —— */
  --huat-bg:            #f3f4f8;   /* 页面画布 */
  --huat-surface:       #ffffff;   /* 卡片、侧栏 */
  --huat-surface-2:     #f7f8fb;   /* 卡片内的次级块、表头、代码块 */
  --huat-surface-hover: #f5f7fc;   /* 列表行悬停 */
  --huat-line:          #e9ebf2;   /* 主边框 */
  --huat-line-2:        #f1f2f7;   /* 表格行分隔线 */
  --huat-line-strong:   #d6dbe8;   /* 悬停边框、输入框边框 */

  /* —— 文字 —— */
  --huat-text:   #151a30;
  --huat-text-2: #6b7190;
  --huat-text-3: #a3a8c0;
  --huat-text-inverse: #ffffff;

  /* —— 品牌 —— */
  --huat-brand:        #2364db;
  --huat-brand-hover:  #1d55bd;
  --huat-brand-active: #184aa6;
  --huat-brand-soft:   #eef3ff;    /* 激活背景、浅色徽章 */
  --huat-brand-soft-2: #dde7ff;
  --huat-violet:       #6d5bff;
  --huat-grad: linear-gradient(120deg, #2364db 0%, #4a6cf7 55%, #7b5cff 100%);

  /* —— 状态 —— */
  --huat-ok:      #12b76a;  --huat-ok-soft:      #ecfdf3;
  --huat-bad:     #f04438;  --huat-bad-soft:     #fef3f2;
  --huat-warn:    #f79009;  --huat-warn-soft:    #fffaeb;
  --huat-info:    #2364db;  --huat-info-soft:    #eef3ff;
  --huat-muted:   #98a2b3;  --huat-muted-soft:   #f2f4f7;
  --huat-gold: #e0a100; --huat-silver: #8b96aa; --huat-bronze: #c27a43;

  /* —— 字体 —— */
  --huat-font-num: "Segoe UI", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --huat-fs-xs: 12px; --huat-fs-sm: 13px; --huat-fs-base: 14px; --huat-fs-md: 15px;
  --huat-fs-lg: 17px; --huat-fs-xl: 20px; --huat-fs-2xl: 26px; --huat-fs-3xl: 32px;

  /* —— 圆角 —— */
  --huat-r-sm: 6px; --huat-r: 10px; --huat-r-lg: 16px; --huat-r-xl: 20px; --huat-r-pill: 999px;

  /* —— 阴影 —— */
  --huat-shadow-xs: 0 1px 2px rgba(21, 26, 48, .04);
  --huat-shadow-sm: 0 2px 8px rgba(21, 26, 48, .06);
  --huat-shadow-md: 0 14px 40px rgba(21, 26, 48, .08);
  --huat-shadow-lg: 0 24px 60px rgba(21, 26, 48, .14);   /* 弹窗、下拉菜单 */
  --huat-shadow-brand: 0 6px 16px rgba(35, 100, 219, .28);
  --huat-shadow-brand-hover: 0 10px 24px rgba(35, 100, 219, .36);
  --huat-focus: 0 0 0 3px rgba(35, 100, 219, .22);

  /* —— 动效 —— */
  --huat-ease: cubic-bezier(.22, 1, .36, 1);       /* 主曲线：快出慢停 */
  --huat-spring: cubic-bezier(.34, 1.56, .64, 1);  /* 轻微回弹：按钮、小图标 */
  --huat-t-fast: 150ms; --huat-t: 250ms; --huat-t-slow: 450ms; --huat-t-enter: 600ms;

  /* —— 布局尺寸 —— */
  --huat-side-w: 248px;      /* 侧栏完整宽度 */
  --huat-rail-w: 72px;       /* 侧栏收起（图标栏）宽度 */
  --huat-top-h: 64px;        /* 顶栏高度 */
  --huat-content-max: 1360px;
  --huat-gap: 18px;          /* 卡片之间的间距 */

  /* —— 层级 —— */
  --huat-z-side: 400; --huat-z-top: 500;   /* 上游 .nav 是 500，下拉 drop 和对话框都在这之上，不要调高 */
}

/* Additional values prescribed by the component and homepage specifications. */
:root {
  --huat-line-hover: #dfe3ee;
  --huat-input-hover: #c3cadb;
  --huat-danger-line: #fecdca;
  --huat-violet-soft: #f4efff;
  --huat-top-bg: rgba(243, 244, 248, .82);
  --huat-top-scrolled: rgba(255, 255, 255, .9);
  --huat-float-bg: rgba(255, 255, 255, .95);
  --huat-dialog-overlay: rgba(21, 26, 48, .4);
  --huat-search-overlay: rgba(21, 26, 48, .35);
  --huat-loader-overlay: rgba(243, 244, 248, .7);
  --huat-tooltip-bg: #151a30;
  --huat-side-foot-bg: linear-gradient(140deg, #eef3ff, #f4efff);
  --huat-side-foot-line: #e3e8fb;
  --huat-side-foot-text: #151a30;
  --huat-side-foot-text-2: #6b7190;
  --huat-side-mark-shadow: 0 6px 16px rgba(35, 100, 219, .35);
  --huat-error-focus: 0 0 0 3px rgba(240, 68, 56, .15);
  --huat-progress-glow: 0 0 10px rgba(35, 100, 219, .5);
  --huat-white-14: rgba(255, 255, 255, .14);
  --huat-white-18: rgba(255, 255, 255, .18);
  --huat-white-20: rgba(255, 255, 255, .2);
  --huat-white-25: rgba(255, 255, 255, .25);
  --huat-white-30: rgba(255, 255, 255, .3);
  --huat-white-35: rgba(255, 255, 255, .35);
  --huat-white-85: rgba(255, 255, 255, .85);
  --huat-hero-brand: #2364db;
  --huat-hero-glow: radial-gradient(400px 200px at 85% 10%, var(--huat-white-25), transparent 60%);
  --huat-inline-code: #c4320a;
  --huat-code-keyword: #7c3aed;
  --huat-code-string: #0e9f6e;
  --huat-heat-0: #eef0f6;
  --huat-heat-1: #cfdcfb;
  --huat-heat-2: #93b1f6;
  --huat-heat-3: #4f80ec;
  --huat-heat-4: #2364db;
  --huat-gold-soft: #fffbeb;
  --huat-silver-soft: #f8fafc;
  --huat-bronze-soft: #fff7ed;
  --huat-auth-glow-1: #c9d8ff;
  --huat-auth-glow-2: #e4dcff;
  --huat-select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7190' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* html:root adds enough specificity to coexist with ui-default's dark theme. */
html:root { scroll-padding-top: calc(var(--huat-top-h) + 16px); }
html:root body {
  margin: 0;
  color: var(--huat-text);
  background: var(--huat-bg);
  font-size: var(--huat-fs-base);
  line-height: 1.6;
}
html:root #panel {
  min-width: 0;
  min-height: 100vh;
  margin-left: var(--huat-side-w);
  padding-top: var(--huat-top-h);
  background: var(--huat-bg);
}
html:root .main { min-width: 0; padding: 24px 32px 48px; }
html:root .main > .row,
html:root .main .row { max-width: var(--huat-content-max); margin-left: 0; margin-right: auto; }
html:root .columns { min-width: 0; }
html:root .nav--placeholder,
html:root .nav--shadow { display: none; }
html:root .monaco-editor .main { padding: 0; }
html:root :is(.huat-side, .huat-topbar, .huat-card, .header--mobile) { box-sizing: border-box; }
html:root :is(.huat-side, .huat-topbar, .huat-stat__icon, .huat-card__header, .huat-hero__actions) svg {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
html:root :is(.huat-side, .huat-topbar) a { text-decoration: none; }

html:root .huat-side {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: var(--huat-z-side);
  display: flex;
  flex-direction: column;
  width: var(--huat-side-w);
  padding: 18px 14px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--huat-surface);
  border-right: 1px solid var(--huat-line);
  scrollbar-width: thin;
  scrollbar-color: var(--huat-line-strong) transparent;
  transition: width 300ms var(--huat-ease);
}
html:root .huat-side::-webkit-scrollbar { width: 6px; }
html:root .huat-side::-webkit-scrollbar-track { background: transparent; box-shadow: none; }
html:root .huat-side::-webkit-scrollbar-thumb { background: var(--huat-line-strong); border-radius: var(--huat-r-pill); box-shadow: none; }
html:root .huat-side__brand {
  display: flex;
  flex: none;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 4px 10px 18px;
  color: var(--huat-text);
}
html:root .huat-side__mark {
  display: inline-flex;
  flex: 0 0 34px;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border-radius: var(--huat-r);
  background: var(--huat-grad);
  color: var(--huat-text-inverse);
  box-shadow: var(--huat-side-mark-shadow);
  font-style: normal;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  transition: transform 300ms var(--huat-spring);
}
html:root .huat-side__mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
html:root :is(.huat-side__brand, .huat-topbar__brand):hover .huat-side__mark { transform: rotate(-8deg) scale(1.06); }
html:root .huat-side__brandtext { font-size: 16px; font-weight: 800; line-height: 1.3; white-space: nowrap; }
html:root .huat-side__brandtext small { display: block; margin-top: 2px; color: var(--huat-text-3); font-size: 11px; font-weight: 500; }
html:root .huat-side__nav { position: relative; flex: 1 0 auto; padding-bottom: 20px; }
html:root .huat-side__group { position: relative; }
html:root .huat-side__group[hidden] { display: none; }
@supports selector(:has(*)) {
  html:root .huat-side__group:has(> .huat-side__list:empty) { display: none; }
}
html:root .huat-side__heading { margin: 16px 12px 6px; color: var(--huat-text-3); font-size: 11px; font-weight: 600; letter-spacing: .12em; line-height: 1.6; }
html:root .huat-side__list { margin: 0; padding: 0; list-style: none; }
html:root .huat-side__item { position: relative; margin: 0 0 2px; }
html:root .huat-side__link {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: var(--huat-r);
  color: var(--huat-text-2);
  font-size: var(--huat-fs-base);
  font-weight: 500;
  white-space: nowrap;
  transition: color 200ms, background var(--huat-t-fast);
}
html:root .huat-side__link:hover,
html:root .huat-side__link.is-active { color: var(--huat-text); }
html:root .huat-side__link.is-active { background: var(--huat-brand-soft); font-weight: 600; }
html:root .huat-side__link.is-active svg { color: var(--huat-brand); }
html:root .huat-side__link.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: calc(50% - 9px);
  width: 3px;
  height: 18px;
  border-radius: var(--huat-r-sm);
  background: var(--huat-brand);
}
html:root.huat-pill-ready .huat-side__link.is-active { background: transparent; }
html:root.nojs .huat-side__link.is-active { background: var(--huat-brand-soft); }
html:root .huat-side__pill {
  position: absolute;
  z-index: 0;
  top: 0;
  left: 0;
  border-radius: var(--huat-r);
  background: var(--huat-brand-soft);
  pointer-events: none;
  transition: transform var(--huat-t-slow) var(--huat-ease), height var(--huat-t);
}
html:root .huat-side__badge { margin-left: auto; padding: 1px 7px; border-radius: var(--huat-r-pill); background: var(--huat-bad-soft); color: var(--huat-bad); font-style: normal; font-size: var(--huat-fs-xs); font-weight: 700; }
html:root .huat-side__foot { flex: none; margin-top: auto; padding: 14px; border: 1px solid var(--huat-side-foot-line); border-radius: var(--huat-r-lg); background: var(--huat-side-foot-bg); color: var(--huat-side-foot-text); }
html:root .huat-side__foot > b { display: block; font-size: 13.5px; font-weight: 700; }
html:root .huat-side__foot p { margin: 4px 0 12px; color: var(--huat-side-foot-text-2); font-size: 12.5px; line-height: 1.7; }
html:root .huat-side__login { display: block; margin-top: 8px; padding: 4px; border-radius: var(--huat-r); color: var(--huat-brand); font-size: var(--huat-fs-sm); font-weight: 500; text-align: center; }
html:root .huat-side__login:hover { color: var(--huat-brand-hover); text-decoration: underline; }
html:root .huat-side__login:focus-visible { outline: 0; box-shadow: var(--huat-focus); }
html:root .huat-side__me { display: flex; align-items: center; gap: 8px; color: var(--huat-side-foot-text); border-radius: var(--huat-r); }
html:root .huat-side__me > span { min-width: 0; }
html:root .huat-side__me b { display: block; overflow: hidden; text-overflow: ellipsis; font-size: var(--huat-fs-base); font-weight: 600; }
html:root .huat-side__me small { display: block; margin-top: 4px; color: var(--huat-side-foot-text-2); font-size: var(--huat-fs-xs); line-height: 1.6; }
html:root .huat-avatar { display: inline-block; flex: none; border-radius: 50%; object-fit: cover; vertical-align: middle; }

html:root .nav.huat-topbar {
  position: fixed;
  top: 0;
  left: var(--huat-side-w);
  right: 0;
  z-index: var(--huat-z-top);
  display: flex;
  align-items: center;
  gap: 14px;
  width: auto;
  height: var(--huat-top-h);
  min-height: var(--huat-top-h);
  padding: 0 32px;
  border: 0;
  border-bottom: 0;
  background: var(--huat-top-bg);
  box-shadow: none;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: background var(--huat-t), border-color var(--huat-t);
}
html:root .nav.huat-topbar.is-scrolled { background: var(--huat-top-scrolled); box-shadow: inset 0 -1px 0 var(--huat-line); }
html:root .huat-topbar__brand { display: none; align-items: center; gap: 10px; color: var(--huat-text); font-size: 16px; font-weight: 800; white-space: nowrap; }
html:root .huat-topbar__title { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--huat-text-2); font-size: var(--huat-fs-sm); white-space: nowrap; }
html:root .huat-topbar__title b { color: var(--huat-text); font-weight: 600; }
html:root .huat-search {
  display: flex;
  flex: 0 1 340px;
  align-items: center;
  gap: 10px;
  width: 340px;
  height: 40px;
  margin-left: auto;
  padding: 0 12px;
  border: 1px solid var(--huat-line);
  border-radius: var(--huat-r);
  background: var(--huat-surface);
  color: var(--huat-text-3);
  font-size: var(--huat-fs-sm);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: width var(--huat-t-slow) var(--huat-ease), flex-basis var(--huat-t-slow) var(--huat-ease), border-color var(--huat-t-fast), box-shadow var(--huat-t-fast);
}
html:root .huat-search:hover { width: 380px; flex-basis: 380px; border-color: var(--huat-line-strong); }
html:root .huat-search svg { width: 16px; height: 16px; }
html:root .huat-search > span { overflow: hidden; text-overflow: ellipsis; }
html:root .huat-search kbd { margin-left: auto; padding: 3px 6px; border: 1px solid var(--huat-line); border-radius: var(--huat-r-sm); background: var(--huat-surface-2); color: var(--huat-text-2); font-size: 11px; font-weight: 400; line-height: 1; }
html:root .huat-topbar__actions { display: flex; flex: none; align-items: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
html:root .huat-topbar__actions .nav__list-item { display: block; float: none; margin: 0; }
html:root .huat-topbar .nav__item { display: inline-flex; align-items: center; gap: 8px; width: auto; height: 38px; padding: 0 12px; border: 1px solid transparent; border-radius: var(--huat-r); background: transparent; color: var(--huat-text-2); font-size: var(--huat-fs-base); line-height: 1; }
html:root .huat-topbar .nav__item:hover { border-color: var(--huat-line); background: var(--huat-surface); color: var(--huat-text); }
html:root .huat-topbar .huat-topbar__login { font-weight: 500; }
html:root .huat-topbar .nav__item--round { margin: 0; }
html:root .huat-user-chip { max-width: 200px; border-radius: var(--huat-r-pill); font-weight: 600; }
html:root .huat-user-chip .huat-avatar { width: 28px; height: 28px; }
html:root .huat-user-chip > span:not(.icon) { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html:root .huat-icon-btn { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0; border: 1px solid var(--huat-line); border-radius: var(--huat-r); background: var(--huat-surface); color: var(--huat-text-2); transition: background var(--huat-t-fast), border-color var(--huat-t-fast), transform var(--huat-t) var(--huat-spring); }
html:root .huat-icon-btn:hover { color: var(--huat-brand); border-color: var(--huat-line-strong); }
html:root .huat-icon-btn:active { transform: scale(.97); }
html:root :is(.huat-side__link, .huat-side__brand, .huat-side__me, .huat-topbar a, .huat-search, .huat-icon-btn):focus-visible { outline: 0; box-shadow: var(--huat-focus); }

/* Cards, controls and dense tables retain Hydro's DOM and behavior. */
html:root .section {
  margin-bottom: var(--huat-gap);
  overflow: hidden;
  border: 1px solid var(--huat-line);
  border-radius: var(--huat-r-lg);
  background: var(--huat-surface);
  color: var(--huat-text);
  box-shadow: var(--huat-shadow-xs);
  transition: box-shadow var(--huat-t-slow) var(--huat-ease), border-color var(--huat-t);
}
html:root .section:hover { border-color: var(--huat-line-hover); box-shadow: var(--huat-shadow-md); }
html:root .section.side { font-size: 13.5px; }
html:root .section__header { padding: 18px 20px 0; }
html:root .section__header:last-child { padding-bottom: 18px; }
html:root .section__title,
html:root .section__header .section__title { margin: 0; color: var(--huat-text); font-size: var(--huat-fs-md); font-weight: 700; line-height: 1.4; }
html:root .section__body { padding: 12px 20px 20px; }
html:root .section > .section__body:first-child { padding-top: 20px; }
html:root .section > .section__body:last-child { padding-bottom: 20px; }
html:root .section__body.no-padding,
html:root .section__header + .section__body.no-padding:last-child { padding: 0 !important; }
html:root .section__footer { padding: 14px 20px; border-top: 1px solid var(--huat-line-2); background: var(--huat-surface-2); }
html:root .section__tools { top: 18px; right: 20px; }
html:root .section__tools .tool-button { min-height: 30px; padding: 0 8px; border-radius: var(--huat-r); color: var(--huat-text-2); font-size: var(--huat-fs-sm); transition: color var(--huat-t-fast), background var(--huat-t-fast); }
html:root .section__tools .tool-button:hover { background: var(--huat-surface-2); color: var(--huat-brand); }
html:root .section__list__item { padding: 16px 20px; border-bottom: 1px solid var(--huat-line-2); transition: background 200ms; }
html:root .section__list__item:last-child { border-bottom: 0; }
html:root .section__list__item:hover { background: var(--huat-surface-hover); }

html:root .button:not(.codicon),
html:root .huat-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-sizing: border-box;
  max-width: 100%;
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--huat-line);
  border-radius: var(--huat-r);
  background: var(--huat-surface);
  color: var(--huat-text);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform var(--huat-t) var(--huat-spring), background var(--huat-t-fast), border-color var(--huat-t-fast), box-shadow var(--huat-t);
}
html:root .button:not(.codicon) { margin: 0 0 12px; }
html:root .huat-btn { margin: 0; }
html:root .button:not(.codicon):visited,
html:root .typo .button:not(.codicon),
html:root .typo .button:not(.codicon):visited,
html:root .huat-btn:visited { color: var(--huat-text); }
html:root .button:not(.codicon):not(:disabled):not(.disabled):is(:hover, :focus),
html:root .typo .button:not(.codicon):not(:disabled):not(.disabled):hover,
html:root .huat-btn:not(:disabled):not(.disabled):hover { border-color: var(--huat-line-strong); background: var(--huat-surface-2); color: var(--huat-text); box-shadow: none; text-decoration: none; }
html:root :is(.button:not(.codicon), .huat-btn):not(:disabled):not(.disabled):active { transform: scale(.97); }
html:root :is(.button:not(.codicon), .huat-btn):focus-visible { outline: 0; box-shadow: var(--huat-focus); }
html:root .button:not(.codicon).rounded { border-radius: var(--huat-r); }
html:root .button:not(.codicon):is(.primary, .inverse),
html:root .typo .button:not(.codicon):is(.primary, .inverse),
html:root .button:not(.codicon):is(.primary, .inverse):visited,
html:root .huat-btn--primary,
html:root .huat-btn--primary:visited { overflow: hidden; border-color: var(--huat-brand); background: var(--huat-brand); color: var(--huat-text-inverse); box-shadow: var(--huat-shadow-brand); }
html:root .button:not(.codicon):is(.primary, .inverse):not(:disabled):not(.disabled):is(:hover, :focus),
html:root .typo .button:not(.codicon):is(.primary, .inverse):not(:disabled):not(.disabled):hover,
html:root .huat-btn--primary:not(:disabled):not(.disabled):hover { transform: translateY(-1px); border-color: var(--huat-brand-hover); background: var(--huat-brand-hover); color: var(--huat-text-inverse); box-shadow: var(--huat-shadow-brand-hover); }
html:root .button:not(.codicon):is(.primary, .inverse):not(:disabled):not(.disabled):active,
html:root .huat-btn--primary:not(:disabled):not(.disabled):active { transform: scale(.97); border-color: var(--huat-brand-active); background: var(--huat-brand-active); }
html:root .button:not(.codicon).expanded,
html:root .huat-btn--block { width: 100%; height: 42px; font-size: var(--huat-fs-md); }
html:root .button:not(.codicon).compact,
html:root .section__tools .button:not(.codicon) { height: 30px; margin-bottom: 0; padding: 0 12px; font-size: var(--huat-fs-sm); }
html:root .huat-btn--ghost { border-color: var(--huat-white-30); background: var(--huat-white-14); color: var(--huat-text-inverse); }
html:root .huat-btn--ghost:visited,
html:root .huat-btn--ghost:not(:disabled):not(.disabled):hover { border-color: var(--huat-white-35); background: var(--huat-white-20); color: var(--huat-text-inverse); }
html:root .button:not(.codicon):is([name*="delete"], [value*="delete"], .text-red) { border-color: var(--huat-line); background: var(--huat-surface); color: var(--huat-bad); box-shadow: none; }
html:root .button:not(.codicon):is([name*="delete"], [value*="delete"], .text-red):not(:disabled):not(.disabled):hover { transform: none; border-color: var(--huat-danger-line); background: var(--huat-bad-soft); color: var(--huat-bad); box-shadow: none; }
html:root :is(.button:not(.codicon), .huat-btn):is(:disabled, .disabled, [aria-disabled="true"]) { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
html:root .huat-ripple { position: absolute; border-radius: 50%; background: var(--huat-white-35); pointer-events: none; animation: huat-ripple var(--huat-t-enter) var(--huat-ease) forwards; }
html:root .button:not(.codicon):not(:disabled):not(.disabled):focus-visible,
html:root .button:not(.codicon):is(.primary, .inverse):not(:disabled):not(.disabled):focus-visible,
html:root .typo .button:not(.codicon):is(.primary, .inverse):not(:disabled):not(.disabled):focus-visible,
html:root .huat-btn:not(:disabled):not(.disabled):focus-visible,
html:root .huat-btn--primary:not(:disabled):not(.disabled):focus-visible { outline: 0; box-shadow: var(--huat-focus); transform: none; }

html:root a.link,
html:root .typo-a { color: var(--huat-brand); }
html:root a.link:hover,
html:root .typo-a:hover { text-decoration: underline; }
html:root label:not(.quick-input-list-label):not(.checkbox):not(.radiobox) { color: var(--huat-text); font-size: var(--huat-fs-sm); font-weight: 600; }
html:root input.textbox,
html:root textarea.textbox,
html:root span.textbox,
html:root select.select,
html:root label.textbox.material input {
  box-sizing: border-box;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--huat-line-strong);
  border-radius: var(--huat-r);
  outline: 0;
  background-color: var(--huat-surface);
  color: var(--huat-text);
  font-size: var(--huat-fs-base);
  font-weight: 400;
  transition: border-color var(--huat-t-fast), box-shadow var(--huat-t-fast), background var(--huat-t-fast);
}
html:root textarea.textbox { height: 200px; min-height: 100px; padding: 10px 12px; line-height: 1.6; }
html:root :is(input.textbox, textarea.textbox, label.textbox.material input)::placeholder { color: var(--huat-text-3); opacity: 1; }
html:root :is(input.textbox, textarea.textbox, select.select, label.textbox.material input):enabled:read-write:hover { border-color: var(--huat-input-hover); }
html:root select.select:enabled:hover { border-color: var(--huat-input-hover); }
html:root :is(input.textbox, textarea.textbox, select.select, label.textbox.material input):focus { border-color: var(--huat-brand); outline: 0; box-shadow: var(--huat-focus); }
html:root :is(input.textbox, textarea.textbox, select.select, label.textbox.material input):disabled,
html:root :is(input.textbox, textarea.textbox, label.textbox.material input):read-only { background-color: var(--huat-surface-2); color: var(--huat-text-2); }
html:root .textbox.error,
html:root .select.error,
html:root label.textbox.error input,
html:root .form__item.error .textbox { border-color: var(--huat-bad); box-shadow: var(--huat-error-focus); }
html:root .help-text { margin: 6px 0 12px; color: var(--huat-text-2); font-size: 12.5px; font-weight: 400; }
html:root .help-text.error,
html:root .error > .help-text { color: var(--huat-bad); }
html:root label.textbox.material { display: block; margin-bottom: 16px; padding: 0; border: 0; background: none; color: var(--huat-text); font-size: var(--huat-fs-xs); font-weight: 600; }
html:root label.textbox.material input { width: 100%; height: 44px; margin-top: 6px; }
html:root label.textbox.material.focus { color: var(--huat-brand); }
html:root input.textbox.compact,
html:root select.select.compact,
html:root .select-container.compact .select { height: 30px; margin-bottom: 0; }
html:root select.select { appearance: none; -webkit-appearance: none; padding-right: 32px; background-image: var(--huat-select-arrow); background-size: 14px 14px; background-position: right 12px center; background-origin: border-box; background-repeat: no-repeat; }
html:root .checkbox { color: var(--huat-text) !important; font-size: var(--huat-fs-base) !important; line-height: 1.6 !important; }
html:root label.checkbox.inverse { color: var(--huat-text) !important; }
html:root .radiobox { color: var(--huat-text); font-size: var(--huat-fs-base); }
html:root .checkbox input,
html:root .radiobox input { display: inline-block; width: 16px; height: 16px; accent-color: var(--huat-brand); vertical-align: middle; cursor: pointer; }
html:root .checkbox input { appearance: auto; -webkit-appearance: checkbox; border: 0; background: initial; margin: 2px 8px 2px 0 !important; }
html:root .checkbox input::after { display: none; }
html:root .radiobox input { margin-right: 8px; }
html:root :is(.checkbox, .radiobox) input:focus-visible { outline: 2px solid var(--huat-brand); outline-offset: 2px; }
html:root :is(.checkbox, .radiobox) input:disabled { cursor: not-allowed; }
html:root .radiobox__image-container { border-color: var(--huat-line-strong); border-radius: var(--huat-r); }
html:root .radiobox.with-image input:checked + .radiobox__image-container { border-color: var(--huat-brand); }
html:root :is(input.textbox, textarea.textbox, label.textbox.material input):enabled:read-write:focus { border-color: var(--huat-brand); outline: 0; box-shadow: var(--huat-focus); }
html:root select.select:enabled:focus { border-color: var(--huat-brand); outline: 0; box-shadow: var(--huat-focus); }
html:root :is(input.textbox.error, textarea.textbox.error, label.textbox.material.error input, .form__item.error input.textbox):enabled:read-write:focus,
html:root select.select.error:enabled:focus { border-color: var(--huat-bad); box-shadow: var(--huat-error-focus); }

html:root .data-table { width: 100%; border-collapse: separate; border-spacing: 0; color: var(--huat-text); font-size: var(--huat-fs-base); }
html:root .data-table tr { border: 0; }
html:root .data-table tbody tr:nth-child(even) { background: transparent; }
html:root .data-table th { padding: 10px 16px; border-bottom: 1px solid var(--huat-line); background: var(--huat-surface-2); color: var(--huat-text-3); font-size: var(--huat-fs-xs); font-weight: 600; line-height: 1.5; text-transform: none; }
html:root .data-table td { padding: 12px 16px; border-top: 1px solid var(--huat-line-2); vertical-align: middle; line-height: 1.5; transition: background var(--huat-t-fast); }
html:root .data-table tbody > tr:first-child > td { border-top: 0; }
html:root .data-table tbody tr:hover,
html:root .data-table.is--full-row tr:hover { background: var(--huat-surface-hover); }
html:root .data-table tr.highlight { background: var(--huat-brand-soft); }
html:root :is(.section__body, .section__table-container) > .data-table :is(td, th):first-child { padding-left: 16px; }
html:root :is(.section__body, .section__table-container) > .data-table :is(td, th):last-child { padding-right: 16px; }
html:root .section__table-container { overflow-x: auto; }
html:root .section__table-header { background: var(--huat-float-bg); box-shadow: var(--huat-shadow-sm); }
html:root .data-table .col--pid { color: var(--huat-brand); font-size: var(--huat-fs-sm); font-weight: 700; }
html:root .data-table .col--rank { font-family: var(--huat-font-num); font-weight: 700; font-variant-numeric: tabular-nums; }
html:root .data-table :is(.col--rp, .col--ac, .col--time, .col--memory, .col--difficulty, .col--score, .col--total_score) { font-family: var(--huat-font-num); font-variant-numeric: tabular-nums; text-align: right; }
html:root .data-table .empty-row { color: var(--huat-text-2); }
html:root time.relative { color: var(--huat-text-2); font-size: var(--huat-fs-sm); }
html:root .huat-diff--easy,
html:root .huat-score--full { color: var(--huat-ok); font-weight: 600; }
html:root .huat-diff--mid,
html:root .huat-score--partial { color: var(--huat-warn); font-weight: 600; }
html:root .huat-diff--hard,
html:root .huat-score--zero { color: var(--huat-bad); font-weight: 600; }

html:root .pager { margin: 16px 0; padding: 0; border: 0; text-align: center; font-size: var(--huat-fs-sm); }
html:root .pager:is(.pager-top, .pager-bottom) { margin: 16px 0; border: 0; }
html:root .pager li { margin: 0 2px; }
html:root .pager .pager__item { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 8px; border: 0; border-radius: var(--huat-r); color: var(--huat-text-2); font-size: var(--huat-fs-sm); font-weight: 600; transition: background var(--huat-t-fast), color var(--huat-t-fast); }
html:root .pager .pager__item.link { color: var(--huat-text-2); }
html:root .pager .pager__item.link:hover { border: 0; background: var(--huat-surface-2); color: var(--huat-text); text-decoration: none; }
html:root .pager .pager__item.current { border-color: var(--huat-brand) !important; background: var(--huat-brand); color: var(--huat-text-inverse) !important; box-shadow: var(--huat-shadow-brand); }
html:root .pager .pager__item:focus-visible { outline: 0; box-shadow: var(--huat-focus); }

html:root .menu { padding: 6px; color: var(--huat-text); font-size: var(--huat-fs-base); }
html:root :is(.drop-element .menu, .dropdown-target.menu, .drop.nav__dropdown .menu) { min-width: 200px; border: 1px solid var(--huat-line); border-radius: var(--huat-r-lg); background: var(--huat-surface); box-shadow: var(--huat-shadow-lg); }
html:root .drop-element { transition: opacity 200ms var(--huat-ease); }
html:root .drop-element.drop-open .drop-content { animation: huat-drop-in 200ms var(--huat-ease); }
html:root .drop-element::before,
html:root .drop-element::after { display: none; }
html:root .menu__link { display: flex; align-items: center; min-height: 36px; padding: 8px 12px; border: 0; border-left: 3px solid transparent; border-radius: var(--huat-r); background: transparent; color: var(--huat-text); font-size: var(--huat-fs-base); line-height: 1.4; text-decoration: none; transition: color var(--huat-t-fast), background var(--huat-t-fast); }
html:root .menu__link .icon { flex: none; margin-right: 10px; color: var(--huat-text-2); font-size: 16px; }
html:root :is(a, button).menu__link:not(.disabled):hover { border-color: transparent; background: var(--huat-surface-2); color: var(--huat-text); }
html:root :is(a, button).menu__link.active,
html:root :is(a, button).menu__link.active:hover { border-color: var(--huat-brand); background: var(--huat-brand-soft); color: var(--huat-brand); font-weight: 600; }
html:root .menu__link.active .icon { color: var(--huat-brand); }
html:root .menu__link.disabled { cursor: not-allowed; opacity: .5; }
html:root .menu__link:focus-visible { outline: 0; box-shadow: inset var(--huat-focus); }
html:root .menu__seperator { height: 1px; margin: 6px 0; border-top: 1px solid var(--huat-line-2); }
html:root .section.side .menu__link { min-height: 38px; }
html:root .menu__item .menu .menu__link { padding-left: 24px; }

html:root .section__tab-header-wrapper { border-bottom: 1px solid var(--huat-line); }
html:root .section__tab-header { position: relative; padding: 0 20px 20px; }
html:root .section__tab-header-item,
html:root .section__tab-container:is(.immersive, :not(.immersive)) .section__tab-header-item { height: 44px; margin-right: 24px; padding: 0; border-top: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--huat-text-2); box-shadow: none; font-size: var(--huat-fs-base); font-weight: 500; line-height: 42px; transition: color var(--huat-t-fast); }
html:root .section__tab-container .section__tab-header-item:hover { border-top: 0; border-bottom-color: transparent; background: transparent; color: var(--huat-text); }
html:root .section__tab-container .section__tab-header-item:is(.selected, .tab--active) { border-top: 0; border-bottom-color: var(--huat-brand); background: transparent; color: var(--huat-text); box-shadow: none; font-weight: 600; }
html:root .section__tab-container .section__tab-header-item.selected::after { display: none; }
html:root .section__tab-title { color: var(--huat-text); font-size: var(--huat-fs-md); font-weight: 600; }
html:root .huat-tab-indicator { position: absolute; left: 0; bottom: 20px; height: 2px; border-radius: var(--huat-r-pill); background: var(--huat-brand); pointer-events: none; transition: transform 300ms var(--huat-ease), width 300ms var(--huat-ease); }
html:root .huat-tabs-ready .section__tab-header-item:is(.selected, .tab--active) { border-bottom-color: transparent; }
html:root.nojs .section__tab-item { border-bottom-color: var(--huat-line); }

html:root .dialog { background: var(--huat-dialog-overlay); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
html:root .dialog__content,
html:root .dialog.withBg .dialog__content { box-sizing: border-box; width: 560px; min-width: 0; max-width: 92vw; padding: 24px; border: 1px solid var(--huat-line); border-radius: var(--huat-r-xl); background: var(--huat-surface); color: var(--huat-text); box-shadow: var(--huat-shadow-lg); animation: huat-dialog-in 350ms var(--huat-spring); }
html:root .dialog__body h1 { margin-bottom: 16px; color: var(--huat-text); font-size: 18px; font-weight: 700; }
html:root .dialog__action { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 20px; }
html:root .dialog__action .button:not(.codicon) { margin: 0; }
html:root .dialog--signin .dialog__content { display: flex; align-items: stretch; width: 760px; min-height: 420px; padding: 0; overflow: hidden; }
html:root .dialog--signin__bg { inset: 0; z-index: 0; border-radius: inherit; background: var(--huat-grad); box-shadow: none; }
html:root .dialog--signin__side { position: relative; top: auto; right: auto; z-index: 1; order: 0; display: flex; flex: 0 0 300px; flex-direction: column; justify-content: center; box-sizing: border-box; width: 300px; padding: 32px; background: var(--huat-hero-glow), var(--huat-grad); color: var(--huat-white-85); transform: none; }
html:root .dialog--signin__side h1 { color: var(--huat-text-inverse); font-size: var(--huat-fs-xl); font-weight: 700; }
html:root .dialog--signin__side p { margin: 12px 0 20px; color: var(--huat-white-85); font-size: var(--huat-fs-base); line-height: 1.75; }
html:root .dialog--signin__main { position: relative; z-index: 2; order: 1; flex: 1 1 0; box-sizing: border-box; width: auto; min-width: 0; margin: 0; padding: 32px; border-radius: 0; background: var(--huat-surface); box-shadow: none; }
html:root .dialog--signin .dialog--signin__main:first-child { margin-right: 0; }
html:root .dialog--signin__title { margin: 0 0 6px; color: var(--huat-text); font-size: 22px; font-weight: 700; }
html:root .dialog--signin__note { margin: 4px 0 24px; color: var(--huat-text-2); font-size: var(--huat-fs-sm); }
html:root .dialog--signin__side .button:not(.codicon).inverse,
html:root .dialog--signin__side .button:not(.codicon).inverse:is(:visited, :hover, :focus) { border-color: var(--huat-text-inverse); background: var(--huat-text-inverse); color: var(--huat-hero-brand); box-shadow: var(--huat-shadow-sm); }
html:root .dialog--signin__main .supplementary { margin-top: 12px; color: var(--huat-text-2); font-size: var(--huat-fs-sm); text-align: center; }
html:root .dialog--signin__main .supplementary a { color: var(--huat-text-2); }
html:root .dialog--signin__main .supplementary a:hover { color: var(--huat-brand); }
html:root .dialog--signin__close-container { top: 12px; right: 12px; z-index: 3; }
html:root [name="dialog--signin__close"] { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; overflow: hidden; border: 1px solid transparent; border-radius: var(--huat-r-pill); background: var(--huat-surface-2); color: var(--huat-text-2); font-size: 0; text-decoration: none; }
html:root [name="dialog--signin__close"]::before { content: "×"; font-size: 22px; line-height: 1; }
html:root [name="dialog--signin__close"]:hover { border-color: var(--huat-line); color: var(--huat-text); }

html:root :is(.typo blockquote, .main > .row.typo > blockquote, .hint) { margin: 12px 0; padding: 12px 16px; border: 0; border-left: 3px solid var(--huat-info); border-radius: var(--huat-r); background: var(--huat-info-soft); color: var(--huat-text); font-size: var(--huat-fs-base); line-height: 1.75; }
html:root .typo blockquote:is(.warn, .warning, .yellow) { border-left-color: var(--huat-warn); background: var(--huat-warn-soft); }
html:root .typo blockquote:is(.error, .fail, .red) { border-left-color: var(--huat-bad); background: var(--huat-bad-soft); }
html:root .typo blockquote:is(.success, .pass, .green) { border-left-color: var(--huat-ok); background: var(--huat-ok-soft); }
html:root .typo blockquote > :first-child { margin-top: 0; }
html:root .typo blockquote > :last-child { margin-bottom: 0; }
html:root .notification { border: 1px solid var(--huat-line); border-left: 3px solid var(--huat-info); border-radius: var(--huat-r); background: var(--huat-surface); color: var(--huat-text); box-shadow: var(--huat-shadow-lg); }
html:root .notification:is(.success, .pass) { border-left-color: var(--huat-ok); }
html:root .notification:is(.error, .fail) { border-left-color: var(--huat-bad); }
html:root .notification:is(.warning, .warn) { border-left-color: var(--huat-warn); }
html:root .notification-content { color: var(--huat-text); font-size: var(--huat-fs-base); }
html:root .tooltip,
html:root .tooltip .drop-content { border-radius: var(--huat-r-sm); background: var(--huat-tooltip-bg); color: var(--huat-text-inverse); box-shadow: var(--huat-shadow-sm); font-size: var(--huat-fs-xs); }
html:root .tooltip .drop-content { padding: 5px 9px; }
html:root .tooltip .drop-content::before { display: none; }
html:root #nprogress .bar { height: 2px; background: var(--huat-grad); }
html:root #nprogress .peg { box-shadow: var(--huat-progress-glow); }
html:root #nprogress .spinner { display: none; }
html:root .loader { border-color: var(--huat-brand-soft); border-left-color: var(--huat-brand); color: var(--huat-brand); }
html:root .page-loader { background: var(--huat-loader-overlay); }
html:root .nothing-placeholder { padding: 48px 0; color: var(--huat-text-2); font-size: var(--huat-fs-base); text-align: center; animation: huat-empty-in 400ms var(--huat-ease); }
html:root .nothing-icon { max-width: 120px; max-height: 120px; opacity: .8; }
html:root .nothing-placeholder p { color: var(--huat-text-2); }

html:root .user-profile-avatar { width: 32px; height: 32px; object-fit: cover; box-shadow: 0 0 0 2px var(--huat-surface); }
html:root .user-profile-avatar.small,
html:root .user-profile-link.small .user-profile-avatar { width: 20px; height: 20px; }
html:root .user-profile-avatar.large { width: 64px; height: 64px; }
html:root .user-profile-name { font-size: var(--huat-fs-base); font-weight: 500; }
html:root .user-profile-name:not([class*="uname--lv"]) { color: var(--huat-text); }
html:root .user-profile-name:hover { color: var(--huat-brand); }
/* ui-default uses !important for badge size, padding and semantic colors. */
html:root .user-profile-badge { border-radius: var(--huat-r-pill); font-size: 11px !important; font-weight: 700; padding: 1px 6px !important; line-height: 1.6 !important; }
html:root .user-profile-badge.badge--su,
html:root .profile-header__contact-item.badge--su { background-color: var(--huat-bad-soft) !important; color: var(--huat-bad) !important; }

html:root :is(.record-status--text, .record-status--icon, .record-status--border, .record-status--background).pass { --huat-status: var(--huat-ok); --huat-status-soft: var(--huat-ok-soft); }
html:root :is(.record-status--text, .record-status--icon, .record-status--border, .record-status--background).fail { --huat-status: var(--huat-bad); --huat-status-soft: var(--huat-bad-soft); }
html:root :is(.record-status--text, .record-status--icon, .record-status--border, .record-status--background).progress { --huat-status: var(--huat-warn); --huat-status-soft: var(--huat-warn-soft); }
html:root :is(.record-status--text, .record-status--icon, .record-status--border, .record-status--background):is(.ignored, .pending) { --huat-status: var(--huat-muted); --huat-status-soft: var(--huat-muted-soft); }
html:root .record-status--text:is(.pass, .fail, .progress, .ignored, .pending) { color: var(--huat-status) !important; font-weight: 600; }
html:root .record-status--icon,
html:root .record-status--icon::before { color: var(--huat-status, var(--huat-muted)); }
html:root .record-status--icon.progress { animation: huat-spin 1s linear infinite; }
html:root .record-status--border { border-left: 3px solid var(--huat-status, transparent); }
html:root .data-table tr.record-status--border > td:first-child { border-left: 3px solid var(--huat-status, transparent); }
html:root .record-status--background { background-color: var(--huat-status-soft, var(--huat-muted-soft)); color: var(--huat-status, var(--huat-muted)); }
html:root .huat-flash,
html:root .huat-flash > td { animation: huat-record-flash 1200ms var(--huat-ease); }
html:root .huat-fade-in { animation: huat-content-in 200ms var(--huat-ease); }

html:root .problem__tags { gap: 4px; }
html:root .problem__tag { height: auto; }
html:root .problem__tag-item,
html:root .problem__tag-link,
html:root .widget--category-filter__tag,
html:root .search-tag__item,
html:root .discussion-node-tag { display: inline-flex; align-items: center; min-height: 24px; height: auto; padding: 2px 10px; border: 1px solid var(--huat-line); border-radius: var(--huat-r-pill); background: var(--huat-surface-2); color: var(--huat-text-2); font-size: 12.5px; font-weight: 500; line-height: 1.5; vertical-align: middle; transition: transform 200ms var(--huat-spring), background 200ms, color 200ms, border-color 200ms; }
html:root .problem__tag-item { min-width: 0; margin-left: 0; margin-bottom: 0; padding: 2px 10px !important; line-height: 1.5 !important; }
html:root .problem__tag-link { color: var(--huat-text-2) !important; }
html:root :is(.problem__tag-item, .problem__tag-link, .widget--category-filter__tag, .search-tag__item, .discussion-node-tag):hover,
html:root .problem__tag-item.interactive:hover { transform: translateY(-1px); border-color: var(--huat-brand-soft-2); background: var(--huat-brand-soft); color: var(--huat-brand); text-decoration: none; }
html:root .problem__tag-link:hover,
html:root .discussion-node-tag:hover { color: var(--huat-brand) !important; }
html:root .widget--category-filter__tag.selected { border-color: var(--huat-brand-soft-2); background: var(--huat-brand-soft); color: var(--huat-brand); }
html:root .search-tag__item.selected { background: var(--huat-brand) !important; color: var(--huat-text-inverse); }
html:root .chip-list__item { display: inline-block; margin: 0 4px 8px 0; }
html:root .chip-list__item a,
html:root .huat-chips a { display: inline-flex; align-items: center; padding: 5px 12px; border: 1px solid var(--huat-line); border-radius: var(--huat-r-pill); background: var(--huat-surface-2); color: var(--huat-text-2); font-size: 12.5px; line-height: 1.5; text-decoration: none; transition: transform var(--huat-t) var(--huat-spring), background var(--huat-t-fast), color var(--huat-t-fast); }
html:root .chip-list__item a:hover,
html:root .huat-chips a:hover { transform: translateY(-2px); border-color: var(--huat-brand); background: var(--huat-brand); color: var(--huat-text-inverse); text-decoration: none; }

html:root .typo,
html:root .richmedia { color: var(--huat-text); }
html:root :is(.typo, .richmedia) :is(p, li) { color: var(--huat-text); font-size: var(--huat-fs-md); line-height: 1.75; }
html:root :is(.typo, .richmedia) p { margin: 0 0 12px; }
html:root :is(.typo, .richmedia) h1 { margin: 28px 0 12px; color: var(--huat-text); font-size: 22px; font-weight: 700; line-height: 1.4; }
html:root :is(.typo, .richmedia) h2 { margin: 24px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--huat-line-2); color: var(--huat-text); font-size: 18px; font-weight: 700; line-height: 1.5; }
html:root :is(.typo, .richmedia) h3 { margin: 20px 0 12px; color: var(--huat-text); font-size: 16px; font-weight: 700; line-height: 1.5; }
html:root .typo a:not(.user-profile-name):not(.media-link):not(.button),
html:root .typo a:visited:not(.user-profile-name):not(.media-link):not(.button),
html:root .richmedia a:not(.user-profile-name):not(.media-link):not(.button) { color: var(--huat-brand); }
html:root :is(.typo, .richmedia) a:hover:not(.user-profile-name):not(.media-link):not(.button) { color: var(--huat-brand); text-decoration: underline; }
html:root :is(.typo, .richmedia) :not(pre) > code { padding: 1px 6px; border: 1px solid var(--huat-line); border-radius: var(--huat-r-sm); background: var(--huat-surface-2); color: var(--huat-inline-code); font-family: var(--code-font-family); font-size: var(--huat-fs-sm); }
html:root pre,
html:root pre[class*="language-"],
html:root :is(.typo, .richmedia) pre { margin: 12px 0; padding: 14px 16px; overflow-x: auto; border: 1px solid var(--huat-line); border-radius: var(--huat-r); background: var(--huat-surface-2); color: var(--huat-text); font-family: var(--code-font-family); font-size: 13.5px; line-height: 1.7; text-shadow: none; }
html:root pre > code,
html:root code[class*="language-"] { padding: 0; border: 0; background: transparent; color: var(--huat-text); font-family: var(--code-font-family); font-size: inherit; line-height: inherit; white-space: pre; word-break: normal; overflow-wrap: normal; text-shadow: none; }
html:root :is(.typo, .richmedia) table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--huat-line); border-radius: var(--huat-r); overflow: hidden; }
html:root :is(.typo, .richmedia) table :is(th, td) { padding: 10px 16px; border: 0; border-right: 1px solid var(--huat-line); border-bottom: 1px solid var(--huat-line); }
html:root :is(.typo, .richmedia) table th { background: var(--huat-surface-2); color: var(--huat-text-2); font-size: var(--huat-fs-xs); font-weight: 600; }
html:root :is(.typo, .richmedia) table tr > :last-child { border-right: 0; }
html:root :is(.typo, .richmedia) table tbody tr:last-child > td { border-bottom: 0; }
html:root :is(.typo, .richmedia) img { max-width: 100%; height: auto; border-radius: var(--huat-r); }
html:root :is(.typo, .richmedia) hr { height: 0; margin: 24px 0; border: 0; border-top: 1px solid var(--huat-line); }
html:root .token:is(.keyword, .atrule, .boolean) { color: var(--huat-code-keyword); }
html:root .token:is(.function, .class-name) { color: var(--huat-brand); }
html:root .token:is(.string, .char, .attr-value, .regex) { color: var(--huat-code-string); }
html:root .token:is(.number, .constant, .symbol) { color: var(--huat-inline-code); }
html:root .token:is(.comment, .prolog, .doctype, .cdata) { color: var(--huat-text-3); font-style: italic; }
html:root .token:is(.operator, .punctuation) { background: transparent; color: var(--huat-text-2); }
html:root :is(.monaco-editor, .CodeMirror) { border: 1px solid var(--huat-line); border-radius: var(--huat-r); }
html:root .monaco-editor .monaco-editor { border: 0; border-radius: 0; }
html:root .line-numbers-rows { border-right-color: var(--huat-line-2); }
html:root .line-numbers-rows > span::before { color: var(--huat-text-3); }
html:root .copy-button,
html:root [data-copy] { transition: opacity var(--huat-t-fast), color var(--huat-t-fast); }

html:root .omnibar { background: var(--huat-search-overlay); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
html:root .omnibar-main { top: 12vh; left: 50%; box-sizing: border-box; width: 640px; max-width: 92vw; height: min(600px, 76vh); padding: 0; overflow: hidden; border: 1px solid var(--huat-line); border-radius: var(--huat-r-lg); background: var(--huat-surface); box-shadow: var(--huat-shadow-lg); transform: translateX(-50%); animation: huat-search-in 200ms var(--huat-ease); }
html:root .omnibar-main > div:first-child { margin: 0; border-bottom: 1px solid var(--huat-line); }
html:root .omnibar-main > div:first-child input { height: 52px; padding: 0 16px 0 48px; border: 0; border-radius: var(--huat-r-lg) var(--huat-r-lg) 0 0; background: var(--huat-surface); color: var(--huat-text); font-size: 16px; }
html:root .omnibar-main > div:first-child input::placeholder { color: var(--huat-text-3); }
html:root .omnibar-main > div:first-child > span { width: 48px; height: 52px; color: var(--huat-text-3); }
html:root #omnibar-content { padding: 16px; }
html:root .omnibar-content-title { margin: 0 0 8px; color: var(--huat-text-3); font-size: var(--huat-fs-xs); font-weight: 600; }
html:root .omnibar-content-section { min-height: 44px; margin-bottom: 4px; padding: 12px; border: 0; border-radius: var(--huat-r); background: var(--huat-surface); color: var(--huat-text); line-height: 1.5; }
html:root .omnibar-content-section:is(:hover, .selected, .active, [aria-selected="true"]) { background: var(--huat-brand-soft); color: var(--huat-text); }
html:root .omnibar-content-section a { color: var(--huat-brand); }
html:root .omnibar-toggle { display: none; }
html:root.nojs .huat-search { display: none; }

html:root .numbox { padding: 8px 12px; border-radius: var(--huat-r); background: var(--huat-surface-2); }
html:root .numbox__num { color: var(--huat-text); font-family: var(--huat-font-num); font-weight: 700; font-variant-numeric: tabular-nums; }
html:root .numbox__num.large { font-size: 24px; }
html:root .numbox__text { margin-top: 4px; color: var(--huat-text-2); font-size: var(--huat-fs-xs); }
html:root .star { color: var(--huat-text-3); border-radius: var(--huat-r-sm); transition: transform 300ms var(--huat-spring), color var(--huat-t-fast); }
html:root .star.starred { color: var(--huat-gold); }
html:root .star:active { transform: scale(1.25); }
html:root .star:focus-visible { outline: 0; box-shadow: var(--huat-focus); }
html:root :is(.contest-tag, .contest-tag-rated, .contest-type-tag) { padding: 2px 10px; border: 1px solid var(--huat-line); border-radius: var(--huat-r-pill); background: var(--huat-surface-2); color: var(--huat-text-2); font-size: var(--huat-fs-xs); font-weight: 600; line-height: 1.6; }
html:root .contest-type-tag,
html:root .contest-type-tag:visited,
html:root .supplementary .contest-type-tag,
html:root [class*="contest-type--"] .contest-type-tag { border-color: var(--huat-brand-soft-2); background: var(--huat-info-soft); color: var(--huat-brand); }
html:root :is(.contest-tag, .contest-type-tag):hover { border-color: var(--huat-brand-soft-2); background: var(--huat-brand-soft); color: var(--huat-brand) !important; text-decoration: none; }
html:root .contest-tag-rated,
html:root .contest-tag-rated:hover { border-color: transparent; background: var(--huat-warn-soft); color: var(--huat-warn) !important; }
html:root .contest-tag.live { border-color: transparent; background: var(--huat-ok-soft); color: var(--huat-ok); }
html:root .contest-tag.ready { border-color: transparent; background: var(--huat-info-soft); color: var(--huat-brand); }
html:root .contest-tag.done { border-color: transparent; background: var(--huat-muted-soft); color: var(--huat-muted); }
html:root .contest-timer { top: var(--huat-top-h); left: var(--huat-side-w); border-radius: 0 0 var(--huat-r) 0; background: var(--huat-surface); color: var(--huat-text); font-family: var(--huat-font-num); font-variant-numeric: tabular-nums; }
html:root :is(.training-status--text, .training-status--icon, .training-section-status--text, .training-section-status--icon).pass,
html:root :is(.training-status--icon, .training-section-status--icon).pass::before { color: var(--huat-ok); }
html:root :is(.training-status--text, .training-status--icon, .training-section-status--text, .training-section-status--icon).progress,
html:root :is(.training-status--icon, .training-section-status--icon).progress::before { color: var(--huat-warn); }
html:root :is(.training-status--text, .training-status--icon, .training-section-status--text, .training-section-status--icon):is(.invalid, .pending, .ignored),
html:root :is(.training-status--icon, .training-section-status--icon):is(.invalid, .pending, .ignored)::before { color: var(--huat-muted); }
html:root :is(.training-status--text, .training-section-status--text).fail,
html:root :is(.training-status--icon, .training-section-status--icon).fail::before { color: var(--huat-bad); }

html:root :is(.dczcomments__item, .dczcomments__reply) { border-top-color: var(--huat-line-2); }
html:root :is(.dczcomments__item, .dczcomments__reply) > .media { padding: 20px 0; }
html:root .dczcomments__reply { margin-left: 16px; padding-left: 16px; border-left: 2px solid var(--huat-line); }
html:root .dczcomments__item .media__body { min-width: 0; }
html:root .dczcomments__item .user-profile-name { font-weight: 600; }
html:root .dczcomments__supplementary { color: var(--huat-text-3); font-size: var(--huat-fs-xs); }
html:root .dczcomments__operations,
html:root .dczcomments__operations a,
html:root .dczcomments__operations a:visited { color: var(--huat-text-2); font-size: 12.5px; }
html:root .dczcomments__operations a:hover { color: var(--huat-brand); }
html:root .dczcomments__item .vote-number { margin: 0 0 8px; color: var(--huat-text-2); font-family: var(--huat-font-num); font-size: var(--huat-fs-xl); font-weight: 600; }
html:root .dczcomments__item .vote-op { overflow: hidden; border-color: var(--huat-line); border-radius: var(--huat-r-pill); opacity: 1; }
html:root .dczcomments__item .vote-button { color: var(--huat-text-3); }
html:root .dczcomments__item .vote-button:is(.upvote, .downvote):hover { background: var(--huat-brand-soft); color: var(--huat-brand); box-shadow: none; }
html:root .dczcomments__item .vote-button:is(.upvote, .downvote).active { color: var(--huat-brand); }
html:root .reactions { border-radius: var(--huat-r-pill); background: var(--huat-surface-2); }
html:root .reactions:hover { background: var(--huat-brand-soft); }
html:root .messagepad__sidebar,
html:root .messagepad__header,
html:root .messagepad__input { border-color: var(--huat-line); }
html:root .messagepad__message__body { padding: 12px 16px; border-radius: var(--huat-r-lg); font-size: var(--huat-fs-base); line-height: 1.7; }
html:root .side--self .messagepad__message__body { background: var(--huat-brand); color: var(--huat-text-inverse); }
html:root .side--other .messagepad__message__body { background: var(--huat-surface-2); color: var(--huat-text); }
html:root .messagepad__message__body::after { display: none; }
html:root .messagepad__input button:enabled { background: var(--huat-brand); color: var(--huat-text-inverse); }
html:root .messagepad__input button:enabled:hover { background: var(--huat-brand-hover); }
html:root .messagepad__textarea-container textarea { color: var(--huat-text); }
html:root .calendar { border: 1px solid var(--huat-line); border-radius: var(--huat-r); background: var(--huat-surface); color: var(--huat-text); box-shadow: var(--huat-shadow-lg); }
html:root .calendar .today { border-color: var(--huat-brand); }
html:root .calendar .selected { background: var(--huat-brand); color: var(--huat-text-inverse); }
html:root .calendar__header h1 { color: var(--huat-text); font-size: var(--huat-fs-lg); font-weight: 700; }
html:root .calendar__header button { color: var(--huat-text-2); }
html:root .calendar__header button:hover { color: var(--huat-brand); }
html:root .calendar__week-title th { color: var(--huat-text-3); font-size: var(--huat-fs-xs); }
html:root .calendar__row__bg td { border-color: var(--huat-line-2); }
html:root .calendar__row__bg td.is-current-day { background: var(--huat-brand-soft); }
html:root .calendar__row__content th { color: var(--huat-text-2); font-family: var(--huat-font-num); font-variant-numeric: tabular-nums; }
html:root .calendar__row__content th.is-current-day { color: var(--huat-brand); }
html:root .calendar__banner { border-radius: var(--huat-r-sm); background-color: var(--huat-brand); color: var(--huat-text-inverse); }

html:root .footer { box-sizing: border-box; width: calc(100% - 64px); max-width: var(--huat-content-max); margin: 48px auto 0 32px; padding: 32px 0 24px; border-top: 1px solid var(--huat-line); background: transparent; color: var(--huat-text-2); }
html:root .footer .row { max-width: 100%; margin-left: 0; margin-right: 0; }
html:root .footer__category { padding-top: 0; padding-bottom: 24px; }
html:root .footer h1 { margin: 0; padding: 0; color: var(--huat-text); font-size: var(--huat-fs-sm); font-weight: 700; }
html:root .footer__category__list { margin: 8px 0 0; font-size: var(--huat-fs-sm); line-height: 28px; }
html:root .footer a,
html:root .footer a:visited { color: var(--huat-text-2); }
html:root .footer a:hover { color: var(--huat-brand); }
html:root .footer__extra-link { padding: 8px 0 0; color: var(--huat-text-3); font-size: 12.5px; }
html:root .footer__extra-link-item { line-height: 2; }

/* Homepage: the dashboard itself is the twelve-column grid. */
html:root .huat-dash { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--huat-gap); width: 100%; max-width: var(--huat-content-max); margin: 0 auto 0 0; }
html:root .huat-span-3 { grid-column: span 3; }
html:root .huat-span-4 { grid-column: span 4; }
html:root .huat-span-8 { grid-column: span 8; }
html:root .huat-span-12 { grid-column: span 12; }
html:root .huat-card { position: relative; min-width: 0; margin: 0; padding: 20px; }
html:root .huat-card::before,
html:root .huat-card::after { display: none; }
html:root .huat-card__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
html:root .huat-card__header :is(h2, h3) { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--huat-text); font-size: var(--huat-fs-md); font-weight: 700; line-height: 1.4; }
html:root .huat-card__header a,
html:root .huat-card__header > span { color: var(--huat-text-2); font-size: 12.5px; white-space: nowrap; }
html:root .huat-card__header a:hover { color: var(--huat-brand); }
html:root .huat-hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 8px 0 2px; }
html:root .huat-hello__copy { min-width: 0; }
html:root .huat-hello h1 { margin: 0; color: var(--huat-text); font-size: var(--huat-fs-2xl); font-weight: 700; line-height: 1.3; letter-spacing: -.02em; }
html:root .huat-hello p { margin: 4px 0 0; color: var(--huat-text-2); font-size: var(--huat-fs-base); }
html:root .huat-hello > .huat-btn { flex: none; }
html:root .huat-hero { display: flex; align-items: center; gap: 26px; min-height: 210px; padding: 28px; border-color: transparent; background: var(--huat-grad); color: var(--huat-text-inverse); }
html:root .huat-hero::before { content: ""; position: absolute; inset: 0; display: block; background-image: var(--huat-hero-glow), radial-gradient(var(--huat-white-18) 1.2px, transparent 1.3px); background-size: auto, 28px 28px; pointer-events: none; }
html:root .huat-hero > * { position: relative; z-index: 1; }
html:root .huat-hero__content { flex: 1 1 0; min-width: 0; }
html:root .huat-hero__tag { display: inline-flex; align-items: center; margin-bottom: 10px; padding: 3px 10px; border-radius: var(--huat-r-pill); background: var(--huat-white-18); color: var(--huat-text-inverse); font-size: var(--huat-fs-xs); line-height: 1.5; }
html:root .huat-hero h2 { margin: 0 0 6px; color: var(--huat-text-inverse); font-size: 24px; font-weight: 700; line-height: 1.4; letter-spacing: -.01em; overflow-wrap: anywhere; }
html:root .huat-hero p { max-width: 50ch; margin: 0 0 18px; color: var(--huat-white-85); font-size: var(--huat-fs-base); line-height: 1.75; }
html:root .huat-hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
html:root .huat-hero .huat-btn--primary,
html:root .huat-hero .huat-btn--primary:visited,
html:root .huat-hero .huat-btn--primary:not(:disabled):not(.disabled):hover { border-color: var(--huat-text-inverse); background: var(--huat-text-inverse); color: var(--huat-hero-brand); box-shadow: var(--huat-shadow-sm); }
html:root .huat-hero .huat-btn--primary:active { background: var(--huat-white-85); }
html:root .huat-hero .huat-btn--primary:not(:disabled):not(.disabled):focus-visible { box-shadow: var(--huat-focus); transform: none; }
html:root .huat-ring { position: relative; flex: 0 0 150px; width: 150px; height: 150px; margin-left: auto; }
html:root .huat-ring svg { display: block; width: 100%; height: 100%; transform: rotate(-90deg); }
html:root .huat-ring circle { fill: none; stroke-width: 10; }
html:root .huat-ring__bg { stroke: var(--huat-white-20); }
html:root .huat-ring__fg { stroke: var(--huat-text-inverse); stroke-linecap: round; stroke-dasharray: 377; stroke-dashoffset: 377; transition: stroke-dashoffset 1600ms var(--huat-ease) 300ms; }
html:root .section.visible .huat-ring__fg,
html:root.nojs .huat-ring__fg,
html:root.huat-no-motion .huat-ring__fg { stroke-dashoffset: calc(377 * (1 - var(--huat-progress, 1))); }
html:root .huat-ring__value { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; }
html:root .huat-ring__value b { color: var(--huat-text-inverse); font-family: var(--huat-font-num); font-size: 30px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
html:root .huat-ring__label { color: var(--huat-white-85); font-size: var(--huat-fs-xs); }
html:root .huat-ring__value small { color: var(--huat-white-85); font-size: 11px; }
html:root .huat-contest { display: flex; flex-direction: column; min-height: 210px; }
html:root .huat-contest h3 { margin: 0; color: var(--huat-text); font-size: var(--huat-fs-lg); font-weight: 700; line-height: 1.5; }
html:root .huat-contest h3 a { color: inherit; }
html:root .huat-contest h3 a:hover { color: var(--huat-brand); }
html:root .huat-contest__meta { margin: 2px 0 16px; color: var(--huat-text-2); font-size: 12.5px; line-height: 1.7; }
html:root .huat-countdown { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
html:root .huat-countdown > div { padding: 10px 4px; border: 1px solid var(--huat-line); border-radius: var(--huat-r); background: var(--huat-surface-2); text-align: center; }
html:root .huat-countdown b { display: block; color: var(--huat-text); font-family: var(--huat-font-num); font-size: 22px; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; }
html:root .huat-countdown span { color: var(--huat-text-3); font-size: 11px; }
html:root .huat-contest > .huat-btn--block { margin-top: auto; }
html:root .huat-contest-banner > .section__header { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 24px 24px 0; }
html:root .huat-contest-banner > .section__body { padding: 12px 24px 0; }
html:root .huat-contest-banner__state { color: var(--huat-white-85); font-size: var(--huat-fs-xs); font-weight: 600; line-height: 1.5; }
html:root .huat-contest-banner .huat-countdown { width: min(380px, calc(100% - 48px)); margin: 16px 24px 24px; }
html:root .huat-contest-banner .huat-countdown > div { border-color: var(--huat-white-30); background: var(--huat-white-14); }
html:root .huat-contest-banner .huat-countdown b { color: var(--huat-text-inverse); }
html:root .huat-contest-banner .huat-countdown span { color: var(--huat-white-85); }
html:root .huat-live { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: var(--huat-r-pill); background: var(--huat-ok-soft); color: var(--huat-ok); font-size: var(--huat-fs-xs); font-weight: 600; }
html:root .huat-card__header .huat-live { color: var(--huat-ok); font-size: var(--huat-fs-xs); }
html:root .huat-live::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: huat-live-pulse 1.8s infinite; }
html:root .huat-empty { display: flex; flex: 1 1 auto; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 120px; padding: 20px 0; color: var(--huat-text-2); text-align: center; }
html:root .huat-empty p { margin: 0; }
html:root .huat-empty > a:not(.huat-btn) { color: var(--huat-brand); font-size: var(--huat-fs-sm); }
html:root .huat-stat { display: flex; flex-direction: column; gap: 2px; min-height: 150px; }
html:root .huat-stat__icon { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 36px; height: 36px; margin-bottom: 10px; border-radius: var(--huat-r); font-style: normal; }
html:root .huat-stat__icon--problem { background: var(--huat-brand-soft); color: var(--huat-brand); }
html:root .huat-stat__icon--record { background: var(--huat-ok-soft); color: var(--huat-ok); }
html:root .huat-stat__icon--member { background: var(--huat-violet-soft); color: var(--huat-violet); }
html:root .huat-stat__icon--contest { background: var(--huat-warn-soft); color: var(--huat-warn); }
html:root .huat-stat > b { color: var(--huat-text); font-family: var(--huat-font-num); font-size: var(--huat-fs-2xl); font-weight: 700; line-height: 1.3; letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
html:root .huat-stat > span { color: var(--huat-text-2); font-size: 12.5px; }
html:root .huat-stat__delta { position: absolute; top: 20px; right: 18px; color: var(--huat-ok); font-size: var(--huat-fs-xs); font-weight: 600; }
html:root .huat-feed .data-table { table-layout: auto; }
html:root .huat-feed .data-table th { background: transparent; }
html:root .huat-feed .data-table :is(td, th) { padding: 10px 8px; }
html:root .huat-feed .data-table :is(td, th):first-child { padding-left: 0; }
html:root .huat-feed .data-table :is(td, th):last-child { padding-right: 0; }
html:root .huat-feed .data-table tbody tr { cursor: pointer; }
html:root .huat-feed .data-table td:first-child { min-width: 130px; }
html:root .huat-feed .col--problem-name { max-width: 280px; }
html:root .huat-feed .col--problem-name a { color: var(--huat-text); }
html:root .huat-feed .col--problem-name a:hover { color: var(--huat-brand); }
html:root .huat-pid { color: var(--huat-brand); font-weight: 700; }
html:root .huat-feed :is(.col--lang, .col--time, .col--submit-at) { color: var(--huat-text-2); font-size: var(--huat-fs-sm); }
html:root .huat-feed__status { display: inline-flex; align-items: center; gap: 6px; font-size: var(--huat-fs-sm); font-weight: 600; }
html:root .huat-status-dot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
html:root .huat-status-dot.progress { box-sizing: border-box; width: 10px; height: 10px; border: 2px solid currentColor; border-right-color: transparent; background: transparent; animation: huat-spin 1s linear infinite; }
html:root .huat-rank__list { margin: 0; padding: 0; list-style: none; }
html:root .huat-rank__list > li { margin: 0 0 4px; }
html:root .huat-rank__item { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 8px 10px; border-radius: var(--huat-r); color: var(--huat-text); text-decoration: none; transition: background var(--huat-t-fast), transform 300ms var(--huat-spring); }
html:root .huat-rank__item:hover { transform: translateX(3px); background: var(--huat-surface-2); color: var(--huat-text); text-decoration: none; }
html:root .huat-rank__number { flex: 0 0 24px; width: 24px; color: var(--huat-text-3); font-family: var(--huat-font-num); font-weight: 800; text-align: center; }
html:root .huat-rank__list > li:nth-child(1) .huat-rank__number { color: var(--huat-gold); }
html:root .huat-rank__list > li:nth-child(2) .huat-rank__number { color: var(--huat-silver); }
html:root .huat-rank__list > li:nth-child(3) .huat-rank__number { color: var(--huat-bronze); }
html:root .huat-rank__avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
html:root .huat-rank__name { min-width: 0; overflow: hidden; color: var(--huat-text); font-size: var(--huat-fs-base); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
html:root .huat-rank__name small { display: block; margin-top: 2px; color: var(--huat-text-3); font-size: var(--huat-fs-xs); font-weight: 400; }
html:root .huat-rank__rp { margin-left: auto; color: var(--huat-text); font-family: var(--huat-font-num); font-weight: 700; font-variant-numeric: tabular-nums; }
html:root .huat-heat__grid { display: flex; gap: 4px; min-width: 0; padding-bottom: 4px; overflow-x: auto; }
html:root .huat-heat__week { display: flex; flex: none; flex-direction: column; gap: 4px; }
html:root .huat-heat__cell { display: inline-block; flex: none; width: 13px; height: 13px; border-radius: 4px; background: var(--huat-heat-0); }
html:root .huat-heat__grid.is-ready .huat-heat__cell { opacity: 0; transform: scale(.4); transition: opacity 400ms, transform 450ms var(--huat-spring); transition-delay: var(--huat-delay, calc(var(--i, 0) * 3ms)); }
html:root .section.visible .huat-heat__grid.is-ready .huat-heat__cell { opacity: 1; transform: none; }
html:root .huat-heat__cell--0 { background: var(--huat-heat-0); }
html:root .huat-heat__cell--1 { background: var(--huat-heat-1); }
html:root .huat-heat__cell--2 { background: var(--huat-heat-2); }
html:root .huat-heat__cell--3 { background: var(--huat-heat-3); }
html:root .huat-heat__cell--4 { background: var(--huat-heat-4); }
html:root .huat-heat__legend { display: flex; align-items: center; gap: 4px; margin-top: 12px; color: var(--huat-text-3); font-size: 11.5px; }
html:root .huat-heat__legend .huat-heat__cell { width: 11px; height: 11px; border-radius: 3px; }
html:root .huat-heat__fallback { display: block; padding: 16px 0; color: var(--huat-text-2); font-size: var(--huat-fs-sm); }
html:root .huat-notice > .huat-card__header:not(:first-child) { margin-top: 20px; }
html:root .huat-bulletin { margin-bottom: 20px; }
html:root .huat-bulletin__content { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; max-height: 8.75em; overflow: hidden; }
html:root .huat-bulletin__content :is(p, li) { font-size: var(--huat-fs-base); }
html:root .huat-bulletin.is-expanded .huat-bulletin__content,
html:root.nojs .huat-bulletin__content { display: block; max-height: none; -webkit-line-clamp: unset; overflow: visible; }
html:root [data-huat-bulletin] { height: 30px; margin-top: 8px; padding: 0 12px; font-size: var(--huat-fs-sm); }
html:root .huat-quote { margin: 0 0 20px; color: var(--huat-text); font-size: 16px; line-height: 1.8; }
html:root .huat-chips { display: flex; flex-wrap: wrap; gap: 8px; }
html:root .huat-recent { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--huat-gap); min-width: 0; }
html:root .huat-list { margin: 0; padding: 0; list-style: none; }
html:root .huat-list > li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 42px; padding: 8px 0; border-top: 1px solid var(--huat-line-2); }
html:root .huat-list > li:first-child { border-top: 0; }
html:root .huat-list > li > a { min-width: 0; overflow: hidden; color: var(--huat-text); font-size: var(--huat-fs-sm); text-overflow: ellipsis; white-space: nowrap; }
html:root .huat-list > li > a:hover { color: var(--huat-brand); }
html:root .huat-list small { flex: none; color: var(--huat-text-3); font-size: var(--huat-fs-xs); }

/* The signin artwork contains the side panel in Hydro's actual template. */
html:root .dialog--signin__bg { position: relative; inset: auto; order: 0; display: flex; flex: 0 0 300px; width: 300px; border-radius: 0; }
html:root .dialog--signin__bg .dialog--signin__side { flex: 1 1 auto; width: 100%; }
html:root .section__tab-header-wrapper { position: relative; }
html:root .huat-tab-underline { position: absolute; left: 0; bottom: 0; height: 2px; border-radius: var(--huat-r-pill); background: var(--huat-brand); pointer-events: none; transition: transform 300ms var(--huat-ease), width 300ms var(--huat-ease); }
html:root .huat-pjax-in { animation: huat-content-in 200ms var(--huat-ease); }

/* Page refinements use the actual ui-default templates and column classes. */
html:root.page--problem_main .search { position: relative; }
html:root.page--problem_main .search > input { box-sizing: border-box; height: 42px; padding: 0 170px 0 36px; border: 1px solid var(--huat-line-strong); border-right: 0; border-radius: var(--huat-r) 0 0 var(--huat-r); background: var(--huat-surface); color: var(--huat-text); font-size: var(--huat-fs-base); }
html:root.page--problem_main .search::before { content: ""; position: absolute; left: 13px; top: 13px; width: 11px; height: 11px; border: 1.8px solid var(--huat-text-3); border-radius: 50%; pointer-events: none; }
html:root.page--problem_main .search::after { content: ""; position: absolute; left: 24px; top: 26px; width: 5px; height: 2px; border-radius: var(--huat-r-pill); background: var(--huat-text-3); transform: rotate(45deg); pointer-events: none; }
html:root.page--problem_main .search > input:focus { border-color: var(--huat-brand); box-shadow: var(--huat-focus); }
html:root.page--problem_main .search > button { flex: 0 0 42px; width: 42px; height: 42px; border: 1px solid var(--huat-brand); border-radius: 0 var(--huat-r) var(--huat-r) 0; background: var(--huat-brand); color: var(--huat-text-inverse); }
html:root.page--problem_main .search > button:hover { border-color: var(--huat-brand-hover); background: var(--huat-brand-hover); }
html:root.page--problem_main .search-sort { top: 1px; right: 42px; width: 120px; height: 40px; padding: 0 8px; border-left: 1px solid var(--huat-line); border-radius: 0; background: var(--huat-surface); color: var(--huat-text-2); font-size: var(--huat-fs-sm); }
html:root.page--problem_main .search > div { right: 174px; top: 13px; color: var(--huat-text-3); }
html:root.page--problem_main .col--checkbox { width: 40px; }
html:root.page--problem_main .col--pid { width: 90px; }
html:root.page--problem_main .col--difficulty { width: 80px; }
html:root.page--problem_main .col--ac-tried { border-left-color: var(--huat-line-2); }
html:root.page--problem_main .col--problem-name > a { color: var(--huat-text); font-size: 14.5px; font-weight: 500; }
html:root.page--problem_main .col--problem-name > a:hover { color: var(--huat-brand); }
html:root.page--problem_main .col--problem-name .problem__tags { flex-wrap: nowrap; max-width: 50%; overflow: hidden; }
html:root .widget--category-filter__category { color: var(--huat-text-3); font-size: var(--huat-fs-xs); font-weight: 600; }
html:root .widget--category-filter__drop { padding: 12px; border: 1px solid var(--huat-line); border-radius: var(--huat-r-lg); background: var(--huat-surface); box-shadow: var(--huat-shadow-lg); }
html:root .widget--category-filter__drop::before { display: none; }
html:root .category-filter__header .list .list__item { border: 1px solid var(--huat-line); border-radius: var(--huat-r); background: var(--huat-surface-2); color: var(--huat-text-2); }
html:root .category-filter__header .list .list__item.selected { border-color: var(--huat-brand-soft-2); background: var(--huat-brand-soft); color: var(--huat-brand); }
html:root .category-filter__body { border-radius: var(--huat-r); background: var(--huat-surface-2); }
html:root .category-filter__body .divider { border-bottom-color: var(--huat-line); }
html:root .category-filter__body .search-tag__item { background: var(--huat-surface); }

html:root:is(.page--problem_detail, .page--contest_detail_problem, .page--homework_detail_problem) .medium-9 > .section:first-child > .section__header { padding: 24px 24px 0; }
html:root:is(.page--problem_detail, .page--contest_detail_problem, .page--homework_detail_problem) .medium-9 > .section:first-child > .section__header .section__title { font-size: 22px; line-height: 1.4; }
html:root:is(.page--problem_detail, .page--contest_detail_problem, .page--homework_detail_problem) .medium-9 > .section > .section__body.typo { padding-top: 20px; border-top: 1px solid var(--huat-line-2); }
html:root:is(.page--problem_detail, .page--contest_detail_problem, .page--homework_detail_problem) .section__tab-header-item { color: var(--huat-text-2) !important; }
html:root:is(.page--problem_detail, .page--contest_detail_problem, .page--homework_detail_problem) .section__tab-header-item:is(.tab--active, .selected) { color: var(--huat-text) !important; }
html:root .section--problem-sidebar .menu__link[href*="/submit"] { justify-content: center; min-height: 40px; margin-bottom: 4px; border-color: var(--huat-brand); background: var(--huat-brand); color: var(--huat-text-inverse); font-weight: 600; }
html:root .section--problem-sidebar .menu__link[href*="/submit"]:hover { border-color: var(--huat-brand-hover); background: var(--huat-brand-hover); color: var(--huat-text-inverse); }
html:root .section--problem-sidebar .menu__link[href*="/submit"] .icon { color: inherit; }
html:root .problem-sidebar-information dl { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 12px; margin: 0; }
html:root .problem-sidebar-information dt { margin: 0; color: var(--huat-text-2); font-size: var(--huat-fs-sm); font-weight: 400; }
html:root .problem-sidebar-information dd { margin: 0; color: var(--huat-text); font-size: var(--huat-fs-sm); font-weight: 600; text-align: right; }
html:root.page--problem_submit select.select { width: 240px; max-width: 100%; }
html:root.page--problem_submit .button[type="submit"] { height: 42px; }
html:root.page--problem_solution .dczcomments__item .vote-op { display: flex; flex-direction: column; width: 40px; border-radius: var(--huat-r-pill); }
html:root.page--problem_solution .dczcomments__item .vote-op > button { float: none; width: 100%; border-radius: 0; padding: 0; }
html:root .toolbar { background: var(--huat-surface-2); }
html:root .code-toolbar > .toolbar { padding: 4px; opacity: .6 !important; transition: opacity var(--huat-t-fast); }
html:root .code-toolbar:hover > .toolbar { opacity: 1 !important; }
html:root .toolbar-item a { display: inline-flex; align-items: center; min-height: 28px; padding: 0 8px; border: 1px solid var(--huat-line); border-radius: var(--huat-r) !important; background: var(--huat-surface) !important; color: var(--huat-text-2); font-size: var(--huat-fs-xs) !important; }

html:root.page--record_main .form--inline { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 8px; }
html:root.page--record_main .form--inline :is(input.textbox, select.select) { height: 34px; margin-bottom: 0; }
html:root.page--record_main .form--inline .button { height: 34px; margin-bottom: 0; }
html:root.page--record_main :is(.col--status, .col--submit-by, .col--lang) { border-right-color: var(--huat-line-2); }
html:root.page--record_main .col--status__progress { background: var(--huat-warn-soft); }
html:root.page--record_detail #status .section__title { color: var(--huat-text); font-size: var(--huat-fs-2xl); font-weight: 700; }
html:root.page--record_detail #summary { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(90px, 1fr); grid-template-rows: auto auto; gap: 4px 16px; overflow-x: auto; margin: 0; padding: 12px 0; }
html:root.page--record_detail #summary dt { grid-row: 1; float: none; width: auto; padding: 0; color: var(--huat-text-3); font-size: var(--huat-fs-xs); }
html:root.page--record_detail #summary dd { grid-row: 2; margin: 0; color: var(--huat-text); font-family: var(--huat-font-num); font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
html:root.page--record_detail .compiler-text { max-height: 320px; padding: 14px 16px; overflow: auto; }
html:root.page--record_detail #status[data-status="7"] .compiler-text { border-color: var(--huat-danger-line); }
html:root.page--record_detail .compiler-text-mask { background-image: linear-gradient(to bottom, transparent, var(--huat-surface-2) 25px); }
html:root.page--record_detail .subtask { background-color: var(--huat-surface-2) !important; font-weight: 600; }
html:root.page--record_detail .record_detail__table .col--status > .record-status--icon { display: none; }
html:root.page--record_detail .record_detail__table .record-status--text:not(.float-right)::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: currentColor; }
html:root.page--record_detail .record_detail__table .record-status--text.progress:not(.float-right)::before { box-sizing: border-box; width: 10px; height: 10px; border: 2px solid currentColor; border-right-color: transparent; background: transparent; animation: huat-spin 1s linear infinite; }
html:root.page--record_detail .side button.menu__link { margin-bottom: 8px; }

html:root .contest__item { border-left-width: 3px; }
html:root .contest__item.live { border-left-color: var(--huat-ok); }
html:root .contest__item.ready { border-left-color: var(--huat-brand); }
html:root .contest__title { margin-bottom: 8px; color: var(--huat-text); font-size: 16px; font-weight: 700; line-height: 1.4; }
html:root .contest__title a { color: var(--huat-text); }
html:root .contest__title a:hover { color: var(--huat-brand); }
html:root .contest__date { width: 64px; min-width: 64px; }
html:root .contest__date .numbox { min-height: 64px; }
html:root.page--contest_main .section--contest:is(.live, .ready) { border-color: transparent; background: var(--huat-grad); color: var(--huat-text-inverse); }
html:root.page--contest_main .section--contest:is(.live, .ready) h1 { color: var(--huat-text-inverse); font-size: 24px; }
html:root.page--contest_main .section--contest .status_title { border-radius: var(--huat-r-pill); background: var(--huat-white-18); color: var(--huat-text-inverse); }
html:root.page--contest_main .section--contest .info,
html:root.page--contest_main .section--contest .info .icon { color: var(--huat-white-85); }
html:root.page--contest_main .section--contest .detail-button { border-radius: var(--huat-r); background: var(--huat-text-inverse); color: var(--huat-hero-brand); font-weight: 600; }
html:root.page--contest_main .section--contest .detail-button::after { display: none; }
html:root:is(.page--contest_detail, .page--homework_detail) .medium-9 > .section:first-child { border-color: transparent; background: var(--huat-grad); color: var(--huat-text-inverse); }
html:root:is(.page--contest_detail, .page--homework_detail) .medium-9 > .section:first-child .section__title { color: var(--huat-text-inverse); font-size: 24px; }
html:root:is(.page--contest_detail, .page--homework_detail) .medium-9 > .section:first-child .problem__tag-item { border-color: var(--huat-white-30); background: var(--huat-white-14); color: var(--huat-text-inverse); }
html:root:is(.page--contest_detail, .page--homework_detail) .medium-9 > .section:first-child .user-profile-name { color: var(--huat-text-inverse); }
html:root .contest-sidebar__bg { height: 0; margin: 0; padding: 0; background: none; }
html:root:is(.page--contest_scoreboard, .page--homework_scoreboard) .main .row { max-width: var(--huat-content-max) !important; }
html:root:is(.page--contest_scoreboard, .page--homework_scoreboard) .section__body.no-padding { overflow-x: auto; }
html:root:is(.page--contest_scoreboard, .page--homework_scoreboard) .data-table { table-layout: auto; min-width: 900px; }
html:root:is(.page--contest_scoreboard, .page--homework_scoreboard) :is(th, td).col--rank { position: sticky; left: 0; z-index: 2; box-sizing: border-box; width: 60px; min-width: 60px; max-width: 60px; background: var(--huat-sticky-bg, var(--huat-surface)); text-align: center; }
html:root:is(.page--contest_scoreboard, .page--homework_scoreboard) :is(th, td).col--user { position: sticky; left: 60px; z-index: 2; box-sizing: border-box; width: 180px; min-width: 180px; background: var(--huat-sticky-bg, var(--huat-surface)); box-shadow: 1px 0 0 var(--huat-line); }
html:root:is(.page--contest_scoreboard, .page--homework_scoreboard) th:is(.col--rank, .col--user) { z-index: 3; background: var(--huat-surface-2); }
html:root:is(.page--contest_scoreboard, .page--homework_scoreboard) tr.star-highlight { --huat-sticky-bg: var(--huat-warn-soft); background: var(--huat-warn-soft); }
html:root:is(.page--contest_scoreboard, .page--homework_scoreboard) tr.huat-self { --huat-sticky-bg: var(--huat-brand-soft); background: var(--huat-brand-soft); }
html:root .huat-sb--ac { background: var(--huat-ok-soft); color: var(--huat-ok); }
html:root .huat-sb--first { background: var(--huat-ok); color: var(--huat-text-inverse); }
html:root .huat-sb--fail { background: var(--huat-bad-soft); color: var(--huat-bad); }
html:root .huat-sb--pending { background: var(--huat-warn-soft); color: var(--huat-warn); }
html:root .training__title { color: var(--huat-text); font-size: 16px; font-weight: 700; line-height: 1.4; }
html:root .training__intro { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--huat-text-2); font-size: var(--huat-fs-sm); }
html:root .training__progress-bar { height: 6px; border-radius: 3px; background: var(--huat-line-2); }
html:root .training__progress-track { border-radius: inherit; background: var(--huat-ok); }
html:root .training__section.invalid .training__problems { opacity: .6; }

html:root .discussion__title { margin-bottom: 8px; color: var(--huat-text); font-size: var(--huat-fs-md); font-weight: 600; line-height: 1.4; }
html:root .discussion__title a,
html:root .discussion__title a:visited { color: var(--huat-text); }
html:root .discussion__title a:hover { color: var(--huat-brand); }
html:root .discussion__item { border-left-width: 3px; }
html:root .discussion__item.highlight { border-left-color: var(--huat-brand); }
html:root .discussion__replies .numbox { border-radius: var(--huat-r-pill); }
html:root.page--discussion_detail .profile__bg { height: 0; margin: 0; background: none; }
html:root.page--discussion_detail .sidebar-user-profile .media { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
html:root.page--discussion_detail .sidebar-user-profile .media__left { padding: 0; }
html:root.page--discussion_detail .sidebar-user-profile .media__body { padding: 0; }
html:root.page--discussion_detail .sidebar-user-profile .user-profile-avatar { width: 64px; height: 64px; }
html:root.page--discussion_detail .sidebar-user-profile .user-profile-name { color: var(--huat-text); font-size: var(--huat-fs-lg); font-weight: 600; }
html:root.page--ranking .data-table .col--user .user-profile-avatar { width: 28px; height: 28px; }
html:root.page--ranking .data-table .col--rp { font-weight: 700; }
html:root.page--ranking .data-table .col--bio { color: var(--huat-text-2); font-size: var(--huat-fs-sm); }
html:root.page--ranking tbody > tr:nth-child(1):not(.highlight),
html:root.page--ranking tbody > tr.highlight + tr { --huat-medal: var(--huat-gold); background: var(--huat-gold-soft); }
html:root.page--ranking tbody > tr:nth-child(2):not(.highlight),
html:root.page--ranking tbody > tr.highlight + tr + tr { --huat-medal: var(--huat-silver); background: var(--huat-silver-soft); }
html:root.page--ranking tbody > tr:nth-child(3):not(.highlight),
html:root.page--ranking tbody > tr.highlight + tr + tr + tr { --huat-medal: var(--huat-bronze); background: var(--huat-bronze-soft); }
html:root.page--ranking tbody > tr:not(.highlight) .col--rank { position: relative; isolation: isolate; color: var(--huat-text); }
html:root.page--ranking tbody > tr:nth-child(-n+3):not(.highlight) .col--rank,
html:root.page--ranking tbody > tr.highlight + tr .col--rank,
html:root.page--ranking tbody > tr.highlight + tr + tr .col--rank,
html:root.page--ranking tbody > tr.highlight + tr + tr + tr .col--rank { color: var(--huat-text-inverse); }
html:root.page--ranking tbody > tr:not(.highlight) .col--rank::before { content: ""; position: absolute; top: calc(50% - 14px); left: calc(50% - 14px); z-index: -1; width: 28px; height: 28px; border-radius: 50%; background: var(--huat-medal, transparent); }

html:root.page--user_detail .profile-header { position: relative; min-height: 0; padding-bottom: 24px; border-radius: var(--huat-r-lg) var(--huat-r-lg) 0 0; background: var(--huat-surface); background-image: none; }
html:root.page--user_detail .profile-header::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 120px; background: var(--huat-grad); }
html:root.page--user_detail .profile-header__content { padding: 72px 24px 0; }
html:root.page--user_detail .profile-header__content > .media { display: flex; align-items: flex-start; gap: 24px; }
html:root.page--user_detail .profile-header__content .media__left { padding-right: 0; }
html:root.page--user_detail .profile-header__content .user-profile-avatar { box-sizing: border-box; width: 96px; height: 96px; border: 4px solid var(--huat-surface); box-shadow: none; }
html:root.page--user_detail .profile-header__main { min-width: 0; padding-top: 64px; }
html:root.page--user_detail .profile-header__main h1 { margin: 0 0 8px; color: var(--huat-text); font-size: 24px; font-weight: 700; line-height: 1.4; }
html:root.page--user_detail .profile-header__main p { margin: 4px 0; color: var(--huat-text-2); font-size: var(--huat-fs-sm); line-height: 1.7; }
html:root.page--user_detail .profile-header__main small { color: var(--huat-text-2); }
html:root.page--user_detail .profile-header__contact-bar { position: relative; top: auto; right: auto; display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; text-align: left; }
html:root.page--user_detail .profile-header__contact-item { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; margin: 0; border: 1px solid var(--huat-line); border-radius: var(--huat-r); background: var(--huat-surface-2); color: var(--huat-text-2); }
html:root.page--user_detail .profile-header__contact-item:hover { color: var(--huat-brand); border-color: var(--huat-line-strong); }
html:root.page--user_detail .profile-content { margin-top: 0; }
html:root.page--user_detail .profile-content .section__tabs { padding-top: 0; }
html:root .messagepad__list-item { min-height: 64px; padding: 12px 16px; border-left-color: transparent; color: var(--huat-text); }
html:root .messagepad__list-item:hover { background: var(--huat-surface-2); border-left-color: var(--huat-line-strong); }
html:root .messagepad__list-item.active { background: var(--huat-brand-soft); border-left-color: var(--huat-brand); }
html:root .messagepad__desc { color: var(--huat-text-2); }
html:root .sessionlist__item { border-bottom-color: var(--huat-line-2); }
html:root:is(.page--wiki_help, .page--about) .medium-3 > .section.side { position: sticky; top: calc(var(--huat-top-h) + 16px); }
html:root:is(.page--domain_permission, .page--domain_role) .section__body.no-padding { overflow-x: auto; }
html:root:is(.page--domain_permission, .page--domain_role) .data-table { min-width: 900px; }
html:root:is(.page--domain_permission, .page--domain_role) .data-table :is(td, th):first-child { position: sticky; left: 0; z-index: 2; background: var(--huat-surface); }
html:root:is(.page--domain_permission, .page--domain_role) .data-table td { text-align: center; }
html:root.page--error .main > .row { max-width: 560px; margin: 32px auto 0; }
html:root.page--error .error__twd2 { max-width: 160px; height: auto; }
html:root.page--error .section__title { font-size: 22px; }

html:root.layout--immersive body { position: relative; isolation: isolate; background: var(--huat-bg); }
html:root.layout--immersive body::before,
html:root.layout--immersive body::after { content: ""; position: fixed; z-index: -1; width: 520px; height: 520px; border-radius: 50%; opacity: .7; filter: blur(80px); pointer-events: none; animation: huat-auth-drift 20s var(--huat-ease) infinite; }
html:root.layout--immersive body::before { top: -160px; left: -160px; background: var(--huat-auth-glow-1); }
html:root.layout--immersive body::after { bottom: -160px; right: -160px; background: var(--huat-auth-glow-2); animation-delay: -10s; }
html:root.layout--immersive #menu.huat-side { display: none; }
html:root.layout--immersive #panel { margin-left: 0; padding-top: 0; background: transparent; }
html:root.layout--immersive .nav.huat-topbar { left: 0; border: 0; background: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
html:root.layout--immersive .huat-topbar__brand { display: inline-flex; }
html:root.layout--immersive .huat-topbar__title,
html:root.layout--immersive .huat-search,
html:root.layout--immersive .huat-icon-btn { display: none; }
html:root.layout--immersive .huat-topbar__actions { margin-left: auto; }
html:root.layout--immersive .main { padding: 0 12px 32px; }
html:root.layout--immersive .immersive--content { box-sizing: border-box; width: 440px; max-width: 92vw; margin: 12vh auto 40px; padding: 36px; border: 1px solid var(--huat-line); border-radius: var(--huat-r-xl); background: var(--huat-surface); color: var(--huat-text); box-shadow: var(--huat-shadow-lg); }
html:root.layout--immersive .immersive--content h1 { margin: 0 0 24px; color: var(--huat-text); font-size: 24px; font-weight: 700; line-height: 1.4; text-align: center; }
html:root.layout--immersive .immersive--content :is(h2, h3, h4) { color: var(--huat-text); }
html:root.layout--immersive .immersive--content .button:not(.codicon).expanded { height: 44px; }
html:root.layout--immersive .supplementary,
html:root.layout--immersive .supplementary a,
html:root.layout--immersive .supplementary a:visited { color: var(--huat-text-2); font-size: var(--huat-fs-sm); }
html:root.layout--immersive .supplementary a:hover { color: var(--huat-brand); }
html:root.layout--immersive .footer { margin-top: auto; }
html:root.layout--immersive .footer a,
html:root.layout--immersive .footer a:visited { color: var(--huat-text-2); }
html:root.layout--immersive .footer a:hover { color: var(--huat-brand); }

@media (min-width: 601px) {
  html:root.hasjs .section { opacity: 0; transform: translateY(12px); transition: opacity var(--huat-t-enter) var(--huat-ease), transform var(--huat-t-enter) var(--huat-ease), box-shadow var(--huat-t-slow) var(--huat-ease), border-color var(--huat-t); }
  html:root.hasjs .section.visible { opacity: 1; transform: none; }
}
@media (min-width: 601px) and (max-width: 1279px) {
  html:root #panel { margin-left: var(--huat-rail-w); }
  html:root .nav.huat-topbar { left: var(--huat-rail-w); padding: 0 20px; }
  html:root .main { padding: 20px 20px 40px; }
  html:root .footer { width: calc(100% - 40px); margin-left: 20px; }
  html:root .huat-side { width: var(--huat-rail-w); }
  html:root .huat-side__brand { justify-content: center; gap: 0; padding-left: 0; padding-right: 0; }
  html:root :is(.huat-side__brandtext, .huat-side__label) { width: 0; opacity: 0; overflow: hidden; visibility: hidden; transition: opacity 200ms 80ms; }
  html:root .huat-side__heading { display: none; }
  html:root .huat-side__group + .huat-side__group { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--huat-line); }
  html:root .huat-side__link { justify-content: center; gap: 0; min-height: 44px; padding: 0; }
  html:root .huat-side__badge { display: none; }
  html:root .huat-side__foot { padding: 6px; border-color: transparent; background: transparent; }
  html:root .huat-side__foot > :is(b, p, .huat-btn) { display: none; }
  html:root .huat-side__foot > .huat-side__login { display: none; }
  html:root .huat-side__me { justify-content: center; gap: 0; }
  html:root .huat-side__me > span { display: none; }
  html:root .huat-side:hover { width: var(--huat-side-w); box-shadow: var(--huat-shadow-lg); }
  html:root .huat-side:hover .huat-side__brand { justify-content: flex-start; gap: 10px; padding-left: 10px; padding-right: 10px; }
  html:root .huat-side:hover :is(.huat-side__brandtext, .huat-side__label) { width: auto; opacity: 1; overflow: visible; visibility: visible; }
  html:root .huat-side:hover .huat-side__heading { display: block; }
  html:root .huat-side:hover .huat-side__group + .huat-side__group { margin-top: 0; padding-top: 0; border-top: 0; }
  html:root .huat-side:hover .huat-side__link { justify-content: flex-start; gap: 11px; padding: 0 12px; }
  html:root .huat-side:hover .huat-side__badge { display: block; }
  html:root .huat-side:hover .huat-side__foot { padding: 14px; border-color: var(--huat-side-foot-line); background: var(--huat-side-foot-bg); }
  html:root .huat-side:hover .huat-side__foot > :is(b, p, .huat-btn) { display: block; }
  html:root .huat-side:hover .huat-side__foot > .huat-btn { display: flex; }
  html:root .huat-side:hover .huat-side__foot > .huat-side__login { display: block; }
  html:root .huat-side:hover .huat-side__me { justify-content: flex-start; gap: 8px; }
  html:root .huat-side:hover .huat-side__me > span { display: block; }
  html:root .huat-side:not(:hover) .huat-side__link[data-huat-tip]::after { content: attr(data-huat-tip); position: fixed; left: calc(var(--huat-rail-w) + 8px); z-index: var(--huat-z-top); padding: 4px 8px; border-radius: var(--huat-r-sm); background: var(--huat-tooltip-bg); color: var(--huat-text-inverse); box-shadow: var(--huat-shadow-sm); font-size: var(--huat-fs-xs); font-weight: 400; line-height: 1.5; opacity: 0; pointer-events: none; transform: translateX(-4px); transition: opacity var(--huat-t-fast), transform var(--huat-t-fast); }
  html:root .huat-side:not(:hover) .huat-side__link:focus-visible::after { opacity: 1; transform: none; }
  html:root .huat-search { width: 240px; flex-basis: 240px; }
  html:root .huat-search:hover { width: 280px; flex-basis: 280px; }
  html:root .huat-dash > .huat-card { grid-column: span 12; }
  html:root .huat-dash > .huat-stat { grid-column: span 6; }
  html:root .huat-recent { grid-template-columns: minmax(0, 1fr); }
  html:root .contest-timer { left: var(--huat-rail-w); }
}
@media (min-width: 601px) and (max-width: 799px) {
  html:root .huat-search,
  html:root .huat-search:hover { flex: 0 0 40px; justify-content: center; width: 40px; padding: 0; }
  html:root .huat-search > span,
  html:root .huat-search kbd { display: none; }
  html:root .huat-topbar__title { font-size: 0; }
  html:root .huat-topbar__title b { font-size: var(--huat-fs-sm); }
  html:root .huat-user-chip > span:not(.icon) { max-width: 80px; }
}
@media (max-width: 600px) {
  html:root { scroll-padding-top: 72px; }
  html:root #panel { margin-left: 0; padding-top: 0; background: var(--huat-bg); }
  html:root .nav.huat-topbar { display: none; }
  html:root .header--mobile { position: sticky; top: 0; z-index: 50; display: block; box-sizing: border-box; height: 56px; padding: 0 12px; border-bottom: 1px solid var(--huat-line); background: var(--huat-surface); color: var(--huat-text); line-height: 1; }
  html:root .header--mobile > .row { display: flex; align-items: center; height: 100%; margin: 0; }
  html:root .header--mobile > .row > .columns { padding: 0; }
  html:root .header--mobile__domain,
  html:root .huat-mobile__brand { display: flex; align-items: center; gap: 8px; height: 28px; margin-top: 0; color: var(--huat-text); font-size: var(--huat-fs-md); font-weight: 800; text-decoration: none; white-space: nowrap; }
  html:root .header--mobile__domain:is(:visited, :hover) { color: var(--huat-text); }
  html:root .header--mobile .huat-side__mark { flex-basis: 28px; width: 28px; height: 28px; font-size: 16px; }
  html:root .header--mobile .huat-side__brandtext { font-size: var(--huat-fs-md); }
  html:root .header--mobile .huat-side__brandtext small { display: none; }
  html:root .header__hamburger { color: var(--huat-text); }
  html:root .hamburger-inner,
  html:root .hamburger-inner::before,
  html:root .hamburger-inner::after { background-color: var(--huat-text); }
  html:root .huat-side { left: auto; right: 0; z-index: 0; display: none; width: 200px; padding: 14px 10px; border-right: 0; border-left: 1px solid var(--huat-line); box-shadow: none; }
  /* ui-default forces the open drawer to block; the custom drawer is flex. */
  html:root.slideout-open #menu.huat-side { display: flex !important; }
  html:root .huat-side__brand { gap: 8px; min-height: 50px; padding: 4px 4px 16px; }
  html:root .huat-side__brand .huat-side__mark { flex-basis: 28px; width: 28px; height: 28px; }
  html:root .huat-side__brandtext { font-size: var(--huat-fs-base); }
  html:root .huat-side__brandtext small { font-size: 10px; }
  html:root .huat-side__link { min-height: 40px; padding: 0 10px; gap: 8px; }
  html:root .huat-side__heading { margin: 12px 10px 6px; }
  html:root .huat-side__foot { padding: 12px; }
  html:root .huat-side__foot .huat-btn { padding: 0 8px; font-size: var(--huat-fs-sm); }
  html:root .main { padding: 12px 12px 32px; }
  html:root .section { margin-left: 0; margin-right: 0; border-radius: 12px; }
  html:root .section__header { padding: 16px 16px 0; }
  html:root .section__body { padding: 12px 16px 16px; }
  html:root .section > .section__body:first-child { padding-top: 16px; }
  html:root .section > .section__body:last-child { padding-bottom: 16px; }
  html:root .section__footer { padding: 12px 16px; }
  html:root .section__tools { top: 14px; right: 16px; }
  html:root .section__list__item { padding: 16px; }
  html:root .section__body.no-padding,
  html:root .section__table-container { overflow-x: auto; }
  html:root .data-table :is(td, th) { white-space: nowrap; }
  html:root .huat-dash > .huat-card { grid-column: span 12; padding: 16px; }
  html:root .huat-dash > .huat-stat { grid-column: span 6; min-height: 146px; }
  html:root .huat-stat__delta { position: static; margin-top: 4px; }
  html:root .huat-hello { flex-wrap: wrap; align-items: flex-start; gap: 12px; padding-top: 4px; }
  html:root .huat-hello h1 { font-size: 24px; }
  html:root .huat-hero { flex-direction: column; align-items: stretch; gap: 20px; }
  html:root .huat-hero h2 { font-size: 22px; }
  html:root .huat-ring { flex-basis: auto; width: 138px; height: 138px; margin: 0 auto; }
  html:root .huat-feed__table { min-width: 620px; }
  html:root .huat-recent { grid-template-columns: minmax(0, 1fr); }
  html:root .huat-recent .huat-card { padding: 16px; }
  html:root .huat-heat__grid.is-ready .huat-heat__cell { opacity: 1; transform: none; }
  html:root .huat-rank__item { padding-left: 4px; padding-right: 4px; }
  html:root .huat-rank__item:hover { transform: none; }
  html:root .dialog__content { max-height: 88vh; overflow-y: auto; }
  html:root .dialog--signin .dialog__content { width: 440px; min-height: 0; }
  html:root .dialog--signin__bg,
  html:root .dialog--signin__side { display: none; }
  html:root .dialog--signin__main { padding: 32px 24px 24px; }
  html:root .section__tab-header { padding-left: 16px; padding-right: 48px; }
  html:root .footer { width: calc(100% - 24px); margin-top: 32px; margin-left: 12px; padding-top: 24px; }
  html:root .footer__category { padding: 12px 0; border-bottom-color: var(--huat-line); }
  html:root .footer__category.expandable { padding: 0; }
  html:root .footer h1 { padding: 12px 0; }
  html:root .footer__category__list { padding: 0 0 12px; }
  html:root .footer__extra-left,
  html:root .footer__extra-right { float: none; }
  html:root .pager .pager__item:is(.previous, .next) { display: inline-flex; }
  html:root.page--problem_main .data-table,
  html:root.page--training_detail .data-table { min-width: 720px; }
  html:root.page--record_main .data-table { min-width: 900px; }
  html:root:is(.page--problem_main, .page--training_detail) .data-table :is(th, td):is(.col--status, .col--tried, .col--difficulty),
  html:root.page--record_main .data-table :is(th, td):is(.col--submit-by, .col--submit-at, .col--time, .col--memory, .col--lang),
  html:root:is(.page--contest_scoreboard, .page--homework_scoreboard) .data-table :is(th, td).col--problem { display: table-cell; }
  html:root:is(.page--problem_main, .page--training_detail) .data-table col:is(.col--status, .col--tried, .col--difficulty),
  html:root.page--record_main .data-table col:is(.col--submit-by, .col--submit-at, .col--time, .col--memory, .col--lang),
  html:root:is(.page--contest_scoreboard, .page--homework_scoreboard) .data-table col.col--problem { display: table-column; }
  html:root:is(.page--problem_detail, .page--contest_detail_problem, .page--homework_detail_problem) .medium-9 > .section:first-child > .section__header { padding: 16px 16px 0; }
  html:root.page--user_detail .profile-header__content { padding: 72px 16px 0; }
  html:root.page--user_detail .profile-header__content > .media { flex-direction: column; align-items: center; gap: 0; }
  html:root.page--user_detail .profile-header__main { padding-top: 16px; margin-top: 0; text-align: center; }
  html:root.page--user_detail .profile-header__contact-bar { justify-content: center; }
  html:root.layout--immersive .immersive--content { margin-top: 32px; padding: 24px; }
  html:root:is(.page--wiki_help, .page--about) .medium-3 > .section.side { position: static; }
  html:root.nojs #menu.huat-side { position: relative; left: auto; right: auto; display: flex; width: 100%; min-height: 0; max-height: none; border-left: 0; border-bottom: 1px solid var(--huat-line); }
  html:root.nojs .huat-side__nav { padding-bottom: 0; }
  html:root.nojs .huat-side__foot { margin-top: 16px; }
  html:root.nojs .header__hamburger { display: none; }
  html:root.layout--immersive.nojs #menu.huat-side { display: none; }
  html:root.layout--immersive .header__hamburger { display: none; }
}

/* Fullscreen editing resets the frame without changing editor internals. */
html:root.mode--scratchpad #panel { margin-left: 0; padding-top: 0; }
html:root.mode--scratchpad #huat-topbar,
html:root.mode--scratchpad .header--mobile { display: none; }
html:root.mode--scratchpad #menu.huat-side,
html:root.layout--immersive.slideout-open #menu.huat-side { display: none !important; }
html:root.mode--scratchpad #scratchpad { top: 0; }
html:root .scratchpad__toolbar { border-bottom: 1px solid var(--huat-line); background: var(--huat-surface); color: var(--huat-text); }
html:root .scratchpad__toolbar__button { padding: 0 12px; min-height: 30px; border: 1px solid var(--huat-line); border-radius: var(--huat-r); background: var(--huat-surface); color: var(--huat-text-2); font-size: var(--huat-fs-sm); }
html:root .scratchpad__toolbar__button.enabled:hover { background: var(--huat-surface-2); color: var(--huat-text); }
html:root .scratchpad__toolbar__submit { border-color: var(--huat-brand); background: var(--huat-brand); color: var(--huat-text-inverse); }
html:root .scratchpad__toolbar__submit.enabled:hover { background: var(--huat-brand-hover); color: var(--huat-text-inverse); }
html:root .scratchpad__toolbar__submit.enabled:hover .icon,
html:root .scratchpad__toolbar__pretest.enabled:hover .icon { color: inherit; }
html:root .scratchpad__toolbar__button.activated { color: var(--huat-brand) !important; background: var(--huat-brand-soft) !important; }
html:root .scratchpad__toolbar__split { background: var(--huat-line); }
html:root .scratchpad-container { background: var(--huat-surface); }

@media print {
  html:root #huat-topbar,
  html:root #menu.huat-side,
  html:root .header--mobile,
  html:root .footer,
  html:root .omnibar,
  html:root .omnibar-toggle { display: none; }
  html:root #panel { margin-left: 0; padding-top: 0; }
  html:root .main { padding: 0; }
  html:root.hasjs .section { opacity: 1; transform: none; box-shadow: none; }
  html:root .section { break-inside: avoid; }
  html:root .huat-dash > .huat-card { grid-column: span 12; }
}

@keyframes huat-ripple { from { transform: scale(0); opacity: 1; } to { transform: scale(4); opacity: 0; } }
@keyframes huat-spin { to { transform: rotate(360deg); } }
@keyframes huat-drop-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes huat-dialog-in { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes huat-search-in { from { opacity: 0; transform: translateX(-50%) scale(.98); } to { opacity: 1; transform: translateX(-50%); } }
@keyframes huat-content-in { from { opacity: .4; } to { opacity: 1; } }
@keyframes huat-empty-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes huat-record-flash { from { background-color: var(--huat-brand-soft); } to { background-color: transparent; } }
@keyframes huat-live-pulse { 0% { box-shadow: 0 0 0 0 var(--huat-ok-soft); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }
@keyframes huat-auth-drift { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(24px, -20px, 0); } }

html:root.nojs .section { opacity: 1; transform: none; }
html.huat-no-motion *,
html.huat-no-motion *::before,
html.huat-no-motion *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0ms !important; transition-duration: .01ms !important; transition-delay: 0ms !important; }
html.huat-no-motion .section { opacity: 1 !important; transform: none !important; }
html:root.huat-no-motion .huat-heat__cell { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0ms !important; transition-duration: .01ms !important; transition-delay: 0ms !important; }
  .section { opacity: 1 !important; transform: none !important; }
  html:root .huat-heat__grid.is-ready .huat-heat__cell { opacity: 1; transform: none; }
  html:root .huat-ring__fg { stroke-dashoffset: calc(377 * (1 - var(--huat-progress, 1))); }
}

/* All component colors are tokens, so the dark theme follows the same layout. */
html.theme--dark {
  --huat-bg: #0f1117; --huat-surface: #171a23; --huat-surface-2: #1e2230; --huat-surface-hover: #1c2030;
  --huat-line: #262b3a; --huat-line-2: #20242f; --huat-line-strong: #343a4d;
  --huat-text: #e6e8f0; --huat-text-2: #a0a6bd; --huat-text-3: #6c7290;
  --huat-brand: #5b8cff; --huat-brand-hover: #739dff; --huat-brand-soft: rgba(91,140,255,.14); --huat-brand-soft-2: rgba(91,140,255,.24);
  --huat-ok-soft: rgba(18,183,106,.14); --huat-bad-soft: rgba(240,68,56,.14); --huat-warn-soft: rgba(247,144,9,.14); --huat-muted-soft: rgba(152,162,179,.14);
  --huat-shadow-xs: none; --huat-shadow-md: 0 14px 40px rgba(0,0,0,.35); --huat-shadow-lg: 0 24px 60px rgba(0,0,0,.5);
  --huat-line-hover: #343a4d;
  --huat-input-hover: #4b5470;
  --huat-danger-line: rgba(240,68,56,.35);
  --huat-info: #5b8cff;
  --huat-info-soft: rgba(91,140,255,.14);
  --huat-violet-soft: rgba(109,91,255,.16);
  --huat-top-bg: rgba(15,17,23,.82);
  --huat-top-scrolled: rgba(23,26,35,.9);
  --huat-float-bg: rgba(23,26,35,.95);
  --huat-loader-overlay: rgba(15,17,23,.7);
  --huat-shadow-sm: 0 2px 8px rgba(0,0,0,.24);
  --huat-inline-code: #ff9b7a;
  --huat-code-keyword: #b69aff;
  --huat-code-string: #65d6a6;
  --huat-heat-0: #262b3a;
  --huat-heat-1: #263b67;
  --huat-heat-2: #375b9e;
  --huat-heat-3: #4f80ec;
  --huat-heat-4: #739dff;
  --huat-gold-soft: rgba(224,161,0,.1);
  --huat-silver-soft: rgba(139,150,170,.1);
  --huat-bronze-soft: rgba(194,122,67,.1);
  --huat-auth-glow-1: rgba(35,100,219,.24);
  --huat-auth-glow-2: rgba(109,91,255,.2);
  --huat-select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a0a6bd' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  color-scheme: dark;
}
html:root.theme--dark .section__tab-header-item { color: var(--huat-text-2) !important; }
html:root.theme--dark .section__tab-header-item:is(.selected, .tab--active) { color: var(--huat-text) !important; }
html:root.theme--dark .section__tab-header-item:hover { color: var(--huat-text) !important; }
/* Mobile account actions retain the same native logout and switch handlers. */
html:root .huat-side__account-actions { display: none; }
@media (max-width: 600px) {
  html:root .huat-side__account-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
  html:root .huat-side__action { display: flex; align-items: center; justify-content: center; min-height: 32px; padding: 4px 8px; border: 1px solid var(--huat-line); border-radius: var(--huat-r); background: var(--huat-surface); color: var(--huat-text-2); font-size: var(--huat-fs-xs); font-weight: 500; text-decoration: none; }
  html:root .huat-side__action:hover { border-color: var(--huat-brand-soft-2); background: var(--huat-brand-soft); color: var(--huat-brand); }
  html:root .huat-side__action:focus-visible { outline: 0; box-shadow: var(--huat-focus); }
}
