/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #0d6efd;
  --primary-dark: #095f88;
  --accent: #13a1fc;
  --text: #333;
  --text-light: #666;
  --bg: #f8f9fa;
  --white: #fff;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --radius: 8px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ===== Header ===== */
header {
  background: var(--white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo a {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.nav-desktop {
  display: flex;
  gap: 28px;
  list-style: none;
}

.nav-desktop a {
  font-size: 0.95rem;
  color: var(--text);
  transition: color .2s;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-form {
  display: flex;
  align-items: center;
  background: #f1f3f5;
  border-radius: 20px;
  padding: 4px 4px 4px 14px;
}

.search-form input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.9rem;
  width: 120px;
}

.search-form button {
  border: none;
  background: var(--primary);
  color: #fff;
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 0.8rem;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 0.9rem;
  transition: opacity .2s, transform .2s;
}

.btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-outline {
  border: 1px solid var(--primary);
  color: var(--primary);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: 0.3s;
}

.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.98);
  z-index: 1100;
  flex-direction: column;
  padding: 80px 30px 30px;
}

.mobile-menu.open {
  display: flex;
}

.mobile-menu .close {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 1.5rem;
  cursor: pointer;
}

.mobile-menu ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 18px;
  font-size: 1.1rem;
}

.mobile-menu .actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: center;
  flex: 1;
  background: linear-gradient(135deg, #e0f7fa 0%, #f8f9fa 100%);
  overflow: hidden;
}

.hero-shapes img {
  position: absolute;
  opacity: 0.35;
  pointer-events: none;
}

.hero-shapes .t1 { top: 10%; left: 8%; width: 60px; }
.hero-shapes .t2 { top: 20%; right: 10%; width: 50px; }
.hero-shapes .r1 { bottom: 15%; left: 12%; width: 45px; }
.hero-shapes .r2 { bottom: 25%; right: 8%; width: 40px; }
.hero-shapes .target { top: 50%; left: 50%; width: 70px; transform: translate(-50%,-50%); }
.hero-shapes .water { bottom: 10%; right: 20%; width: 55px; }

.hero-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  position: relative;
  z-index: 2;
}

.hero h1 {
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
}

.hero h1 span {
  color: var(--primary);
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-light);
  max-width: 560px;
  margin-bottom: 28px;
}

/* ===== Page Title Banner ===== */
.page-banner {
  background: linear-gradient(90deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #fff;
  padding: 60px 20px;
  text-align: center;
}

.page-banner h1 {
  font-size: 2rem;
  font-weight: 600;
}

/* ===== Container ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* ===== Blog Layout ===== */
.blog-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 40px;
}

@media (max-width: 900px) {
  .blog-layout {
    grid-template-columns: 1fr;
  }
}

.post-item {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 28px;
}

.post-thumb img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.post-content {
  padding: 22px 24px;
}

.post-content h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.post-content h3 a {
  color: var(--text);
}

.post-content h3 a:hover {
  color: var(--primary);
}

.post-content p {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.read-more {
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 500;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 14px;
  font-size: 0.85rem;
  color: #888;
}

.meta a:hover {
  color: var(--primary);
}

.pagination {
  display: flex;
  gap: 8px;
  list-style: none;
  margin-top: 20px;
}

.pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: var(--white);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 0.9rem;
}

.pagination a.active,
.pagination a:hover {
  background: var(--primary);
  color: #fff;
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.widget {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.widget h4 {
  font-size: 1rem;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
}

.blog-search {
  display: flex;
  gap: 8px;
}

.blog-search input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  outline: none;
}

.blog-search button {
  padding: 10px 16px;
  border: none;
  background: var(--primary);
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
}

.widget-post li {
  list-style: none;
  margin-bottom: 14px;
}

.widget-post a {
  display: flex;
  gap: 12px;
}

.widget-post .thumb {
  width: 64px;
  height: 48px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
}

.widget-post .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.widget-post .info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.widget-post .subtitle {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.widget-post .date {
  font-size: 0.75rem;
  color: var(--primary);
  margin-top: 4px;
}

/* ===== Content Page ===== */
.content-page {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}

.content-page h2 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: var(--primary-dark);
}

.content-page p,
.content-page li {
  margin-bottom: 12px;
  color: var(--text-light);
}

.content-page ol,
.content-page ul {
  padding-left: 22px;
  margin-bottom: 16px;
}

/* ===== Auth Pages ===== */
.auth-body {
  margin: 0;
  overflow: hidden;
  background: linear-gradient(to bottom, #19778c, #095f88);
  background-size: 1400% 300%;
  animation: dynamics 6s ease infinite;
  font-size: 14px;
  color: #fff;
  min-height: 100vh;
}

@keyframes dynamics {
  0% { background-position: 0% 0%; }
  50% { background-position: 50% 100%; }
  100% { background-position: 100% 0%; }
}

.auth-box {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: none;
}

.auth-box > * {
  pointer-events: auto;
}

.auth-card {
  width: 470px;
  max-width: 92vw;
  background: rgba(13, 110, 253, 0.12);
  backdrop-filter: blur(6px);
  border: solid 1px var(--accent);
  border-radius: 6px;
  padding: 2px;
}

.auth-card-inner {
  background: linear-gradient(var(--accent), var(--accent)) left top,
              linear-gradient(var(--accent), var(--accent)) left top,
              linear-gradient(var(--accent), var(--accent)) right top,
              linear-gradient(var(--accent), var(--accent)) right top,
              linear-gradient(var(--accent), var(--accent)) left bottom,
              linear-gradient(var(--accent), var(--accent)) left bottom,
              linear-gradient(var(--accent), var(--accent)) right bottom,
              linear-gradient(var(--accent), var(--accent)) right bottom;
  background-repeat: no-repeat;
  background-size: 3px 20px, 20px 3px;
  height: 100%;
  padding: 26px 28px 32px;
  border-radius: 4px;
}

.auth-card h2 {
  font-size: 28px;
  text-align: center;
  margin-bottom: 36px;
  position: relative;
}

.auth-card h2::after {
  display: block;
  content: '';
  width: 57px;
  height: 3px;
  background: #fff;
  margin: 14px auto 0;
}

.auth-card input {
  display: block;
  width: 100%;
  max-width: 340px;
  margin: 0 auto 20px;
  height: 46px;
  background: rgba(255,255,255,0.95);
  border-radius: 4px;
  border: 0;
  font-size: 15px;
  outline: none;
  padding-left: 12px;
  color: #000;
}

.auth-card input::placeholder {
  color: #555;
}

.auth-card .code-row {
  display: flex;
  gap: 12px;
  max-width: 340px;
  margin: 0 auto 20px;
}

.auth-card .code-row input:first-child {
  flex: 1;
  margin: 0;
}

.auth-card .code-row input#code {
  width: 100px;
  margin: 0;
  text-align: center;
  cursor: pointer;
  background: rgba(255,255,255,0.85);
  font-weight: 700;
  letter-spacing: 2px;
}

.auth-card .btn-auth {
  width: 100%;
  max-width: 340px;
  height: 46px;
  background: #0090ff;
  border-radius: 4px;
  display: block;
  margin: 0 auto 14px;
  text-align: center;
  line-height: 46px;
  cursor: pointer;
  color: #fff;
  font-size: 15px;
  transition: background .2s;
}

.auth-card .btn-auth:hover {
  background: #007be0;
}

.auth-card .btn-row {
  display: flex;
  gap: 12px;
  max-width: 340px;
  margin: 0 auto;
}

.auth-card .btn-row .btn-auth {
  flex: 1;
  margin: 0;
}

.auth-logo {
  position: fixed;
  left: 40px;
  top: 26px;
  z-index: 20;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.auth-footer {
  position: fixed;
  bottom: 14px;
  width: 100%;
  text-align: center;
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  z-index: 20;
}

.auth-footer a {
  color: #fff;
  text-decoration: underline;
}

#canvas-container canvas {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--white);
  border-top: 1px solid #e9ecef;
  padding: 18px 20px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-light);
  position: relative;
  z-index: 5;
}

.site-footer a {
  color: var(--primary);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .nav-desktop,
  .header-actions .search-form,
  .header-actions .btn {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .hero {
    min-height: 420px;
  }

  .hero h1 {
    font-size: 1.6rem;
  }

  .post-thumb img {
    height: 160px;
  }

  .content-page {
    padding: 20px;
  }
}
