:root {
  --bg: #f4f5f7;
  --bg-warm: #f7f6f3;
  --surface: #ffffff;
  --text: #1f2430;
  --text-2: #5b6474;
  --text-3: #8b93a1;
  --line: #e6e8ec;
  --line-strong: #d8dbe2;
  --accent: #f2662f;
  --accent-dark: #d94f1c;
  --accent-soft: #fff1eb;
  --success: #18a058;
  --success-soft: #eaf8f0;
  --danger: #e5484d;
  --danger-soft: #fdeeee;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(20, 25, 40, 0.04);
  --shadow: 0 8px 28px rgba(25, 32, 50, 0.07);
  --shadow-lg: 0 18px 50px rgba(25, 32, 50, 0.12);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background: var(--bg-warm);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

.hidden {
  display: none !important;
}

/* ---------------- 公共 ---------------- */

.mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text-2);
}

.mode-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.mode-badge.cloud .dot {
  background: var(--success);
}

/* ---------------- 首页 ---------------- */

.portal {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 56px 20px 40px;
  background:
    radial-gradient(1000px 460px at 50% -160px, #ffe6d8 0%, rgba(255, 230, 216, 0) 70%),
    var(--bg-warm);
}

.portal-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 36px;
  text-align: center;
}

.portal-logo {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(145deg, #ff8a4c, var(--accent));
  box-shadow: 0 10px 24px rgba(242, 102, 47, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.portal-brand h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.portal-brand p {
  margin: 0;
  color: var(--text-3);
  font-size: 14px;
}

.portal-list {
  width: 100%;
  max-width: 620px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.activity-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.activity-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: #f0c9b8;
}

.activity-card .icon {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.activity-card .meta {
  flex: 1;
  min-width: 0;
}

.activity-card h3 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 600;
}

.activity-card p {
  margin: 0;
  color: var(--text-3);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-card .arrow {
  flex: none;
  color: var(--text-3);
}

.portal-empty,
.portal-foot {
  color: var(--text-3);
  font-size: 13px;
}

.portal-empty {
  background: #fff;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 44px 24px;
  text-align: center;
  max-width: 620px;
  width: 100%;
}

.portal-foot {
  margin-top: 40px;
}

.portal-foot a {
  color: var(--text-2);
  border-bottom: 1px dotted var(--line-strong);
}

/* ---------------- 报名页 ---------------- */

.form-page {
  min-height: 100vh;
  padding: 0 0 48px;
  background:
    linear-gradient(180deg, #fff8f4 0, rgba(255, 248, 244, 0) 320px),
    var(--bg-warm);
}

.form-topbar {
  max-width: 620px;
  margin: 0 auto;
  padding: 20px 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-size: 14px;
}

.back-link:hover {
  color: var(--accent);
}

.form-card {
  max-width: 620px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 0;
  overflow: hidden;
}

.form-card-body {
  padding: 32px 34px 34px;
}

.form-banner {
  width: 100%;
  aspect-ratio: 16 / 7;
  background: #f1f2f5;
  overflow: hidden;
}

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

.product-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 26px;
}

.product-gallery figure {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
  background: #fafbfc;
}

.product-gallery img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.product-gallery figcaption {
  padding: 8px 10px;
  font-size: 12.5px;
  color: var(--text-2);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-card-head {
  padding-bottom: 22px;
  border-bottom: 1px solid #f0f1f4;
  margin-bottom: 26px;
}

.form-card-head h1 {
  margin: 0;
  font-size: 23px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.form-card-head .desc {
  margin: 10px 0 0;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.75;
}

.form-card-head .count-tip {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-3);
}

.field {
  margin-bottom: 22px;
}

.field:last-child {
  margin-bottom: 0;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 9px;
}

.field-label .req {
  color: var(--danger);
  font-size: 15px;
  line-height: 1;
  transform: translateY(1px);
}

.field-label .optional {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 400;
  margin-left: 4px;
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fafbfc;
  border-radius: 10px;
  padding: 0 14px;
  height: 48px;
  font-size: 15px;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  appearance: none;
}

.textarea {
  height: auto;
  min-height: 108px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.6;
}

.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%239aa1ad' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  color: var(--text);
}

.select:invalid,
.select.is-placeholder {
  color: var(--text-3);
}

.input::placeholder,
.textarea::placeholder {
  color: #a8afba;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(242, 102, 47, 0.12);
}

.choice-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.choice {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  background: #fafbfc;
  border-radius: 10px;
  font-size: 14.5px;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice:hover {
  border-color: #efc3b1;
}

.choice.checked {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 500;
}

.field-error {
  margin-top: 7px;
  font-size: 12.5px;
  color: var(--danger);
  display: none;
}

.field.has-error .input,
.field.has-error .select,
.field.has-error .textarea {
  border-color: var(--danger);
  background: #fffafa;
}

.field.has-error .field-error {
  display: block;
}

.submit-btn {
  width: 100%;
  height: 52px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ff8447, var(--accent));
  color: #fff;
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: 1px;
  box-shadow: 0 8px 20px rgba(242, 102, 47, 0.26);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  margin-top: 30px;
}

.submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(242, 102, 47, 0.3);
}

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

.submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.form-tip {
  margin-top: 14px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-3);
}

.form-footer {
  max-width: 620px;
  margin: 22px auto 0;
  text-align: center;
  font-size: 12.5px;
  color: #a8afba;
}

/* 成功页 */
.success-card {
  max-width: 520px;
  margin: 72px auto 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 46px 36px;
  text-align: center;
}

.success-icon {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.success-card h2 {
  margin: 0 0 8px;
  font-size: 21px;
  font-weight: 600;
}

.success-card p {
  margin: 0;
  color: var(--text-2);
  font-size: 14px;
}

.success-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 42px;
  padding: 0 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--line-strong);
  background: #fafbfc;
}

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

.btn-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.btn-ghost {
  background: transparent;
}

.btn-danger {
  color: var(--danger);
  border-color: #f3c9ca;
  background: #fff;
}

.btn-danger:hover {
  background: var(--danger-soft);
  border-color: var(--danger);
}

.btn-sm {
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: 8px;
}

.btn-block {
  width: 100%;
}

/* ---------------- 后台 ---------------- */

.admin-body {
  min-height: 100vh;
  background: var(--bg);
}

/* 登录 */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(800px 400px at 50% -120px, #ffe6d8 0%, rgba(255, 230, 216, 0) 70%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  padding: 36px 32px 32px;
}

.login-logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(145deg, #ff8a4c, var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  margin-bottom: 18px;
  box-shadow: 0 8px 18px rgba(242, 102, 47, 0.25);
}

.login-card h1 {
  margin: 0 0 6px;
  font-size: 21px;
  font-weight: 600;
}

.login-card .sub {
  margin: 0 0 24px;
  color: var(--text-3);
  font-size: 13.5px;
}

.login-card .field {
  margin-bottom: 16px;
}

.login-hint {
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 9px;
  background: #f7f8fa;
  border: 1px dashed var(--line-strong);
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.6;
}

/* 布局 */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  flex: none;
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 20px;
  border-bottom: 1px solid #f0f1f4;
  margin-bottom: 16px;
}

.side-brand .mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(145deg, #ff8a4c, var(--accent));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.side-brand .name {
  font-weight: 600;
  font-size: 15px;
  line-height: 1.3;
}

.side-brand .sub {
  font-size: 12px;
  color: var(--text-3);
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--text-2);
  font-size: 14px;
  transition: all 0.15s ease;
}

.side-nav a:hover {
  background: #f7f8fa;
  color: var(--text);
}

.side-nav a.active {
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 500;
}

.side-nav a svg {
  flex: none;
}

.side-foot {
  margin-top: auto;
  border-top: 1px solid #f0f1f4;
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.side-user {
  font-size: 12.5px;
  color: var(--text-3);
  padding: 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main {
  flex: 1;
  min-width: 0;
  padding: 26px 32px 60px;
}

.main-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.main-head .title-group h1 {
  margin: 0;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.main-head .title-group p {
  margin: 4px 0 0;
  color: var(--text-3);
  font-size: 13px;
}

.head-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* 活动列表 */
.act-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.act-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.act-item:hover {
  box-shadow: var(--shadow);
  border-color: #e8d2c8;
}

.act-item .top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.act-item h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
}

.act-item .desc {
  margin: 0;
  color: var(--text-3);
  font-size: 13px;
  min-height: 20px;
}

.act-item .foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid #f2f3f5;
}

.act-item .foot .time {
  font-size: 12px;
  color: var(--text-3);
}

.act-item .foot .ops {
  display: flex;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 999px;
  background: #f4f5f7;
  color: var(--text-2);
  white-space: nowrap;
}

.chip .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-3);
}

.chip.on {
  background: var(--success-soft);
  color: var(--success);
}

.chip.on .dot {
  background: var(--success);
}

.empty-state {
  background: #fff;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 64px 24px;
  text-align: center;
  color: var(--text-3);
}

.empty-state .icon {
  width: 54px;
  height: 54px;
  border-radius: 15px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.empty-state h3 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
}

.empty-state p {
  margin: 0 0 20px;
  font-size: 13.5px;
}

/* 卡片 / 表单 */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card + .card {
  margin-top: 16px;
}

.card-head {
  padding: 18px 22px;
  border-bottom: 1px solid #f2f3f5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-head h2 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 600;
}

.card-head .hint {
  font-size: 12.5px;
  color: var(--text-3);
}

.card-body {
  padding: 22px;
}

.form-row {
  margin-bottom: 18px;
}

.form-row:last-child {
  margin-bottom: 0;
}

.form-row > label.lbl {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-2);
}

.form-row .help {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-3);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* 字段构建器 */
.builder-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.builder-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fcfcfd;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.builder-item:hover {
  border-color: #e5c6b8;
  background: #fff;
}

.drag-handle {
  color: #c1c7d0;
  flex: none;
  display: flex;
}

.f-type {
  flex: none;
  width: 62px;
  font-size: 11.5px;
  text-align: center;
  padding: 3px 0;
  border-radius: 6px;
  background: #eef0f4;
  color: var(--text-2);
}

.builder-item .info {
  flex: 1;
  min-width: 0;
}

.builder-item .name {
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.builder-item .name .req {
  color: var(--danger);
  font-size: 13px;
}

.builder-item .opts {
  font-size: 12px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}

.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.icon-btn:hover {
  background: #f2f3f5;
  color: var(--text);
}

.icon-btn.danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.add-field-btn {
  width: 100%;
  height: 46px;
  border: 1px dashed var(--line-strong);
  border-radius: 11px;
  color: var(--text-2);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: #fcfcfd;
  margin-top: 12px;
  transition: all 0.15s ease;
}

.add-field-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.field-editor {
  margin-top: 14px;
  border: 1px solid #f0d3c5;
  background: #fffaf7;
  border-radius: 12px;
  padding: 18px;
}

.field-editor .editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.field-editor .editor-head strong {
  font-size: 14px;
}

.field-editor .editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.checkbox-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}

.checkbox-line input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

/* 开关 */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  user-select: none;
  font-size: 13.5px;
  color: var(--text-2);
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch .track {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #d8dbe2;
  position: relative;
  transition: background 0.18s ease;
  flex: none;
}

.switch .track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.18s ease;
}

.switch input:checked + .track {
  background: var(--accent);
}

.switch input:checked + .track::after {
  transform: translateX(18px);
}

/* 统计 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}

.stat-card .k {
  font-size: 12.5px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-card .v {
  margin-top: 8px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}

.stat-card .v small {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-3);
  margin-left: 4px;
}

.stat-card .s {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-3);
}

.dist-card .card-body {
  padding: 20px 22px 22px;
}

.dist-row {
  margin-bottom: 18px;
}

.dist-row:last-child {
  margin-bottom: 0;
}

.dist-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 13.5px;
  margin-bottom: 7px;
}

.dist-head .label {
  color: var(--text-2);
}

.dist-head .val {
  color: var(--text-3);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.dist-head .val b {
  color: var(--text);
  font-weight: 600;
  font-size: 13.5px;
}

.bar {
  height: 8px;
  background: #f1f2f5;
  border-radius: 999px;
  overflow: hidden;
}

.bar > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffa36e, var(--accent));
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.dist-empty {
  color: var(--text-3);
  font-size: 13px;
  padding: 8px 0;
}

/* 表格 */
.table-wrap {
  overflow-x: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  white-space: nowrap;
}

table.data th {
  text-align: left;
  font-weight: 500;
  color: var(--text-3);
  font-size: 12.5px;
  padding: 12px 14px;
  background: #fafbfc;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
}

table.data td {
  padding: 13px 14px;
  border-bottom: 1px solid #f2f3f5;
  color: var(--text-2);
}

table.data tbody tr:hover {
  background: #fcfaf9;
}

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

table.data td.strong {
  color: var(--text);
  font-weight: 500;
}

table.data .idx {
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

table.data .time {
  color: var(--text-3);
  font-size: 12.5px;
}

table.data .op {
  color: var(--text-3);
}

table.data .op:hover {
  color: var(--danger);
}

.tag-cell {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: #f4f5f7;
  font-size: 12px;
  color: var(--text-2);
}

/* 空表 */
.table-empty {
  padding: 56px 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 13.5px;
}

/* 弹窗 */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(20, 24, 33, 0.42);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  animation: fade 0.16s ease;
}

.modal {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 26px;
  animation: pop 0.18s ease;
}

.modal h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 600;
}

.modal p {
  margin: 0 0 22px;
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.7;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pop {
  from { opacity: 0; transform: scale(0.97) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 36px;
  transform: translateX(-50%) translateY(12px);
  background: #232937;
  color: #fff;
  font-size: 13.5px;
  padding: 10px 18px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: all 0.22s ease;
  z-index: 200;
  max-width: 90vw;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.error {
  background: #b3261e;
}

/* 分享条 */
.share-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #f8f9fb;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-2);
}

.share-bar .link {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--accent-dark);
}

/* Tabs */
.tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: #eceef2;
  border-radius: 10px;
  margin-bottom: 18px;
}

.tabs .tab {
  padding: 7px 17px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--text-2);
  transition: all 0.15s ease;
}

.tabs .tab:hover {
  color: var(--text);
}

.tabs .tab.active {
  background: #fff;
  color: var(--text);
  font-weight: 500;
  box-shadow: 0 1px 3px rgba(25, 32, 50, 0.1);
}

/* 统计分布网格 */
.dist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.dist-grid .card + .card {
  margin-top: 0;
}

/* 图片管理 */
.img-editor {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.img-preview {
  width: 230px;
  aspect-ratio: 16 / 7;
  border-radius: 10px;
  border: 1px dashed var(--line-strong);
  background: #fafbfc;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 12.5px;
  overflow: hidden;
  flex: none;
}

.img-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.img-ops {
  flex: 1;
  min-width: 210px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.img-ops .input {
  height: 38px;
  font-size: 13px;
}

.product-editor {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}

.product-tile {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px;
  background: #fcfcfd;
}

.product-tile .thumb {
  aspect-ratio: 1 / 1;
  border-radius: 7px;
  overflow: hidden;
  background: #f1f2f5;
}

.product-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-tile .tile-del {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(20, 24, 33, 0.65);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  backdrop-filter: blur(2px);
}

.product-tile .tile-del:hover {
  background: var(--danger);
}

.product-tile input {
  height: 34px;
  margin-top: 6px;
  font-size: 12.5px;
  padding: 0 9px;
}

.product-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 150px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  color: var(--text-2);
  font-size: 13px;
  background: #fcfcfd;
  transition: all 0.15s ease;
}

.product-add:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.product-url-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.product-url-row .input {
  height: 38px;
  font-size: 13px;
}

/* 实时人数 */
.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--success);
}

.live-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(24, 160, 88, 0.4); }
  50% { opacity: 0.6; box-shadow: 0 0 0 5px rgba(24, 160, 88, 0); }
}

.count-num {
  font-weight: 600;
  color: var(--text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.count-num small {
  font-weight: 400;
  color: var(--text-3);
  font-size: 12px;
  margin-left: 3px;
}

.ops {
  flex-wrap: wrap;
}

/* 筛选条 */
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.filter-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 132px;
}

.filter-item label {
  font-size: 12px;
  color: var(--text-3);
}

.filter-item .select,
.filter-item .input {
  height: 38px;
  font-size: 13px;
  background: #fff;
}

.filter-bar .btn {
  height: 38px;
}

.filter-bar .spacer {
  flex: 1;
}

.filter-count {
  font-size: 12.5px;
  color: var(--text-3);
  padding-bottom: 10px;
}

/* 汇总小表 */
.summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.summary-table th {
  text-align: left;
  font-weight: 500;
  color: var(--text-3);
  font-size: 12.5px;
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
}

.summary-table td {
  padding: 9px 6px;
  border-bottom: 1px solid #f2f3f5;
  color: var(--text-2);
}

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

.summary-table td.num {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.summary-table th.num {
  text-align: right;
}

.summary-table .mini-bar {
  height: 6px;
  border-radius: 999px;
  background: #f1f2f5;
  overflow: hidden;
  min-width: 70px;
}

.summary-table .mini-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffa36e, var(--accent));
}

.summary-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #f2f3f5;
  font-size: 12.5px;
  color: var(--text-3);
}

/* 二维码 */
.qr-modal {
  max-width: 420px;
  text-align: center;
}

.qr-modal p {
  margin-bottom: 16px;
}

.qr-box {
  width: 236px;
  height: 236px;
  margin: 0 auto 16px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-box img,
.qr-box canvas {
  display: block;
  width: 220px;
  height: 220px;
}

.qr-url {
  font-size: 12.5px;
  color: var(--text-3);
  word-break: break-all;
  line-height: 1.6;
  background: #f8f9fb;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  text-align: left;
}

.qr-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.qr-actions .btn {
  flex: 1;
  min-width: 110px;
}

/* 响应式 */
@media (max-width: 900px) {
  .admin-layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: sticky;
    top: 0;
    z-index: 20;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 10px 16px;
    border-right: none;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
  }

  .side-brand {
    padding: 0;
    border: none;
    margin: 0;
    flex: none;
  }

  .side-brand .sub {
    display: none;
  }

  .side-nav {
    flex-direction: row;
    flex: 1;
    gap: 2px;
  }

  .side-nav a {
    padding: 8px 11px;
    font-size: 13px;
    white-space: nowrap;
  }

  .side-nav a span {
    display: none;
  }

  .side-foot {
    margin: 0;
    border: none;
    padding: 0;
    flex: none;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .side-user {
    display: none;
  }

  .main {
    padding: 20px 16px 48px;
  }
}

@media (max-width: 560px) {
  .form-page {
    padding-bottom: 32px;
  }

  .form-topbar {
    padding: 14px 16px 10px;
  }

  .form-card {
    margin: 0 12px;
    border-radius: 16px;
  }

  .form-card-body {
    padding: 24px 20px 26px;
  }

  .form-card-head h1 {
    font-size: 20px;
  }

  .form-card-head {
    padding-bottom: 18px;
    margin-bottom: 22px;
  }

  .field {
    margin-bottom: 19px;
  }

  .choice {
    padding: 9px 14px;
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .portal {
    padding: 38px 16px 32px;
  }

  .portal-brand {
    margin-bottom: 28px;
  }

  .activity-card {
    padding: 18px;
    gap: 14px;
  }

  .stat-card .v {
    font-size: 25px;
  }

  .main-head .title-group h1 {
    font-size: 18px;
  }

  .success-card {
    margin: 36px 12px 0;
    padding: 36px 24px;
  }

  .success-actions {
    flex-direction: column;
  }
}
