:root {
  --color-bg: #F0F0F0;
  --color-bg-elevated: #FAFAFA;
  --color-bg-card: #FFFFFF;
  --color-bg-hover: #F5F5F5;
  --color-surface: #F8F8F8;
  --color-border: #D0D0D0;
  --color-border-subtle: #E0E0E0;
  --color-border-strong: #C0C0C0;
  --color-titlebar-from: #E8E8E8;
  --color-titlebar-to: #D8D8D8;
  --color-text-primary: #1a1a1a;
  --color-text-secondary: #4a4a4a;
  --color-text-muted: #666666;
  --color-text-faint: #999999;
  --color-accent: #0088CC;
  --color-accent-light: #0095DD;
  --color-accent-hover-from: #00A8F0;
  --color-accent-hover-to: #0095DD;
  --color-error: #d4183d;
  
  --font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', 'Menlo', 'Monaco', monospace;
  
  --radius-sm: 0px;
  --radius-md: 0px;
  --radius-lg: 0px;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.1);
  --shadow-window: 0 2px 8px rgba(0,0,0,0.12), 0 0 1px rgba(0,0,0,0.08);
  
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  font-size: 0.875rem;
  line-height: 1.5;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--color-bg-elevated);
}
::-webkit-scrollbar-thumb {
  background: var(--color-border-strong);
  border: 2px solid var(--color-bg-elevated);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-faint);
}

/* Top Bar */
.topbar {
  height: 38px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  background: linear-gradient(to bottom, #FAFAFA, #E8E8E8);
  border-bottom: 1px solid var(--color-border-strong);
  flex-shrink: 0;
  z-index: 10;
}

.topbar__brand {
  font-weight: 500;
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
}

.topbar__link {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 0.8125rem;
  transition: color var(--transition-fast);
}

.topbar__link:hover {
  color: var(--color-accent);
}

/* Layout */
.app-container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 180px;
  background: linear-gradient(to bottom, #F6F6F6, #EFEFEF);
  border-right: 1px solid var(--color-border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 24px 0;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
}

.sidebar__item {
  padding: 8px 24px;
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  position: relative;
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
  background: transparent;
  text-align: left;
  font-family: inherit;
}

.sidebar__item:hover {
  background-color: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.sidebar__item--active {
  color: var(--color-text-primary);
  font-weight: 500;
  background-color: var(--color-bg-hover);
}

.sidebar__item--active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background-color: var(--color-accent);
}

/* Content Area */
.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 32px 40px;
  background-color: var(--color-bg);
}

.content-wrapper {
  max-width: 760px;
  margin: 0 auto;
}

/* Sections */
.section {
  display: none;
  animation: fadeIn 0.35s ease-out;
}

.section--active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Typography */
.page-title {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
  margin-bottom: 24px;
}

.section-header {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
  margin-top: 32px;
}

.body-text {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
}

.text-meta {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.link {
  color: var(--color-accent);
  text-decoration: none;
}
.link:hover {
  text-decoration: underline;
}

/* Window Cards */
.window-card {
  background-color: var(--color-bg-card);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-window);
  margin-bottom: 24px;
  border-radius: var(--radius-sm);
}

.window-card__titlebar {
  background: linear-gradient(to bottom, var(--color-titlebar-from), var(--color-titlebar-to));
  border-bottom: 1px solid var(--color-border);
  padding: 6px 12px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.window-card__content {
  padding: 24px;
}

/* Flash Widget Area */
.flash-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  margin-top: 16px;
}

esp-web-install-button {
  --esp-tools-button-color: var(--color-accent);
  --esp-tools-button-text-color: #ffffff;
  --esp-tools-button-border-radius: 0px;
}

.btn-install {
  background: linear-gradient(to bottom, var(--color-accent-light), var(--color-accent));
  color: #fff;
  border: none;
  font-family: var(--font-family);
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 14px 32px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-install:hover {
  background: linear-gradient(to bottom, var(--color-accent-hover-from), var(--color-accent-hover-to));
}

.btn-install:active {
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

.status-message {
  margin-top: 16px;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.status-message code {
  font-family: var(--font-mono);
  background: rgba(0,0,0,0.05);
  padding: 1px 5px;
  font-size: 0.8125rem;
}

/* Setup Steps */
.step-list {
  counter-reset: setup-step;
}

.step-card {
  position: relative;
  padding-left: 12px;
}

.step-card__header {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.step-card__number {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-right: 12px;
}

.step-card__title {
  font-weight: 500;
  color: var(--color-text-primary);
}

/* Note Alert */
.alert-note {
  background-color: var(--color-surface);
  border-left: 3px solid var(--color-accent);
  padding: 12px 16px;
  margin-top: 24px;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  border-top: 1px solid var(--color-border-subtle);
  border-right: 1px solid var(--color-border-subtle);
  border-bottom: 1px solid var(--color-border-subtle);
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    display: none;
  }
  .content-area {
    padding: 24px 16px;
  }
}
