:root {
  --primary: #E63946;
  --dark: #1D2D44;
  --light-bg: #F8F9FA;
  --border: #E0E0E0;
  --text: #333;
  --text-light: #666;
  --accent-bg: #FFF3CD;
  --accent-border: #FFECB5;
  --success-bg: #D1E7DD;
  --success-border: #BADBCC;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.7;
  color: var(--text);
  background: #fff;
}

/* Header */
.site-header {
  background: var(--dark);
  color: white;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: 60px;
  gap: 32px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: white;
  font-weight: 700;
  font-size: 1.1em;
  flex-shrink: 0;
}

.site-logo img {
  height: 32px;
  width: auto;
}

.site-nav {
  display: flex;
  gap: 24px;
  flex: 1;
}

.site-nav a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95em;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.site-nav a:hover,
.site-nav a.active {
  color: white;
  border-bottom-color: var(--primary);
}

.lang-switcher {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.9em;
}

.lang-switcher a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}

.lang-switcher a:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}

.lang-switcher .current-lang {
  color: white;
  font-weight: 600;
  padding: 4px 8px;
  background: var(--primary);
  border-radius: 4px;
}

/* Hero */
.hero {
  background: var(--dark);
  color: white;
  text-align: center;
  padding: 60px 20px;
}

.hero .logo {
  width: 60px;
  height: 60px;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: 2.4em;
  margin-bottom: 12px;
  font-weight: 700;
}

.hero p {
  font-size: 1.2em;
  opacity: 0.85;
  max-width: 600px;
  margin: 0 auto;
}

/* Container */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Article */
.article-header {
  padding: 40px 0 0;
}

.article-header h1 {
  font-size: 2.2em;
  color: var(--dark);
  margin-bottom: 8px;
}

.subtitle {
  font-size: 1.15em;
  color: var(--text-light);
  margin-bottom: 24px;
}

/* TOC */
.toc {
  background: var(--light-bg);
  border-radius: 12px;
  padding: 24px 32px;
  margin: 24px 0 40px;
}

.toc h2 {
  font-size: 1.2em;
  margin-bottom: 12px;
  color: var(--dark);
  border: none;
  padding: 0;
}

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

.toc li {
  margin-bottom: 6px;
}

.toc a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.toc a:hover {
  text-decoration: underline;
}

.toc ul ul {
  padding-left: 20px;
  margin-top: 4px;
}

/* Content */
.content {
  padding: 20px 0 60px;
}

.content h2 {
  font-size: 1.8em;
  color: var(--dark);
  border-bottom: 3px solid var(--primary);
  padding-bottom: 8px;
  margin: 48px 0 24px;
}

.content h3 {
  font-size: 1.3em;
  color: var(--dark);
  margin: 28px 0 12px;
}

.content h4 {
  font-size: 1.1em;
  color: var(--text);
  margin: 20px 0 8px;
}

.content p {
  margin-bottom: 14px;
}

.content ol,
.content ul {
  padding-left: 24px;
  margin-bottom: 16px;
}

.content li {
  margin-bottom: 6px;
}

/* Screenshots */
.screenshot {
  margin: 24px 0;
  text-align: center;
}

.screenshot img {
  max-width: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  border: 1px solid var(--border);
}

.screenshot figcaption {
  margin-top: 8px;
  font-size: 0.9em;
  color: var(--text-light);
  font-style: italic;
}

/* Tip & Info boxes */
.tip {
  background: var(--accent-bg);
  border-left: 4px solid #FFC107;
  padding: 14px 18px;
  margin: 20px 0;
  border-radius: 0 8px 8px 0;
  font-size: 0.95em;
}

.tip strong { color: #856404; }

.info {
  background: var(--success-bg);
  border-left: 4px solid #198754;
  padding: 14px 18px;
  margin: 20px 0;
  border-radius: 0 8px 8px 0;
  font-size: 0.95em;
}

.info strong { color: #0F5132; }

.warning {
  background: #FFF3CD;
  border-left: 4px solid #DC3545;
  padding: 14px 18px;
  margin: 20px 0;
  border-radius: 0 8px 8px 0;
  font-size: 0.95em;
}
.warning strong { color: #842029; }

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 0.95em;
}

th {
  background: var(--dark);
  color: white;
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
}

td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

tr:nth-child(even) td {
  background: var(--light-bg);
}

/* Page list */
.page-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin: 32px 0;
}

.page-card {
  background: var(--light-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.page-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  border-color: var(--primary);
}

.page-card h3 {
  color: var(--dark);
  margin-bottom: 8px;
}

.page-card p {
  color: var(--text-light);
  font-size: 0.95em;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 40px 20px;
  background: var(--dark);
  color: white;
  margin-top: 60px;
}

.site-footer p {
  opacity: 0.7;
  font-size: 0.9em;
  margin-bottom: 8px;
}

.site-footer a {
  color: var(--primary);
  text-decoration: none;
}

/* Responsive */
@media (max-width: 768px) {
  .header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 0;
    gap: 12px;
  }

  .site-nav {
    order: 3;
    width: 100%;
    gap: 16px;
  }

  .hero h1 { font-size: 1.8em; }
  .article-header h1 { font-size: 1.6em; }
  .content h2 { font-size: 1.4em; }
  .container { padding-left: 16px; padding-right: 16px; }
  table { font-size: 0.85em; }
  th, td { padding: 8px 10px; }
}
