/* ═══════════════════════════════════════
   千刻AI — 轻量化科技风设计系统
   ═══════════════════════════════════════ */

:root {
  --primary: #1677ff;
  --primary-light: #e6f0ff;
  --primary-dark: #0958d9;
  --purple: #7c3aed;
  --purple-light: #f3e8ff;
  --cyan: #06b6d4;
  --cyan-light: #e0faff;
  --orange: #f59e0b;
  --orange-light: #fff7e6;
  --green: #10b981;
  --green-light: #e8faf0;
  --pink: #ec4899;
  --pink-light: #fce7f3;
  --bg: #f7f9fc;
  --card-bg: #ffffff;
  --text-primary: #1a1a2e;
  --text-secondary: #8c8fa3;
  --text-light: #b0b3c6;
  --border: #eef0f4;
  --shadow-sm: 0 2px 8px rgba(22, 119, 255, 0.06);
  --shadow-md: 0 4px 16px rgba(22, 119, 255, 0.08);
  --shadow-lg: 0 8px 32px rgba(22, 119, 255, 0.12);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tab-height: 64px;
}

* {
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

body {
  background-color: var(--bg);
  min-height: 100vh;
  padding-bottom: calc(var(--tab-height) + var(--safe-bottom) + 8px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
}

/* ─── Container ─── */
.app-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px;
}
@media (min-width: 769px) {
  .app-has-topbar {
    margin-top: 56px;
  }
}

/* ─── PC Back Button ─── */
.pc-back-btn {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  margin: 12px 0 8px -8px;
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  width: fit-content;
}
.pc-back-btn:active {
  transform: scale(0.96);
  opacity: 0.8;
}
.pc-back-btn i {
  font-size: 12px;
  color: var(--primary);
}
@media (min-width: 769px) {
  .pc-back-btn {
    display: inline-flex;
  }
}

/* ─── Gradient Banner ─── */
.banner {
  background: linear-gradient(135deg, #1677ff 0%, #4096ff 50%, #69b1ff 100%);
  border-radius: var(--radius-lg);
  padding: 32px 24px 28px;
  margin: 12px 0 20px;
  position: relative;
  overflow: hidden;
  color: #fff;
}

.banner::before {
  content: "";
  position: absolute;
  top: -60px;
  right: -40px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, transparent 70%);
  border-radius: 50%;
}

.banner::after {
  content: "";
  position: absolute;
  bottom: -30px;
  left: -20px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
  border-radius: 50%;
}

.banner-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.banner-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  opacity: 0.92;
  position: relative;
  z-index: 1;
}

.banner-sub span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.banner-sub .fa-check-circle {
  font-size: 13px;
}

/* ─── 3D AI Decoration (pure CSS) ─── */
.banner-ai-deco {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 52px;
  font-weight: 900;
  opacity: 0.15;
  line-height: 1;
  letter-spacing: -4px;
  transform: rotate(-6deg) perspective(200px) rotateX(10deg);
  text-shadow: 0 0 40px rgba(255, 255, 255, 0.3);
  z-index: 1;
  user-select: none;
}

.banner-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 24px 24px;
  z-index: 0;
}

/* ─── Section Title ─── */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 0 12px;
}

.section-title h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}

.section-title a {
  font-size: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ─── Feature Grid ─── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 8px;
}

.feature-item {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 14px 6px;
  text-align: center;
  text-decoration: none;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  display: block;
  border: none;
}

.feature-item:active {
  transform: scale(0.94);
  box-shadow: var(--shadow-md);
}

.feature-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  font-size: 18px;
  transition: transform 0.2s;
}

.feature-item:active .feature-icon-wrap {
  transform: scale(0.9);
}

.feature-icon-wrap.bg-blue { background: var(--primary-light); color: var(--primary); }
.feature-icon-wrap.bg-purple { background: var(--purple-light); color: var(--purple); }
.feature-icon-wrap.bg-cyan { background: var(--cyan-light); color: var(--cyan); }
.feature-icon-wrap.bg-orange { background: var(--orange-light); color: var(--orange); }
.feature-icon-wrap.bg-green { background: var(--green-light); color: var(--green); }
.feature-icon-wrap.bg-pink { background: var(--pink-light); color: var(--pink); }

.feature-item .feature-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

/* ─── Tool Cards (large) ─── */
.tool-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 8px;
}

.tool-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 18px 14px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--text-primary);
  display: block;
  transition: transform 0.2s, box-shadow 0.2s;
}

.tool-card:active {
  transform: scale(0.96);
  box-shadow: var(--shadow-md);
}

.tool-card .tool-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 10px;
}
.tool-icon.bg-blue { background: var(--primary-light); color: var(--primary); }
.tool-icon.bg-purple { background: var(--purple-light); color: var(--purple); }
.tool-icon.bg-cyan { background: var(--cyan-light); color: var(--cyan); }
.tool-icon.bg-orange { background: var(--orange-light); color: var(--orange); }
.tool-icon.bg-green { background: var(--green-light); color: var(--green); }
.tool-icon.bg-pink { background: var(--pink-light); color: var(--pink); }

.tool-card .tool-name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.tool-card .tool-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ─── Article List ─── */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.article-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--text-primary);
  display: block;
  transition: transform 0.2s;
}

.article-card:active {
  transform: scale(0.98);
}

.article-card .art-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card .art-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--text-secondary);
}

/* ─── Bottom Tab Bar ─── */
.bottom-tabs {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding-bottom: var(--safe-bottom);
  height: calc(var(--tab-height) + var(--safe-bottom));
  box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.04);
}

.bottom-tabs a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text-light);
  font-size: 10px;
  padding: 4px 0 2px;
  transition: color 0.15s;
  gap: 1px;
  position: relative;
}

.bottom-tabs a i {
  font-size: 20px;
  transition: transform 0.2s;
}

.bottom-tabs a.active {
  color: var(--primary);
}

.bottom-tabs a.active i {
  transform: scale(1.1);
}

.bottom-tabs a:active i {
  transform: scale(0.9);
}

/* ─── Card (general) ─── */
.content-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
  overflow: hidden;
}

.content-card .card-head {
  padding: 14px 16px;
  font-weight: 700;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.content-card .card-body {
  padding: 14px 16px;
}

/* ─── Buttons ─── */
.btn {
  border-radius: var(--radius-sm);
  font-weight: 600;
  padding: 10px 20px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.15s, opacity 0.15s;
  border: none;
  cursor: pointer;
  font-size: 14px;
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:active {
  background: var(--primary-dark);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-primary);
}

.btn-outline:active {
  background: #f5f5f5;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 12px;
}

.btn-lg {
  min-height: 50px;
  font-size: 16px;
  border-radius: var(--radius-md);
}

/* ─── Forms ─── */
.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.form-input,
.form-select {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  padding: 12px 14px;
  font-size: 14px;
  min-height: 48px;
  background: var(--card-bg);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.1);
}

.form-text {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
}

textarea.form-input {
  min-height: 120px;
  resize: vertical;
}

/* ═══ Status Bar ═══ */
.status-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1020;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  height: 52px;
  display: flex;
  align-items: center;
}
@media (max-width: 768px) {
  .status-bar {
    display: none;
  }
}

.status-bar-inner {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-left {
  display: flex;
  align-items: center;
}

.avatar-wrap {
  position: relative;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.avatar-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(22, 119, 255, 0.15);
  transition: transform 0.15s;
  display: block;
}

.avatar-wrap:active .avatar-img {
  transform: scale(0.92);
}

.vip-badge-dot {
  position: absolute;
  bottom: -2px;
  right: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #d9d9d9;
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  color: #fff;
}

.vip-badge-dot.vip {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.status-center {
  flex: 1;
  min-width: 0;
}

.app-title-small {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.app-sub-small {
  font-size: 10px;
  color: var(--text-light);
  line-height: 1.2;
}

.status-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: background 0.15s;
}

.status-icon-btn:active {
  background: #e8e8e8;
}

/* ═══ Avatar Dropdown ═══ */
.dropdown-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1035;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.2s;
}

.dropdown-overlay.show {
  display: block;
  opacity: 1;
}

.avatar-dropdown {
  display: none;
  position: fixed;
  top: 60px;
  left: 16px;
  right: 16px;
  max-width: 360px;
  z-index: 1040;
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  animation: slideDown 0.2s ease;
}

.avatar-dropdown.show {
  display: block;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-arrow {
  position: absolute;
  top: -6px;
  left: 28px;
  width: 12px;
  height: 12px;
  background: #fff;
  transform: rotate(45deg);
  box-shadow: -2px -2px 4px rgba(0,0,0,0.04);
}

.dropdown-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.dropdown-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(22, 119, 255, 0.12);
}

.dropdown-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.dropdown-email {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 0;
}

.dropdown-info {
  padding: 12px 16px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 13px;
}

.info-label {
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.info-value {
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
}

.dropdown-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-primary);
  text-decoration: none;
  transition: background 0.15s;
}

.dropdown-link:active {
  background: #f5f5f5;
}

.dropdown-link i {
  width: 20px;
  text-align: center;
  color: var(--text-secondary);
}

/* ═══ Admin User Cards ═══ */
.admin-user-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
  overflow: hidden;
}

.admin-user-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.admin-user-header:active {
  background: #f5f7fa;
}

.admin-user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(22, 119, 255, 0.1);
}

.admin-user-meta {
  flex: 1;
  min-width: 0;
}

.admin-user-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-user-name .badge-sm {
  font-size: 10px;
  padding: 0 6px;
  height: 18px;
  line-height: 18px;
  border-radius: 9px;
  font-weight: 600;
}

.admin-user-email {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 1px;
}

.admin-user-chevron {
  color: var(--text-light);
  font-size: 14px;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.admin-user-chevron.open {
  transform: rotate(180deg);
}

.admin-user-body {
  display: none;
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
}

.admin-user-body.open {
  display: block;
}

.admin-user-body .info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding-top: 12px;
  margin-bottom: 12px;
}

.admin-user-body .info-grid .info-item {
  font-size: 12px;
  color: var(--text-secondary);
}

.admin-user-body .info-grid .info-item strong {
  display: block;
  color: var(--text-primary);
  font-size: 13px;
  margin-top: 2px;
}

.admin-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-user-actions form {
  flex: 1;
  min-width: 0;
}

.btn-admin {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 38px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s, opacity 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.btn-admin:active {
  transform: scale(0.96);
}

.btn-admin-primary {
  background: var(--primary);
  color: #fff;
}

.btn-admin-success {
  background: var(--green);
  color: #fff;
}

.btn-admin-warning {
  background: var(--orange);
  color: #fff;
}

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

.btn-admin-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* Expiry input inline */
.expiry-form {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}

.expiry-form input[type="date"] {
  flex: 1;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  font-size: 13px;
  outline: none;
  background: #fff;
  color: var(--text-primary);
}

.expiry-form input[type="date"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.1);
}

.expiry-form .btn-admin {
  width: auto;
  padding: 0 16px;
  flex-shrink: 0;
}

/* Reset password modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1050;
  background: rgba(0, 0, 0, 0.4);
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.show {
  display: flex;
}

.modal-box {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 24px;
  width: 100%;
  max-width: 340px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.modal-box h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--text-primary);
}

.modal-box p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 16px;
}

.modal-box input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
  margin-bottom: 12px;
}

.modal-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.1);
}

.modal-btns {
  display: flex;
  gap: 10px;
}

.modal-btns .btn-admin {
  flex: 1;
}

/* ═══ Admin Layout ═══ */
.admin-page {
  padding: 16px;
  max-width: 480px;
  margin: 0 auto;
}

.admin-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.admin-header-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.admin-header-text h1 {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}

.admin-header-text p {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 2px 0 0;
}

/* Admin tabs navigation */
.admin-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0 0 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.admin-tabs::-webkit-scrollbar { display: none; }

.admin-tab {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  background: #f5f5f5;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.15s;
  border: none;
  cursor: pointer;
}

.admin-tab:active {
  transform: scale(0.96);
}

.admin-tab.active {
  background: var(--primary);
  color: #fff;
}

/* Admin stat cards (dashboard) */
.admin-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.admin-stat-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 20px 16px;
  text-align: center;
}

.admin-stat-number {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.admin-stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.admin-stat-label i {
  margin-right: 4px;
}

/* Admin section cards */
.admin-section {
  margin-bottom: 16px;
}

.admin-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-list {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.admin-list-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}

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

.admin-list-item-content {
  flex: 1;
  min-width: 0;
}

.admin-list-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-list-item-sub {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.admin-list-item-right {
  text-align: right;
  flex-shrink: 0;
}

/* Admin quick links grid */
.admin-quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.admin-quick-link {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 20px 16px;
  text-align: center;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  transition: transform 0.15s;
}

.admin-quick-link:active {
  transform: scale(0.96);
}

.admin-quick-link i {
  display: block;
  font-size: 24px;
  color: var(--primary);
  margin-bottom: 8px;
}

/* Admin form card */
.admin-form-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 16px;
}

.admin-form-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
}

.admin-form-body {
  padding: 16px;
}

.admin-form-body .form-group:last-child {
  margin-bottom: 0;
}

/* Admin detail row (settings) */
.admin-info-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  margin-bottom: 16px;
}

.admin-info-card h3 {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-info-card ol {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.admin-info-card ol a {
  color: var(--primary);
  text-decoration: none;
}

/* ─── Auth Pages ─── */
.auth-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 20px;
  background: linear-gradient(180deg, #e6f0ff 0%, var(--bg) 50%);
}

.auth-box {
  width: 100%;
  max-width: 380px;
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  padding: 32px 24px 24px;
  box-shadow: var(--shadow-lg);
}

.auth-box .auth-logo {
  text-align: center;
  margin-bottom: 24px;
}

.auth-box .auth-logo h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  margin: 0;
}

.auth-box .auth-logo p {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 4px 0 0;
}

/* ─── Badges ─── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
}

.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--green-light); color: var(--green); }
.badge-warning { background: var(--orange-light); color: var(--orange); }
.badge-danger { background: #fff1f0; color: #f5222d; }
.badge-default { background: #f5f5f5; color: var(--text-secondary); }

/* ─── Empty State ─── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty-state p {
  font-size: 13px;
  margin-bottom: 16px;
}

/* ─── Category Filter ─── */
.filter-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 12px;
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filter-scroll::-webkit-scrollbar { display: none; }

.filter-scroll .filter-btn {
  flex-shrink: 0;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.filter-scroll .filter-btn.active,
.filter-scroll .filter-btn:active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ─── Pagination ─── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 12px 0;
}

.pagination a,
.pagination span {
  min-width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  text-decoration: none;
  color: var(--text-secondary);
  background: var(--card-bg);
  border: 1px solid var(--border);
  transition: all 0.15s;
}

.pagination a:active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.pagination .active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ─── Flashes / Alerts ─── */
.alert {
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.alert-success { background: var(--green-light); color: #065f46; }
.alert-danger { background: #fff1f0; color: #cf1322; }
.alert-info { background: var(--primary-light); color: #0958d9; }
.alert-warning { background: var(--orange-light); color: #b45309; }

/* ─── Article Content ─── */
.article-content {
  line-height: 1.85;
  font-size: 15px;
  color: var(--text-primary);
  word-break: break-word;
}

.article-content p {
  margin-bottom: 0.8em;
  text-indent: 2em;
}

/* ─── Animated Loading ─── */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.loading-pulse {
  animation: pulse 1.5s ease-in-out infinite;
}

/* ─── Responsive: Desktop ─── */
@media (min-width: 768px) {
  body {
    padding-bottom: 0;
  }
  .bottom-tabs {
    display: none;
  }
  .app-container {
    max-width: 680px;
  }
  .banner {
    padding: 40px 32px 36px;
  }
  .banner-title {
    font-size: 28px;
  }
  .feature-grid {
    gap: 14px;
  }
  .feature-item {
    padding: 20px 10px;
  }
  .feature-icon-wrap {
    width: 52px;
    height: 52px;
    font-size: 22px;
    border-radius: 16px;
  }
  .feature-item .feature-label {
    font-size: 13px;
  }
  .tool-cards {
    gap: 16px;
  }
  .tool-card {
    padding: 24px 20px;
  }
}

/* ─── Misc ─── */
.text-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }

/* ═══ Membership Page ═══ */
.membership-banner {
  background: linear-gradient(135deg, #1e293b, #334155);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
  color: #fff;
}
.membership-pkg-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-radius: 20px;
  padding: 3px 12px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.membership-pkg-free {
  background: rgba(255, 255, 255, 0.15);
}
.membership-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}
.membership-stat {
  text-align: center;
}
.membership-stat-num {
  font-size: 22px;
  font-weight: 800;
}
.membership-stat-label {
  font-size: 11px;
  opacity: 0.7;
}
.membership-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 11px;
  opacity: 0.6;
}
.membership-section-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 16px;
}
.membership-packages {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  align-items: stretch;
}
.membership-pkg {
  flex: 1;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 24px 20px;
  text-align: center;
  position: relative;
  background: #fff;
  transition: all 0.25s;
  display: flex;
  flex-direction: column;
}
.membership-pkg:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}
.pkg-current {
  border-color: #2563eb;
  background: #f8fafc;
}
.pkg-recommended {
  border-color: #f59e0b;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.15);
  transform: scale(1.03);
  z-index: 1;
}
.pkg-recommended:hover {
  transform: scale(1.03) translateY(-2px);
  box-shadow: 0 8px 30px rgba(245, 158, 11, 0.2);
}
.pkg-badge-hot {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 20px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}
.pkg-badge-current {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
}
.pkg-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #e2e8f0, #f1f5f9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 20px;
  margin: 0 auto 14px;
}
.pkg-icon-hot {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
}
.pkg-name {
  font-size: 17px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 12px;
}
.pkg-price {
  margin-bottom: 20px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
}
.pkg-currency {
  font-size: 18px;
  font-weight: 700;
  color: #64748b;
}
.pkg-amount {
  font-size: 36px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
}
.pkg-period {
  font-size: 13px;
  color: #94a3b8;
  font-weight: 400;
}
.pkg-features {
  text-align: left;
  margin-bottom: 20px;
  flex: 1;
}
.pkg-feature {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  color: #475569;
}
.pkg-check {
  color: #22c55e;
  flex-shrink: 0;
}
.pkg-btn-upgrade {
  display: block;
  width: 100%;
  padding: 12px 20px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}
.pkg-btn-upgrade:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}
.pkg-btn-select {
  display: block;
  width: 100%;
  padding: 12px 20px;
  background: #f1f5f9;
  color: #475569;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}
.pkg-btn-select:hover {
  background: #e2e8f0;
  color: #1e293b;
}
.pkg-btn-current {
  display: block;
  width: 100%;
  padding: 12px 20px;
  background: #eff6ff;
  color: #2563eb;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
}
.membership-usage {
  background: #f8fafc;
  border-radius: 12px;
  padding: 16px;
}
.membership-usage-title {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 12px;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 8px;
}
.membership-progress {
  background: #e2e8f0;
  border-radius: 6px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 10px;
}
.membership-progress-bar {
  background: linear-gradient(90deg, #2563eb, #6366f1);
  height: 100%;
  border-radius: 6px;
  transition: width 0.3s;
}
.membership-usage-text {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #64748b;
}
@media (max-width: 640px) {
  .membership-packages {
    flex-direction: column;
  }
  .pkg-recommended {
    transform: none;
    order: -1;
  }
  .pkg-recommended:hover {
    transform: translateY(-2px);
  }
  .pkg-amount {
    font-size: 30px;
  }
}

/* ═══ Articles Page ═══ */
body {
  background: #f8fafc;
}
.articles-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 16px;
}
.articles-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.articles-title {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}
.articles-count {
  font-size: 13px;
  color: #64748b;
  background: #f1f5f9;
  padding: 2px 10px;
  border-radius: 20px;
  font-weight: 500;
}
.btn-create {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
  transition: all 0.2s;
  cursor: pointer;
}
.btn-create:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

/* Article List */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.article-row {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  transition: all 0.15s;
}
.article-row:hover {
  border-color: #cbd5e1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.article-row-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px;
  gap: 16px;
}
.article-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 1px;
}
.dot-generating {
  background: #2563eb;
  animation: dotPulse 1.5s ease-in-out infinite;
}
.dot-failed {
  background: #ef4444;
}
.dot-done {
  background: #22c55e;
}
@keyframes dotPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
  50% { opacity: 0.6; box-shadow: 0 0 0 4px rgba(37, 99, 235, 0); }
}
.article-text {
  flex: 1;
  min-width: 0;
}
.article-title-link {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  text-decoration: none;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
}
.article-title-link:hover {
  color: #2563eb;
}
.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 3px;
  min-width: 0;
  overflow: hidden;
}
.article-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #475569;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 1;
  min-width: 0;
}
.article-tag svg {
  flex-shrink: 0;
}
.article-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #94a3b8;
  white-space: nowrap;
  flex-shrink: 0;
}
.article-time svg {
  flex-shrink: 0;
}
.article-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  min-width: 120px;
}
.action-form {
  display: inline;
}
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: none;
  background: #f1f5f9;
  color: #64748b;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}
.action-btn svg {
  flex-shrink: 0;
}
.action-view {
  flex-shrink: 0;
  min-width: 72px;
  width: auto;
  padding: 0 12px;
  gap: 5px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  white-space: nowrap;
}
.action-view:hover {
  background: #dbeafe;
}
.action-edit:hover {
  background: #f1f5f9;
  color: #334155;
}
.action-delete:hover {
  background: #fef2f2;
  color: #ef4444;
}
.action-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
}
.badge-generating {
  background: #eff6ff;
  color: #2563eb;
}
.badge-failed {
  background: #fef2f2;
  color: #ef4444;
}
.article-toast {
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.generating-toast {
  background: #eff6ff;
  color: #2563eb;
}
.failed-toast {
  background: #fef2f2;
  color: #ef4444;
}

/* Pagination */
.articles-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  background: #fff;
  border: 1px solid #e2e8f0;
  text-decoration: none;
  transition: all 0.15s;
}
.page-btn:hover {
  border-color: #2563eb;
  color: #2563eb;
  background: #eff6ff;
}
.page-active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}
.page-active:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}
.page-arrow {
  border-color: transparent;
  background: transparent;
}
.page-arrow:hover {
  background: #f1f5f9;
  border-color: transparent;
}
.page-dots {
  color: #cbd5e1;
  font-size: 13px;
}

/* Empty State */
.articles-empty {
  text-align: center;
  padding: 64px 24px;
}
.empty-icon-wrap {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: #2563eb;
}
.empty-title {
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 4px;
}
.empty-desc {
  font-size: 13px;
  color: #94a3b8;
  margin: 0;
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .article-row-main {
    padding: 10px 12px;
  }
  .article-title-link {
    font-size: 13px;
  }
  .article-meta {
    gap: 8px;
  }
  .article-tag {
    max-width: 120px;
  }
  .action-view svg {
    display: none;
  }
  .action-view {
    width: 30px;
    padding: 0;
  }
}

/* ═══ Generate Page ═══ */
.gen-tabs {
  margin-bottom: 12px;
}
.gen-usage-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 13px;
  color: #64748b;
}
.gen-usage-bar strong {
  color: #2563eb;
  font-weight: 700;
}
.gen-usage-pkg {
  margin-left: auto;
  font-size: 11px;
  background: #eff6ff;
  color: #2563eb;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}
.gen-tab-track {
  display: flex;
  background: #f1f5f9;
  border-radius: 12px;
  padding: 4px;
  position: relative;
}
.gen-tab-slider {
  position: absolute;
  top: 4px;
  left: 4px;
  height: calc(100% - 8px);
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
}
.gen-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 10px;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 600;
  color: #94a3b8;
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: color 0.2s;
}
.gen-tab.active {
  color: #1e293b;
}
.gen-tab:active {
  transform: scale(0.97);
}
.gen-panel {
  animation: genFadeIn 0.2s ease;
}
@keyframes genFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.gen-field {
  margin-bottom: 16px;
}
.gen-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.gen-input-wrap {
  position: relative;
}
.gen-input {
  width: 100%;
  padding: 12px 14px;
  background: #f4f6f9;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  color: #1e293b;
  outline: none;
  transition: all 0.2s;
  box-sizing: border-box;
}
.gen-input::placeholder {
  color: #94a3b8;
}
.gen-input:focus {
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.gen-select-wrap {
  position: relative;
}
.gen-select {
  width: 100%;
  padding: 12px 36px 12px 14px;
  background: #f4f6f9;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  color: #1e293b;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: all 0.2s;
  box-sizing: border-box;
}
.gen-select:focus {
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.gen-select-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}
.gen-textarea {
  width: 100%;
  padding: 12px 14px;
  background: #f4f6f9;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  color: #1e293b;
  outline: none;
  resize: vertical;
  line-height: 1.6;
  transition: all 0.2s;
  box-sizing: border-box;
  font-family: inherit;
}
.gen-textarea::placeholder {
  color: #94a3b8;
}
.gen-textarea:focus {
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.gen-row-3 {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.gen-row-3 .gen-field {
  margin-bottom: 0;
}
.gen-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #2563eb;
  background: #eff6ff;
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 16px;
}
/* Optional sections */
.gen-optional-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.gen-optional-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border: 1.5px dashed #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  background: #fafbfc;
}
.gen-optional-card:hover {
  border-color: #93c5fd;
  background: #f0f7ff;
}
.gen-optional-card:active {
  transform: scale(0.98);
}
.gen-optional-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}
.gen-optional-hint {
  font-size: 11px;
  color: #94a3b8;
}
.gen-optional-expand {
  margin-bottom: 16px;
  animation: genFadeIn 0.2s ease;
}
/* CTA Button */
.gen-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
  transition: all 0.2s;
  margin-top: 8px;
}
.gen-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}
.gen-cta:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}
/* Parse button */
.gen-url-row {
  display: flex;
  gap: 8px;
}
.gen-parse-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 16px;
  background: #1e293b;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  flex-shrink: 0;
}
.gen-parse-btn:hover {
  background: #334155;
}
.gen-parse-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
/* Parse result */
.gen-parse-result {
  padding: 12px 14px;
  background: #f0fdf4;
  border-radius: 10px;
  margin-bottom: 16px;
  animation: genFadeIn 0.2s ease;
}
.parse-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #16a34a;
  margin-bottom: 4px;
}
.parse-title {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
}
.parse-preview {
  font-size: 12px;
  color: #64748b;
  margin-top: 6px;
  line-height: 1.5;
}
.gen-parse-error {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: #fef2f2;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #dc2626;
  animation: genFadeIn 0.2s ease;
}
.gen-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  background: #fffbeb;
  border-radius: 10px;
  font-size: 12px;
  color: #92400e;
  margin-bottom: 16px;
  line-height: 1.5;
}
/* Loading */
.gen-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  animation: genFadeIn 0.3s ease;
}
.gen-loading-ring {
  display: inline-block;
  position: relative;
  width: 48px;
  height: 48px;
}
.gen-loading-ring div {
  box-sizing: border-box;
  display: block;
  position: absolute;
  width: 40px;
  height: 40px;
  margin: 4px;
  border: 3px solid #e2e8f0;
  border-radius: 50%;
  animation: genRing 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  border-top-color: #3b82f6;
}
.gen-loading-ring div:nth-child(1) { animation-delay: -0.45s; }
.gen-loading-ring div:nth-child(2) { animation-delay: -0.3s; }
.gen-loading-ring div:nth-child(3) { animation-delay: -0.15s; }
@keyframes genRing {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.gen-loading-title {
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
  margin: 16px 0 4px;
}
.gen-loading-sub {
  font-size: 13px;
  color: #94a3b8;
  margin: 0;
}
.gen-spin {
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@media (max-width: 640px) {
  .gen-row-3 {
    flex-wrap: wrap;
  }
  .gen-row-3 .gen-field {
    flex-basis: calc(50% - 5px) !important;
  }
  .gen-row-3 .gen-field:last-child {
    flex-basis: 100% !important;
  }
}
