/* ============================================================
   每日大赛规则与裁判公示站 - 第22套模板专属样式
   设计风格：白灰+法务蓝，规则公示板布局
   主色调：#1D4ED8 辅助色：#6B7280 背景色：#F8FAFC
   卡片色：#FFFFFF 强调色：#B91C1C 正文色：#111827
============================================================ */

:root {
  --primary: #1D4ED8;
  --primary-light: #3B82F6;
  --primary-dark: #1E40AF;
  --secondary: #6B7280;
  --secondary-light: #9CA3AF;
  --bg: #F8FAFC;
  --card: #FFFFFF;
  --accent: #B91C1C;
  --accent-light: #DC2626;
  --text: #111827;
  --text-light: #374151;
  --text-muted: #6B7280;
  --border: #E5E7EB;
  --border-dark: #D1D5DB;
  --radius: 14px;
  --radius-sm: 8px;
  --radius-xs: 4px;
  --shadow: 0 10px 30px rgba(0,0,0,0.12);
  --shadow-sm: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-hover: 0 14px 40px rgba(29,78,216,0.15);
  --transition: 180ms cubic-bezier(0.23, 1, 0.32, 1);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --font-heading: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "Courier New", monospace;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background-color: var(--bg);
  line-height: 1.75;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }

p {
  margin-bottom: 1rem;
  color: var(--text-light);
}

/* Layout */
.site-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

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

/* Header */
.site-header {
  background: var(--card);
  border-bottom: 2px solid var(--primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.site-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-logo svg {
  width: 28px;
  height: 28px;
}

.nav-main {
  display: none;
}

.nav-main a {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-xs);
  transition: all var(--transition);
}

.nav-main a:hover {
  color: var(--primary);
  background: rgba(29,78,216,0.06);
  text-decoration: none;
}

.nav-main a.active {
  color: var(--primary);
  background: rgba(29,78,216,0.1);
}

@media (min-width: 768px) {
  .nav-main {
    display: flex;
    gap: 0.25rem;
    align-items: center;
  }
}

/* Mobile Nav Toggle */
.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}

@media (min-width: 768px) {
  .nav-toggle { display: none; }
}

.mobile-nav {
  display: none;
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 1rem 1.5rem;
}

.mobile-nav.active {
  display: block;
}

.mobile-nav a {
  display: block;
  padding: 0.75rem 0;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.mobile-nav a:last-child {
  border-bottom: none;
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  padding: 3rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.3;
}

.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-section h1 {
  color: #fff;
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.hero-subtitle {
  color: rgba(255,255,255,0.9);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  max-width: 700px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.8);
}

.hero-meta-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255,255,255,0.12);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
}

@media (min-width: 768px) {
  .hero-section {
    padding: 4rem 2rem;
  }
  .hero-section h1 {
    font-size: 2.5rem;
  }
}

/* Breadcrumb */
.breadcrumb {
  padding: 0.75rem 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--secondary);
}

.breadcrumb span {
  margin: 0 0.4rem;
  color: var(--secondary-light);
}

/* Section */
.section {
  padding: 3rem 0;
}

.section-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title svg {
  width: 24px;
  height: 24px;
  color: var(--primary);
}

.section-desc {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  border-color: var(--primary-light);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.card-icon {
  width: 40px;
  height: 40px;
  background: rgba(29,78,216,0.08);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.card-text {
  color: var(--text-light);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* Violation Card */
.violation-card {
  border-left: 4px solid var(--accent);
}

.violation-card .card-icon {
  background: rgba(185,28,28,0.08);
  color: var(--accent);
}

/* Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table thead {
  background: var(--primary);
  color: #fff;
}

.data-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-light);
}

.data-table tbody tr {
  transition: background var(--transition);
}

.data-table tbody tr:hover {
  background: rgba(29,78,216,0.03);
}

.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* Flow Chart */
.flow-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.flow-step {
  display: flex;
  gap: 1rem;
  padding: 1.25rem 0;
  position: relative;
}

.flow-step-num {
  width: 36px;
  height: 36px;
  min-width: 36px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  position: relative;
  z-index: 2;
}

.flow-step:not(:last-child) .flow-step-num::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: calc(100% + 0.5rem);
  background: var(--border-dark);
}

.flow-step-content h4 {
  margin-bottom: 0.25rem;
}

.flow-step-content p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0.5rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-dark);
}

.timeline-item {
  position: relative;
  padding-bottom: 1.5rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.65rem;
  top: 0.4rem;
  width: 10px;
  height: 10px;
  background: var(--primary);
  border-radius: 50%;
  border: 2px solid var(--card);
  box-shadow: 0 0 0 2px var(--primary);
}

.timeline-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.timeline-title {
  font-weight: 600;
  margin: 0.25rem 0;
}

.timeline-desc {
  font-size: 0.9rem;
  color: var(--text-light);
}

/* Anchor Nav (Rule TOC) */
.rule-toc {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.rule-toc-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rule-toc a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  color: var(--text-light);
  font-size: 0.9rem;
  border-radius: var(--radius-xs);
  transition: all var(--transition);
  border-left: 3px solid transparent;
}

.rule-toc a:hover,
.rule-toc a.active {
  color: var(--primary);
  background: rgba(29,78,216,0.05);
  border-left-color: var(--primary);
  text-decoration: none;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  line-height: 1.5;
}

.badge-primary {
  background: rgba(29,78,216,0.1);
  color: var(--primary);
}

.badge-accent {
  background: rgba(185,28,28,0.1);
  color: var(--accent);
}

.badge-success {
  background: rgba(5,150,105,0.1);
  color: #059669;
}

/* FAQ */
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  background: var(--card);
  border: none;
  padding: 1rem 1.25rem;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background var(--transition);
}

.faq-question:hover {
  background: rgba(29,78,216,0.03);
}

.faq-question::after {
  content: "+";
  font-size: 1.25rem;
  color: var(--primary);
  transition: transform var(--transition);
}

.faq-item.active .faq-question::after {
  transform: rotate(45deg);
}

.faq-answer {
  display: none;
  padding: 0 1.25rem 1rem;
  color: var(--text-light);
  font-size: 0.9rem;
  line-height: 1.7;
}

.faq-item.active .faq-answer {
  display: block;
}

/* Footer */
.site-footer {
  background: var(--text);
  color: rgba(255,255,255,0.7);
  padding: 3rem 1.5rem 1.5rem;
  margin-top: 3rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

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

.footer-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.75rem;
}

.footer-desc {
  font-size: 0.85rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.6);
}

.footer-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-links a {
  display: block;
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  padding: 0.3rem 0;
  transition: color var(--transition);
}

.footer-links a:hover {
  color: #fff;
  text-decoration: none;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
}

/* Utility */
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.pt-2 { padding-top: 1rem; }
.pb-2 { padding-bottom: 1rem; }

/* Button */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn:active {
  transform: scale(0.97);
}

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

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

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: #fff;
  text-decoration: none;
}

/* Search */
.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: border-color var(--transition);
  background: var(--card);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
}

.search-wrapper {
  position: relative;
}

.search-wrapper svg {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--secondary);
  width: 20px;
  height: 20px;
}

/* Responsive Image */
.resp-img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  object-fit: cover;
}

/* Collapsible */
.collapsible-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  cursor: pointer;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.collapsible-header:hover {
  border-color: var(--primary-light);
}

.collapsible-content {
  display: none;
  padding: 1rem;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.collapsible.active .collapsible-content {
  display: block;
}

/* Rights List */
.rights-list {
  list-style: none;
}

.rights-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-light);
}

.rights-list li svg {
  width: 20px;
  height: 20px;
  min-width: 20px;
  color: var(--primary);
  margin-top: 0.1rem;
}

/* Page Content */
.page-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.page-content h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

.page-content h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.page-content ul, .page-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.page-content li {
  margin-bottom: 0.5rem;
  color: var(--text-light);
  line-height: 1.7;
}

/* Related Links */
.related-links {
  background: rgba(29,78,216,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-top: 2rem;
}

.related-links h4 {
  font-size: 0.9rem;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.related-links a {
  display: inline-block;
  margin-right: 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}

/* Animations */
@media (prefers-reduced-motion: no-preference) {
  .fade-in {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 400ms var(--ease-out), transform 400ms var(--ease-out);
  }

  .fade-in.visible {
    opacity: 1;
    transform: translateY(0);
  }

  .card {
    transition: all 250ms var(--ease-out);
  }
}

/* Print */
@media print {
  .site-header, .site-footer, .nav-toggle, .mobile-nav {
    display: none;
  }
  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }
}
