:root {
  --frame-bg: #0a1323;
  --frame-surface: #111d33;
  --frame-surface-2: #182744;
  --frame-border: rgba(148, 163, 184, 0.18);
  --frame-text: #e5eefb;
  --frame-muted: #95a7c2;
  --frame-accent: #61b6f7;
  --frame-accent-2: #f4c96d;
  --frame-shadow: 0 22px 50px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(97, 182, 247, 0.18), transparent 32%),
    radial-gradient(circle at bottom right, rgba(244, 201, 109, 0.12), transparent 26%),
    var(--frame-bg);
  color: var(--frame-text);
}

body {
  font-family: Inter, system-ui, sans-serif;
}

.tipao-frame-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.tipao-frame-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--frame-border);
  background: rgba(10, 19, 35, 0.92);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 120px;
  max-width: 32vw;
  height: auto;
}

.brand-name {
  font-size: 0.95rem;
  font-weight: 700;
}

.brand-sub {
  color: var(--frame-muted);
  font-size: 0.82rem;
}

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

.topbar-btn,
.merco-btn,
.flipbook-nav,
.flipbook-dot {
  border: 1px solid var(--frame-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--frame-text);
  cursor: pointer;
  transition: 0.18s ease;
}

.topbar-btn,
.merco-btn {
  padding: 10px 14px;
  font: inherit;
}

.topbar-btn:hover,
.merco-btn:hover,
.flipbook-nav:hover {
  background: rgba(97, 182, 247, 0.12);
  border-color: rgba(97, 182, 247, 0.5);
}

.tipao-frame-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 0;
}

.tipao-frame-rail {
  border-right: 1px solid var(--frame-border);
  background: rgba(17, 29, 51, 0.75);
  min-height: 0;
}

.rail-head {
  padding: 18px 18px 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--frame-muted);
}

.rail-items {
  padding: 0 10px 16px;
  overflow: auto;
  height: calc(100vh - 78px);
}

.rail-group-title {
  font-size: 0.74rem;
  color: var(--frame-muted);
  margin: 14px 8px 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.rail-link {
  width: 100%;
  display: block;
  text-align: left;
  padding: 12px 14px;
  margin-bottom: 8px;
  border-radius: 14px;
  border: 1px solid transparent;
  color: inherit;
  text-decoration: none;
  background: transparent;
}

.rail-link.active,
.rail-link:hover {
  background: rgba(97, 182, 247, 0.08);
  border-color: rgba(97, 182, 247, 0.28);
}

.rail-title {
  font-size: 0.92rem;
  font-weight: 600;
}

.rail-meta {
  font-size: 0.76rem;
  color: var(--frame-muted);
  margin-top: 4px;
}

.tipao-frame-main {
  padding: 24px;
  min-width: 0;
}

.frame-publication-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.meta-kicker {
  color: var(--frame-accent);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  margin-bottom: 8px;
}

.meta-title {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1.05;
}

.meta-sub {
  margin-top: 8px;
  color: var(--frame-muted);
}

.direct-asset-link {
  color: var(--frame-accent);
}

.frame-body,
.frame-merco-panel {
  background: rgba(17, 29, 51, 0.9);
  border: 1px solid var(--frame-border);
  border-radius: 24px;
  box-shadow: var(--frame-shadow);
}

.frame-body {
  padding: 24px;
}

.frame-placeholder,
.rail-empty {
  color: var(--frame-muted);
}

.frame-publication {
  color: #0f172a;
  background: #fff;
  border-radius: 22px;
  overflow: hidden;
}

.frame-publication .publication-wrapper {
  display: block;
}

.legacy-frame {
  width: 100%;
  min-height: 72vh;
  border: 0;
  background: #fff;
  border-radius: 16px;
}

.frame-merco-panel {
  margin-top: 18px;
  padding: 18px 20px;
}

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

.merco-kicker {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--frame-accent);
}

.merco-title {
  margin: 6px 0 0;
  font-size: 1.2rem;
}

.merco-pill {
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.8rem;
}

.merco-copy {
  margin-top: 12px;
  color: var(--frame-muted);
  line-height: 1.55;
}

.merco-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.merco-result {
  margin-top: 16px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  line-height: 1.6;
}

.frame-section {
  margin: 0 0 22px;
  padding: 0 0 22px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.frame-section:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.frame-section-label {
  color: #5f6c81;
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.frame-section-title {
  margin: 8px 0 10px;
  font-size: clamp(1.3rem, 2vw, 2rem);
  line-height: 1.1;
}

.frame-section p,
.frame-section li {
  color: #23344f;
  line-height: 1.68;
}

.frame-bullets,
.frame-reqs {
  padding-left: 18px;
}

.frame-reqs strong {
  color: #0f172a;
}

.flipbook-shell {
  background: #fff;
  color: #13233d;
  border-radius: 22px;
  padding: 24px;
}

.flipbook-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.flipbook-counter {
  font-size: 0.78rem;
  color: #5f6c81;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.flipbook-page {
  min-height: 460px;
  padding: 10px 4px;
}

.flipbook-label {
  color: #6c7f95;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.flipbook-title {
  margin: 10px 0 12px;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 0.98;
}

.flipbook-body {
  display: grid;
  gap: 12px;
  max-width: 720px;
  line-height: 1.7;
}

.flipbook-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}

.flipbook-dot {
  width: 10px;
  height: 10px;
  padding: 0;
}

.flipbook-dot.active {
  background: var(--frame-accent);
  border-color: var(--frame-accent);
}

@media (max-width: 980px) {
  .tipao-frame-layout {
    grid-template-columns: 1fr;
  }

  .tipao-frame-rail {
    border-right: 0;
    border-bottom: 1px solid var(--frame-border);
  }

  .rail-items {
    height: auto;
    max-height: 34vh;
  }
}

@media (max-width: 640px) {
  .tipao-frame-topbar,
  .tipao-frame-main {
    padding: 16px;
  }

  .frame-publication-meta,
  .flipbook-toolbar,
  .merco-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .frame-body,
  .frame-merco-panel {
    padding: 16px;
  }
}
