*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --text: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f8fafc;
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  --radius: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
}

.header-inner .logo {
  flex-shrink: 0;
}

.nav-center {
  flex: 1;
  min-width: 0;
}

.nav-center .nav-links {
  flex-wrap: wrap;
}

.nav-right {
  flex-shrink: 0;
  margin-left: auto;
}

.logo {
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo.logo-has-image {
  background: none;
  -webkit-text-fill-color: inherit;
}

.logo img {
  display: block;
  height: 40px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 15px;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
}

#main-content {
  transition: opacity 0.2s ease;
  min-height: 320px;
}

#main-content.is-loading {
  opacity: 0.45;
  pointer-events: none;
}

.article-section {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 32px;
  margin-bottom: 40px;
}

.article-section-summary {
  font-size: 16px;
  color: #374151;
  margin-bottom: 24px;
  padding: 16px;
  background: #f3f4f6;
  border-radius: 8px;
  border-left: 4px solid var(--primary);
}

.article-section-body {
  font-size: 15px;
  line-height: 1.8;
}

.article-section-body h3 {
  margin: 24px 0 12px;
  font-size: 18px;
}

.article-section-body p {
  margin-bottom: 12px;
}

.article-section-body img,
.article-body img {
  max-width: 100%;
  height: auto;
}

.article-section-body img[data-align="center"],
.article-section-body p.img-align-center img,
.article-section-body p[style*="text-align: center"] img,
.article-section-body p[style*="text-align:center"] img,
.article-body img[data-align="center"],
.article-body p.img-align-center img,
.article-body p[style*="text-align: center"] img,
.article-body p[style*="text-align:center"] img {
  display: block;
  margin-left: auto;
  margin-right: auto;
  float: none;
}

.article-section-body img[data-align="left"],
.article-body img[data-align="left"] {
  display: block;
  margin-left: 0;
  margin-right: auto;
  float: none;
}

.article-section-body img[data-align="right"],
.article-body img[data-align="right"] {
  display: block;
  margin-left: auto;
  margin-right: 0;
  float: none;
}

.article-section-body img[data-align="justify"],
.article-body img[data-align="justify"] {
  display: block;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
  float: none;
}

.article-section-body ul {
  padding-left: 24px;
  margin-bottom: 16px;
}

/* Section title */
.section-title {
  text-align: center;
  padding: 48px 0 32px;
  font-size: 28px;
  font-weight: 700;
  color: #94a3b8;
}

.section-title-news {
  color: #ef4444;
  font-weight: 700;
  font-size: 28px;
}

.section-title > span:not(.section-title-news) {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 18px;
}

/* Project grid */
.project-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 24px;
  padding-bottom: 60px;
}

.project-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: transform 0.25s, box-shadow 0.25s;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

.card-cover {
  position: relative;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.card-cover img {
  max-width: 85%;
  max-height: 85%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.card-cover .placeholder-icon {
  font-size: 64px;
  opacity: 0.3;
}

.card-pin {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: rgba(180, 83, 9, 0.9);
}

.card-star {
  position: absolute;
  top: 10px;
  right: 10px;
  color: #fbbf24;
  font-size: 18px;
}

.card-body {
  padding: 14px 16px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.card-tag {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-tag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tag-color, var(--primary));
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.card-date {
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-price {
  color: var(--primary);
  font-weight: 500;
}

.badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  color: #fff;
  font-weight: 500;
}

.badge-demo {
  background: #f59e0b;
}

.badge-license {
  background: #10b981;
}

.badge-default {
  background: #9ca3af;
}

/* Detail page */
.detail-page {
  padding: 32px 0 60px;
}

.detail-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  align-items: start;
}

.detail-main {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.detail-cover {
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.detail-cover img {
  max-width: 70%;
  max-height: 70%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.detail-content {
  padding: 32px;
}

.detail-content h1 {
  font-size: 26px;
  margin-bottom: 16px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-muted);
}

.detail-summary {
  font-size: 16px;
  color: #374151;
  margin-bottom: 24px;
  padding: 16px;
  background: #f3f4f6;
  border-radius: 8px;
  border-left: 4px solid var(--primary);
}

.article-body {
  font-size: 15px;
  line-height: 1.8;
}

.article-body h3 {
  margin: 24px 0 12px;
  font-size: 18px;
}

.article-body ul {
  padding-left: 24px;
  margin-bottom: 16px;
}

.article-body p {
  margin-bottom: 12px;
}

.detail-sidebar-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 90px;
}

.detail-sidebar {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 24px;
}

.detail-sidebar.user-rights-panel {
  padding: 0;
  overflow: hidden;
  background: #fff;
  border: none;
  box-shadow: 0 6px 28px rgba(15, 23, 42, 0.1);
}

.detail-sidebar h3 {
  font-size: 16px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.sidebar-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.2s;
}

.sidebar-item:hover {
  background: #f9fafb;
}

.sidebar-thumb {
  width: 64px;
  height: 48px;
  border-radius: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.sidebar-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

.sidebar-info {
  flex: 1;
  min-width: 0;
}

.sidebar-info .title {
  font-size: 13px;
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sidebar-info .date {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.sidebar-empty {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

/* 用户权益面板 - 商城卡片风格 */
.ur-price-banner {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #fde68a 0%, #fbbf24 45%, #f59e0b 100%);
  text-align: center;
  border-radius: var(--radius) var(--radius) 0 0;
}

.ur-price-prefix {
  font-size: 13px;
  color: #78716c;
  font-weight: 500;
}

.ur-price-main {
  font-size: 22px;
  font-weight: 800;
  color: #1d4ed8;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.ur-body {
  padding: 16px 18px 18px;
}

.ur-panel-title {
  font-size: 15px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px dashed #e2e8f0;
}

.ur-rows {
  margin-bottom: 4px;
}

.ur-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding: 11px 0;
  border-bottom: 1px dashed #e5e7eb;
}

.ur-row:last-child {
  border-bottom: none;
}

.ur-status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

.ur-status-icon--ok {
  background: #3b82f6;
  color: #fff;
}

.ur-status-icon--vip {
  background: #f97316;
  color: #fff;
}

.ur-status-icon--off {
  background: #9ca3af;
  color: #fff;
  font-size: 12px;
}

.ur-row-text {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  color: #64748b;
  line-height: 1.45;
}

.ur-row--primary .ur-row-text {
  color: #2563eb;
  font-weight: 500;
}

.ur-row--highlight .ur-row-text--strong {
  color: #1d4ed8;
  font-weight: 700;
}

.ur-row--vip .ur-row-text {
  color: #ea580c;
  font-weight: 600;
}

.ur-row--muted .ur-row-text {
  color: #94a3b8;
  font-size: 13px;
}

.ur-row-text em {
  font-style: normal;
  font-weight: 800;
  color: #0d9488;
}

.ur-tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 10px;
  line-height: 1.4;
  flex-shrink: 0;
}

.ur-tag--purple {
  background: linear-gradient(90deg, #8b5cf6, #a855f7);
  color: #fff;
}

.ur-subtitle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: 14px 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
}

.ur-subtitle-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ur-subtitle-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #94a3b8;
  margin-left: auto;
}

.ur-subtitle-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f97316;
  flex-shrink: 0;
}

.ur-rows--optional {
  margin-bottom: 14px;
}

.ur-fee-box {
  margin-bottom: 14px;
  padding: 12px 14px;
  background: #fffbeb;
  border: 1px dashed #fbbf24;
  border-radius: 8px;
}

.ur-fee-box-label {
  font-size: 12px;
  color: #a16207;
  font-weight: 600;
  margin-bottom: 6px;
}

.ur-fee-box-text {
  margin: 0;
  font-size: 12px;
  line-height: 1.65;
  color: #78716c;
}

.ur-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  border: none;
  border-radius: 8px;
  background: linear-gradient(90deg, #2563eb 0%, #0ea5e9 100%);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
  transition: transform 0.15s, box-shadow 0.15s;
}

.ur-cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.5);
  color: #fff;
}

.ur-footer-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 12px;
  font-size: 12px;
  color: #94a3b8;
  background: #f1f5f9;
  border-radius: 8px;
}

.ur-footer-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3b82f6;
  flex-shrink: 0;
}

.breadcrumb {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.breadcrumb a {
  color: var(--primary);
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.site-footer {
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}

.empty-state h2 {
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--text);
}

@media (max-width: 900px) {
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-sidebar-col {
    position: static;
  }
}

@media (max-width: 768px) {
  .site-header {
    padding: 12px 0 0;
  }

  .header-inner {
    flex-wrap: wrap;
    gap: 8px 12px;
    padding-bottom: 12px;
  }

  .header-inner .logo {
    flex: 1;
    min-width: 0;
  }

  .nav-right {
    margin-left: auto;
  }

  .nav-center {
    order: 3;
    flex-basis: 100%;
    width: 100%;
    border-top: 1px solid var(--border);
    padding: 10px 0 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .nav-center::-webkit-scrollbar {
    display: none;
  }

  .nav-center .nav-links {
    flex-wrap: nowrap;
    gap: 20px;
    width: max-content;
    min-width: 100%;
    padding: 0 2px;
  }

  .nav-center .nav-links a {
    white-space: nowrap;
    font-size: 14px;
    padding: 4px 0;
  }

  .nav-center .nav-links a.active {
    font-weight: 600;
  }
}

@media (max-width: 600px) {
  .project-grid {
    grid-template-columns: 1fr;
  }
}
