@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700&family=Oswald:wght@500;700&display=swap');

:root {
  --color-dark: #1f2937;
  --color-dark-2: #374151;
  --color-accent: #f59e0b;
  --color-accent-dark: #d97706;
  --color-bg: #f8fafc;
  --color-card: #ffffff;
  --color-text: #111827;
  --color-muted: #6b7280;
  --color-border: #e5e7eb;
  --radius: 8px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --max-width: 1200px;
  --header-height: 64px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
}

h1, h2, h3, h4 {
  font-family: 'Oswald', 'Noto Sans SC', sans-serif;
  margin: 0 0 0.6em;
  line-height: 1.2;
  font-weight: 700;
}

a {
  color: var(--color-dark);
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: 92%;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Header */
.site-header {
  background: var(--color-dark);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  font-family: 'Oswald', 'Noto Sans SC', sans-serif;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: var(--color-accent);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--color-dark);
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  color: #e5e7eb;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--color-accent);
}

.phone {
  color: var(--color-accent);
  font-weight: 700;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Hero Carousel */
.hero {
  position: relative;
  height: min(60vh, 560px);
  min-height: 360px;
  background: var(--color-dark-2);
  overflow: hidden;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
  background-size: cover;
  background-position: center;
}

.hero-slide.active {
  opacity: 1;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(17,24,39,0.85) 0%, rgba(17,24,39,0.4) 60%, rgba(17,24,39,0.2) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #fff;
}

.hero-content h2 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 0.3em;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.hero-content p {
  font-size: 1.1rem;
  max-width: 560px;
  color: #e5e7eb;
}

.hero-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  backdrop-filter: blur(4px);
  transition: background 0.2s;
}

.hero-nav:hover {
  background: var(--color-accent);
  color: var(--color-dark);
}

.hero-prev { left: 20px; }
.hero-next { right: 20px; }

.hero-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  gap: 10px;
}

.hero-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  border: none;
  cursor: pointer;
}

.hero-dot.active {
  background: var(--color-accent);
}

/* Sections */
.section {
  padding: 64px 0;
}

.section-title {
  font-size: 2rem;
  margin-bottom: 1.2em;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 48px;
  height: 4px;
  background: var(--color-accent);
  border-radius: 2px;
}

.intro-text {
  font-size: 1.05rem;
  color: var(--color-dark-2);
  max-width: 860px;
  white-space: pre-wrap;
}

/* News */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.news-card {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}

.news-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.news-card-body {
  padding: 24px;
  flex: 1;
}

.news-date {
  display: inline-block;
  background: var(--color-dark);
  color: var(--color-accent);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 12px;
}

.news-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5em;
}

.news-card p {
  color: var(--color-muted);
  font-size: 0.95rem;
  margin: 0;
}

.news-card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
}

.read-more {
  color: var(--color-accent-dark);
  font-weight: 700;
  font-size: 0.9rem;
}

.read-more:hover {
  color: var(--color-dark);
}

/* News detail */
.news-detail {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px;
  margin-top: 32px;
}

.news-detail h1 {
  font-size: 1.8rem;
}

.news-meta {
  color: var(--color-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.news-body {
  font-size: 1.05rem;
  line-height: 1.8;
  white-space: pre-wrap;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 32px;
  color: var(--color-dark-2);
  font-weight: 500;
}

.back-link:hover {
  color: var(--color-accent-dark);
}

.news-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.news-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Footer */
.site-footer {
  background: var(--color-dark);
  color: #9ca3af;
  padding: 40px 0;
  text-align: center;
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0;
}

/* Admin layout */
.admin-header {
  background: var(--color-dark);
  color: #fff;
}

.admin-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.admin-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.admin-nav a {
  color: #e5e7eb;
  font-size: 0.9rem;
  padding: 6px 0;
}

.admin-nav a:hover,
.admin-nav a.active {
  color: var(--color-accent);
}

.admin-main {
  padding: 32px 0 64px;
}

.admin-title {
  font-size: 1.6rem;
  margin-bottom: 24px;
}

.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.dashboard-card {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  text-align: center;
}

.dashboard-card .number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-accent-dark);
  font-family: 'Oswald', sans-serif;
}

.dashboard-card .label {
  color: var(--color-muted);
  font-size: 0.9rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius);
  border: none;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
}

.btn-primary:hover {
  background: var(--color-accent-dark);
}

.btn-danger {
  background: #dc2626;
  color: #fff;
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-secondary {
  background: var(--color-dark-2);
  color: #fff;
}

.btn-secondary:hover {
  background: var(--color-dark);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
}

/* Forms */
.card {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 0.9rem;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

.form-hint {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-top: 4px;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

th, td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.95rem;
}

th {
  background: var(--color-dark);
  color: #fff;
  font-weight: 500;
}

tr:last-child td {
  border-bottom: none;
}

.thumb {
  width: 80px;
  height: 56px;
  object-fit: cover;
  border-radius: 4px;
}

.sort-input {
  width: 70px;
  padding: 6px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 0.95rem;
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* Login */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-dark-2) 100%);
}

.login-card {
  width: 92%;
  max-width: 420px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  padding: 40px;
}

.login-card h1 {
  text-align: center;
  margin-bottom: 8px;
}

.login-sub {
  text-align: center;
  color: var(--color-muted);
  margin-bottom: 28px;
}

/* Empty state */
.empty {
  text-align: center;
  color: var(--color-muted);
  padding: 40px 0;
}

.hero-cta {
  margin-top: 24px;
  padding: 14px 28px;
  font-size: 1.1rem;
  align-self: flex-start;
}

.call-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: var(--color-accent);
  color: var(--color-dark);
  text-align: center;
  padding: 14px;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.15);
}

.qr-section {
  background: #fff;
}

.qr-card {
  max-width: 320px;
  margin: 0 auto;
  text-align: center;
  background: var(--color-bg);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}

.qr-img {
  width: 200px;
  height: 200px;
  object-fit: contain;
  margin: 0 auto 16px;
  border-radius: var(--radius);
}

.qr-text {
  color: var(--color-muted);
  margin: 0 0 16px;
  font-size: 0.95rem;
}

.register-section {
  background: var(--color-bg);
}

.register-card {
  max-width: 520px;
  margin: 0 auto;
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding-bottom: 56px;
  }

  .call-bar {
    display: block;
  }

  .menu-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-dark);
    flex-direction: column;
    gap: 0;
    padding: 12px 4%;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }

  .admin-nav {
    display: none;
  }

  .admin-header .menu-toggle {
    display: block;
  }

  .admin-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-dark);
    padding: 12px 4%;
    gap: 0;
  }

  .admin-nav.open a {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }

  .section {
    padding: 40px 0;
  }

  .news-detail {
    padding: 24px;
  }

  .hero-nav {
    width: 36px;
    height: 36px;
  }

  .hero-prev { left: 10px; }
  .hero-next { right: 10px; }
}
