@import './theme.css';

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body, * {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
*::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
  background: transparent;
}
body {
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
}

/* =========================================================================
   Top Dual-Mode Progress Bar (顶部加载过渡 & 页面上下滚动双模进度条)
   ========================================================================= */
.top-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2.5px;
  width: 0%;
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary), 0 0 4px var(--primary);
  z-index: 99999;
  pointer-events: none;
  opacity: 0;
  transition: width 0.2s cubic-bezier(0.1, 0.9, 0.2, 1), opacity 0.25s ease-out, background 0.3s ease;
}

.top-progress-bar.active {
  opacity: 1;
}

.top-progress-bar.scroll-mode {
  opacity: 0.95;
  transition: width 0.06s linear, opacity 0.2s ease;
}

/* Header */
header {
  height: var(--header-h);
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-base);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 16px;
  overflow-x: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-primary);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.brand-badge {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
  white-space: nowrap;
}
.top-nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 100%;
  margin-left: 28px;
  white-space: nowrap;
  flex-shrink: 0;
}
.top-nav-item {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
  position: relative;
  transition: color 0.2s;
  cursor: pointer;
  white-space: nowrap;
}
.top-nav-item:hover {
  color: var(--text-primary);
}
.top-nav-item.active {
  color: var(--primary);
  font-weight: 600;
}
.top-nav-item.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 2px 2px 0 0;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Custom UI GSelect Top Navigation Dropdown */
.g-nav-select {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: min(520px, 46vw);
}
.g-nav-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  border-radius: var(--radius);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  width: 100%;
  min-width: min(520px, 46vw);
  height: 32px;
}
.g-nav-select-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.g-nav-select-trigger:hover {
  border-color: var(--primary);
  background: var(--bg-surface);
}
.g-nav-select-arrow {
  font-size: 11px;
  color: var(--text-secondary);
  transition: transform 0.25s ease;
  margin-left: 4px;
}
.g-menu.g-nav-select-menu {
  position: fixed;
  min-width: 360px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 10000;
  backdrop-filter: blur(8px);
  left: 0;
  top: 0;
}
.g-menu.g-nav-select-menu.open {
  display: flex;
}
.g-nav-select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  transition: background 0.15s;
  width: 100%;
  border: 0;
  background: transparent;
}
.g-nav-select-option:hover {
  background: var(--bg-surface);
}
.g-nav-select-option.selected {
  background: rgba(24, 160, 88, 0.12);
}
@keyframes dropdownFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.g-nav-select-menu.is-placement-top,
.g-nav-select-menu.is-placement-bottom {
  animation: dropdownFadeIn 0.16s ease;
}
select, button {
  font-family: inherit;
}
.select-theme {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-base);
  padding: 6px 12px;
  border-radius: var(--radius);
  outline: none;
  cursor: pointer;
  font-size: 0.88rem;
}
.btn-icon {
  background: var(--bg-card);
  color: var(--text-regular);
  border: 1px solid var(--border-base);
  padding: 6px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  text-decoration: none;
  transition: all 0.2s;
}
.btn-icon:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* App Container */
.app-container {
  display: flex;
  min-height: calc(100vh - var(--header-h));
}

/* Sidebar */
aside {
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-base);
  padding: 20px 12px;
  flex-shrink: 0;
  height: calc(100vh - var(--header-h));
  position: sticky;
  top: var(--header-h);
  overflow-y: auto;
}
.nav-search-wrapper {
  position: relative;
  width: 100%;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
}
.nav-search {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  color: var(--text-primary);
  padding: 8px 30px 8px 12px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}
.nav-search:focus { border-color: var(--primary); }
.nav-search-clear-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}
.nav-search-clear-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}
.nav-search-clear-btn svg {
  width: 13px;
  height: 13px;
  display: block;
}
.nav-group-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  padding: 8px 12px 4px;
  font-weight: 600;
}
.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  color: var(--text-regular);
  text-decoration: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  cursor: pointer;
  margin-bottom: 2px;
  transition: all 0.15s ease;
}
.nav-item:hover {
  background: var(--bg-hover);
  color: var(--primary);
}
.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

/* Main Content */
main {
  flex: 1;
  padding: 28px 36px;
  max-width: 1060px;
  overflow-y: auto;
  min-width: 0;
}

/* Naive UI / Element Plus Style Right-Side Anchor Table of Contents (大纲导航栏) */
.doc-anchor-nav {
  width: 185px;
  flex-shrink: 0;
  padding: 28px 10px 32px 6px;
  height: calc(100vh - var(--header-h));
  position: sticky;
  top: var(--header-h);
  overflow-y: auto;
  font-size: 13px;
  display: block;
  box-sizing: border-box;
  user-select: none;
}

@media (max-width: 1024px) {
  .doc-anchor-nav {
    display: none !important;
  }
}

.anchor-nav-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.anchor-nav-header {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding-left: 8px;
}

.anchor-nav-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 4px;
  font-size: 12.5px;
  line-height: 1.4;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 2px solid transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.anchor-nav-item:hover {
  color: var(--primary);
  background: var(--bg-hover);
}

.anchor-nav-item.active {
  color: var(--primary);
  font-weight: 700;
  border-left-color: var(--primary);
  background: rgba(24, 160, 88, 0.08);
}

.anchor-nav-subitem {
  padding-left: 18px;
  font-size: 12px;
}

.anchor-nav-divider {
  height: 1px;
  background: var(--border-base);
  margin: 8px 0 6px 0;
}
.doc-header {
  margin-bottom: 24px;
}
.doc-title {
  font-size: 1.85rem;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.doc-desc {
  color: var(--text-secondary);
  font-size: 1rem;
}

.doc-page-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  margin: 36px 0 104px;
  padding-top: 18px;
  border-top: 1px solid var(--border-base);
}
.doc-page-nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 14px;
  border: 1px solid var(--border-base);
  border-radius: var(--radius);
  background: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.doc-page-nav-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--bg-hover);
}
.doc-page-nav-btn small {
  display: block;
  margin-bottom: 2px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
}
.doc-page-nav-btn span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}
.doc-page-nav-btn-next {
  justify-content: flex-end;
  text-align: right;
}
.doc-page-nav-btn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 720px) {
  .doc-page-nav {
    grid-template-columns: 1fr;
  }
}

/* Demo Section & Demo Card Standards (Element Plus / Naive UI Style) */
.demo-section,
.demo-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-lg, 10px);
  margin-top: 24px;
  margin-bottom: 36px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  transition: all 0.25s ease;
}
.demo-section:hover,
.demo-card:hover {
  border-color: var(--border-hover, var(--border-base));
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
}
.demo-section-header,
.demo-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-base);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
}
.demo-section-title,
.demo-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
}
.demo-canvas,
.demo-card-body {
  padding: 26px 22px;
  background: var(--bg-surface);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  box-sizing: border-box;
}
.demo-canvas-col {
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
}
.code-box {
  background: #141418;
  border-top: 1px solid var(--border-base);
  position: relative;
}
.code-box pre {
  padding: 18px 20px;
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  overflow-x: auto;
}
.btn-copy {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-copy:hover {
  background: var(--primary);
  border-color: var(--primary);
}

/* Code Tab Bar for Before vs After Comparison */
.code-tab-container {
  border-top: 1px solid var(--border-base);
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
}
.code-tab-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid var(--border-base);
  flex-wrap: wrap;
  gap: 8px;
}
.code-tab-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.code-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}
.code-tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}
.code-tab-btn.active {
  background: var(--bg-card);
  color: var(--primary);
  border-color: var(--primary);
}
.code-tab-btn.tab-before.active {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.5);
  background: rgba(248, 113, 113, 0.12);
}
.code-tab-btn.tab-after.active {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.5);
  background: rgba(52, 211, 153, 0.12);
}
.code-tab-panel {
  display: none;
  position: relative;
}
.code-tab-panel.active {
  display: block;
}
.code-diff-tip {
  padding: 8px 14px;
  font-size: 11.5px;
  color: var(--text-regular);
  background: rgba(64, 158, 255, 0.08);
  border-bottom: 1px solid var(--border-base);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* UI Component Simulation */
.g-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 16px;
  font-size: 0.88rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}
.g-btn-default {
  background: var(--bg-surface);
  border-color: var(--border-base);
  color: var(--text-primary);
}
.g-btn-default:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.g-btn-primary { background: var(--primary); color: #fff; }
.g-btn-primary:hover { background: var(--primary-hover); }
.g-btn-success { background: var(--success); color: #fff; }
.g-btn-warning { background: var(--warning); color: #fff; }
.g-btn-danger { background: var(--danger); color: #fff; }
.g-btn-info { background: var(--info); color: #fff; }

.g-btn-outline {
  background: transparent;
  border-color: var(--primary);
  color: var(--primary);
}
.g-btn-outline:hover {
  background: var(--primary-light);
}
.g-btn-dashed {
  background: transparent;
  border: 1px dashed var(--primary);
  color: var(--primary);
}
.g-btn-text {
  background: transparent;
  border: none;
  color: var(--primary);
}
.g-btn-text:hover { background: var(--bg-hover); }
.g-btn-round { border-radius: 999px; }

/* GMenu Navigation Component */
.g-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.g-menu-horizontal {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
}
.g-menu-horizontal > .g-menu-item,
.g-menu-horizontal > .g-sub-menu {
  width: auto;
  flex: 0 0 auto;
}
.g-menu-item {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--text-primary);
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  text-align: left;
  white-space: nowrap;
}
.g-menu-item:hover,
.g-menu-item.selected,
.g-menu-item.is-active {
  background: var(--primary-light);
  color: var(--primary);
}
.g-menu-item.is-disabled,
.g-menu-item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  background: transparent !important;
  border-color: transparent !important;
  color: var(--text-disabled) !important;
  box-shadow: none !important;
}
.g-sub-menu {
  position: relative;
  width: 100%;
}
.g-sub-menu-title {
  justify-content: space-between;
  width: 100%;
}
.g-sub-menu-arrow {
  font-size: 11px;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
}
.g-sub-menu.is-open > .g-sub-menu-title .g-sub-menu-arrow {
  transform: rotate(180deg);
}
.g-sub-menu-panel {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 4px 0 0;
}
.g-sub-menu.is-open > .g-sub-menu-panel {
  display: flex;
}
.g-sub-menu-popup {
  width: auto;
}
.g-sub-menu-popup > .g-sub-menu-panel {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  min-width: 200px;
  z-index: 40;
  padding: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.g-sub-menu-popup.is-placement-top > .g-sub-menu-panel {
  top: auto;
  bottom: calc(100% + 6px);
}

/* Multi-level Recursive Submenu Indentation (Level 2 to Level 5+) */
.g-sub-menu-panel .g-menu-item {
  padding-left: 28px;
}
.g-sub-menu-panel .g-sub-menu-panel .g-menu-item {
  padding-left: 44px;
}
.g-sub-menu-panel .g-sub-menu-panel .g-sub-menu-panel .g-menu-item {
  padding-left: 60px;
}
.g-sub-menu-panel .g-sub-menu-panel .g-sub-menu-panel .g-sub-menu-panel .g-menu-item {
  padding-left: 76px;
}

/* Disabled State for Buttons & Form Controls */
.g-btn:disabled,
.g-btn.is-disabled,
button:disabled {
  cursor: not-allowed !important;
  opacity: 0.45 !important;
  background: var(--border-base) !important;
  border-color: var(--border-base) !important;
  color: var(--text-disabled) !important;
  box-shadow: none !important;
  transform: none !important;
  pointer-events: none !important;
}
.g-btn:disabled *,
button:disabled * {
  color: var(--text-disabled) !important;
}

.g-input:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed !important;
  opacity: 0.55 !important;
  background-color: var(--bg-hover) !important;
  border-color: var(--border-base) !important;
  color: var(--text-disabled) !important;
}

/* Inputs */
.g-input-wrapper {
  display: inline-flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-base);
  border-radius: var(--radius);
  padding: 0 12px;
  height: 36px;
  width: auto;
  max-width: 100%;
  box-sizing: border-box;
  transition: border-color var(--transition);
}
.g-input-wrapper:focus-within { border-color: var(--primary); }
.g-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  flex: 1;
  font-size: 0.88rem;
  font-family: inherit;
}

/* Switch */
.g-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 22px;
}
.g-switch input { opacity: 0; width: 0; height: 0; }
.g-switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--border-base);
  transition: .3s;
  border-radius: 22px;
}
.g-switch-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}
input:checked + .g-switch-slider { background-color: var(--primary); }
input:checked + .g-switch-slider:before { transform: translateX(22px); }

/* Tags */
.g-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  font-size: 0.78rem;
  border-radius: 4px;
  border: 1px solid transparent;
}
.g-tag-default { background: var(--bg-surface); border-color: var(--border-base); color: var(--text-regular); }
.g-tag-primary { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.g-tag-success { background: rgba(24, 160, 88, 0.15); border-color: var(--success); color: var(--success); }
.g-tag-warning { background: rgba(240, 160, 32, 0.15); border-color: var(--warning); color: var(--warning); }
.g-tag-danger { background: rgba(208, 48, 80, 0.15); border-color: var(--danger); color: var(--danger); }

/* Progress */
.g-progress-bar {
  width: 100%;
  height: 8px;
  background: var(--border-base);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}
.g-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 99px;
  transition: width 0.4s ease;
}

/* Card simulation */
.sim-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  width: 100%;
}
.sim-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-base);
  margin-bottom: 12px;
  font-weight: 600;
}

/* Button Style Checkbox & Radio (Element Plus / Naive UI style) */
.g-btn-group-segmented {
  display: inline-flex;
  border-radius: var(--radius);
  border: 1px solid var(--border-base);
  overflow: hidden;
  background: var(--bg-card);
}
.g-btn-segmented-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-regular);
  cursor: pointer;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-base);
  transition: all 0.2s ease;
  user-select: none;
}
.g-btn-segmented-item:last-child {
  border-right: none;
}
.g-btn-segmented-item input {
  display: none;
}
.g-btn-segmented-item:hover {
  color: var(--primary);
}
.g-btn-segmented-item.active,
.g-btn-segmented-item:has(input:checked) {
  background: var(--primary);
  color: #ffffff;
  font-weight: 600;
}
.g-btn-segmented-item.disabled,
.g-btn-segmented-item:has(input:disabled) {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--bg-hover);
}

/* Modal / Dialog */
.g-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99990;
}
.g-modal-overlay.active { display: flex !important; }
.g-modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-lg);
  width: 440px;
  max-width: 90vw;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  animation: modalPop 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
@keyframes modalPop {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.g-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 12px;
}
.g-modal-footer {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Drawer Simulation */
.g-drawer-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  justify-content: flex-end;
  z-index: 99990;
}
.g-drawer-overlay.active { display: flex !important; }
.g-drawer-box {
  background: var(--bg-surface);
  width: 360px;
  height: 100%;
  padding: 24px;
  box-shadow: var(--shadow);
  animation: drawerSlide 0.25s ease-out;
  display: flex;
  flex-direction: column;
}
@keyframes drawerSlide {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

/* Vant Style GPopup & GOverlay Simulation */
.g-popup-mask {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 99990;
  display: none;
  animation: fadeIn 0.25s ease-out;
}
.g-popup-mask.active {
  display: block !important;
}
.g-popup-panel {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  position: fixed;
  z-index: 99991;
  padding: 20px;
  box-sizing: border-box;
}
.g-popup-panel.g-popup-center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 320px;
  max-width: 90vw;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-base);
  animation: modalPop 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
.g-popup-panel.g-popup-top {
  top: 0;
  left: 0;
  right: 0;
  border-bottom: 1px solid var(--border-base);
  animation: slideDown 0.25s ease-out;
}
.g-popup-panel.g-popup-bottom {
  bottom: 0;
  left: 0;
  right: 0;
  border-top: 1px solid var(--border-base);
  animation: slideUp 0.25s ease-out;
}
.g-popup-panel.g-popup-left {
  top: 0;
  bottom: 0;
  left: 0;
  width: 280px;
  max-width: 80vw;
  border-right: 1px solid var(--border-base);
  animation: slideRight 0.25s ease-out;
}
.g-popup-panel.g-popup-right {
  top: 0;
  bottom: 0;
  right: 0;
  width: 280px;
  max-width: 80vw;
  border-left: 1px solid var(--border-base);
  animation: slideLeft 0.25s ease-out;
}

.g-popup-panel.g-popup-round.g-popup-bottom {
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
}
.g-popup-panel.g-popup-round.g-popup-top {
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
}
.g-popup-panel.g-popup-round.g-popup-center {
  border-radius: 18px;
}

@keyframes slideDown {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
@keyframes slideRight {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}
@keyframes slideLeft {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

/* GOverlay */
.g-overlay-mask {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 99990;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease-out;
}
.g-overlay-mask.active {
  display: flex !important;
}

/* Vant UI Style GSkeleton Shimmer Animation */
.g-skeleton-box {
  display: flex;
  gap: 16px;
  width: 100%;
}
.g-skeleton-avatar {
  background: var(--bg-hover);
  flex-shrink: 0;
}
.g-skeleton-avatar-round {
  border-radius: 50%;
}
.g-skeleton-avatar-square {
  border-radius: var(--radius);
}
.g-skeleton-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.g-skeleton-title {
  height: 18px;
  background: var(--bg-hover);
  border-radius: 4px;
  width: 40%;
}
.g-skeleton-row {
  height: 14px;
  background: var(--bg-hover);
  border-radius: 4px;
}
.g-skeleton-animate {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.15) 37%, rgba(255, 255, 255, 0.05) 63%);
  background-size: 400% 100%;
  animation: skeletonShimmer 1.5s ease infinite;
}
[data-theme="light"] .g-skeleton-animate {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.04) 25%, rgba(0, 0, 0, 0.1) 37%, rgba(0, 0, 0, 0.04) 63%);
  background-size: 400% 100%;
  animation: skeletonShimmer 1.5s ease infinite;
}
@keyframes skeletonShimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ======================================================== */
/* Vant / Element Plus Style: Popover, NoticeBar, ActionSheet, Stepper, Picker, Tour */
/* ======================================================== */

/* 1. GPopover */
.g-popover-wrapper {
  position: relative;
  display: inline-block;
}
.g-popover-bubble {
  position: absolute;
  z-index: 10000;
  background: #323233;
  color: #fff;
  border-radius: 8px;
  padding: 8px 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  font-size: 13px;
  min-width: 120px;
  display: none;
  animation: fadeIn 0.2s ease-out;
}
.g-popover-bubble.light {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-base);
  box-shadow: var(--shadow);
}
.g-popover-bubble.active {
  display: block;
}
.g-popover-bubble.placement-bottom {
  top: calc(100% + 8px);
  left: 0;
}
.g-popover-bubble.placement-top {
  bottom: calc(100% + 8px);
  left: 0;
}
.g-popover-bubble.placement-left {
  right: calc(100% + 8px);
  top: 0;
}
.g-popover-bubble.placement-right {
  left: calc(100% + 8px);
  top: 0;
}
.g-popover-item {
  padding: 8px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s;
}
.g-popover-item:hover {
  background: rgba(255, 255, 255, 0.1);
}
.g-popover-bubble.light .g-popover-item:hover {
  background: var(--bg-hover);
}

/* 2. GNoticeBar */
.g-notice-bar {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  font-size: 13px;
  border-radius: var(--radius);
  overflow: hidden;
  gap: 10px;
}
.g-notice-bar-warning {
  background: #fffbe8;
  color: #ed6a0c;
  border: 1px solid #ffe58f;
}
[data-theme="dark"] .g-notice-bar-warning {
  background: rgba(240, 160, 32, 0.15);
  color: #f0a020;
  border: 1px solid rgba(240, 160, 32, 0.3);
}
.g-notice-bar-info {
  background: rgba(32, 128, 240, 0.12);
  color: var(--info);
  border: 1px solid rgba(32, 128, 240, 0.3);
}
.g-notice-marquee {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
}
.g-notice-content {
  display: inline-block;
  animation: noticeMarquee 12s linear infinite;
}
@keyframes noticeMarquee {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* 3. GActionSheet */
.g-action-sheet-mask {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.65);
  z-index: 99990;
  display: none;
}
.g-action-sheet-mask.active {
  display: block;
}
.g-action-sheet-panel {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg-surface);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  z-index: 99991;
  overflow: hidden;
  animation: slideUp 0.25s ease-out;
  border-top: 1px solid var(--border-base);
}
.g-action-sheet-header {
  padding: 16px;
  text-align: center;
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
}
.g-action-sheet-item {
  padding: 14px 16px;
  text-align: center;
  font-size: 15px;
  color: var(--text-primary);
  background: var(--bg-surface);
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s;
}
.g-action-sheet-item:hover {
  background: var(--bg-hover);
}
.g-action-sheet-item.danger {
  color: var(--danger);
}
.g-action-sheet-cancel {
  padding: 14px 16px;
  text-align: center;
  font-size: 15px;
  color: var(--text-secondary);
  background: var(--bg-card);
  cursor: pointer;
  margin-top: 8px;
}

/* 4. GStepper */
.g-stepper {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  overflow: hidden;
}
.g-stepper-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.g-stepper-btn:hover {
  background: var(--bg-hover);
}
.g-stepper-input {
  width: 44px;
  height: 32px;
  text-align: center;
  border: none;
  background: none;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-mono);
  outline: none;
}
.g-stepper.round {
  border-radius: 20px;
  padding: 2px;
}
.g-stepper.round .g-stepper-btn {
  border-radius: 50%;
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: #fff;
}

/* 5. GPicker Wheel */
.g-picker-mask {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.65);
  z-index: 99990;
  display: none;
}
.g-picker-mask.active {
  display: block;
}
.g-picker-panel {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg-surface);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  z-index: 99991;
  border-top: 1px solid var(--border-base);
  animation: slideUp 0.25s ease-out;
}
.g-picker-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-base);
}
.g-picker-list {
  display: flex;
  flex-direction: column;
  max-height: 200px;
  overflow-y: auto;
}
.g-picker-item {
  padding: 12px 20px;
  text-align: center;
  font-size: 15px;
  color: var(--text-regular);
  cursor: pointer;
}
.g-picker-item.selected {
  color: var(--primary);
  font-weight: 700;
  background: var(--primary-light);
}

/* 6. GTour */
.g-tour-mask {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 99995;
  pointer-events: auto;
  display: none;
}
.g-tour-mask.active {
  display: block;
}
.g-tour-popover {
  position: fixed;
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  padding: 18px 20px;
  z-index: 99999;
  width: 280px;
  animation: modalPop 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

/* Alert Simulation */
.g-alert-box {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.g-alert-info { background: rgba(32, 128, 240, 0.12); border: 1px solid rgba(32, 128, 240, 0.3); color: var(--info); }
.g-alert-success { background: rgba(24, 160, 88, 0.12); border: 1px solid rgba(24, 160, 88, 0.3); color: var(--success); }
.g-alert-warning { background: rgba(240, 160, 32, 0.12); border: 1px solid rgba(240, 160, 32, 0.3); color: var(--warning); }
.g-alert-danger { background: rgba(208, 48, 80, 0.12); border: 1px solid rgba(208, 48, 80, 0.3); color: var(--danger); }

/* Toast Message */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast-item {
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  color: var(--text-primary);
  padding: 10px 14px 10px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  animation: toastIn 0.3s ease;
  pointer-events: auto;
}
.toast-close-btn {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin-left: 6px;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.toast-close-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.toast-close-btn svg {
  width: 13px;
  height: 13px;
  display: block;
  pointer-events: none;
}
@keyframes toastIn {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* API Table */
.api-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 0.88rem;
}
.api-table th, .api-table td {
  border: 1px solid var(--border-base);
  padding: 10px 14px;
  text-align: left;
}
.api-table th {
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-weight: 600;
}
.api-prop { font-family: var(--font-mono); color: var(--primary); font-weight: 600; }
.api-type { font-family: var(--font-mono); color: #e06c75; font-size: 0.82rem; }

/* Global Search Command Palette */
.global-search-backdrop {
  position: fixed;
  inset: 0;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: flex-start;
  padding-top: 14vh;
  z-index: 999999;
  animation: fadeIn 0.15s ease-out;
}
.global-search-backdrop.active {
  display: flex !important;
}

.global-search-card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-base) !important;
  border-radius: 14px !important;
  width: 660px !important;
  max-width: 92vw !important;
  box-shadow: 0 25px 65px rgba(0, 0, 0, 0.6) !important;
  overflow: hidden !important;
  animation: searchPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes searchPop {
  from { transform: scale(0.95) translateY(-10px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.search-result-item:hover {
  background: var(--bg-hover) !important;
}

/* Router Simulator & Transition Animations */
.sim-page {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.anim-slide-left-in { animation: slideLeftIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.anim-slide-left-out { animation: slideLeftOut 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.anim-slide-right-in { animation: slideRightIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.anim-slide-right-out { animation: slideRightOut 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.anim-slide-up-in { animation: slideUpIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.anim-slide-up-out { animation: slideUpOut 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.anim-slide-down-in { animation: slideDownIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.anim-slide-down-out { animation: slideDownOut 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.anim-zoom-in { animation: zoomIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.anim-zoom-out { animation: zoomOut 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.anim-zoom-bounce { animation: zoomBounce 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.anim-zoom-center-in { animation: zoomIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.anim-zoom-center-out { animation: zoomCenterOut 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.anim-fade-in { animation: fadeIn 0.35s ease-out forwards; }
.anim-fade-out { animation: fadeOut 0.35s ease-out forwards; }

@keyframes slideLeftIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
@keyframes slideLeftOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(-35%); opacity: 0.5; }
}
@keyframes slideRightIn {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}
@keyframes slideRightOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(35%); opacity: 0.5; }
}
@keyframes slideUpIn {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
@keyframes slideUpOut {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(-35%); opacity: 0.5; }
}
@keyframes slideDownIn {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}
@keyframes slideDownOut {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(35%); opacity: 0.5; }
}
@keyframes zoomIn {
  from { transform: scale(0.05); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes zoomOut {
  from { transform: scale(2.2); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes zoomBounce {
  0% { transform: scale(0.1); opacity: 0; }
  70% { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes zoomCenterOut {
  from { transform: scale(1); opacity: 1; }
  to { transform: scale(1.2); opacity: 0; }
}
@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Uni-UI Style Expandable FAB Floating Action Toolbar in Bottom-Right */
.g-fab-wrapper {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 10px;
}

.g-fab-trigger {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-base) !important;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  outline: none;
}

.g-fab-trigger:hover {
  transform: scale(1.08);
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

.g-fab-trigger.collapsed {
  background: var(--primary) !important;
  color: #ffffff !important;
  border-color: var(--primary) !important;
}

.g-fab-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card) !important;
  border: 1px solid var(--border-base) !important;
  padding: 6px 14px;
  border-radius: 30px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: right center;
}

.g-fab-menu.collapsed {
  opacity: 0;
  transform: scale(0.85) translateX(15px);
  pointer-events: none;
  visibility: hidden;
}

.g-fab-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.g-fab-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.g-fab-divider {
  width: 1px;
  height: 18px;
  background: var(--border-base);
  margin: 0 2px;
}

.g-fab-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 14px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.g-fab-btn:hover {
  background: var(--bg-surface);
  color: var(--primary);
}

/* Vant UI Styled GToast */
.g-toast-mask {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.001);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.g-toast-mask.forbid-click {
  pointer-events: auto;
}
.g-toast-box {
  background: rgba(18, 18, 22, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #ffffff;
  border-radius: 8px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  max-width: 80%;
  text-align: center;
  animation: gToastFadeIn 0.2s ease forwards;
  pointer-events: auto;
  user-select: none;
}
.g-toast-box.with-icon {
  min-width: 120px;
  min-height: 100px;
  padding: 18px 20px;
}
.g-toast-icon {
  font-size: 32px;
  line-height: 1;
}
.g-toast-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: gSpin 0.8s linear infinite;
  box-sizing: border-box;
}
.g-loading-fullscreen-mask {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  animation: gToastFadeIn 0.2s ease forwards;
}
.g-loading-fullscreen-card {
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  border-radius: 12px;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  max-width: 80%;
  text-align: center;
}
.g-loading-ring {
  width: 44px;
  height: 44px;
  border: 3.5px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: gSpin 0.8s linear infinite;
}
.g-loading-fullscreen-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* =========================================================================
   Real Interactive Modal Dialog, Overlay, Popup Styles
   ========================================================================= */
.g-dialog-modal-mask {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99990;
  display: none;
  align-items: center;
  justify-content: center;
  animation: gToastFadeIn 0.2s ease forwards;
}
.g-dialog-modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  border-radius: 12px;
  width: 90%;
  max-width: 440px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: gDialogZoomIn 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}
@keyframes gDialogZoomIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.g-dialog-modal-header {
  padding: 16px 20px 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.g-dialog-modal-body {
  padding: 8px 20px 20px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.g-dialog-modal-footer {
  padding: 12px 20px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-base);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.g-overlay-fullscreen-mask {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99980;
  display: none;
  align-items: center;
  justify-content: center;
  animation: gToastFadeIn 0.2s ease forwards;
}
.g-overlay-center-box {
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  border-radius: 10px;
  padding: 20px 28px;
  color: var(--text-primary);
  font-size: 13px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.g-popup-fullscreen-mask {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 99985;
  display: none;
  animation: gToastFadeIn 0.2s ease forwards;
}
.g-popup-panel {
  position: absolute;
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
  padding: 18px 22px;
}
.g-popup-panel.pos-center {
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 12px;
  min-width: 300px;
  max-width: 90%;
}
.g-popup-panel.pos-bottom {
  left: 0; right: 0; bottom: 0;
  border-radius: 16px 16px 0 0;
  border-bottom: none;
}
.g-popup-panel.pos-top {
  left: 0; right: 0; top: 0;
  border-radius: 0 0 16px 16px;
  border-top: none;
}
.g-popup-panel.pos-left {
  left: 0; top: 0; bottom: 0;
  width: 280px;
  border-left: none;
}
.g-popup-panel.pos-right {
  right: 0; top: 0; bottom: 0;
  width: 280px;
  border-right: none;
}
.g-toast-mask.pos-top .g-toast-box {
  margin-top: 80px;
  align-self: flex-start;
}
.g-toast-mask.pos-bottom .g-toast-box {
  margin-bottom: 80px;
  align-self: flex-end;
}
@keyframes gToastFadeIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes gSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* JRPG Golden Sun / Final Fantasy Style Dialogue Box */
.g-dialogue-mask {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 99990;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 30px;
}
.g-dialogue-box {
  width: 90%;
  max-width: 760px;
  min-height: 140px;
  background: linear-gradient(180deg, #0a1f44 0%, #051026 100%);
  border: 3px solid #d4d9e6;
  outline: 2px solid #000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), inset 0 0 10px rgba(0, 0, 0, 0.6);
  border-radius: 6px;
  padding: 16px 20px;
  color: #ffffff;
  display: flex;
  gap: 16px;
  position: relative;
  cursor: pointer;
  user-select: none;
  animation: gToastFadeIn 0.2s ease forwards;
}
.g-dialogue-avatar {
  width: 80px;
  height: 80px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  flex-shrink: 0;
}
.g-dialogue-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.g-dialogue-speaker {
  display: inline-block;
  align-self: flex-start;
  background: linear-gradient(90deg, #1b356d, #0d1e44);
  border: 1px solid #e6a23c;
  color: #ffd04b;
  font-size: 13px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 4px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}
.g-dialogue-content {
  font-size: 16px;
  line-height: 1.6;
  color: #f1f2f6;
  text-shadow: 1px 1px 2px #000;
  font-family: var(--font-sans);
  letter-spacing: 0.5px;
}
.g-dialogue-indicator {
  position: absolute;
  right: 16px;
  bottom: 12px;
  color: #ffd04b;
  font-size: 14px;
  animation: gBlink 0.7s infinite alternate ease-in-out;
}
.g-dialogue-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.g-dialogue-option-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}
.g-dialogue-option-btn:hover {
  background: #409eff;
  border-color: #ffd04b;
  color: #fff;
  transform: translateX(4px);
}
@keyframes gBlink {
  from { opacity: 0.3; transform: translateY(0); }
  to { opacity: 1; transform: translateY(3px); }
}

/* WeChat & Lifeline Style Chat Stream */
.g-chat-container {
  display: flex;
  flex-direction: column;
  height: 380px;
  background: var(--bg-surface);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}
.g-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.g-chat-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  max-width: 85%;
}
.g-chat-row.is-self {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.g-chat-row.is-other {
  align-self: flex-start;
}
.g-chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.g-chat-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.g-chat-row.is-self .g-chat-col {
  align-items: flex-end;
}
.g-chat-bubble {
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  position: relative;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.g-chat-row.is-self .g-chat-bubble {
  background: #07c160;
  color: #ffffff;
  border-top-right-radius: 2px;
}
.g-chat-row.is-other .g-chat-bubble {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-base);
  border-top-left-radius: 2px;
}
.g-chat-sys-pill {
  align-self: center;
  background: rgba(0, 0, 0, 0.15);
  color: var(--text-secondary);
  font-size: 11px;
  padding: 3px 12px;
  border-radius: 12px;
  margin: 4px 0;
}

/* Lifeline Style Dark Bubbles */
.g-lifeline-container {
  background: #242426;
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-family: var(--font-sans);
}
.g-lifeline-bubble {
  align-self: flex-start;
  background: #38383c;
  color: #e4e4e6;
  padding: 8px 16px;
  border-radius: 18px;
  font-size: 14px;
  max-width: 80%;
  line-height: 1.5;
  animation: gToastFadeIn 0.25s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.g-lifeline-bubble.highlight {
  border: 2px solid #f56c6c;
  background: #44444a;
}




/* ==========================================================================
   Element Plus Style High-Fidelity Custom Select Component
   ========================================================================== */
.g-custom-select-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
  font-family: var(--font-sans);
  user-select: none;
}

.g-custom-select-control {
  min-height: 38px;
  background: var(--bg-surface);
  border: 1px solid var(--border-base);
  border-radius: var(--radius);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  gap: 8px;
}

.g-custom-select-control:hover {
  border-color: var(--primary);
}

.g-custom-select-control.is-focused,
.g-custom-select-control.is-open {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
}

.g-custom-select-control.is-disabled {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-base);
  cursor: not-allowed;
  opacity: 0.6;
}

.g-custom-select-value-area {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  overflow: hidden;
}

.g-custom-select-placeholder {
  color: var(--text-secondary);
  font-size: 13px;
}

.g-custom-select-single-value {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
}

.g-custom-select-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
}

.g-custom-select-clear {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--border-base);
  color: var(--text-primary);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.g-custom-select-clear:hover {
  background: var(--danger);
  color: #ffffff;
}

.g-custom-select-control:hover .g-custom-select-clear.has-value {
  display: flex;
}

.g-custom-select-control:hover .g-custom-select-clear.has-value + .g-custom-select-arrow {
  display: none;
}

.g-custom-select-arrow {
  font-size: 10px;
  transition: transform 0.25s ease;
}

.g-custom-select-control.is-open .g-custom-select-arrow {
  transform: rotate(180deg);
}

.g-custom-select-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: gDropdownFadeIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.g-custom-select-dropdown.is-open {
  display: flex;
}

@keyframes gDropdownFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.g-custom-select-search-box {
  padding: 8px;
  border-bottom: 1px solid var(--border-base);
  background: var(--bg-surface);
}

.g-custom-select-search-input {
  width: 100%;
  padding: 6px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 12px;
  outline: none;
  box-sizing: border-box;
}

.g-custom-select-search-input:focus {
  border-color: var(--primary);
}

.g-custom-select-options-list {
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.g-custom-select-group-header {
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.g-custom-select-option {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.15s ease;
}

.g-custom-select-option:hover:not(.is-disabled) {
  background: rgba(64, 158, 255, 0.12);
  color: var(--primary);
}

.g-custom-select-option.is-selected {
  color: var(--primary);
  font-weight: 600;
  background: rgba(64, 158, 255, 0.08);
}

.g-custom-select-option.is-disabled {
  color: var(--text-disabled);
  cursor: not-allowed;
  opacity: 0.5;
}

.g-custom-select-empty {
  padding: 24px 12px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 12px;
}

/* ==========================================================================
   Universal Icon Gallery & Picker System
   ========================================================================== */
.icon-gallery-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.icon-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-base);
  border-radius: var(--radius);
  padding: 12px 16px;
}

.icon-category-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.icon-category-btn {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-base);
  background: var(--bg-card);
  color: var(--text-regular);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-category-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.icon-category-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.icon-search-input {
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  width: 240px;
  outline: none;
}

.icon-search-input:focus {
  border-color: var(--primary);
}

.icon-grid-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  max-height: 480px;
  overflow-y: auto;
  padding: 4px;
}

.icon-gallery-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-base);
  border-radius: var(--radius);
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  position: relative;
}

.icon-gallery-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  background: rgba(64, 158, 255, 0.05);
}

.icon-preview-box {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-card-name {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-primary);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.icon-card-label {
  font-size: 10px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ==========================================================================
   Advanced Icon Gallery Color Swatches & Size Toggles
   ========================================================================== */
.icon-size-btn {
  height: 26px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-base);
  background: var(--bg-card);
  color: var(--text-regular);
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-size-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.icon-size-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(64, 158, 255, 0.35);
}

.icon-color-swatch {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
  position: relative;
}

.icon-color-swatch:hover {
  transform: scale(1.25);
}

.icon-color-swatch.active {
  transform: scale(1.3);
  border-color: #ffffff;
  box-shadow: 0 0 0 2px var(--primary), 0 2px 8px rgba(0, 0, 0, 0.4);
}

.icon-custom-color-picker {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  border-radius: 50%;
  overflow: hidden;
}

.icon-custom-color-picker::-webkit-color-swatch-wrapper {
  padding: 0;
}

.icon-custom-color-picker::-webkit-color-swatch {
  border: 2px solid var(--border-base);
  border-radius: 50%;
}

.icon-gallery-card.copied-pulse {
  animation: iconPulse 0.4s ease;
  border-color: var(--success) !important;
  background: rgba(103, 194, 58, 0.15) !important;
}

@keyframes iconPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* ==========================================================================
   Custom Icon Size Stepper & Input
   ========================================================================== */
.icon-size-input-wrapper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-base);
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 0 6px;
  height: 26px;
  gap: 4px;
}

.icon-size-input-wrapper:focus-within {
  border-color: var(--primary);
}

.icon-custom-size-input {
  width: 38px;
  height: 22px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  outline: none;
  -moz-appearance: textfield;
}

.icon-custom-size-input::-webkit-outer-spin-button,
.icon-custom-size-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.icon-size-step-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 10px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-size-step-btn:hover {
  background: var(--bg-surface);
  color: var(--primary);
}

.icon-svg-host {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-svg-host svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ==========================================================================
   Icon Search Clearable Wrapper
   ========================================================================== */
.icon-search-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.icon-search-input {
  padding: 6px 30px 6px 12px !important;
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  width: 280px;
  outline: none;
  transition: all 0.2s ease;
}

.icon-search-input:focus {
  border-color: var(--primary);
}

.icon-search-clear-btn {
  position: absolute;
  right: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.icon-search-clear-btn:hover {
  color: var(--danger);
  transform: scale(1.15);
}

/* ==========================================================================
   Icon Gallery Pagination Component (Element / Naive Style)
   ========================================================================== */
.icon-pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-base);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-top: 12px;
}

.icon-pagination-info {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-page-btn {
  height: 28px;
  min-width: 28px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-base);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.icon-page-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.icon-page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  font-weight: 600;
}

.icon-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.icon-page-jumper {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.icon-page-input {
  width: 44px;
  height: 26px;
  border: 1px solid var(--border-base);
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  outline: none;
}

.icon-page-input:focus {
  border-color: var(--primary);
}

/* =========================================================================
   Element Plus Style Demo Card Action Toolbar & Expandable Code Container
   ========================================================================= */
.demo-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-top: 1px solid var(--border-base);
  background: var(--bg-card);
  user-select: none;
}
.g-demo-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}
.g-demo-icon-btn:hover {
  background: var(--bg-hover) !important;
  color: var(--primary) !important;
}
.g-demo-icon-btn.active {
  color: var(--primary) !important;
  background: rgba(24, 160, 88, 0.12) !important;
}
.demo-source-wrapper {
  transition: max-height 0.35s ease;
  overflow: hidden;
}

/* =========================================================================
   JD.com Style Right-Side Fixed Toolbar Dock (京东右侧悬浮侧边栏)
   ========================================================================= */
.jd-sidebar-dock {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  border-right: none;
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(16px);
  width: 48px;
  user-select: none;
}

.jd-dock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 9px 2px;
  color: var(--text-secondary);
  text-decoration: none;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-base);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

.jd-dock-item:last-child {
  border-bottom: none;
}

.jd-dock-menu {
  position: relative;
  width: 100%;
}
.jd-dock-menu .jd-dock-item {
  border-bottom: 1px solid var(--border-base);
}
.g-menu.jd-dock-submenu {
  position: absolute;
  right: calc(100% + 8px);
  top: 0;
  min-width: 132px;
  display: none;
  padding: 8px;
  box-shadow: -8px 8px 24px rgba(0, 0, 0, 0.32);
  z-index: 40;
}
.jd-dock-menu:hover .g-menu.jd-dock-submenu,
.jd-dock-menu.is-open .g-menu.jd-dock-submenu {
  display: flex;
}
.jd-dock-menu.is-placement-top .g-menu.jd-dock-submenu {
  top: auto;
  bottom: 0;
}
.jd-dock-submenu .g-menu-item {
  min-height: 38px;
  justify-content: flex-start;
}

.jd-dock-item i {
  font-size: 15px;
  margin-bottom: 3px;
  transition: transform 0.2s;
}

.jd-dock-item span {
  font-size: 10px;
  font-weight: 600;
  transform: scale(0.9);
  white-space: nowrap;
  letter-spacing: -0.2px;
}

.jd-dock-item:hover {
  background: var(--primary);
  color: #ffffff !important;
}

.jd-dock-item:hover i {
  transform: scale(1.15);
  color: #ffffff !important;
}

.jd-dock-item:hover span {
  opacity: 1;
}

/* =========================================================================
   Tree Shaker Search Dropdown & Highlight Pulse Animation
   ========================================================================= */
.shaker-dropdown-item:hover {
  background: var(--bg-hover) !important;
  color: var(--primary) !important;
}

@keyframes shakerPulseGlow {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(24, 160, 88, 0.7); }
  50% { transform: scale(1.05); box-shadow: 0 0 0 8px rgba(24, 160, 88, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(24, 160, 88, 0); }
}

.shaker-item-highlight {
  animation: shakerPulseGlow 1.2s ease-in-out 2;
  background: rgba(24, 160, 88, 0.22) !important;
  border-radius: 4px;
  color: var(--primary) !important;
  font-weight: 700;
  border: 1px solid var(--primary);
  padding: 3px 6px !important;
}

.jd-dock-item.is-active {
  background: rgba(34, 197, 94, 0.15);
  color: var(--primary);
}

.jd-dock-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #ef4444;
  color: #ffffff;
  font-size: 8px;
  padding: 0 4px;
  border-radius: 6px;
  font-weight: 800;
  transform: scale(0.82);
  line-height: 1.2;
}

/* Sections Flyout Menu */
.jd-sections-flyout {
  position: absolute;
  right: 100%;
  top: -60px;
  width: 270px;
  max-height: 75vh;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  border-radius: 8px 0 0 8px;
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.45);
  display: none;
  flex-direction: column;
  padding: 6px 0;
  z-index: 10000;
}

.jd-dock-item.has-flyout:hover .jd-sections-flyout,
.jd-dock-item.has-flyout.is-open .jd-sections-flyout {
  display: flex;
}

.jd-flyout-header {
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-base);
  background: var(--bg-surface);
  text-align: left;
}

.jd-flyout-item {
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.jd-flyout-item:hover {
  background: var(--primary);
  color: #ffffff !important;
  padding-left: 16px;
}

.jd-flyout-item.active {
  background: rgba(34, 197, 94, 0.12);
  color: var(--primary);
  font-weight: 700;
}
