/* ============================================================
   活动获奖查询后台
   风格：宣纸暖白 / 朱砂红 / 鎏金
   ============================================================ */

:root {
  --paper: #f5efe3;
  --paper-deep: #efe7d6;
  --card: #fffdf8;
  --ink: #2c251c;
  --ink-2: #4e4437;
  --ink-3: #7e7160;
  --ink-4: #a09680;
  --line: #e8ddc9;
  --line-soft: #f2ebdd;
  --gold: #a98a52;
  --gold-2: #c8ac76;
  --gold-deep: #8a6a35;
  --gold-wash: #f9f4e8;
  --cinnabar: #a03a2e;
  --cinnabar-deep: #883026;
  --green: #3f6b51;
  --red: #a03a2e;
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", "SimSun", serif;
  --sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", "JetBrains Mono", Consolas, "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background-color: var(--paper);
  background-image:
    radial-gradient(1100px 520px at 82% -8%, rgba(200, 168, 106, 0.14), transparent 62%),
    radial-gradient(900px 420px at -6% 100%, rgba(160, 58, 46, 0.05), transparent 60%);
  background-attachment: fixed;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
}

/* ------------------------------ 布局骨架 ------------------------------ */

.shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  width: 240px;
  flex: 0 0 240px;
  height: 100vh;
  padding: 22px 14px 18px;
  background:
    radial-gradient(90% 40% at 10% 0%, rgba(200, 168, 106, 0.1), transparent 60%),
    linear-gradient(180deg, #261d15 0%, #1d1610 100%);
  color: #cbbca2;
}

.main {
  flex: 1;
  min-width: 0;
  max-width: 1220px;
  margin: 0 auto;
  padding: 28px 34px 56px;
}

/* ------------------------------ 侧边栏 ------------------------------ */

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 8px 20px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(216, 192, 150, 0.14);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border: 1px solid rgba(201, 173, 120, 0.55);
  border-radius: 4px;
  box-shadow: inset 0 0 0 3px rgba(201, 173, 120, 0.1);
  color: #d9bc85;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-text strong {
  font-family: var(--serif);
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #f2e9d6;
  white-space: nowrap;
}

.brand-text small {
  margin-top: 2px;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(203, 188, 162, 0.55);
  white-space: nowrap;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 2px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 14px;
  border-radius: 6px;
  font-size: 13.5px;
  letter-spacing: 0.12em;
  color: #b6a689;
  transition: color 0.18s ease, background 0.18s ease;
}

.nav-item:hover {
  color: #f0e4cb;
  background: rgba(216, 192, 150, 0.06);
}

.nav-item.is-active {
  color: #f4ead4;
  background: rgba(216, 192, 150, 0.1);
}

.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, #d3b479, #a9874c);
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(216, 192, 150, 0.14);
}

.account {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 14px;
}

.account-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid rgba(201, 173, 120, 0.5);
  border-radius: 50%;
  background: rgba(216, 192, 150, 0.08);
  color: #e6d2a8;
  font-family: var(--serif);
  font-size: 15px;
}

.account-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.account-meta strong {
  font-size: 13px;
  font-weight: 500;
  color: #eadfc8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-meta small {
  margin-top: 1px;
  font-size: 11px;
  color: rgba(203, 188, 162, 0.55);
}

.sidebar .btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(216, 192, 150, 0.25);
  color: #d9c9a9;
}

.sidebar .btn-ghost:hover {
  background: rgba(216, 192, 150, 0.08);
  border-color: rgba(216, 192, 150, 0.45);
  color: #f2e9d6;
}

/* ------------------------------ Flash 提示 ------------------------------ */

.flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding: 11px 16px;
  border: 1px solid;
  border-radius: 8px;
  font-size: 13px;
}

.flash-success {
  background: #eef4ec;
  border-color: #d5e2d3;
  color: #3d6147;
}

.flash-error {
  background: #fbf0ed;
  border-color: #e8c7be;
  color: var(--red);
}

.flash-info {
  background: var(--gold-wash);
  border-color: #e6d8bd;
  color: #7a6237;
}

.flash-text {
  flex: 1;
}

.flash-close {
  border: 0;
  background: none;
  padding: 0 2px;
  font-size: 17px;
  line-height: 1;
  color: inherit;
  opacity: 0.55;
  cursor: pointer;
}

.flash-close:hover {
  opacity: 1;
}

/* 安全提醒条：不可关闭，直到风险处置完成 */
.banner {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 13px 18px;
  border: 1px solid #e3b8ae;
  border-left: 4px solid var(--red);
  border-radius: 8px;
  background: #fbf1ee;
  font-size: 13px;
  color: #7d2f24;
}

.banner-body {
  flex: 1;
  min-width: 0;
}

.banner-title {
  display: block;
  margin-bottom: 3px;
  font-size: 14px;
  color: #6f2a20;
}

.banner-text {
  margin: 0;
  line-height: 1.75;
}

.banner .btn {
  flex: none;
}

.notice-inline {
  margin: 0 0 14px;
  padding: 10px 14px;
  border: 1px dashed #dccbb0;
  border-radius: 8px;
  background: var(--gold-wash);
  font-size: 12.5px;
  line-height: 1.85;
  color: #7a6237;
}

@media (max-width: 760px) {
  .banner {
    flex-wrap: wrap;
  }

  .banner .btn {
    width: 100%;
  }
}

/* ------------------------------ 页头 ------------------------------ */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.page-head h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
  line-height: 1.35;
}

.page-head h1::after {
  content: "";
  display: block;
  width: 34px;
  height: 2px;
  margin-top: 9px;
  border-radius: 1px;
  background: linear-gradient(90deg, var(--gold-2), rgba(200, 172, 118, 0));
}

.page-head h1 .badge {
  margin-left: 8px;
  vertical-align: 3px;
}

.page-head p {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--ink-4);
}

.page-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  padding-bottom: 4px;
}

.back-link {
  display: inline-block;
  margin-bottom: 6px;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--ink-4);
  transition: color 0.18s ease;
}

.back-link:hover {
  color: var(--cinnabar);
}

/* ------------------------------ 按钮 ------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 13px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, filter 0.18s ease;
}

.btn-primary {
  background: linear-gradient(180deg, #a94332, #91362a);
  border-color: #863025;
  color: #fdf3e3;
  box-shadow: 0 1px 2px rgba(120, 40, 30, 0.25);
}

.btn-primary:hover {
  filter: brightness(1.07);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-gold {
  background: linear-gradient(180deg, #d6b87e, #bb9758);
  border-color: #aa8749;
  color: #38290f;
  box-shadow: 0 1px 2px rgba(120, 90, 30, 0.22);
}

.btn-gold:hover {
  filter: brightness(1.05);
}

.btn-gold:active {
  transform: translateY(1px);
}

.btn-ghost {
  background: var(--card);
  border-color: #ddd1bc;
  color: var(--ink-2);
}

.btn-ghost:hover {
  border-color: #c8b48d;
  background: #fbf7ec;
}

.btn-danger-ghost {
  background: transparent;
  border-color: #dcb6ae;
  color: #9c392c;
}

.btn-danger-ghost:hover {
  background: #fbf0ed;
  border-color: #cf9d93;
}

.btn-block {
  width: 100%;
}

.btn-lg {
  height: 44px;
  font-size: 14px;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
}

/* ------------------------------ 统计卡 ------------------------------ */

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.stat {
  position: relative;
  padding: 20px 22px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(70, 55, 30, 0.03), 0 18px 40px -34px rgba(70, 55, 30, 0.25);
  overflow: hidden;
}

.stat::before {
  content: "";
  position: absolute;
  left: 22px;
  top: 0;
  width: 36px;
  height: 2px;
  background: linear-gradient(90deg, var(--gold-2), transparent);
}

.stat-label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
}

.stat-value {
  display: block;
  margin: 8px 0 4px;
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink);
}

.stat-note {
  font-size: 12px;
  color: var(--ink-4);
}

/* ------------------------------ 卡片 ------------------------------ */

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(70, 55, 30, 0.03), 0 18px 40px -34px rgba(70, 55, 30, 0.25);
  overflow: hidden;
}

.card + .card {
  margin-top: 0;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line-soft);
}

.card-head h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--ink);
}

.card-head h2::before {
  content: "";
  width: 3px;
  height: 15px;
  border-radius: 2px;
  background: linear-gradient(180deg, #b23c2d, var(--cinnabar-deep));
}

.card-note {
  font-size: 12px;
  color: var(--ink-4);
}

.card-link {
  font-size: 12.5px;
  color: var(--gold-deep);
  transition: color 0.18s ease;
}

.card-link:hover {
  color: var(--cinnabar);
}

.card-count {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 9px;
  border: 1px solid #e6d8bd;
  border-radius: 20px;
  background: var(--gold-wash);
  color: var(--gold-deep);
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.hint {
  margin: 12px 22px 20px;
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--ink-4);
}

/* ------------------------------ 表格 ------------------------------ */

.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th {
  padding: 10px 14px;
  background: #faf5ea;
  border-bottom: 1px solid #ece2d0;
  text-align: left;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  white-space: nowrap;
}

.table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
  color: #3a3128;
}

.table tbody tr {
  transition: background 0.15s ease;
}

.table tbody tr:hover {
  background: #fcf8ee;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.col-num {
  width: 72px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

th.col-num {
  text-align: right;
}

.col-time {
  white-space: nowrap;
  font-size: 12.5px;
  color: var(--ink-3);
}

.col-actions {
  text-align: right;
  white-space: nowrap;
}

.col-index {
  width: 44px;
  text-align: center;
  color: var(--ink-4);
}

.col-extra {
  font-size: 12px;
  color: var(--ink-3);
  max-width: 260px;
}

.table-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  transition: color 0.18s ease;
}

.table-title:hover {
  color: var(--cinnabar);
}

.table-sub {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--ink-4);
}

.mono {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: #6d6152;
}

.award-text {
  font-weight: 500;
  color: var(--cinnabar-deep);
}

.muted {
  color: var(--ink-4);
}

/* ------------------------------ 徽标与文字链接 ------------------------------ */

.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 20px;
  font-family: var(--sans);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.badge-on {
  background: #edf3ec;
  border-color: #d3e2d4;
  color: var(--green);
}

.badge-off {
  background: #f4f0e7;
  border-color: #e2d9c6;
  color: #8d8272;
}

.link {
  font-size: 12.5px;
  color: var(--gold-deep);
  transition: color 0.18s ease;
}

.link:hover {
  color: var(--cinnabar);
}

.link + .link,
.inline-form + .link,
.link + .inline-form {
  margin-left: 10px;
}

.link-btn {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  font-size: 12.5px;
  font-family: inherit;
}

.link-danger {
  color: var(--red);
}

.link-danger:hover {
  color: #7e241b;
}

.inline-form {
  display: inline;
}

.inline-search {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ------------------------------ 空状态 ------------------------------ */

.empty {
  padding: 46px 24px;
  text-align: center;
}

.empty-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-2);
}

.empty-text {
  max-width: 420px;
  margin: 0 auto 16px;
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--ink-4);
}

.empty-sm {
  padding: 30px 20px;
}

.empty-sm .empty-text {
  margin: 0;
}

/* ------------------------------ 时间线 ------------------------------ */

.timeline {
  list-style: none;
  margin: 0;
  padding: 10px 22px 20px;
}

.timeline-item {
  position: relative;
  padding: 12px 0 12px 18px;
  border-left: 1px solid #eadfc9;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -3.5px;
  top: 18px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-2);
}

.timeline-item:last-child {
  padding-bottom: 4px;
}

.timeline-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.timeline-time {
  flex-shrink: 0;
  font-size: 11.5px;
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
}

.timeline-meta {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--ink-3);
}

/* ------------------------------ 分页 ------------------------------ */

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--line-soft);
}

.page-link {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border: 1px solid #ddd1bc;
  border-radius: 6px;
  background: var(--card);
  font-size: 12.5px;
  color: var(--ink-2);
  transition: border-color 0.18s ease, color 0.18s ease;
}

.page-link:hover {
  border-color: var(--gold-2);
  color: var(--cinnabar);
}

.page-link.is-disabled {
  pointer-events: none;
  border-color: #eee6d6;
  background: #faf6ec;
  color: #c3b9a6;
}

.page-info {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------ 工具条 ------------------------------ */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line-soft);
  flex-wrap: wrap;
}

.toolbar-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar-count {
  font-size: 12.5px;
  color: var(--ink-4);
}

/* ------------------------------ 表单 ------------------------------ */

.field {
  display: block;
  margin-bottom: 16px;
}

.field-full {
  grid-column: 1 / -1;
}

.field-label {
  display: block;
  margin-bottom: 7px;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: #5b5040;
}

.field-label em {
  color: var(--cinnabar);
  font-style: normal;
}

.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-4);
}

.input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #ddd1bc;
  border-radius: 6px;
  background: #fffdf9;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13.5px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(169, 138, 82, 0.16);
}

.input::placeholder {
  color: #b0a48f;
}

select.input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238a7a5f' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

.input-search {
  width: 260px;
}

.input-select {
  width: 160px;
}

.input-mono {
  font-family: var(--mono);
  font-size: 12.5px;
}

.textarea {
  height: auto;
  padding: 10px 12px;
  line-height: 1.7;
  resize: vertical;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: #5b5040;
  cursor: pointer;
}

.check input {
  width: 15px;
  height: 15px;
  accent-color: var(--cinnabar);
}

.alert {
  margin-bottom: 18px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
}

.alert-error {
  background: #fbf1ee;
  border: 1px solid #e7c6bd;
  color: var(--red);
}

.alert ul {
  margin: 0;
  padding-left: 18px;
}

.alert li {
  line-height: 1.8;
}

/* 表单页 */

.form-card {
  padding: 4px 26px 22px;
}

.form-section {
  padding: 20px 0 16px;
  border-bottom: 1px solid var(--line-soft);
}

.form-section:last-of-type {
  border-bottom: 0;
}

.form-section-head {
  margin-bottom: 16px;
}

.form-section-head h2 {
  margin: 0 0 4px;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--ink);
}

.form-section-head p {
  margin: 0;
  font-size: 12px;
  color: var(--ink-4);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 18px;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  padding: 20px 0 4px;
  border-top: 1px solid var(--line-soft);
}

/* 背景图上传 */

.upload-row {
  display: flex;
  align-items: flex-start;
  gap: 22px;
}

.upload-box {
  display: block;
  width: 230px;
  flex: 0 0 230px;
  cursor: pointer;
}

.upload-box input[type="file"] {
  display: none;
}

.upload-cover {
  display: flex;
  align-items: flex-end;
  height: 300px;
  border: 1px solid #ddd1bc;
  border-radius: 8px;
  background-color: #faf5ea;
  background-size: cover;
  background-position: center;
  overflow: hidden;
  transition: border-color 0.18s ease;
}

.upload-box:hover .upload-cover {
  border-color: var(--gold-2);
}

.upload-text {
  display: block;
  width: 100%;
  padding: 8px 0;
  background: rgba(30, 22, 15, 0.55);
  color: #f6ecd9;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-align: center;
}

.upload-side {
  flex: 1;
  min-width: 0;
  padding-top: 4px;
}

.upload-tip {
  margin: 0 0 14px;
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--ink-4);
}

/* 点缀图上传：两张并排，透明底纹样用 contain 完整显示 */

.upload-row-deco {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px dashed var(--line);
}

.deco-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 152px;
  flex: 0 0 152px;
}

.deco-col .upload-box {
  width: 100%;
  flex: none;
}

.deco-col-title {
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}

.upload-cover-deco {
  height: 126px;
  background-color: #f3ecdf;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* ------------------------------ 活动详情 ------------------------------ */

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  align-items: start;
}

.detail-main,
.detail-side {
  display: grid;
  gap: 18px;
  min-width: 0;
}

/* 导入 */

.import-form {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(200px, 1fr) auto;
  gap: 14px;
  align-items: end;
  padding: 18px 22px 4px;
}

.import-form .field {
  margin-bottom: 0;
}

.import-form input[type="file"] {
  padding: 5px 8px;
  height: 40px;
  font-size: 12px;
  color: var(--ink-4);
  cursor: pointer;
}

.import-form input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 6px 12px;
  border: 1px solid #ddd1bc;
  border-radius: 6px;
  background: var(--card);
  color: var(--ink-2);
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.import-form input[type="file"]::file-selector-button:hover {
  border-color: #c8b48d;
  background: #fbf7ec;
}

/* 奖项分布 */

.dist-list {
  display: grid;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 10px 16px 2px;
}

.dist-item {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  transition: background 0.18s ease, box-shadow 0.18s ease;
}

.dist-item:hover {
  background: var(--gold-wash);
}

.dist-item.is-active {
  background: #fbf4e7;
  box-shadow: inset 0 0 0 1px #e3cfa8;
}

.dist-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.dist-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--cinnabar-deep);
  word-break: break-word;
}

.dist-num {
  flex: none;
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.dist-num strong {
  margin-right: 2px;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.dist-percent {
  margin-left: 8px;
  font-size: 11.5px;
  font-style: normal;
  color: var(--ink-4);
}

.dist-bar {
  margin-top: 7px;
  height: 8px;
  border-radius: 999px;
  background: #f3ecdd;
  overflow: hidden;
}

.dist-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold-2), var(--gold));
  transition: width 0.3s ease;
}

.dist-item.is-active .dist-bar span {
  background: linear-gradient(90deg, #c05a48, var(--cinnabar));
}

.dist-meta {
  margin: 6px 0 0;
  font-size: 11.5px;
  color: var(--ink-4);
}

/* 筛选提示条 */

.filter-tip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
  padding: 11px 22px;
  background: #fbf7ec;
  border-bottom: 1px solid var(--line-soft);
}

.filter-note {
  font-size: 12px;
  color: var(--ink-4);
}

/* 单条录入 */

.entry-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto auto;
  gap: 10px;
  padding: 16px 22px 4px;
}

.entry-form .btn {
  height: 40px;
}

/* 危险操作行 */

.danger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 14px 22px 20px;
  border-top: 1px solid var(--line-soft);
  font-size: 12.5px;
  color: var(--ink-4);
}

/* 二维码卡片 */

.qr-figure {
  max-width: 250px;
  margin: 18px auto 0;
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.qr-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.qr-caption {
  margin: 10px 0 0;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ink-4);
}

.qr-link {
  display: flex;
  gap: 8px;
  padding: 14px 22px 0;
}

.qr-link .input {
  flex: 1;
  min-width: 0;
  text-overflow: ellipsis;
}

.qr-hint {
  margin: 12px 22px 0;
  font-size: 11.5px;
  line-height: 1.9;
  color: var(--ink-4);
}

.qr-card > .btn-block {
  display: flex;
  width: auto;
  margin: 14px 22px 22px;
}

/* 活动信息 */

.info-list {
  margin: 0;
  padding: 12px 22px 16px;
}

.info-list > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px dashed #f0e8d8;
}

.info-list > div:last-child {
  border-bottom: 0;
}

.info-list dt {
  flex: 0 0 88px;
  font-size: 12px;
  color: var(--ink-4);
}

.info-list dd {
  margin: 0;
  font-size: 12.5px;
  color: #3a3128;
  text-align: right;
  word-break: break-word;
}

.bg-thumb-label {
  margin: 0;
  padding: 14px 22px 0;
  border-top: 1px dashed #f0e8d8;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-4);
}

.bg-thumb {
  margin: 8px 22px 22px;
  height: 170px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-size: cover;
  background-position: center;
}

.deco-thumb-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 8px 22px 22px;
}

.deco-thumb {
  width: 136px;
}

.deco-thumb span {
  display: block;
  height: 86px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background-color: #faf5ea;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.deco-thumb em {
  display: block;
  margin-top: 6px;
  font-style: normal;
  font-size: 12px;
  text-align: center;
  color: var(--ink-4);
}

.danger-card .hint {
  margin: 12px 22px 14px;
}

.danger-card form {
  padding: 0 22px 22px;
}

/* ------------------------------ 设置页 ------------------------------ */

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

.settings-grid .hint {
  margin: 14px 22px 0;
}

.settings-grid .card > form {
  padding: 16px 22px 22px;
}

.settings-grid .field-hint {
  margin-bottom: 14px;
}

.chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 4px 0 16px;
}

.chips-label {
  font-size: 12px;
  color: var(--ink-4);
}

.chip {
  height: 28px;
  padding: 0 10px;
  border: 1px solid #ddd1bc;
  border-radius: 6px;
  background: var(--card);
  color: #5b5040;
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease;
}

.chip:hover {
  border-color: var(--gold-2);
  color: var(--cinnabar);
}

/* ------------------------------ 登录 / 错误页 ------------------------------ */

.auth-page {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  overflow: hidden;
  background:
    radial-gradient(60% 50% at 50% 0%, #fbf6ea 0%, #f4ecdc 55%, #efe5d2 100%);
}

.auth-page::before,
.auth-page::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.auth-page::before {
  top: -220px;
  right: -160px;
  width: 560px;
  height: 560px;
  border: 1px solid rgba(169, 138, 82, 0.2);
}

.auth-page::after {
  bottom: -260px;
  left: -180px;
  width: 620px;
  height: 620px;
  border: 1px solid rgba(160, 58, 46, 0.12);
}

.auth-panel {
  position: relative;
  width: min(430px, 100%);
  padding: 34px 34px 28px;
  background: var(--card);
  border: 1px solid #e6dac2;
  border-radius: 12px;
  box-shadow: 0 30px 70px -40px rgba(80, 55, 20, 0.45);
}

.auth-panel::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(169, 138, 82, 0.22);
  border-radius: 8px;
  pointer-events: none;
}

.auth-panel-narrow {
  width: min(420px, 100%);
}

.auth-panel > * {
  position: relative;
  z-index: 1;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

.auth-brand .brand-mark {
  border-color: rgba(169, 138, 82, 0.55);
  box-shadow: inset 0 0 0 3px rgba(169, 138, 82, 0.08);
  color: var(--gold-deep);
}

.auth-brand .brand-text strong {
  color: var(--ink);
}

.auth-brand .brand-text small {
  color: var(--ink-4);
}

.auth-panel h1 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.auth-sub {
  margin: 0 0 22px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--ink-3);
}

.auth-form .field {
  margin-bottom: 16px;
}

.auth-form .btn {
  margin-top: 8px;
}

.auth-foot {
  margin: 18px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--ink-4);
}

.auth-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

/* ------------------------------ 海报（A4 打印） ------------------------------ */

.poster-body {
  background: #efe6d4;
  padding-bottom: 40px;
}

.poster-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: #241c14;
  color: #d9c9a9;
  font-size: 12.5px;
  letter-spacing: 0.05em;
}

.poster {
  position: relative;
  display: flex;
  width: 210mm;
  min-height: 297mm;
  margin: 24px auto;
  overflow: hidden;
  background: #faf5ea;
  border: 1px solid #e0d2b6;
  box-shadow: 0 24px 60px -30px rgba(60, 40, 10, 0.5);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.poster-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.poster.has-image::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(250, 245, 234, 0.8) 0%, rgba(250, 245, 234, 0.62) 45%, rgba(250, 245, 234, 0.9) 100%);
}

.poster::after {
  content: "";
  position: absolute;
  inset: 10mm;
  z-index: 2;
  border: 1px solid rgba(169, 138, 82, 0.45);
  pointer-events: none;
}

/* 点缀水印：海报只保留下方那一张（上方那张手机查询页才有，见 query.css）。
   共性样式与浓淡变量在 public/css/deco.css，这里只定 A4 版式下的尺寸与位置。
   走普通文档流而不用 absolute：海报内容是一列上下排开的文字，绝对定位的
   「距底固定 mm」会压在活动编号、查询网址那几行上（和手机页踩过的是同一个坑），
   排在 .poster-inner 最后就永远不会撞。margin: 0 auto 靠 flex 居中，
   尺寸在 inset:10mm 的金色内框线以内 */
.deco-poster-bottom {
  width: 44mm;
  max-height: 14mm;
  margin: 7mm auto 0;
}

.poster-inner {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 30mm 20mm;
  text-align: center;
}

/* 标题区：底图自带大字时用一枚宣纸光晕把背景压淡，保证标题可读 */
.poster-head {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 4mm 0 6mm;
  margin-bottom: 22px;
}

.poster-head::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -34mm;
  bottom: -14mm;
  left: 50%;
  width: 210mm;
  transform: translateX(-50%);
  background: linear-gradient(180deg,
    rgba(250, 245, 234, 0.55) 0%,
    rgba(250, 245, 234, 0.42) 46%,
    rgba(250, 245, 234, 0.12) 78%,
    rgba(250, 245, 234, 0) 100%);
}

.poster-kicker {
  margin: 0 0 20px;
  padding-left: 0.55em;
  font-size: 13px;
  letter-spacing: 0.55em;
  color: var(--cinnabar);
  text-shadow: 0 1px 0 rgba(255, 253, 247, 0.9);
}

.poster-title {
  margin: 0 0 10px;
  max-width: 88%;
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.7;
  letter-spacing: 0.03em;
  color: #1c150e;
  text-wrap: balance;
  text-shadow:
    0 1px 0 rgba(255, 253, 247, 0.9),
    0 2px 0 rgba(255, 253, 247, 0.55),
    0 4px 10px rgba(255, 250, 240, 0.5);
}

/* 主标题字体方案（.poster-title.font-serif / -hei / -siyuan / -kaiti / -biaosong）
   与下拉预览的 .font-opt-* 一起统一写在 fonts.css 里，
   与手机查询页的 .hero-title.font-* 同源，不要在此重复定义字体栈 */

.poster-tagline {
  /* 主标题下方的一行，字号比主标题小一号 */
  margin: 0 0 2px;
  max-width: 86%;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: 0.03em;
  color: #2b2318;
  text-wrap: balance;
  text-shadow:
    0 1px 0 rgba(255, 253, 247, 0.9),
    0 2px 0 rgba(255, 253, 247, 0.55);
}

.poster-sub {
  margin: 6px 0 0;
  max-width: 86%;
  font-size: 14px;
  letter-spacing: 0.06em;
  color: #5a4f3f;
  text-shadow: 0 1px 0 rgba(255, 253, 247, 0.85);
}

.poster-qr {
  width: 62mm;
  padding: 14px;
  background: #ffffff;
  border: 1px solid #e3d7c0;
  border-radius: 8px;
  box-shadow: 0 16px 36px -24px rgba(60, 40, 10, 0.5);
}

.poster-qr img {
  display: block;
  width: 100%;
  height: auto;
}

.poster-scan {
  margin: 26px 0 14px;
  padding-left: 0.3em;
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: 0.3em;
  color: #241c14;
}

.poster-divider {
  width: 40mm;
  height: 1px;
  margin-bottom: 16px;
  background: linear-gradient(90deg, transparent, rgba(169, 138, 82, 0.7), transparent);
}

.poster-tip {
  margin: 0;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: #8a7b66;
}

.poster-meta {
  margin: 10px 0 0;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: #a09680;
}

.poster-url {
  margin: 8px 0 0;
  font-family: var(--mono);
  font-size: 10.5px;
  color: #a09680;
  word-break: break-all;
}

@media print {
  @page {
    size: A4;
    margin: 0;
  }

  body.poster-body {
    padding: 0;
    background: #fff;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .poster-toolbar {
    display: none;
  }

  .poster {
    width: 210mm;
    min-height: 297mm;
    margin: 0;
    border: 0;
    box-shadow: none;
  }
}

/* ------------------------------ 响应式 ------------------------------ */

@media (max-width: 1180px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .shell {
    display: block;
  }

  .sidebar {
    position: static;
    width: auto;
    height: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
  }

  .brand {
    padding: 0;
    margin: 0 auto 0 0;
    border-bottom: 0;
  }

  .nav {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0;
    gap: 4px;
  }

  .nav-item {
    height: 34px;
    padding: 0 12px;
  }

  .nav-item.is-active::before {
    top: auto;
    bottom: 0;
    left: 12px;
    right: 12px;
    width: auto;
    height: 2px;
  }

  .sidebar-foot {
    margin: 0;
    padding: 0;
    border-top: 0;
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .account {
    padding: 0;
  }

  .account-meta small {
    display: none;
  }

  .sidebar-foot form .btn {
    height: 32px;
    padding: 0 12px;
  }

  .main {
    padding: 20px 16px 40px;
  }

  .page-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .toolbar-form {
    width: 100%;
  }

  .toolbar-form .input-search {
    flex: 1;
    width: auto;
    min-width: 160px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .import-form {
    grid-template-columns: 1fr;
  }

  .entry-form {
    grid-template-columns: 1fr 1fr;
  }

  .upload-row {
    flex-direction: column;
  }

  .upload-box {
    width: 100%;
    flex: none;
  }

  .deco-col {
    width: 100%;
    flex: none;
  }

  .upload-cover {
    height: 220px;
  }

  .upload-cover-deco {
    height: 150px;
  }

  .poster-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .poster {
    width: 100%;
    min-height: auto;
  }

  .poster-inner {
    padding: 18mm 10mm;
  }
}

@media (max-width: 600px) {
  .stats {
    grid-template-columns: 1fr;
  }

  .sidebar {
    flex-direction: column;
    align-items: stretch;
  }

  .brand {
    margin: 0;
  }

  .sidebar-foot {
    justify-content: space-between;
  }

  .entry-form {
    grid-template-columns: 1fr;
  }

  .table {
    min-width: 640px;
  }

  .qr-link {
    flex-wrap: wrap;
  }

  .qr-link .btn {
    width: 100%;
  }
}
