:root {
  --qt-green: #41a62a;
  --qt-green-dark: #328721;
  --header-bg: #2c3e50;
  --header-fg: #ecf0f1;
  --sidebar-bg: #f5f6f7;
  --sidebar-border: #dcdcdc;
  --link: #0066cc;
  --link-hover: #004499;
  --code-bg: #f4f4f4;
  --border: #ccc;
  --table-head: #eee;
  --text: #222;
  --muted: #666;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: #fff;
}

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

.site-header {
  background: var(--header-bg);
  color: var(--header-fg);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
}

.site-header .logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.4rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
}

.site-header .logo .logo-mark {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: block;
}

.site-header .logo:hover { color: #fff; text-decoration: none; }
.site-header .logo span { color: var(--qt-green); }

.site-header nav a {
  color: #bdc3c7;
  margin-right: 1rem;
}

.site-header nav a:hover { color: #fff; }

.layout {
  display: flex;
  min-height: calc(100vh - 48px);
}

.content-with-toc {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: flex-start;
}

.content-with-toc > .content {
  flex: 1;
  min-width: 0;
}

.page-toc {
  width: 11rem;
  flex-shrink: 0;
  padding: 1.5rem 0.75rem 2rem;
  border-left: 1px solid var(--sidebar-border);
  font-size: 0.82rem;
  position: sticky;
  top: 0;
  align-self: flex-start;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

.page-toc h4 {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 600;
}

.page-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.page-toc li {
  margin: 0.2rem 0;
}

.page-toc a {
  color: var(--muted);
  display: block;
  padding: 0.15rem 0;
}

.page-toc a:hover {
  color: var(--link);
}

.page-toc .sub {
  padding-left: 0.75rem;
  font-size: 0.78rem;
}

.members-index {
  margin: 0.5rem 0 1rem;
  font-size: 0.9rem;
}

.members-index a {
  margin-right: 0.35rem;
}

table.memlist td.enum-name {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.85rem;
  width: 28%;
}

.private-section {
  color: #444;
}

.private-section .note {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.content > .note,
main.content .note {
  font-size: 0.92rem;
  color: var(--text);
  background: #f4f7f4;
  border-left: 3px solid #41a62a;
  padding: 0.65rem 0.9rem;
  margin: 0.75rem 0 1.25rem;
}

@media (max-width: 1100px) {
  .page-toc {
    display: none;
  }
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  padding: 1rem 0;
  overflow-y: auto;
}

.sidebar h3 {
  margin: 0 1rem 0.5rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.sidebar ul {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
}

.sidebar li a {
  display: block;
  padding: 0.25rem 1rem;
  font-size: 0.9rem;
}

.sidebar li a.active {
  background: #e8eef5;
  border-left: 3px solid var(--link);
  padding-left: calc(1rem - 3px);
  font-weight: 600;
}

.content {
  flex: 1;
  padding: 1.5rem 2rem 3rem;
  max-width: 980px;
}

/* Qt-style doc path */
.doc-path {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.doc-path a { color: var(--muted); }

/* Class page title */
.content h1.title {
  font-size: 1.85rem;
  font-weight: 400;
  margin: 0 0 0.35rem;
  border: none;
}

.content h1 {
  font-size: 1.75rem;
  margin: 0 0 0.25rem;
  font-weight: 400;
}

.content .brief {
  margin: 0 0 1rem;
  font-size: 0.95rem;
}

.content .brief .more { white-space: nowrap; }

.content .subtitle {
  color: var(--muted);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.content h2 {
  font-size: 1.25rem;
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.content h3.fn-title {
  font-size: 1.05rem;
  margin: 1.75rem 0 0.5rem;
  font-weight: 600;
  font-family: Consolas, "Courier New", monospace;
  color: #003366;
}

.content h3 {
  font-size: 1.05rem;
  margin: 1.5rem 0 0.5rem;
}

.content p { margin: 0.75rem 0; }

.content ul, .content ol { margin: 0.5rem 0 1rem 1.5rem; }

/* Qt meta table (Header, CMake) */
table.props {
  border-collapse: collapse;
  margin: 0.75rem 0 1.25rem;
  font-size: 0.9rem;
}

table.props th {
  text-align: left;
  padding: 0.35rem 1rem 0.35rem 0;
  vertical-align: top;
  font-weight: 600;
  white-space: nowrap;
  width: 5.5rem;
}

table.props td {
  padding: 0.35rem 0;
  vertical-align: top;
}

table.props td code {
  font-size: 0.88rem;
}

/* Qt member index (Public Functions) */
table.memlist {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0 1.5rem;
  font-size: 0.9rem;
}

table.memlist td {
  border-top: 1px solid #e0e0e0;
  padding: 0.45rem 0.6rem;
  vertical-align: top;
}

table.memlist tr:first-child td { border-top: 1px solid var(--border); }

table.memlist td:first-child {
  width: 55%;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.85rem;
}

table.memlist td:first-child a {
  font-weight: 600;
}

table.memlist td:last-child {
  color: #333;
}

.class-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem 1.5rem;
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.class-list li { margin: 0; }

.class-list a {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.95rem;
}

.diagram {
  background: var(--code-bg);
  border: 1px solid var(--border);
  padding: 1rem;
  font-family: Consolas, monospace;
  font-size: 0.85rem;
  white-space: pre;
  overflow-x: auto;
}

.fn-signature {
  font-family: Consolas, "Courier New", monospace;
  background: var(--code-bg);
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  margin: 0.5rem 0;
  font-size: 0.9rem;
}

.fn-block {
  margin: 0 0 1.25rem;
  padding: 0 0 1.25rem;
  border-bottom: 1px solid #eee;
}

.fn-block:last-child { border-bottom: none; }

.fn-name {
  font-family: Consolas, monospace;
  font-size: 1rem;
  color: #003366;
}

.fn-type { color: #008080; }
.fn-param { color: #333; }

.fn-desc { margin: 0.45rem 0 0.5rem; }

table.fn-params,
table.members {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0 0.65rem;
  font-size: 0.88rem;
}

table.fn-params th,
table.fn-params td,
table.members th,
table.members td {
  border: 1px solid var(--border);
  padding: 0.35rem 0.55rem;
  text-align: left;
  vertical-align: top;
}

table.fn-params th,
table.members th {
  background: var(--table-head);
  font-weight: 600;
}

table.fn-params td:first-child {
  width: 8rem;
  font-family: Consolas, monospace;
  font-size: 0.85rem;
}

.fn-returns,
.fn-throws {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
}

.fn-returns strong,
.fn-throws strong { font-weight: 600; }

pre.example {
  background: #fafafa;
  border: 1px solid var(--border);
  border-left: 4px solid var(--qt-green);
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.45;
}

pre.example code {
  font-family: Consolas, "Courier New", monospace;
}

.tag {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  background: #e0e0e0;
  color: #444;
  margin-left: 0.5rem;
}

.tag-enum { background: #d4edda; }
.tag-struct { background: #cce5ff; }
.tag-class { background: #fff3cd; }

.breadcrumb,
.doc-path {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.breadcrumb a { color: var(--muted); }
