/* ============================================
   PicGen Common Styles — 共享样式
   适用于: index.html / canvas.html / guide.html
   ============================================ */

/* ----- CSS Variables (§1 Colors) ----- */
:root {
  --page-bg: #FFFFFF;
  --panel-bg: #FDFDFC;
  --text-primary: #171717;
  --text-secondary: #404040;
  --text-tertiary: #737373;
  --text-muted: #A3A3A3;
  --text-placeholder: #888888;
  --divider: rgba(0, 0, 0, 0.06);
  --divider-hover: rgba(0, 0, 0, 0.10);
  --btn-primary-bg: #000000;
  --btn-primary-text: #FFFFFF;
  --btn-primary-hover: rgba(0, 0, 0, 0.80);
  --hover-bg: rgba(0, 0, 0, 0.03);
  --hover-bg-strong: rgba(0, 0, 0, 0.04);
  --input-bg: rgba(0, 0, 0, 0.04);
  --code-bg: #F7F7F5;
  --red: #E53E3E;
  --red-bg: rgba(229, 62, 62, 0.10);
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Geist Mono', monospace;
  --nav-height: 60px;
  --sidebar-w: 240px;
  --content-px: 24px;
  --radius-card: 20px;
  --nav-actions-gap: 8px;
}

[data-theme="dark"] {
  --page-bg: #000000;
  --panel-bg: #0A0A0A;
  --text-primary: #EDEDED;
  --text-secondary: #A3A3A3;
  --text-tertiary: #737373;
  --text-muted: #525252;
  --text-placeholder: #666666;
  --divider: rgba(255, 255, 255, 0.06);
  --divider-hover: rgba(255, 255, 255, 0.10);
  --btn-primary-bg: #FFFFFF;
  --btn-primary-text: #000000;
  --btn-primary-hover: rgba(255, 255, 255, 0.80);
  --hover-bg: rgba(255, 255, 255, 0.04);
  --hover-bg-strong: rgba(255, 255, 255, 0.06);
  --input-bg: rgba(255, 255, 255, 0.06);
  --code-bg: #0D0D0D;
  --red-bg: rgba(229, 62, 62, 0.15);
}

/* ----- Reset & Base ----- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.65;
  color: var(--text-primary);
  background: var(--page-bg);
  transition: background 300ms ease, color 300ms ease;
  overflow-x: hidden;
  letter-spacing: -0.01em;
}

/* ----- Navigation (§5) ----- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  background: var(--page-bg);
  border-bottom: 1px solid var(--divider);
  transition: background 300ms ease, border-color 300ms ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  transition: transform 200ms ease;
}

.nav-logo:hover {
  transform: scale(1.05);
}

.nav-logo-svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.nav-logo-svg .icon-frame {
  fill: none;
  stroke: var(--text-primary);
  stroke-width: 1.5;
}

.nav-logo-svg .icon-line {
  fill: none;
  stroke: var(--text-primary);
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-logo-svg .icon-dot {
  fill: var(--text-primary);
}

.nav-logo-svg .ai-spark {
  fill: var(--text-primary);
}

.nav-logo-svg .ai-spark.small {
  fill: var(--text-tertiary);
}

.nav-logo-text {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  height: 32px;
  padding: 0 14px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 200ms ease, background 200ms ease;
  letter-spacing: -0.01em;
}

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

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-gradient {
  position: absolute;
  bottom: -60px;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to bottom, var(--page-bg), transparent);
  pointer-events: none;
  transition: background 300ms ease;
}

/* Theme Toggle */
.theme-toggle {
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  border: 1px solid var(--divider);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  font-size: 15px;
  transition: all 200ms ease;
}

.theme-toggle:hover {
  border-color: var(--divider-hover);
  color: var(--text-primary);
  background: var(--hover-bg);
}

/* ----- Mobile Menu (shared by index / canvas / guide) ----- */
.mobile-menu-btn {
  display: none;
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  border: 1px solid var(--divider);
  background: transparent;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  font-size: 16px;
  transition: all 200ms ease;
}

.mobile-menu-btn:hover {
  border-color: var(--divider-hover);
  color: var(--text-primary);
  background: var(--hover-bg);
}

.mobile-menu {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  max-height: calc(100vh - var(--nav-height));
  background: var(--page-bg);
  border-bottom: 1px solid var(--divider);
  padding: 12px 14px 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 998;
  display: flex;
  flex-direction: column;
  gap: 2px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 240ms ease, transform 280ms cubic-bezier(0.16, 1, 0.3, 1), visibility 240ms;
}

[data-theme="dark"] .mobile-menu {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.mobile-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mobile-menu a {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 180ms ease;
  min-height: 40px;
}

.mobile-menu a:hover,
.mobile-menu a:active {
  background: var(--hover-bg);
  color: var(--text-primary);
}

/* ----- Buttons (§4) ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 24px;
  border-radius: 9999px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 200ms ease;
  white-space: nowrap;
}

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

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

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--divider-hover);
}

.btn-secondary:hover {
  background: var(--hover-bg-strong);
  border-color: rgba(0, 0, 0, 0.20);
}

[data-theme="dark"] .btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.20);
}

.btn-sm {
  height: 32px;
  padding: 0 16px;
}

.btn-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* ----- Code Block ----- */
.code-block {
  background: var(--code-bg);
  border: 1px solid var(--divider);
  border-radius: 10px;
  margin-bottom: 16px;
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--divider);
}

.code-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.code-copy {
  height: 26px;
  padding: 0 12px;
  border-radius: 9999px;
  border: 1px solid var(--divider);
  background: transparent;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  transition: all 200ms ease;
  flex-shrink: 0;
}

.code-copy:hover {
  border-color: var(--divider-hover);
  color: var(--text-primary);
}

.code-copy.copied {
  border-color: #22c55e;
  color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
}

.code-block pre {
  padding: 16px;
  margin: 0;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-primary);
}

code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-primary);
  background: var(--hover-bg);
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

/* ----- Alert ----- */
.alert {
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  border: 1px solid var(--divider);
  font-size: 14px;
  line-height: 1.65;
}

.alert-info {
  background: var(--hover-bg);
  color: var(--text-secondary);
  border-left: 3px solid var(--text-tertiary);
}

.alert-warn {
  background: var(--red-bg);
  color: var(--red);
  border-left: 3px solid var(--red);
}

.alert-title {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 4px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* ----- Back to Top ----- */
.back-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  border: 1px solid var(--divider);
  background: var(--page-bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  font-size: 16px;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all 300ms cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.back-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-top:hover {
  border-color: var(--divider-hover);
  color: var(--text-primary);
  transform: translateY(-2px);
}

/* ----- Sidebar Toggle & Overlay (doc pages) ----- */
.sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 80px;
  left: 24px;
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  border: 1px solid var(--divider);
  background: var(--page-bg);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  font-size: 18px;
  z-index: 300;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.sidebar-overlay.show {
  display: block;
}

/* ============================================
   Document Page Layout (guide.html / canvas.html)
   ============================================ */

/* Doc pages need body padding to clear the fixed nav */
.doc-page {
  padding-top: var(--nav-height);
}

/* Page wrapper: sidebar + main flex layout */
.page-wrap {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  padding: 48px 24px 96px;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--nav-height) + 48px);
  max-height: calc(100vh - var(--nav-height) - 96px);
  overflow-y: auto;
  padding: 0 20px 32px 0;
  border-right: 1px solid var(--divider);
}

.sidebar-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-link {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-tertiary);
  text-decoration: none;
  transition: all 200ms ease;
  letter-spacing: -0.01em;
}

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

.sidebar-link.active {
  color: var(--text-primary);
  background: var(--hover-bg-strong);
}

.sidebar-sub {
  padding-left: 24px;
  font-size: 12px;
  color: var(--text-muted);
}

.sidebar-sub:hover {
  color: var(--text-secondary);
}

.sidebar-sub.active {
  color: var(--text-primary);
  background: var(--hover-bg-strong);
}

/* Main content area */
.main {
  flex: 1;
  min-width: 0;
  padding: 0 0 0 48px;
}

/* Document content typography */
.main h1 {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 8px;
}

.main h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-top: 56px;
  margin-bottom: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--divider);
  scroll-margin-top: calc(var(--nav-height) + 24px);
}

.main h2:first-of-type {
  margin-top: 40px;
  border-top: none;
  padding-top: 0;
}

.main h3 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-top: 36px;
  margin-bottom: 12px;
  scroll-margin-top: calc(var(--nav-height) + 24px);
}

.main h4 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-top: 24px;
  margin-bottom: 8px;
}

.main p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.7;
}

.main ul,
.main ol {
  color: var(--text-secondary);
  margin-bottom: 16px;
  padding-left: 24px;
}

.main li {
  margin-bottom: 8px;
  line-height: 1.7;
}

.main strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ----- Step Component ----- */
.step {
  display: flex;
  gap: 20px;
  margin-bottom: 32px;
}

.step-num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  margin-top: 2px;
}

.step-body {
  flex: 1;
  min-width: 0;
}

.step-body h4 {
  margin-top: 0;
  margin-bottom: 6px;
}

.step-body p {
  color: var(--text-secondary);
  margin-bottom: 12px;
}

/* ----- Directory Tree ----- */
.dir-tree {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-secondary);
  padding: 16px 20px;
  background: var(--code-bg);
  border: 1px solid var(--divider);
  border-radius: 10px;
  margin-bottom: 16px;
  overflow-x: auto;
  white-space: pre;
}

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

/* ----- Table ----- */
.table-wrap {
  overflow-x: auto;
  margin-bottom: 20px;
  border: 1px solid var(--divider);
  border-radius: 10px;
}

.config-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.config-table th {
  text-align: left;
  padding: 10px 16px;
  border-bottom: 1px solid var(--divider);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  white-space: nowrap;
}

.config-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--divider);
  color: var(--text-secondary);
  line-height: 1.6;
}

.config-table td:first-child {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
  white-space: nowrap;
}

.config-table tr:last-child td {
  border-bottom: none;
}

/* ----- Guide Footer ----- */
.guide-footer {
  margin-top: 80px;
  padding-top: 32px;
  border-top: 1px solid var(--divider);
  text-align: center;
}

.guide-footer p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.guide-footer a {
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 200ms ease;
}

.guide-footer a:hover {
  color: var(--text-primary);
}

/* ============================================
   Responsive (shared)
   ============================================ */
@media (max-width: 768px) {
  .nav-inner {
    padding: 0 16px;
  }

  .nav-links {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
  }

  /* Doc page: sidebar becomes off-canvas overlay */
  .page-wrap {
    display: block;
    padding: 32px 16px 80px;
  }

  .sidebar {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    width: 280px;
    height: 100vh;
    max-height: none;
    z-index: 200;
    padding: 32px 20px;
    border-right: 1px solid var(--divider);
    background: var(--page-bg);
    transform: translateX(-100%);
    transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: none;
    overflow-y: auto;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08);
  }

  .main {
    padding: 0;
  }

  .sidebar-toggle {
    display: flex;
  }

  .main h1 {
    font-size: 24px;
  }

  .main h2 {
    font-size: 18px;
    margin-top: 40px;
    padding-top: 20px;
  }

  .main h3 {
    font-size: 16px;
    margin-top: 28px;
  }

  .step {
    gap: 12px;
  }

  .step-num {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  .back-top {
    bottom: 24px;
    right: 20px;
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .sidebar-toggle {
    bottom: 72px;
    left: 20px;
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  /* Button density */
  .btn {
    height: 40px;
    padding: 0 20px;
  }

  .btn-sm {
    height: 30px;
    padding: 0 14px;
  }

  /* btn-group goes vertical earlier (was at 480) */
  .btn-group {
    flex-direction: column;
    width: 100%;
  }

  .btn-group .btn {
    width: 100%;
    justify-content: center;
  }

  /* Code block */
  .code-block pre {
    font-size: 12px;
    padding: 14px;
  }

  .code-header {
    padding: 8px 12px;
  }

  .code-copy {
    height: 24px;
    padding: 0 10px;
    font-size: 10px;
  }

  /* Tables */
  .config-table {
    font-size: 13px;
  }

  .config-table th {
    padding: 9px 12px;
  }

  .config-table td {
    padding: 10px 12px;
  }

  /* Directory tree */
  .dir-tree {
    font-size: 12px;
    padding: 14px 16px;
  }

  /* Code inline */
  code {
    font-size: 12px;
    padding: 2px 6px;
  }
}

@media (max-width: 480px) {
  /* Override shared tokens for narrow screens */
  :root {
    --content-px: 14px;
    --radius-card: 16px;
    --nav-actions-gap: 4px;
  }

  /* Nav: only logo + theme + hamburger remain */
  .nav-inner {
    padding: 0 12px;
  }

  .nav-actions {
    gap: var(--nav-actions-gap);
  }

  .nav-actions > *:not(.theme-toggle):not(.mobile-menu-btn) {
    display: none;
  }

  .theme-toggle,
  .mobile-menu-btn {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }

  .nav-logo-text {
    font-size: 14px;
  }

  .nav-logo-svg {
    width: 22px;
    height: 22px;
  }

  /* Mobile menu drawer */
  .mobile-menu {
    padding: 8px 10px 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }

  .mobile-menu a {
    padding: 10px 12px;
    font-size: 13.5px;
    min-height: 38px;
    border-radius: 8px;
  }

  /* Buttons */
  .btn {
    height: 38px;
    padding: 0 16px;
    font-size: 12px;
  }

  .btn-sm {
    height: 28px;
    padding: 0 12px;
    font-size: 12px;
  }

  /* Doc page */
  .page-wrap {
    padding: 24px 14px 72px;
  }

  .sidebar {
    width: 240px;
    padding: 24px 16px;
  }

  .main h1 {
    font-size: 22px;
  }

  .main h2 {
    font-size: 17px;
    margin-top: 32px;
    padding-top: 18px;
  }

  .main h3 {
    font-size: 15px;
    margin-top: 24px;
  }

  .main p {
    font-size: 14px;
  }

  .main ul,
  .main ol {
    padding-left: 20px;
  }

  .main li {
    font-size: 14px;
  }

  /* Steps */
  .step {
    gap: 10px;
    margin-bottom: 24px;
  }

  .step-num {
    width: 26px;
    height: 26px;
    font-size: 11px;
  }

  .step-body p {
    font-size: 13px;
  }

  /* Code block */
  .code-block {
    border-radius: 8px;
    margin-bottom: 14px;
  }

  .code-block pre {
    font-size: 11.5px;
    padding: 12px;
    line-height: 1.55;
  }

  .code-header {
    padding: 8px 12px;
  }

  .code-copy {
    height: 22px;
    padding: 0 8px;
    font-size: 10px;
  }

  code {
    font-size: 11.5px;
    padding: 2px 5px;
  }

  /* Tables */
  .table-wrap {
    border-radius: 8px;
    margin-bottom: 16px;
  }

  .config-table {
    font-size: 12px;
  }

  .config-table th {
    padding: 8px 10px;
    font-size: 10px;
  }

  .config-table td {
    padding: 8px 10px;
    font-size: 12px;
  }

  .config-table td:first-child {
    font-size: 12px;
  }

  /* Directory tree */
  .dir-tree {
    font-size: 12px;
    padding: 12px 14px;
    line-height: 1.7;
  }

  /* Alerts */
  .alert {
    padding: 12px 14px;
    font-size: 13px;
    border-radius: 10px;
    margin-bottom: 16px;
  }

  .alert-title {
    font-size: 12px;
  }

  /* Back to top & sidebar toggle */
  .back-top {
    bottom: 16px;
    right: 14px;
    width: 32px;
    height: 32px;
    font-size: 13px;
  }

  .sidebar-toggle {
    bottom: 56px;
    left: 14px;
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  /* Modal */
  .modal-overlay {
    padding: 14px;
  }

  .modal {
    padding: 24px 20px;
    border-radius: 14px;
  }

  .modal h3 {
    font-size: 16px;
  }

  .modal > p {
    font-size: 13px;
    margin-bottom: 20px;
  }

  .modal-contact {
    gap: 10px;
  }

  .modal-contact-item {
    flex-wrap: wrap;
    padding: 12px;
    gap: 8px;
  }

  .modal-contact-label {
    font-size: 13px;
    flex: 1 1 auto;
    min-width: 0;
  }

  .modal-contact-value {
    font-size: 12px;
    word-break: break-all;
  }

  .modal-copy-btn {
    height: 28px;
    padding: 0 12px;
    font-size: 11px;
    margin-left: auto;
  }

  .modal-close {
    width: 28px;
    height: 28px;
    font-size: 16px;
  }

  .modal-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
    margin-bottom: 16px;
  }
}

@media (min-width: 769px) and (max-width: 1100px) {
  :root {
    --sidebar-w: 200px;
  }

  .page-wrap {
    padding: 40px 24px 80px;
  }

  .main {
    padding: 0 0 0 32px;
  }
}

@media print {
  .nav,
  .sidebar,
  .sidebar-toggle,
  .sidebar-overlay,
  .back-top {
    display: none;
  }

  .page-wrap {
    display: block;
    padding: 0;
  }

  .main {
    padding: 0;
  }
}
