:root {
  --ui-v2-bg: #f6f6f8;
  --ui-v2-text: #111318;
  --ui-v2-muted: #6b7280;
  --ui-v2-primary: #9766f6;
  --ui-v2-primary-hover: #824ef5;
  --ui-v2-danger: #ef4444;
}

.ui-v2-body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--ui-v2-bg);
  color: var(--ui-v2-text);
}

.ui-v2-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.ui-v2-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
}

.ui-v2-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  gap: 16px;
}

.ui-v2-brand {
  font-weight: 700;
  letter-spacing: -0.02em;
  color: inherit;
  text-decoration: none;
}

.ui-v2-nav {
  display: flex;
  gap: 24px;
}

.ui-v2-nav__link {
  color: var(--ui-v2-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.ui-v2-actions {
  display: flex;
  gap: 12px;
}

.ui-v2-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
}

.ui-v2-btn--primary {
  background: var(--ui-v2-primary);
  color: #ffffff;
}

.ui-v2-btn--primary:hover {
  background: var(--ui-v2-primary-hover);
}

.ui-v2-btn--ghost {
  background: transparent;
  color: var(--ui-v2-text);
  border-color: #e5e7eb;
}

.ui-v2-btn--danger {
  color: var(--ui-v2-danger);
  border-color: #fecaca;
  background: #fff5f5;
}

.ui-v2-main {
  min-height: 60vh;
  padding: 32px 0 64px;
}

.ui-v2-footer {
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  padding: 40px 0 24px;
}

.ui-v2-footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.ui-v2-footer__title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 12px;
}

.ui-v2-footer__link {
  display: block;
  color: var(--ui-v2-muted);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 8px;
}

.ui-v2-muted {
  color: var(--ui-v2-muted);
  font-size: 14px;
}

.ui-v2-codeblock pre[class*="language-"],
.ui-v2-codeblock code[class*="language-"] {
  background: transparent !important;
}

.ui-v2-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: rgba(151, 102, 246, 0.45) transparent;
}

.ui-v2-scrollbar::-webkit-scrollbar {
  width: 6px;
}

.ui-v2-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(151, 102, 246, 0.4);
  border-radius: 9999px;
}

.ui-v2-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.app-alert {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 16px;
  padding: 14px 48px 14px 16px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: #ffffff;
  color: #111827;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.app-alert__content {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  line-height: 1.6;
}

.app-alert__content a {
  color: inherit;
  font-weight: 700;
}

.app-alert__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  color: currentColor;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  opacity: 0.72;
}

.app-alert__close:hover {
  opacity: 1;
  background: rgba(15, 23, 42, 0.08);
}

.app-alert__close:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.app-alert--danger {
  border-color: #fecaca;
  background: #fff1f2;
  color: #9f1239;
}

.app-alert--success {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #065f46;
}

.app-alert--info {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.app-alert--warning {
  border-color: #fde68a;
  background: #fffbeb;
  color: #b45309;
}

html.dark .app-alert {
  background: #172033;
  color: #f9fafb;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

html.dark .app-alert__close:hover {
  background: rgba(255, 255, 255, 0.08);
}

html.dark .app-alert--danger {
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(127, 29, 29, 0.28);
  color: #fecaca;
}

html.dark .app-alert--success {
  border-color: rgba(52, 211, 153, 0.38);
  background: rgba(6, 78, 59, 0.34);
  color: #a7f3d0;
}

html.dark .app-alert--info {
  border-color: rgba(96, 165, 250, 0.4);
  background: rgba(30, 64, 175, 0.28);
  color: #bfdbfe;
}

html.dark .app-alert--warning {
  border-color: rgba(251, 191, 36, 0.38);
  background: rgba(146, 64, 14, 0.28);
  color: #fde68a;
}
