:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --panel: #ffffff;
  --panel-soft: #f9faf7;
  --ink: #1d2426;
  --muted: #697577;
  --line: #dfe5df;
  --blue: #2f6fed;
  --green: #168a67;
  --amber: #b66b14;
  --red: #ba3b35;
  --shadow: 0 20px 50px rgba(34, 47, 43, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background:
    linear-gradient(90deg, rgba(223, 229, 223, 0.65) 1px, transparent 1px),
    linear-gradient(rgba(223, 229, 223, 0.65) 1px, transparent 1px),
    var(--bg);
  background-size: 34px 34px;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 28px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: var(--radius);
  background: #1f342e;
  color: #fff;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
}

.side-nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  width: 100%;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: #344143;
  padding: 11px 12px;
  text-align: left;
}

.nav-item:hover,
.nav-item.is-active {
  border-color: var(--line);
  background: var(--panel);
  color: var(--blue);
}

.side-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 26px;
}

.side-metrics div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 12px;
}

.side-metrics span {
  display: block;
  font-size: 22px;
  font-weight: 800;
}

.side-metrics small {
  color: var(--muted);
}

.main {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 26px 28px 48px;
}

.topbar,
.admin-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 34px;
  line-height: 1.08;
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.primary-button,
.ghost-button,
.copy-button,
.icon-button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
}

.primary-button {
  border-color: #21473d;
  background: #21473d;
  color: #fff;
  padding: 10px 15px;
  font-weight: 700;
}

.ghost-button,
.copy-button {
  padding: 9px 12px;
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  font-size: 20px;
}

.summary-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 148px;
  gap: 16px;
  align-items: stretch;
  margin: 24px 0 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
}

.summary-copy {
  display: grid;
  gap: 8px;
  padding: 20px;
}

.summary-copy span {
  color: var(--muted);
}

.summary-stat {
  display: grid;
  place-items: center;
  border-left: 1px solid var(--line);
  background: var(--panel-soft);
}

.summary-stat span {
  font-size: 30px;
  font-weight: 850;
}

.summary-stat small {
  color: var(--muted);
}

.tool-strip {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 12px;
  margin-bottom: 18px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 0 12px;
}

.search-box span {
  color: var(--muted);
  font-size: 20px;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 12px 0;
}

.segmented {
  display: flex;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 4px;
}

.segmented button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 8px 11px;
}

.segmented button.is-active {
  background: #e8efe9;
  color: #173a32;
  font-weight: 700;
}

.feed {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.benefit-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  padding: 12px;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.benefit-card:hover {
  transform: translateY(-2px);
  border-color: #cbd6ce;
  box-shadow: 0 12px 34px rgba(32, 43, 39, 0.1);
}

.visual {
  position: relative;
  overflow: hidden;
  min-height: 152px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f8f6;
}

.visual-domain {
  background:
    linear-gradient(90deg, rgba(47, 111, 237, 0.1) 1px, transparent 1px),
    linear-gradient(rgba(47, 111, 237, 0.1) 1px, transparent 1px),
    #fbfcff;
  background-size: 18px 18px;
}

.visual-cloud {
  background:
    linear-gradient(135deg, rgba(22, 138, 103, 0.16), transparent 42%),
    linear-gradient(315deg, rgba(182, 107, 20, 0.14), transparent 48%),
    #f9fbf8;
}

.visual-tool {
  background:
    linear-gradient(135deg, rgba(29, 36, 38, 0.06), transparent 48%),
    #fbfaf5;
}

.visual-coupon {
  background:
    linear-gradient(90deg, rgba(186, 59, 53, 0.09) 1px, transparent 1px),
    #fffafa;
  background-size: 22px 22px;
}

.visual-inner {
  position: absolute;
  inset: 16px;
  display: grid;
  align-content: center;
  gap: 10px;
}

.visual-browser {
  border: 1px solid rgba(31, 52, 46, 0.14);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 10px 26px rgba(31, 52, 46, 0.1);
}

.visual-bar {
  display: flex;
  gap: 5px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.visual-bar i {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: #cfd8d1;
}

.visual-body {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.visual-title {
  max-width: 92%;
  height: 13px;
  border-radius: 99px;
  background: #1f342e;
}

.visual-line {
  height: 9px;
  border-radius: 99px;
  background: #dfe5df;
}

.visual-line.short {
  width: 58%;
}

.visual-badge {
  display: inline-flex;
  width: fit-content;
  border-radius: 99px;
  background: #eaf1ff;
  color: var(--blue);
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 800;
}

.card-body {
  display: grid;
  gap: 10px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.card-head h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.28;
}

.save-button {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: #8a9495;
  font-size: 19px;
}

.save-button.is-saved {
  border-color: #f3d19b;
  background: #fff6e8;
  color: var(--amber);
}

.summary {
  min-height: 44px;
  color: var(--muted);
  line-height: 1.55;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag,
.status {
  display: inline-flex;
  align-items: center;
  border-radius: 99px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 700;
}

.tag {
  background: #eef2ef;
  color: #435052;
}

.status {
  border: 1px solid transparent;
}

.status-可领取 {
  background: #e9f7f1;
  color: var(--green);
}

.status-限时 {
  background: #fff4e5;
  color: var(--amber);
}

.status-已过期 {
  background: #faeeee;
  color: var(--red);
}

.meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.meta-row strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.card-actions .primary-button {
  width: 100%;
}

.empty {
  grid-column: 1 / -1;
  border: 1px dashed #bdc8c0;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.76);
  padding: 32px;
  text-align: center;
  color: var(--muted);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(16, 24, 21, 0.3);
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 30;
  width: min(520px, 100vw);
  height: 100vh;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
  transform: translateX(100%);
  transition: transform 0.22s ease;
}

.drawer.is-open {
  transform: translateX(0);
}

.close-button {
  position: sticky;
  top: 14px;
  left: calc(100% - 54px);
  z-index: 2;
  margin: 14px 14px 0 auto;
}

.detail {
  display: grid;
  gap: 20px;
  padding: 0 24px 28px;
}

.detail h2 {
  margin-bottom: 8px;
  font-size: 28px;
}

.detail .visual {
  min-height: 210px;
}

.detail-section {
  display: grid;
  gap: 10px;
}

.detail-section h3 {
  margin: 0;
  font-size: 15px;
}

.step-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step-list li {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 10px;
  align-items: start;
  color: #3e494b;
}

.step-list span {
  display: grid;
  height: 26px;
  place-items: center;
  border-radius: 99px;
  background: #e8efe9;
  color: #173a32;
  font-size: 12px;
  font-weight: 800;
}

.link-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
}

.link-box code {
  overflow: hidden;
  color: #435052;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-dialog {
  width: min(760px, calc(100vw - 28px));
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  box-shadow: var(--shadow);
}

.admin-dialog::backdrop {
  background: rgba(16, 24, 21, 0.35);
}

.admin-panel {
  padding: 22px;
}

.admin-panel h2 {
  margin-bottom: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 22px 0;
}

.form-grid label {
  display: grid;
  gap: 7px;
  color: #3b4648;
  font-size: 13px;
  font-weight: 700;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 10px 11px;
  outline: 0;
}

.form-grid textarea {
  resize: vertical;
}

.admin-panel footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 50;
  max-width: calc(100vw - 28px);
  border-radius: var(--radius);
  background: #1f342e;
  color: #fff;
  padding: 10px 14px;
  opacity: 0;
  transform: translate(-50%, 18px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 1080px) {
  .feed {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 16px;
  }

  .brand {
    margin-bottom: 14px;
  }

  .side-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .nav-item {
    width: auto;
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .side-metrics {
    display: none;
  }

  .main {
    padding: 18px 14px 34px;
  }

  .topbar {
    align-items: flex-start;
  }

  h1 {
    font-size: 30px;
  }

  .summary-band,
  .tool-strip {
    grid-template-columns: 1fr;
  }

  .summary-stat {
    min-height: 86px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .segmented {
    overflow-x: auto;
  }

  .segmented button {
    flex: 0 0 auto;
  }

  .feed {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .topbar {
    display: grid;
  }

  .top-actions {
    width: 100%;
  }

  .top-actions .primary-button {
    flex: 1;
  }

  .summary-copy {
    padding: 16px;
  }

  .meta-row,
  .card-actions,
  .link-box {
    grid-template-columns: 1fr;
  }

  .drawer {
    width: 100vw;
  }
}
