/* A11y 管理后台基础样式 */

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  margin: 0;
  padding: 0;
  color: #374151;
  background: #f5f6f7;
  line-height: 1.75;
  word-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: #0d6efd;
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: #0b5ed7;
  text-decoration: none;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* 导航 */
.navbar {
  background: #fff;
  border-bottom: 1px solid #dee2e6;
  padding: 0.75rem 0;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0d6efd;
}

.navbar-menu a {
  margin-left: 1.5rem;
  color: #555;
}

.navbar-menu a:hover {
  color: #0d6efd;
}

/* 主内容 */
.main {
  min-height: calc(100vh - 140px);
  padding-top: 2rem;
  padding-bottom: 2rem;
}

/* 后台布局 */
.container-fluid {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

.admin-header {
  background: #fff;
  border-bottom: 1px solid #dee2e6;
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.admin-header .container-fluid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.admin-header .navbar-brand {
  font-size: 1.5rem;
  font-weight: 600;
  color: #0d6efd;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
  overflow-x: auto;
}

.top-nav a {
  display: block;
  padding: 0.5rem 1rem;
  color: #4b5563;
  border-radius: 6px;
  font-size: 0.95rem;
  white-space: nowrap;
}

.top-nav a:hover {
  background: #f8f9fa;
  color: #0d6efd;
  text-decoration: none;
}

.top-nav a.active {
  background: #e7f1ff;
  color: #0d6efd;
  font-weight: 500;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  position: relative;
}

.user-menu span {
  color: #555;
}

.frontend-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  color: #4b5563;
  border-radius: 6px;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.frontend-link:hover {
  background: #f8f9fa;
  color: #0d6efd;
  text-decoration: none;
}

.frontend-link svg {
  display: block;
}

.user-menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  color: #374151;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.user-menu-toggle:hover {
  background: #f8f9fa;
  border-color: #d1d5db;
}

.user-menu-toggle svg {
  display: block;
  color: #6b7280;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 140px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
  z-index: 200;
  overflow: hidden;
}

.user-menu:hover .user-dropdown,
.user-menu-toggle:focus + .user-dropdown,
.user-dropdown:hover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown a {
  display: block;
  padding: 0.75rem 1rem;
  color: #374151;
  font-size: 0.95rem;
  border-bottom: 1px solid #f3f4f6;
}

.user-dropdown a:last-child {
  border-bottom: none;
}

.user-dropdown a:hover {
  background: #f8f9fa;
  color: #0d6efd;
  text-decoration: none;
}

.admin-main {
  width: 100%;
  min-height: calc(100vh - 140px);
  padding: 2rem;
  background: #f5f6f7;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.75rem;
}

.page-header h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 600;
  color: #1f2937;
  letter-spacing: -0.02em;
}

/* 卡片 */
.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.card h2 {
  margin-top: 0;
  margin-bottom: 1.25rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  border-bottom: 1px solid #f3f4f6;
  padding-bottom: 0.875rem;
}

/* 表单 */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #374151;
  font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group textarea,
.form-group select,
.form-group .input-group input,
.inline-form input[type="text"],
.inline-form input[type="tel"],
.inline-form input[type="email"],
.inline-form input[type="password"],
.inline-form .input-group input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 1rem;
  line-height: 1.5;
  color: #1f2937;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus,
.form-group .input-group input:focus,
.inline-form input:focus,
.inline-form .input-group input:focus {
  outline: none;
  border-color: #0d6efd;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.12);
}

.input-group {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.input-group input {
  flex: 1;
  min-width: 0;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.inline-form .form-group {
  flex: 1;
  min-width: 200px;
  margin-bottom: 0;
}

.inline-form .form-error {
  width: 100%;
  margin-bottom: 0;
}

.form-error {
  color: #dc3545;
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
  min-height: 1.25rem;
}

/* 按钮 */
.btn {
  display: inline-block;
  padding: 0.625rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 1rem;
  line-height: 1.5;
  cursor: pointer;
  text-align: center;
  background: #e9ecef;
  color: #374151;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
  background: #0d6efd;
  color: #fff;
}

.btn-primary:hover {
  background: #0b5ed7;
}

.btn-secondary {
  background: #6c757d;
  color: #fff;
}

.btn-secondary:hover {
  background: #5c636a;
}

.btn-danger {
  background: #dc3545;
  color: #fff;
}

.btn-danger:hover {
  background: #bb2d3b;
}

.btn-sm {
  padding: 0.375rem 0.625rem;
  font-size: 0.875rem;
}

.btn-block {
  display: block;
  width: 100%;
}

/* 登录/注册框 */
.auth-box {
  max-width: 420px;
  margin: 3rem auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 2.25rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.auth-box h1 {
  margin-top: 0;
  margin-bottom: 1.75rem;
  text-align: center;
  font-size: 1.625rem;
  font-weight: 600;
  color: #1f2937;
  letter-spacing: -0.02em;
}

.tabs {
  display: flex;
  border-bottom: 1px solid #dee2e6;
  margin-bottom: 1.5rem;
}

.tab-btn {
  flex: 1;
  padding: 0.875rem;
  border: none;
  background: none;
  cursor: pointer;
  color: #6b7280;
  font-size: 1rem;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease;
}

.tab-btn.active {
  color: #0d6efd;
  border-bottom-color: #0d6efd;
}

.auth-links {
  margin-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
}

.text-center {
  text-align: center;
}

.text-danger {
  color: #dc3545;
}

.hidden {
  display: none !important;
}

/* 二维码 */
.qr-box {
  padding: 2rem;
  background: #f8f9fa;
  border-radius: 8px;
  margin: 1.5rem 0;
}

.qr-placeholder {
  padding: 2rem;
  border: 2px dashed #ced4da;
  border-radius: 8px;
}

.qr-tip {
  color: #6c757d;
  font-size: 0.875rem;
  margin-top: 1rem;
}

/* 弹窗 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: #fff;
  border-radius: 8px;
  padding: 1.5rem;
  width: 90%;
  max-width: 420px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  border: none;
  background: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/* 列表 */
.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}

.table th,
.table td {
  padding: 0.875rem 1rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
  line-height: 1.6;
  vertical-align: middle;
}

.table th {
  background: #f9fafb;
  font-weight: 600;
  color: #374151;
}

.table tr:last-child td {
  border-bottom: none;
}

.cell-ellipsis {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pagination {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.375rem;
  list-style: none;
  padding: 0;
}

.pagination li {
  list-style: none;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.625rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  color: #374151;
  font-size: 0.875rem;
  text-decoration: none;
  transition: all 0.15s ease;
}

.pagination a:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
  color: #111827;
}

.pagination .active span,
.pagination .current span {
  background: #0d6efd;
  border-color: #0d6efd;
  color: #fff;
  font-weight: 600;
}

.pagination .disabled span {
  background: #f9fafb;
  border-color: #e5e7eb;
  color: #9ca3af;
  cursor: not-allowed;
}

/* 页脚 */
.footer {
  background: #fff;
  border-top: 1px solid #e5e7eb;
  padding: 1.25rem 0;
  text-align: center;
  color: #6b7280;
  font-size: 0.875rem;
  line-height: 1.6;
}

/* 个人设置 */
.profile-section {
  border-bottom: 1px solid #eee;
  padding: 1.5rem 0;
}

.profile-section:first-of-type {
  padding-top: 0;
}

.profile-section:last-child {
  border-bottom: none;
}

.profile-section h3 {
  margin-top: 0;
  margin-bottom: 0.875rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: #1f2937;
}

.profile-section p {
  color: #6b7280;
  margin-bottom: 1rem;
  line-height: 1.6;
}

/* 标签 */
.tag {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: #e9ecef;
  border-radius: 4px;
  margin: 0.25rem;
  font-size: 0.875rem;
}

/* 统计 */
.stats-grid {
  display: flex;
  gap: 2rem;
  margin-bottom: 1rem;
}

.stat-item {
  text-align: center;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  min-width: 120px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 600;
  color: #0d6efd;
  letter-spacing: -0.02em;
}

.stat-label {
  color: #6b7280;
  font-size: 0.875rem;
}

.text-muted {
  color: #6c757d;
}

.required {
  color: #dc3545;
}

pre {
  background: #f9fafb;
  padding: 1.125rem;
  border-radius: 8px;
  overflow-x: auto;
  line-height: 1.6;
  border: 1px solid #e5e7eb;
}

code {
  font-family: "SFMono-Regular", Menlo, Monaco, "Consolas", "Noto Sans Mono CJK SC", monospace;
  font-size: 0.9rem;
}

/* 帮助中心 */
.help-categories {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.help-categories .tag {
  margin: 0.25rem;
}

.help-categories .tag.active {
  background: #0d6efd;
  color: #fff;
}

.article-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.article-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid #e5e7eb;
}

.article-item:last-child {
  border-bottom: none;
}

.article-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.article-summary {
  margin: 0.5rem 0;
  line-height: 1.6;
}

.article-meta {
  font-size: 0.875rem;
}

.article-meta span {
  margin-right: 1rem;
}

.article-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.article-header h1 {
  margin: 0 0 0.75rem;
  font-size: 1.75rem;
}

.article-body {
  line-height: 1.8;
}

.article-body p {
  margin: 0 0 1rem;
}

.article-body img {
  max-width: 100%;
  height: auto;
}

/* 营销页面 */
.hero-section {
  background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
  color: #fff;
  padding: 5rem 0;
}

.hero-section .container {
  display: flex;
  align-items: center;
  gap: 3rem;
}

.hero-content {
  flex: 1;
}

.hero-content h1 {
  font-size: 3rem;
  font-weight: 700;
  margin: 0 0 1.5rem;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.25rem;
  line-height: 1.7;
  margin-bottom: 2rem;
  opacity: 0.95;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-actions .btn-primary {
  background: #fff;
  color: #0d6efd;
}

.hero-actions .btn-primary:hover {
  background: #f0f7ff;
}

.hero-actions .btn-secondary {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.6);
}

.hero-actions .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.hero-visual {
  flex-shrink: 0;
  width: 320px;
}

.widget-preview {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.widget-header {
  background: #f8f9fa;
  padding: 0.75rem 1rem;
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.widget-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #dee2e6;
}

.widget-body {
  padding: 1rem;
}

.widget-item {
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  background: #f8f9fa;
  border-radius: 8px;
  color: #374151;
  font-size: 0.95rem;
}

.widget-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: #0d6efd;
  color: #fff;
  border-radius: 4px;
  margin-right: 0.5rem;
  font-size: 0.8rem;
}

.section {
  padding: 4rem 0;
}

.section-white {
  background: #fff;
}

.section-light {
  background: #f8f9fa;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  font-size: 2rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 0.75rem;
}

.section-header p {
  color: #6b7280;
  font-size: 1.1rem;
  margin: 0;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.75rem;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

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

.feature-icon {
  width: 48px;
  height: 48px;
  background: #e7f1ff;
  color: #0d6efd;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 0.5rem;
}

.feature-card p {
  color: #6b7280;
  margin: 0;
  line-height: 1.6;
}

.step-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.step-card {
  text-align: center;
  padding: 2rem;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
}

.step-number {
  width: 56px;
  height: 56px;
  background: #0d6efd;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 auto 1rem;
}

.step-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.step-card p {
  color: #6b7280;
  margin: 0;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.article-card {
  display: block;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem;
  color: inherit;
}

.article-card:hover {
  border-color: #0d6efd;
  text-decoration: none;
}

.article-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 0.5rem;
}

.article-card p {
  color: #6b7280;
  margin: 0;
  font-size: 0.95rem;
}

.cta-section {
  background: #1f2937;
  color: #fff;
  padding: 4rem 0;
  text-align: center;
}

.cta-section h2 {
  font-size: 2rem;
  font-weight: 600;
  margin: 0 0 1rem;
}

.cta-section p {
  opacity: 0.9;
  margin-bottom: 1.5rem;
}

.page-hero {
  background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
  color: #fff;
  padding: 4rem 0;
  text-align: center;
}

.page-hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 0 1rem;
}

.page-hero p {
  font-size: 1.15rem;
  opacity: 0.95;
  margin: 0;
}

.feature-detail {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.feature-detail-item {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.75rem;
}

.feature-detail-icon {
  width: 56px;
  height: 56px;
  background: #e7f1ff;
  color: #0d6efd;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  flex-shrink: 0;
}

.feature-detail-content h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 0.5rem;
}

.feature-detail-content p {
  color: #6b7280;
  margin: 0;
  line-height: 1.7;
}

/* Quill 编辑器 */
.ql-editor {
  min-height: 320px;
  font-size: 1rem;
  line-height: 1.8;
}

.ql-container {
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
}

.ql-toolbar {
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  background: #fff;
}

/* 批量操作栏 */
.batch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
  flex-wrap: wrap;
}

.batch-bar label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: #374151;
}

.batch-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* 响应式 */
@media (max-width: 768px) {
  .admin-header .container-fluid {
    flex-wrap: wrap;
  }

  .top-nav {
    order: 3;
    width: 100%;
    padding-top: 0.5rem;
    border-top: 1px solid #f3f4f6;
  }

  .inline-form {
    flex-direction: column;
    align-items: stretch;
  }

  .inline-form .form-group {
    min-width: auto;
    margin-bottom: 1rem;
  }

  .input-group {
    flex-direction: column;
  }

  .hero-section h1 {
    font-size: 2rem;
  }

  .feature-grid,
  .step-grid,
  .pricing-grid {
    grid-template-columns: 1fr;
  }
}
