/* ===== Layout Helpers ===== */
.page-centered { text-align: center; padding: 80px 0; }
.page-centered h1 { font-size: 72px; color: var(--primary); margin-bottom: 16px; }
.page-centered p { font-size: 18px; color: var(--text-secondary); margin-bottom: 24px; }
.page-centered .btn-home { position: static; display: inline-flex; opacity: 1; border-radius: 8px; padding: 0 24px; width: auto; }

.content-narrow { max-width: 480px; }
.content-medium { max-width: 720px; }
.text-center { text-align: center; }

.infeed-ad-placeholder { border-style: dashed; cursor: default; min-height: 120px; align-items: center; justify-content: center; display: flex; }

/* ===== Ad Containers ===== */
.ad-container {
  text-align: center;
  overflow: hidden;
  margin: 24px 0;
  padding: 16px 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  position: relative;
}

.ad-container::before {
  content: '广告';
  position: absolute;
  top: 4px;
  right: 8px;
  font-size: 10px;
  color: var(--text-tertiary);
  letter-spacing: 0.5px;
  opacity: 0.5;
}

.ad-container ins,
.ad-container iframe,
.ad-container img {
  max-width: 100%;
  margin: 0 auto;
}

.ad-slot-carousel-banner {
  margin: 0 auto 28px;
  max-width: var(--max-width);
  padding: 12px 24px;
  min-height: 90px;
}

.ad-slot-footer-banner {
  margin: 0;
  padding: 20px 24px;
  background: var(--ad-footer-bg);
  border-radius: 0;
  min-height: 90px;
}
.ad-slot-footer-banner::before { color: var(--ad-footer-before-color); }

.ad-slot-single-top,
.ad-slot-single-middle,
.ad-slot-single-bottom {
  margin: 28px 0;
  padding: 20px 0;
  min-height: 90px;
}

.ad-slot-grid-infeed,
.ad-slot-list-infeed {
  border: 1px dashed var(--border);
  min-height: 120px;
  margin: 0;
}

.ad-widget {
  margin: 0;
  padding: 12px 0;
  min-height: 200px;
  background: transparent;
  border: 1px dashed var(--border);
}
.ad-widget::before { display: none; }

/* ===== Auth Forms ===== */
.auth-card {
  max-width: 420px;
  margin: 0 auto;
  padding: 32px 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border);
}

.auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--transition);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.auth-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.auth-form { display: none; }
.auth-form.active { display: block; }
.auth-form input { width: 100%; padding: 12px 16px; margin-bottom: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; background: var(--bg); color: var(--text); }
.auth-form input:focus { outline: none; border-color: var(--primary); }
.auth-form .btn-primary { width: 100%; justify-content: center; padding: 12px; }
.auth-msg, .submit-msg { font-size: 13px; margin-top: 8px; text-align: center; }
.auth-msg.success, .submit-msg.success { color: var(--success-color); }
.auth-msg.error, .submit-msg.error { color: var(--error-color); }

/* ===== Submit Form ===== */
.submit-card {
  max-width: 680px;
  margin: 0 auto;
  padding: 32px 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.submit-card h3 { font-size: 20px; font-weight: 700; margin-bottom: 20px; }

.submit-card input[type="text"],
.submit-card input[type="url"],
.submit-card select,
.submit-card textarea {
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

.submit-card input:focus,
.submit-card select:focus,
.submit-card textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.submit-card textarea { min-height: 200px; line-height: 1.7; resize: vertical; }
.submit-card .btn-primary { padding: 12px 32px; }

.submit-card input[type="file"] {
  padding: 8px 0;
  font-size: 13px;
}

/* ===== Back to Top ===== */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all var(--transition);
  z-index: 999;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

/* ===== Reading Progress Bar ===== */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  z-index: 9999;
  transition: width 0.1s linear;
}

/* ===== Screen reader / Accessibility ===== */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

/* (responsive rules moved to _mobile.css) */
