:root {
  --primary: #5652ff;
  --primary-dark: #4541e6;
  --danger: #e82121;
  --text: #1e2340;
  --muted: #6b7280;
  --line: #e8eaf2;
  --bg: #f5f7fb;
  --card: #ffffff;
}

* { box-sizing: border-box; }

body.app-body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.app-topbar {
  height: 62px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 40;
}
.app-brand { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 700; }
.app-brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, #8384f7, #5652ff);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
}
.app-logo-img { height: 30px; max-width: 109px; object-fit: contain; }
.app-brand small { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 2px; }
.app-topbar-right { display: flex; align-items: center; gap: 16px; color: var(--muted); }
.app-topbar-right strong { color: var(--text); }
.app-link-btn {
  border: 0; background: transparent; color: var(--primary); cursor: pointer; font-size: 14px;
}
.app-link-btn:hover { text-decoration: underline; }

/* 带统一头尾的页面（login/signup/retrievepwd/pay）：纵向 flex，内容区撑满中部；
   导航为固定 1197px 宽（同营销页），故最小宽度与整站一致 */
body.app-chrome { display: flex; flex-direction: column; min-height: 100vh; min-width: 1200px; background: #fff; }
body.app-chrome .app-login-wrap { flex: 1; min-height: 0; }

.app-login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(circle at 15% 20%, rgba(86,82,255,.14), transparent 32%),
    radial-gradient(circle at 85% 80%, rgba(131,132,247,.16), transparent 30%),
    var(--bg);
  padding: 24px;
}
.app-login-card {
  width: 100%; max-width: 430px; background: #fff; border-radius: 18px;
  box-shadow: 0 20px 60px rgba(43,49,90,.12); padding: 38px 40px 34px;
}
.app-login-title { font-size: 26px; font-weight: 700; text-align: center; margin-bottom: 6px; }
.app-login-sub { text-align: center; color: var(--muted); margin-bottom: 28px; }
.app-tabs { display: flex; gap: 8px; margin-bottom: 24px; }
.app-tab {
  flex: 1; padding: 10px 0; text-align: center; border-radius: 9px; cursor: pointer;
  background: #f4f5fb; color: var(--muted); font-weight: 600;
}
.app-tab.is-on { background: var(--primary); color: #fff; }
.app-field { margin-bottom: 18px; }
.app-field label { display: block; margin-bottom: 8px; color: #4b5069; font-weight: 600; }
.app-input, .app-select, .app-textarea {
  width: 100%; min-height: 42px; padding: 10px 12px;
  border: 1px solid #dfe2ec; border-radius: 9px; background: #fff; color: var(--text);
  font-family: inherit; font-size: 14px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.app-textarea { min-height: 92px; resize: vertical; }
.app-input:focus, .app-select:focus, .app-textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(86,82,255,.1);
}
.app-captcha-row { display: flex; gap: 10px; align-items: center; }
.app-captcha-row .app-input { flex: 1; width: auto; min-height: 40px; }
.app-captcha-img { width: 112px; height: 40px; border-radius: 8px; border: 1px solid #dfe2ec; object-fit: cover; cursor: pointer; flex-shrink: 0; background: #f6f8ff; }
.app-captcha-img[hidden] { display: none !important; }
.app-captcha-ph { width: 112px; height: 40px; border-radius: 8px; border: 1px dashed rgba(86,82,255,.35); background: #f6f8ff; color: var(--primary); font-size: 12px; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; user-select: none; }
.app-captcha-ph[hidden] { display: none !important; }
.app-segment { display: flex; gap: 8px; }
.app-seg-item { flex: 1; position: relative; cursor: pointer; }
.app-seg-item input { position: absolute; opacity: 0; pointer-events: none; }
.app-seg-item span {
  display: block; text-align: center; min-height: 42px; line-height: 22px; padding: 10px 12px;
  border: 1px solid #dfe2ec; border-radius: 9px; background: #fff; color: var(--text);
  font-size: 14px; transition: border-color .15s, box-shadow .15s, color .15s, background .15s;
}
.app-seg-item input:checked + span {
  border-color: var(--primary); color: var(--primary); background: rgba(86,82,255,.06);
  box-shadow: 0 0 0 3px rgba(86,82,255,.1); font-weight: 600;
}
.app-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 0 18px; border-radius: 9px; border: 1px solid transparent;
  background: var(--primary); color: #fff; cursor: pointer; font-size: 14px; font-weight: 600;
  transition: filter .15s, box-shadow .15s;
}
.app-btn:hover { filter: brightness(1.06); box-shadow: 0 6px 16px rgba(86,82,255,.24); }
.app-btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.app-btn--block { width: 100%; min-height: 46px; font-size: 16px; }
.app-btn--ghost { background: #fff; color: var(--primary); border-color: var(--primary); }
.app-btn--muted { background: #f0f1f7; color: #555b73; }
.app-btn--danger { background: var(--danger); }
.app-btn--sm { min-height: 30px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.app-login-foot { margin-top: 18px; text-align: center; color: var(--muted); font-size: 13px; }
.app-login-foot a { margin: 0 6px; }

.app-layout { display: flex; min-height: calc(100vh - 62px); }
.app-sidebar {
  width: 224px; flex: 0 0 224px; background: #fff; border-right: 1px solid var(--line);
  padding: 18px 14px; position: sticky; top: 62px; height: calc(100vh - 62px); overflow-y: auto;
}
.app-side-group { margin-bottom: 20px; }
.app-side-title { font-size: 12px; color: #9aa0b4; padding: 0 12px 8px; letter-spacing: 1px; }
.app-side-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; margin-bottom: 4px;
  border-radius: 9px; color: #555b73; cursor: pointer; font-weight: 500;
}
.app-side-item:hover { background: #f5f6fb; text-decoration: none; }
.app-side-item.is-on { background: rgba(86,82,255,.1); color: var(--primary); font-weight: 700; }
.app-side-icon { width: 20px; text-align: center; font-size: 15px; }
.app-main { flex: 1; padding: 26px 30px 60px; min-width: 0; }
.app-page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.app-page-title { font-size: 22px; font-weight: 700; margin: 0; }
.app-page-desc { color: var(--muted); margin-top: 6px; }

.app-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 22px; margin-bottom: 20px; box-shadow: 0 4px 18px rgba(42,48,88,.04);
  min-width: 0; /* grid/flex 子项允许收缩，内部表格由 .app-table-wrap 横滚 */
}
.app-card-title { font-size: 16px; font-weight: 700; margin: 0 0 16px; }
.app-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.app-card-head h3 { margin: 0; font-size: 16px; }

.app-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.app-stat {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px;
  position: relative; overflow: hidden;
}
.app-stat::after {
  content: ""; position: absolute; right: -18px; top: -18px; width: 70px; height: 70px;
  border-radius: 50%; background: rgba(86,82,255,.07);
}
.app-stat-label { color: var(--muted); font-size: 13px; }
.app-stat-value { font-size: 28px; font-weight: 700; margin-top: 8px; }
.app-stat-value small { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 3px; }

.app-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.app-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.app-form-grid .full { grid-column: 1 / -1; }
.app-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.app-table-wrap { overflow-x: auto; }
.app-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.app-table th {
  text-align: left; padding: 11px 12px; background: #f7f8fc; color: #60667c;
  font-weight: 600; white-space: nowrap; border-bottom: 1px solid var(--line);
}
.app-table td { padding: 12px; border-bottom: 1px solid #f0f1f6; vertical-align: middle; }
.app-table tr:last-child td { border-bottom: 0; }
.app-table tbody tr:hover { background: #fafbff; }
.app-table .is-price { color: var(--danger); font-weight: 700; }
.app-empty { padding: 36px 12px; text-align: center; color: var(--muted); }

.app-badge {
  display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 12px;
  background: #f0f1f7; color: #666c82; white-space: nowrap;
}
.app-badge--primary { background: rgba(86,82,255,.1); color: var(--primary); }
.app-badge--success { background: rgba(22,163,74,.12); color: #16803c; }
.app-badge--warning { background: rgba(234,145,12,.14); color: #b56a00; }
.app-badge--danger { background: rgba(232,33,33,.1); color: var(--danger); }

.app-filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.app-filter-bar .app-input, .app-filter-bar .app-select { width: auto; min-width: 150px; }
.app-filter-bar .grow { flex: 1; }

.app-checkbar {
  position: sticky; bottom: 0; margin-top: 14px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 -6px 24px rgba(42,48,88,.08);
}
.app-checkbar strong { color: var(--danger); font-size: 17px; }

.app-modal-mask {
  position: fixed; inset: 0; background: rgba(20,24,45,.45); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.app-modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 560px;
  max-height: 86vh; overflow-y: auto; box-shadow: 0 24px 70px rgba(20,24,45,.28);
}
.app-modal--wide { max-width: 780px; }
.app-modal-head {
  padding: 18px 22px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.app-modal-head h3 { margin: 0; font-size: 17px; }
.app-modal-close { border: 0; background: transparent; font-size: 22px; color: var(--muted); cursor: pointer; }
.app-modal-body { padding: 22px; }
.app-modal-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }

.app-toast {
  position: fixed; top: 80px; left: 50%; transform: translateX(-50%);
  background: #1e2340; color: #fff; padding: 11px 20px; border-radius: 9px;
  z-index: 200; box-shadow: 0 8px 24px rgba(0,0,0,.18); font-size: 14px;
}
.app-toast--error { background: var(--danger); }
.app-toast--success { background: #16803c; }

.app-score-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.app-score-label { width: 110px; color: var(--muted); }
.app-score-track { flex: 1; height: 9px; border-radius: 9px; background: #eef0f6; overflow: hidden; }
.app-score-fill { height: 100%; background: linear-gradient(90deg, #8384f7, #5652ff); border-radius: 9px; }
.app-score-num { width: 36px; text-align: right; font-weight: 700; }
.app-report-score { font-size: 44px; font-weight: 700; color: var(--primary); line-height: 1; }
.app-report-score small { font-size: 15px; color: var(--muted); font-weight: 400; }

.app-pagination { display: flex; gap: 6px; align-items: center; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.app-pagination button {
  min-width: 32px; height: 32px; padding: 0 8px; border: 1px solid var(--line);
  border-radius: 7px; background: #fff; cursor: pointer; color: var(--text);
}
.app-pagination button.is-on { background: var(--primary); color: #fff; border-color: var(--primary); }
.app-pagination span { color: var(--muted); margin-right: 8px; }

.app-login-banner {
  background: linear-gradient(135deg, #5652ff, #7c6cff); color: #fff; border-radius: 14px;
  padding: 22px; margin-bottom: 22px;
}
.app-login-banner h2 { margin: 0 0 8px; font-size: 20px; }
.app-login-banner p { margin: 0; opacity: .86; line-height: 1.7; }

/* ===== 富文本编辑器（稿件内容） ===== */
.rte { border: 1px solid #dfe2ec; border-radius: 9px; background: #fff; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.rte:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(86,82,255,.1); }
.rte-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; padding: 6px 8px; border-bottom: 1px solid #eef0f6; background: #fafbff; }
.rte-btn { border: 0; background: transparent; min-width: 30px; height: 28px; padding: 0 8px; border-radius: 6px; font-size: 13px; color: var(--text); cursor: pointer; }
.rte-btn:hover { background: #eceefc; color: var(--primary); }
.rte-sep { width: 1px; height: 18px; background: #e2e5f0; margin: 0 6px; }
.rte-editor { min-height: 180px; max-height: 420px; overflow-y: auto; padding: 12px 14px; font-size: 14px; line-height: 1.7; outline: none; }
.rte-editor img, .rich-content img { max-width: 100%; height: auto; border-radius: 6px; margin: 6px 0; }
.rte-editor:empty::before { content: attr(data-placeholder); color: #a5abc0; pointer-events: none; }

/* ===== 富文本内容展示（稿件正文渲染） ===== */
.rich-content { font-size: 14px; line-height: 1.8; word-break: break-word; }
.rich-content p, .rich-content div { margin: 0 0 10px; }
.rich-content h2 { font-size: 18px; font-weight: 600; margin: 14px 0 8px; }
.rich-content h3 { font-size: 16px; font-weight: 600; margin: 12px 0 6px; }
.rich-content h4 { font-size: 15px; font-weight: 600; margin: 10px 0 6px; }
.rich-content ul, .rich-content ol { margin: 0 0 10px; padding-left: 22px; }
.rich-content li { margin-bottom: 4px; }
.rich-content a { color: var(--primary); text-decoration: underline; }
.rich-content blockquote { margin: 0 0 10px; padding: 8px 12px; border-left: 3px solid #d5d9f5; background: #f7f8fd; color: #5a607a; }

@media (max-width: 960px) {
  .app-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-grid-2 { grid-template-columns: 1fr; }
  .app-form-grid { grid-template-columns: 1fr; }
  .app-sidebar { width: 190px; flex-basis: 190px; }
  .app-main { padding: 20px; }
}

/* ===== 移动端适配（≤860px）：侧栏转横向滚动菜单，表格横滚 ===== */
@media (max-width: 860px) {
  body.app-chrome { min-width: 0; }
  .app-topbar { height: 56px; padding: 0 14px; }
  .app-brand { font-size: 16px; gap: 8px; }
  .app-brand small { display: none; }
  .app-logo-img { height: 26px; max-width: 90px; }
  .app-topbar-right { gap: 10px; font-size: 13px; }

  /* 侧栏 → 顶部横向滚动菜单 */
  .app-layout { flex-direction: column; min-height: auto; }
  .app-sidebar {
    width: 100%; flex: none; position: static; height: auto;
    border-right: 0; border-bottom: 1px solid var(--line);
    padding: 10px 12px; overflow-x: auto; overflow-y: hidden;
    -webkit-overflow-scrolling: touch; white-space: nowrap;
  }
  .app-side-group { display: inline-flex; gap: 4px; margin: 0 10px 0 0; vertical-align: top; }
  .app-side-title { display: none; }
  .app-side-item { padding: 8px 12px; margin-bottom: 0; border-radius: 8px; white-space: nowrap; font-size: 13px; }

  .app-main { padding: 16px 14px 48px; }
  .app-page-head { flex-wrap: wrap; gap: 10px; }
  .app-page-title { font-size: 19px; }
  .app-card { padding: 16px; }
  .app-stat { padding: 16px; }
  .app-stat-value { font-size: 22px; }
  .app-table { min-width: 640px; }
  .app-filter-bar { gap: 8px; }
  .app-filter-bar .app-input, .app-filter-bar .app-select { flex: 1; min-width: 120px; }
  .app-checkbar { flex-wrap: wrap; gap: 10px; padding: 12px 14px; }
  .app-modal { max-height: 92vh; border-radius: 12px; }
  .app-modal-body { padding: 16px; }
  .app-modal-foot { flex-wrap: wrap; }
  .app-login-card { padding: 28px 22px 26px; }
  .app-score-label { width: 84px; font-size: 13px; }
  .app-report-score { font-size: 36px; }
  .app-pagination { justify-content: center; }
}
