* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Microsoft YaHei', sans-serif;
  background: #f7f7f9;
  color: #222;
}

a {
  color: #1a73e8;
  text-decoration: none;
}

header {
  background: #111;
  color: #fff;
  padding: 16px;
}

header .container {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-name {
  font-weight: 600;
  font-size: 18px;
}

.admin-link {
  color: #fff;
  opacity: 0.9;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px;
}

/* Banner */
.banner {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: #000;
}

.banner-track {
  display: flex;
  transition: transform 0.6s ease;
}

.banner-slide {
  flex: 0 0 100%;
  position: relative;
}

.banner-slide img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  display: block;
}

.banner-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.banner-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  cursor: pointer;
}

.banner-dot.active {
  background: #fff;
}

/* Announcements */
.announcements {
  margin: 24px 0;
}

.announcement {
  background: #fff !important;
  border: none !important;
  border-left: 4px solid #1a73e8 !important;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 16px;
  color: #5f6368 !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.announcement::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(26, 115, 232, 0.03) 0%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

.announcement:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.announcement-title {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 8px;
  color: #202124 !important;
  display: flex;
  align-items: center;
  gap: 8px;
}

.announcement-title::before {
  content: '📢';
  /* Simple icon, or could use an SVG background if preferred */
  font-size: 18px;
  filter: grayscale(100%);
  /* Make it neutral or remove to keep color */
}

.announcement-content {
  font-size: 14px;
  line-height: 1.6;
  color: #4b4f56 !important;
  padding-left: 2px;
  /* Slight alignment adjustment */
}

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.card {
  background: #fff;
  border-radius: 12px;
  /* Slightly more rounded */
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  /* Remove underline for link */
  color: inherit;
  transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform, box-shadow;
  border: 1px solid transparent;
  /* For hover effect */
}

.card:hover {
  transform: translateY(var(--hover-lift));
  box-shadow: var(--shadow-md);
  border-color: rgba(26, 115, 232, 0.1);
}

.card-thumb-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #eee;
}

.card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.card:hover .card-thumb {
  transform: scale(1.05);
}

.card-overlay {
  position: absolute;
  bottom: 12px;
  left: 12px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
  opacity: 1;
  transform: translateY(0);
  transition: all 0.3s ease;
  pointer-events: none;
}

.card:hover .card-overlay {
  opacity: 1;
  transform: translateY(0);
}

.card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: #1a73e8;
  margin: 0 0 8px;
  line-height: 1.4;
}

.card-desc {
  font-size: 14px;
  color: #5f6368;
  line-height: 1.5;
  margin-bottom: 16px;
  height: 42px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 4px;
}

.version-tag {
  background: #f8f9fa;
  color: #5f6368;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}

.get-btn {
  background: #e8f0fe;
  color: #1a73e8;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.2s;
}

.card:hover .get-btn {
  background: #d2e3fc;
}

.btn {
  display: block;
  width: 100%;
  padding: 12px;
  border-radius: 6px;
  background: #1a73e8;
  color: #fff;
  font-size: 14px;
  text-align: center;
  border: none;
  cursor: pointer;
  box-sizing: border-box;
  margin-top: 10px;
}

.btn.secondary {
  background: #f0f2f5;
  color: #222;
}

/* 主页“用户注册”按钮自适应宽度（根据文字长度变化） */
.btn-fit {
  display: inline-block;
  width: auto;
  padding: 8px 12px;
  margin-top: 0;
}

/* 主页头部按钮保持同一排，宽度随文字自适应 */
header .admin-nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

header .admin-nav .btn {
  display: inline-flex;
  width: auto;
  padding: 8px 12px;
  margin-top: 0;
}

/* Detail - 严格单列布局 - 强制优先级 */
.detail {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 15px !important;
  box-sizing: border-box !important;
  flex-direction: column !important;
}

.detail>* {
  width: 100% !important;
  margin-bottom: 20px !important;
  display: block !important;
  box-sizing: border-box !important;
  clear: both !important;
  float: none !important;
  position: relative !important;
}

.detail .image-section {
  text-align: center !important;
  width: 100% !important;
  display: block !important;
  float: none !important;
}

.detail img {
  width: 50% !important;
  max-width: 50% !important;
  height: auto !important;
  object-fit: cover !important;
  border-radius: 10px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
  display: block !important;
  margin: 0 auto !important;
  float: none !important;
}

.detail h1 {
  margin: 0 0 20px 0 !important;
  font-size: 24px !important;
  text-align: center !important;
  color: #333 !important;
  line-height: 1.3 !important;
  width: 100% !important;
  display: block !important;
  float: none !important;
}

.detail p {
  color: #444 !important;
  line-height: 1.6 !important;
  text-align: left !important;
  margin: 0 0 20px 0 !important;
  width: 100% !important;
  display: block !important;
  float: none !important;
}

.detail .description-section {
  width: 100% !important;
  display: block !important;
  margin-bottom: 20px !important;
  float: none !important;
}

.detail .meta-info {
  padding: 12px !important;
  background: #f8f9fa !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  color: #666 !important;
  width: 100% !important;
  box-sizing: border-box !important;
  display: block !important;
  float: none !important;
}

.detail .download-section {
  padding: 20px !important;
  background: #fff !important;
  border: 2px solid #007bff !important;
  border-radius: 10px !important;
  margin: 20px 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
  display: block !important;
  float: none !important;
}

.detail .video-section {
  width: 100% !important;
  display: block !important;
  box-sizing: border-box !important;
  float: none !important;
}

/* 移动端响应式优化 - 严格单列布局 */
@media (max-width: 768px) {
  .detail {
    padding: 10px;
    width: 100%;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
  }

  .detail>* {
    margin-bottom: 15px;
    width: 100%;
    display: block;
    box-sizing: border-box;
  }

  .detail h1 {
    font-size: 20px;
    margin: 0 0 15px 0;
    width: 100%;
    display: block;
    text-align: center;
  }

  .detail img {
    width: 50% !important;
    max-width: 50% !important;
    height: auto !important;
    display: block !important;
    margin: 0 auto !important;
  }

  .detail .download-section {
    padding: 15px;
    margin: 15px 0;
    width: 100%;
    box-sizing: border-box;
    display: block;
  }

  .detail .meta-info {
    padding: 10px;
    font-size: 13px;
    width: 100%;
    box-sizing: border-box;
    display: block;
  }

  .video-section {
    margin: 15px 0 !important;
    padding: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    display: block !important;
  }

  .video-section h3 {
    font-size: 14px !important;
    width: 100% !important;
    display: block !important;
  }

  .form-group {
    width: 100% !important;
    display: block !important;
    box-sizing: border-box !important;
  }

  input[type="text"],
  input[type="password"] {
    width: 100% !important;
    display: block !important;
    box-sizing: border-box !important;
  }
}

.form-group {
  margin-bottom: 12px !important;
  width: 100% !important;
  display: block !important;
  box-sizing: border-box !important;
  float: none !important;
}

input[type="text"],
input[type="password"],
input[type="file"],
textarea,
select {
  width: 100% !important;
  padding: 8px !important;
  border: 1px solid #ddd !important;
  border-radius: 6px !important;
  display: block !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  float: none !important;
}

label {
  display: block !important;
  font-size: 13px !important;
  color: #333 !important;
  margin-bottom: 6px !important;
  width: 100% !important;
  float: none !important;
}

/* 确保验证码区域完全垂直排列 */
.form-group div {
  width: 100% !important;
  display: block !important;
  text-align: center !important;
  margin-top: 8px !important;
  float: none !important;
}

.form-group img {
  display: block !important;
  margin: 0 auto !important;
  max-width: 100% !important;
  float: none !important;
}

.notice {
  background: #fff3cd;
  color: #664d03;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #ffe69c;
}

.error {
  background: #fdecef;
  color: #b42318;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #fdd8e5;
}

.success {
  background: #ecfdf3;
  color: #027a48;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #d1fadf;
}

/* Pagination Buttons */
.pagination .btn {
  width: 60px !important;
  height: 60px !important;
  border-radius: 50% !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 12px !important;
  line-height: 1 !important;
  margin-top: 0 !important;
  box-shadow: var(--shadow-sm);
}

.pagination .btn:hover {
  transform: translateY(-2px) scale(1.1);
  box-shadow: var(--shadow-md);
}

/* Admin */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-nav {
  display: flex;
  gap: 12px;
}

/* Admin */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-nav {
  display: flex;
  gap: 12px;
}

/* --- Login & Register Redesign --- */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f2f5;
  padding: 20px;
}

.login-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  width: 100%;
  max-width: 400px;
  padding: 40px 32px;
  text-align: center;
  animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-header {
  margin-bottom: 32px;
}

.login-icon {
  width: 64px;
  height: 64px;
  background: #1a73e8;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: #fff;
  font-size: 28px;
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
}

.login-title {
  font-size: 24px;
  font-weight: 700;
  color: #202124;
  margin: 0 0 8px;
}

.login-subtitle {
  font-size: 14px;
  color: #5f6368;
}

.input-group {
  margin-bottom: 20px;
  text-align: left;
}

.input-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #202124;
  margin-bottom: 8px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper input {
  width: 100% !important;
  padding: 12px 12px 12px 44px !important;
  border: 1px solid #dadce0 !important;
  border-radius: 8px !important;
  background: #f8f9fa !important;
  /* Light gray background like screenshot */
  color: #202124 !important;
  font-size: 15px !important;
  transition: all 0.2s ease;
}

/* Darker input style to match screenshot more closely if desired, 
   but keeping it clean/light is usually better for general web apps.
   Let's try to match the dark input style from the screenshot. */
.input-wrapper input.dark-theme {
  background: #333 !important;
  border: 1px solid #444 !important;
  color: #fff !important;
}

/* Actually, let's stick to a clean light theme but with the screenshot's structure. 
   The user said "change style", and the screenshot has dark inputs. 
   I will use dark inputs as requested. */
.input-wrapper input {
  background: #3c4043 !important;
  border: 1px solid #3c4043 !important;
  color: #e8eaed !important;
}

.input-wrapper input::placeholder {
  color: #9aa0a6;
}

.input-wrapper input:focus {
  background: #3c4043 !important;
  border-color: #8ab4f8 !important;
  box-shadow: 0 0 0 2px rgba(138, 180, 248, 0.2) !important;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: #9aa0a6;
  font-size: 18px;
  pointer-events: none;
}

.btn-login {
  width: 100%;
  padding: 12px;
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.btn-login:hover {
  background: #1557b0;
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
  transform: translateY(-1px);
}

.btn-login:active {
  transform: translateY(0);
}

.login-footer {
  margin-top: 24px;
  font-size: 13px;
  color: #5f6368;
}

.login-footer a {
  color: #1a73e8;
  font-weight: 500;
}

.login-footer a:hover {
  text-decoration: underline;
}

/* Captcha specific */
.captcha-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.captcha-input-wrapper {
  flex: 1;
  position: relative;
}

.captcha-img-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f3f4;
  border-radius: 8px;
  padding: 0 12px;
  cursor: pointer;
}

/* --- Dynamic Effects & Animations --- */

:root {
  --transition-speed: 0.3s;
  --hover-lift: -4px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 16px 32px rgba(0, 0, 0, 0.16);
}

/* Smooth scrolling for the whole page */
html {
  scroll-behavior: smooth;
}

/* Button Hover Effects */
.btn {
  transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
  filter: brightness(1.05);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(26, 115, 232, 0.2);
}

.btn.secondary:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  background: #e4e6e9;
}

/* Card Hover Effects */
.card {
  transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform, box-shadow;
}

.card:hover {
  transform: translateY(var(--hover-lift));
  box-shadow: var(--shadow-md);
}

.card-thumb {
  transition: transform 0.5s ease;
  overflow: hidden;
}

.card:hover .card-thumb {
  transform: scale(1.05);
}

/* Banner Hover */
.banner {
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-speed) ease;
}

.banner:hover {
  box-shadow: var(--shadow-md);
}

/* Announcement Hover */
.announcement {
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.announcement:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(211, 47, 47, 0.15);
}

/* Form Inputs Focus Effects */
input[type="text"],
input[type="password"],
input[type="file"],
textarea,
select {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
  border-color: #1a73e8 !important;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15) !important;
  outline: none;
}

/* Navigation Links Hover */
header a {
  transition: opacity 0.2s ease;
}

header a:hover {
  opacity: 0.8;
}

/* Scroll Animation Classes */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
  will-change: opacity, transform;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered delays for grid items */
.grid .card:nth-child(1) {
  transition-delay: 0ms;
}

.grid .card:nth-child(2) {
  transition-delay: 50ms;
}

.grid .card:nth-child(3) {
  transition-delay: 100ms;
}

.grid .card:nth-child(4) {
  transition-delay: 150ms;
}

.grid .card:nth-child(5) {
  transition-delay: 200ms;
}

.grid .card:nth-child(6) {
  transition-delay: 250ms;
}

.grid .card:nth-child(7) {
  transition-delay: 300ms;
}

.grid .card:nth-child(8) {
  transition-delay: 350ms;
}

/* Detail Page Image Hover */
.detail img {
  transition: transform 0.5s ease, box-shadow 0.3s ease;
}

.detail img:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-lg) !important;
}