/* LingTrue Tech Blog Styles */
/* Lightweight, SEO-friendly, no JS dependency */

:root {
  --color-primary: #4f46e5;
  --color-primary-hover: #4338ca;
  --color-text: #1f2937;
  --color-text-secondary: #6b7280;
  --color-bg: #ffffff;
  --color-bg-secondary: #f9fafb;
  --color-border: #e5e7eb;
  --color-card-shadow: rgba(0, 0, 0, 0.06);
  --color-card-shadow-hover: rgba(0, 0, 0, 0.12);
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --max-width: 1200px;
  --article-max-width: 760px;
  --radius: 12px;
  --transition: 0.2s ease;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-primary: #818cf8;
    --color-primary-hover: #a5b4fc;
    --color-text: #f3f4f6;
    --color-text-secondary: #9ca3af;
    --color-bg: #111827;
    --color-bg-secondary: #1f2937;
    --color-border: #374151;
    --color-card-shadow: rgba(0, 0, 0, 0.3);
    --color-card-shadow-hover: rgba(0, 0, 0, 0.5);
  }
}

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

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-primary-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Header / Navigation - Matches main site style */
.tech-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.75);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

@media (prefers-color-scheme: dark) {
  .tech-header {
    background: rgba(24, 24, 27, 0.75);
  }
}

.tech-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 8px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tech-header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--color-text);
  text-decoration: none;
  flex-shrink: 0;
}

.tech-header-logo img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}

.tech-header-nav {
  display: flex;
  gap: 4px;
  list-style: none;
  flex: 1;
  margin: 0 16px;
  overflow-x: auto;
  overflow-y: hidden; /* overflow-x 非 visible 时，overflow-y 会被计算为 auto，导致导航栏出现垂直滚动条 */
}

.tech-header-nav a {
  color: var(--color-text-secondary);
  font-size: 15px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 6px;
  transition: all var(--transition);
  white-space: nowrap;
}

.tech-header-nav a:hover,
.tech-header-nav a.active {
  color: var(--color-primary);
  background: var(--color-bg-secondary);
}

/* Header Actions (language + login) */
.tech-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Language Switcher */
.tech-lang-switcher {
  position: relative;
}

.tech-lang-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--color-bg-secondary);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.tech-lang-btn:hover {
  background: var(--color-border);
  color: var(--color-text);
}

.tech-lang-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  min-width: 140px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: 0 8px 32px var(--color-card-shadow-hover);
  padding: 4px;
  z-index: 200;
}

.tech-lang-switcher:hover .tech-lang-dropdown,
.tech-lang-switcher:focus-within .tech-lang-dropdown {
  display: block;
}

.tech-lang-option {
  display: block;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--color-text);
  border-radius: 6px;
  text-decoration: none;
  transition: background var(--transition);
}

.tech-lang-option:hover {
  background: var(--color-bg-secondary);
  color: var(--color-text);
}

.tech-lang-option.active {
  background: var(--color-primary);
  color: #ffffff;
  font-weight: 600;
}

/* Login Button */
.tech-login-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  background: var(--color-primary);
  border-radius: 8px;
  text-decoration: none;
  transition: background var(--transition);
  white-space: nowrap;
}

.tech-login-btn:hover {
  background: var(--color-primary-hover);
  color: #ffffff;
}

@media (max-width: 600px) {
  .tech-header-inner {
    padding: 0 12px;
  }
  .tech-header-nav {
    margin: 0 8px;
    gap: 2px;
  }
  .tech-header-nav a {
    font-size: 13px;
    padding: 6px 8px;
  }
  .tech-login-btn {
    padding: 5px 10px;
    font-size: 13px;
  }
}

/* Hero Section */
.tech-hero {
  text-align: center;
  padding: 64px 24px 48px;
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border);
}

.tech-hero h1 {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.tech-hero p {
  font-size: 18px;
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* Article Grid */
.tech-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

@media (max-width: 900px) {
  .tech-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

@media (max-width: 600px) {
  .tech-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .tech-hero h1 {
    font-size: 28px;
  }
  .tech-hero p {
    font-size: 16px;
  }
}

/* Article Card */
.tech-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}

.tech-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px var(--color-card-shadow-hover);
}

.tech-card a {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.tech-card-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--color-bg-secondary);
}

.tech-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.tech-card-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
  color: var(--color-text);
}

.tech-card-summary {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.6;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tech-card-meta {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.tech-card-readmore {
  color: var(--color-primary);
  font-weight: 500;
}

/* Article Detail */
.tech-article-container {
  max-width: var(--article-max-width);
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.tech-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 32px;
  transition: color var(--transition);
}

.tech-back-link:hover {
  color: var(--color-primary);
}

.tech-article-header {
  margin-bottom: 32px;
}

.tech-article-header h1 {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 16px;
  letter-spacing: -0.3px;
}

.tech-article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  color: var(--color-text-secondary);
}

.tech-article-meta time {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Article Content */
.tech-article-content {
  font-size: 17px;
  line-height: 1.8;
  color: var(--color-text);
}

.tech-article-content h2 {
  font-size: 24px;
  font-weight: 700;
  margin-top: 40px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}

.tech-article-content h3 {
  font-size: 20px;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 12px;
}

.tech-article-content p {
  margin-bottom: 16px;
}

.tech-article-content a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tech-article-content a:hover {
  color: var(--color-primary-hover);
}

.tech-article-content img {
  margin: 24px auto;
  border-radius: 8px;
  border: 1px solid var(--color-border);
}

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

.tech-article-content li {
  margin-bottom: 8px;
}

.tech-article-content blockquote {
  margin: 24px 0;
  padding: 16px 20px;
  border-left: 4px solid var(--color-primary);
  background: var(--color-bg-secondary);
  border-radius: 0 8px 8px 0;
  color: var(--color-text-secondary);
}

.tech-article-content pre {
  margin: 24px 0;
  padding: 20px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.6;
}

.tech-article-content code {
  font-family: 'SF Mono', 'Fira Code', 'JetBrains Mono', monospace;
  font-size: 0.9em;
  background: var(--color-bg-secondary);
  padding: 2px 6px;
  border-radius: 4px;
}

.tech-article-content pre code {
  background: none;
  padding: 0;
}

.tech-article-content .table-scroll {
  overflow-x: auto;
  margin: 16px 0 24px;
  -webkit-overflow-scrolling: touch;
}

.tech-article-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.6;
}

.tech-article-content th,
.tech-article-content td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

.tech-article-content th {
  background: var(--color-bg-secondary);
  font-weight: 600;
}

.tech-article-content .tech-cta {
  margin-top: 36px;
  padding: 20px 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg-secondary);
}

.tech-article-content .tech-cta p:last-child {
  margin-bottom: 0;
}

/* Footer */
.tech-footer {
  border-top: 1px solid var(--color-border);
  padding: 32px 24px;
  text-align: center;
  font-size: 14px;
  color: var(--color-text-secondary);
}

.tech-footer a {
  color: var(--color-text-secondary);
}

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

/* Empty State */
.tech-empty {
  text-align: center;
  padding: 80px 24px;
  color: var(--color-text-secondary);
}

.tech-empty h2 {
  font-size: 24px;
  margin-bottom: 8px;
  color: var(--color-text);
}

/* 404 */
.tech-not-found {
  text-align: center;
  padding: 120px 24px;
}

.tech-not-found h1 {
  font-size: 64px;
  font-weight: 800;
  color: var(--color-border);
  margin-bottom: 16px;
}

.tech-not-found p {
  font-size: 18px;
  color: var(--color-text-secondary);
  margin-bottom: 24px;
}
