/* ===== Claude Docs Bilingual - Main Styles ===== */

:root {
  /* Colors - Claude Brand */
  --color-primary: #d97706;
  --color-primary-light: #fbbf24;
  --color-bg: #ffffff;
  --color-bg-secondary: #f9fafb;
  --color-text: #1f2937;
  --color-text-secondary: #6b7280;
  --color-border: #e5e7eb;
  --color-border-light: #f3f4f6;

  /* Spacing */
  --sidebar-width: 280px;
  --toc-width: 220px;
  --header-height: 64px;
  --content-max-width: 900px;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans TC", sans-serif;
  --font-mono: "SF Mono", Monaco, "Cascadia Code", monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
}

/* ===== Top Navigation ===== */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 100;
}

.top-nav__logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 18px;
  color: var(--color-text);
  text-decoration: none;
}

.top-nav__logo img {
  height: 32px;
}

.top-nav__title {
  margin-left: 8px;
  padding-left: 12px;
  border-left: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  font-weight: 400;
}

.top-nav__spacer {
  flex: 1;
}

.top-nav__search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: border-color 0.2s;
}

.top-nav__search:hover {
  border-color: var(--color-primary);
}

.top-nav__search kbd {
  font-family: var(--font-sans);
  font-size: 12px;
  padding: 2px 6px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
}

/* ===== Sidebar ===== */
.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--color-bg);
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
  padding: 24px 0;
}

.sidebar__section {
  margin-bottom: 24px;
}

.sidebar__section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-secondary);
  padding: 0 24px;
  margin-bottom: 8px;
}

.sidebar__nav {
  list-style: none;
}

.sidebar__item {
  margin: 0;
}

.sidebar__link {
  display: block;
  padding: 8px 24px;
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.15s;
}

.sidebar__link:hover {
  color: var(--color-text);
  background: var(--color-bg-secondary);
}

.sidebar__link--active {
  color: var(--color-primary);
  background: rgba(217, 119, 6, 0.08);
  border-right: 2px solid var(--color-primary);
}

.sidebar__group {
  margin-left: 24px;
}

.sidebar__group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 24px 8px 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--color-text);
  font-weight: 500;
}

.sidebar__group-toggle::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--color-text-secondary);
  transition: transform 0.2s;
}

.sidebar__group-toggle[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

.sidebar__group-items {
  display: none;
  padding-left: 12px;
}

.sidebar__group-items--open {
  display: block;
}

/* ===== Main Content ===== */
.main-content {
  margin-left: var(--sidebar-width);
  margin-top: var(--header-height);
  padding: 40px;
  min-height: calc(100vh - var(--header-height));
}

.content-wrapper {
  display: flex;
  gap: 40px;
  max-width: calc(var(--content-max-width) + var(--toc-width) + 40px);
}

.content {
  flex: 1;
  max-width: var(--content-max-width);
  min-width: 0;
}

/* ===== Table of Contents (Right) ===== */
.toc {
  position: sticky;
  top: calc(var(--header-height) + 40px);
  width: var(--toc-width);
  max-height: calc(100vh - var(--header-height) - 80px);
  overflow-y: auto;
  flex-shrink: 0;
}

.toc__title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-secondary);
  margin-bottom: 12px;
}

.toc__list {
  list-style: none;
  border-left: 1px solid var(--color-border);
  padding-left: 16px;
}

.toc__item {
  margin: 8px 0;
}

.toc__link {
  font-size: 13px;
  color: var(--color-text-secondary);
  text-decoration: none;
  display: block;
  transition: color 0.15s;
}

.toc__link:hover,
.toc__link--active {
  color: var(--color-primary);
}

/* ===== Typography ===== */
.content h1 {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.2;
}

.content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 48px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}

.content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 12px;
}

.content p {
  margin-bottom: 16px;
}

.content a {
  color: var(--color-primary);
  text-decoration: none;
}

.content a:hover {
  text-decoration: underline;
}

.content ul,
.content ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.content li {
  margin-bottom: 8px;
}

/* ===== Responsive ===== */
@media (max-width: 1200px) {
  .toc {
    display: none;
  }
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s;
    z-index: 99;
  }

  .sidebar--open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    padding: 24px 16px;
  }
}

/* ===== Mobile Menu Toggle ===== */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
}

@media (max-width: 900px) {
  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}
