/* 红领巾订单管理软件 — 现代样式（色调对齐 tbmanage） */

:root {
  --color-primary: #1a56db;
  --color-primary-dark: #1443ad;
  --color-primary-light: #2563eb;
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-border: #e2e8f0;
  --color-info-bg: #eff6ff;
  --color-info-border: #bfdbfe;
  --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);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

/* Layout */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 32px 0;
}

.section-title {
  margin: 0 0 24px;
  font-size: 22px;
  font-weight: 600;
  color: var(--color-text);
}

.section-title--spaced {
  margin-top: 40px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  box-shadow: var(--shadow-md);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 1rem;
}

.site-logo {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.site-logo:hover {
  color: #fff;
  text-decoration: none;
  opacity: 0.9;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
}

.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: 4px;
}

.site-nav a {
  display: block;
  padding: 8px 14px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.site-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  text-decoration: none;
}

.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;
}

/* 页面标题 */
.page-heading {
  margin: 0 0 28px;
  font-size: 26px;
  font-weight: 700;
  color: var(--color-text);
}

.page-lead {
  margin: -16px 0 28px;
  font-size: 15px;
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* 旺旺点灯（官方 webww SDK 渲染） */
.ww-widget {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.ww-widget__name {
  font-weight: 600;
  color: var(--color-primary);
}

.ww-widget .J_WangWang {
  display: inline-block;
  vertical-align: middle;
}

.ww-widget__fallback {
  margin-top: 12px;
  font-size: 14px;
  color: var(--color-text-muted);
}

.ww-widget__fallback a {
  font-weight: 500;
}

.card .btn {
  margin-top: 16px;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.4;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.7);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 16px;
}

.btn-block {
  display: block;
  width: 100%;
  text-align: center;
}

/* Cards */
.card {
  background: var(--color-surface);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

.card__title {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 600;
  color: var(--color-text);
}

.card__text {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 14px;
}

/* Alert */
.alert-warning {
  background: #fff3f3;
  border: 1px solid #ffcdd2;
  border-left: 4px solid #d32f2f;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 24px;
  color: #333;
}

.alert-warning__title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: #d32f2f;
}

.alert-warning__list {
  margin: 0;
  padding-left: 20px;
  color: #555;
  font-size: 14px;
}

.alert-warning__list li {
  margin-bottom: 4px;
}

/* OAuth section */
.oauth-section {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.oauth-card .btn {
  margin-top: 12px;
}

/* Feature grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-item {
  background: var(--color-surface);
  border-radius: 12px;
  padding: 24px 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  transition: transform 0.2s, box-shadow 0.2s;
}

.feature-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.feature-item__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--color-info-bg);
  border-radius: 10px;
  font-size: 22px;
  margin-bottom: 14px;
}

.feature-item__title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
}

.feature-item__desc {
  margin: 0;
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* Download page */
.download-card {
  background: var(--color-surface);
  border: 2px solid var(--color-primary);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
}

.download-card__version {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
}

.download-card__meta {
  margin: 0 0 24px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.download-card__meta code {
  background: var(--color-info-bg);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.download-card .btn-lg {
  min-width: 200px;
}

/* Video list */
.video-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.video-list__item {
  margin-bottom: 8px;
}

.video-list__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--color-surface);
  border-radius: 8px;
  border: 1px solid var(--color-border);
  color: var(--color-text);
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}

.video-list__link:hover {
  background: var(--color-info-bg);
  border-color: var(--color-primary);
  color: var(--color-primary);
  text-decoration: none;
}

.video-list__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

/* Changelog */
.changelog {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.changelog::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--color-border);
}

.changelog__item {
  position: relative;
  padding: 0 0 20px 28px;
}

.changelog__item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 16px;
  height: 16px;
  background: var(--color-primary);
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--color-primary);
}

.changelog__header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
  margin-bottom: 4px;
}

.changelog__date {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

.changelog__version {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-info-bg);
  padding: 2px 10px;
  border-radius: 4px;
}

.changelog__md5 {
  font-size: 12px;
  color: var(--color-text-muted);
  font-family: Consolas, monospace;
}

.changelog__desc {
  margin: 0;
  font-size: 14px;
  color: var(--color-text-muted);
}

.changelog-details {
  margin-top: 0;
}

.changelog-details > .changelog {
  margin-top: 0;
}

.changelog-toggle {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.4;
  border: 2px solid var(--color-primary);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-primary);
  cursor: pointer;
  list-style: none;
  transition: background 0.2s, color 0.2s;
}

.changelog-toggle::-webkit-details-marker {
  display: none;
}

.changelog-toggle:hover {
  background: var(--color-info-bg);
  color: var(--color-primary-dark);
}

.changelog-details:not([open]) .changelog-toggle__collapse {
  display: none;
}

.changelog-details[open] .changelog-toggle__expand {
  display: none;
}

/* Contact grid */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.contact-card {
  background: var(--color-surface);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

.contact-card__label {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.contact-card__value {
  margin: 0;
  font-size: 15px;
  color: var(--color-text);
  word-break: break-all;
}

.contact-card__value a {
  font-weight: 500;
}

.contact-card--full {
  grid-column: 1 / -1;
}

/* Footer */
.site-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 24px 20px;
  margin-top: 48px;
  font-size: 13px;
}

.site-footer__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 24px;
}

.site-footer a {
  color: #cbd5e1;
}

.site-footer a:hover {
  color: #fff;
}

.site-footer__beian {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.site-footer__beian img {
  height: 20px;
  width: auto;
}

.site-footer__beian p {
  margin: 0;
  color: #94a3b8;
}

/* Responsive */
@media (max-width: 900px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .oauth-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .header-inner {
    position: relative;
  }

  .site-nav {
    position: absolute;
    top: 64px;
    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: 8px;
  }

  .site-nav a {
    padding: 12px 16px;
  }

  .site-nav a[aria-current="page"] {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
  }

  .page-heading {
    font-size: 22px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .download-card {
    padding: 24px 16px;
  }

  .changelog__header {
    flex-direction: column;
    gap: 4px;
  }
}
