/* 红领巾软件介绍站 - 现代样式 */

:root {
  --color-primary: #1a56db;
  --color-primary-dark: #1443ad;
  --color-accent: #e53e3e;
  --color-accent-soft: #fef2f2;
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-border: #e2e8f0;
  --color-info-bg: #eff6ff;
  --color-info-border: #bfdbfe;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.1);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
  --max-width: 1100px;
  --header-height: 64px;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

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

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

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(135deg, var(--color-primary) 0%, #2563eb 100%);
  box-shadow: var(--shadow-md);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  gap: 1rem;
}

.site-logo {
  color: #fff;
  font-size: 1.125rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.site-logo:hover {
  color: #fff;
  opacity: 0.9;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
}

.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
}

.nav-toggle svg {
  display: block;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.25rem;
}

.site-nav a {
  display: block;
  padding: 0.5rem 0.875rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: background 0.2s, color 0.2s;
}

.site-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
}

.site-nav a[aria-current="page"] {
  color: var(--color-primary);
  background: #fff;
  font-weight: 600;
}

.site-nav a[aria-current="page"]:hover {
  color: var(--color-primary-dark);
  background: #f1f5f9;
}

/* Main */
.site-main {
  flex: 1;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  color: var(--color-text);
}

.page-header p {
  margin: 0;
  font-size: 1.0625rem;
  color: var(--color-text-muted);
  max-width: 640px;
}

.section-title {
  margin: 0 0 1.25rem;
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--color-text);
}

.section-title--accent {
  color: var(--color-accent);
}

.section-block {
  margin-bottom: 2.5rem;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .hero {
    grid-template-columns: 1fr 1fr;
  }
}

.hero-content h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.25;
}

.hero-content .lead {
  margin: 0 0 1.5rem;
  font-size: 1.0625rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.hero-visual {
  text-align: center;
}

.hero-visual img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
}

.hero-visual figcaption {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  color: #fff;
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-secondary:hover {
  background: var(--color-info-bg);
  color: var(--color-primary-dark);
}

.btn-accent {
  background: var(--color-accent);
  color: #fff;
}

.btn-accent:hover {
  background: #c53030;
  color: #fff;
}

/* Cards */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.card-link:hover {
  color: inherit;
  transform: translateY(-2px);
}

.card-icon {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
  line-height: 1;
}

.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.0625rem;
  font-weight: 600;
}

.card p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* Feature grid */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .feature-grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.feature-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-primary);
}

.feature-card p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  line-height: 1.65;
}

.feature-card--highlight h3 {
  color: var(--color-accent);
}

/* Info bar */
.info-bar {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--color-info-bg);
  border: 1px solid var(--color-info-border);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  color: var(--color-text);
}

.info-bar strong {
  color: var(--color-primary);
}

/* Download cards */
.download-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

@media (min-width: 640px) {
  .download-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.download-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.download-card--featured {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.download-card .version {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  background: var(--color-info-bg);
  color: var(--color-primary);
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}

.download-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
}

.download-card .meta {
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  flex: 1;
}

.download-card .btn {
  align-self: flex-start;
}

/* File & video cards */
.resource-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .resource-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

.resource-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.resource-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
  color: inherit;
}

.resource-card .icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-info-bg);
  border-radius: var(--radius-sm);
  font-size: 1.5rem;
}

.resource-card h3 {
  margin: 0 0 0.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
}

.resource-card p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

/* Contact cards */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .contact-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.contact-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.contact-card h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-primary);
}

.contact-card p,
.contact-card a {
  margin: 0;
  font-size: 0.9375rem;
  word-break: break-all;
}

.contact-card .wangwang-wrap {
  margin: 0;
}

.contact-card .wangwang {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.375rem 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.contact-card .wangwang:hover {
  background: var(--color-info-bg);
}

.contact-card .wangwang .J_WangWang {
  display: inline-block;
  line-height: 0;
}

.contact-card .wangwang .ww-light a {
  text-decoration: none;
}

.contact-card .wangwang-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-primary);
}

.contact-card .wangwang-hint {
  margin: 0.75rem 0 0;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* Changelog */
.changelog-recent {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.changelog-item {
  padding: 1rem 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-primary);
  border-radius: var(--radius-sm);
}

.changelog-item .date {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-bottom: 0.25rem;
}

.changelog-item .ver {
  font-weight: 600;
  color: var(--color-primary);
  margin-right: 0.75rem;
}

.changelog-item .md5 {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-family: monospace;
}

.changelog-item p {
  margin: 0.375rem 0 0;
  font-size: 0.9375rem;
}

.changelog-details {
  margin-top: 0.5rem;
}

.changelog-details summary {
  cursor: pointer;
  padding: 0.75rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-weight: 600;
  color: var(--color-primary);
  user-select: none;
  list-style: none;
}

.changelog-details summary::-webkit-details-marker {
  display: none;
}

.changelog-details summary::before {
  content: "▶ ";
  font-size: 0.75rem;
}

.changelog-details[open] summary::before {
  content: "▼ ";
}

.changelog-details[open] summary {
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border-bottom: none;
}

.changelog-full {
  max-height: 480px;
  overflow-y: auto;
  padding: 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-size: 0.875rem;
  line-height: 1.8;
  color: var(--color-text-muted);
}

.changelog-full .entry {
  padding: 0.375rem 0;
  border-bottom: 1px solid var(--color-border);
}

.changelog-full .entry:last-child {
  border-bottom: none;
}

/* Screenshot section */
.screenshot-section {
  text-align: center;
  margin-top: 2rem;
}

.screenshot-section img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
  max-width: 100%;
}

.screenshot-section figcaption {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* Footer */
.site-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 1.5rem 1.25rem;
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.8125rem;
}

.site-footer a {
  color: #cbd5e1;
}

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

.footer-beian {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.footer-beian img {
  height: 18px;
  width: auto;
}

/* Mobile nav */
@media (max-width: 767px) {
  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-primary-dark);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .site-nav.is-open {
    max-height: 320px;
    box-shadow: var(--shadow-lg);
  }

  .site-nav ul {
    flex-direction: column;
    padding: 0.5rem;
  }

  .site-nav a {
    padding: 0.75rem 1rem;
  }

  .site-nav a[aria-current="page"] {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
  }

  .header-inner {
    position: relative;
  }
}
