:root {
  color-scheme: light;
  --bg: linear-gradient(180deg, #f3f4f8 0%, #e9edf5 100%);
  --bg-wechat: #ededed;
  --card: #ffffff;
  --card-soft: #f8fafc;
  --border: #dfe3ea;
  --border-soft: #eef1f5;
  --text: #1f2937;
  --muted: #7a8598;
  --green: #07c160;
  --green-dark: #06ae57;
  --danger: #dc2626;
  --wechat-title: #111827;
  --wechat-subtitle: #8a94a6;
  --shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 6px 18px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
}

body.share-body {
  background: var(--bg-wechat);
}

a {
  color: #2563eb;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

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

.muted {
  color: var(--muted);
}

.flash-stack {
  position: sticky;
  top: 16px;
  z-index: 20;
  display: grid;
  gap: 8px;
  width: min(1040px, calc(100% - 24px));
  margin: 16px auto 0;
}

.flash {
  padding: 12px 14px;
  border-radius: 14px;
  background: #ecfeff;
  border: 1px solid #a5f3fc;
  box-shadow: var(--shadow-soft);
}

.flash-error {
  background: #fef2f2;
  border-color: #fecaca;
}

.flash-success {
  background: #ecfdf5;
  border-color: #bbf7d0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: white;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.btn-primary {
  background: linear-gradient(180deg, var(--green) 0%, var(--green-dark) 100%);
  border-color: var(--green);
  color: white;
}

.btn-danger {
  background: white;
  border-color: #fecaca;
  color: var(--danger);
}

.btn-large {
  min-height: 46px;
  font-size: 15px;
}

.admin-body,
.share-body {
  padding: 20px 12px 48px;
}

.auth-shell,
.admin-shell,
.share-shell,
.preview-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.wechat-phone {
  width: min(430px, 100%);
  margin: 0 auto;
}

.share-desktop-shell {
  width: min(760px, 100%);
}

.share-desktop-shell .wechat-phone {
  width: 100%;
}

.auth-card,
.admin-card,
.wechat-card,
.preview-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.auth-card {
  max-width: 420px;
  margin: 60px auto 0;
  padding: 28px;
}

.stack-form {
  display: grid;
  gap: 20px;
}

.stack-form label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

.stack-form input,
.stack-form textarea,
.stack-form select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  font: inherit;
  background: white;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.stack-form input:focus,
.stack-form textarea:focus,
.stack-form select:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.12);
}

.admin-hint {
  padding: 16px 18px;
  border-radius: 18px;
  background: #f8fbff;
  border: 1px solid #dbeafe;
}

.admin-hint strong {
  display: block;
  margin-bottom: 8px;
}

.admin-hint ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.admin-header,
.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.admin-header h1,
.preview-header h1,
.auth-card h1 {
  margin-bottom: 6px;
  font-size: 28px;
}

.admin-actions,
.actions,
.fallback-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-card {
  padding: 24px;
  margin-bottom: 20px;
}

.form-section {
  display: grid;
  gap: 16px;
  padding: 20px;
  border-radius: 22px;
  background: var(--card-soft);
  border: 1px solid var(--border-soft);
}

.section-heading {
  display: grid;
  gap: 4px;
}

.section-heading h2 {
  margin: 0;
  font-size: 18px;
}

.section-heading p {
  margin: 0;
  font-size: 13px;
}

.section-heading-inline {
  margin-bottom: 16px;
}

.upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.upload-panel {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  border: 1px dashed #cbd5e1;
  background: white;
}

.upload-panel-wide {
  gap: 12px;
}

.upload-panel-inline {
  margin-top: 4px;
}

.upload-panel-title {
  font-size: 15px;
  font-weight: 700;
}

.upload-panel-hint {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.file-selection-summary {
  font-size: 12px;
  color: #475569;
}

.selection-summary-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 16px;
  border-radius: 18px;
  background: white;
  border: 1px solid var(--border);
}

.selection-summary-board strong {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}

.selection-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.selection-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selection-pill-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selection-pill-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(67, 56, 202, 0.12);
  color: #4338ca;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}

.order-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.item-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.toolbar-help {
  font-size: 13px;
}

.visually-hidden-block {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.drag-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 12px;
  font-weight: 700;
}

.content-order-list {
  display: grid;
  gap: 10px;
}

.unified-item-list {
  gap: 14px;
}

.content-order-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border-radius: 18px;
  background: white;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.content-order-item.is-dragging {
  opacity: 0.66;
}

.content-order-item.drag-over {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.16);
}

.content-order-item.focus-flash {
  animation: focusFlash 1.2s ease;
}

.content-order-handle {
  color: #94a3b8;
  font-size: 18px;
  cursor: grab;
  user-select: none;
  padding-top: 8px;
}

.content-order-body {
  min-width: 0;
}

.content-order-header,
.content-order-meta {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.content-order-header strong,
.content-order-meta strong {
  font-size: 15px;
}

.content-order-header span,
.content-order-meta span {
  color: var(--muted);
  font-size: 12px;
}

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

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

.text-block-input {
  min-height: 120px;
  resize: vertical;
}

.media-block-body {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

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

.content-order-file-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  color: white;
  font-size: 11px;
  font-weight: 800;
}

.content-order-kind {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.content-order-kind.kind-text {
  background: #ede9fe;
  color: #6d28d9;
}

.content-order-kind.kind-image {
  background: #dcfce7;
  color: #166534;
}

.content-order-kind.kind-document {
  background: #dbeafe;
  color: #1d4ed8;
}

.content-order-kind.kind-catalog {
  background: #fef3c7;
  color: #b45309;
}

.content-order-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.order-action-btn {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: white;
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
}

.order-action-btn-danger {
  border-color: #fecaca;
  color: #b91c1c;
}

.share-link-line {
  overflow-wrap: anywhere;
}

.editor-layout {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(360px, 430px);
  gap: 20px;
  align-items: start;
  margin-bottom: 20px;
}

.editor-form-card,
.editor-preview-card {
  margin-bottom: 0;
}

.editor-preview-card {
  position: sticky;
  top: 20px;
  padding: 16px;
  background: linear-gradient(180deg, #fbfcfe 0%, #f6f8fb 100%);
}

.preview-pane-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.preview-pane-header h2 {
  margin: 0;
  font-size: 16px;
}

.preview-phone,
.preview-phone-shell,
.share-phone-shell {
  width: 100%;
}

.preview-flow {
  display: grid;
  gap: 10px;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 14px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.table th {
  font-size: 13px;
  color: #475569;
}

.asset-list,
.document-list,
.file-list,
.wechat-file-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.asset-item,
.document-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.asset-item-main {
  min-width: 0;
  flex: 1;
}

.asset-item-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.asset-order-index {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 12px;
  font-weight: 700;
}

.asset-order-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  margin-left: 8px;
}

.badge-ready {
  background: #dcfce7;
  color: #166534;
}

.wechat-card {
  max-width: 430px;
  margin: 0 auto;
  padding: 12px;
  background: #f5f5f5;
  border-radius: 24px;
  border-color: #e5e7eb;
  box-shadow: none;
}

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

.share-card-no-topbar {
  padding-top: 18px;
}

.wx-window {
  overflow: hidden;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #dddddd;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.06);
}

.wx-chat-page {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #e8e8e8;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.wx-page-header {
  padding: 14px 26px 16px;
  border-bottom: 1px solid #ededed;
  background: #ffffff;
}

.wx-page-title {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  color: #2f3136;
}

.wx-window-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 0 26px;
  border-bottom: 1px solid #ececec;
  background: #ffffff;
}

.wx-window-title {
  font-size: 17px;
  color: #303133;
  font-weight: 500;
}

.wx-window-controls {
  display: flex;
  align-items: center;
  gap: 18px;
  color: #656b78;
  font-size: 18px;
}

.wx-chat-list {
  padding: 10px 26px 28px;
  background: #ffffff;
}

.wx-chat-item {
  padding: 10px 0 14px;
}

.wx-chat-item-separated {
  border-top: 1px solid #f0f0f0;
}

.wx-chat-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.wx-chat-sender {
  color: #b2b5bb;
  font-size: 13px;
  font-weight: 600;
}

.wx-chat-time {
  color: #b2b5bb;
  font-size: 13px;
}

.wx-chat-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.wx-chat-avatar {
  width: 44px;
  height: 44px;
}

.wx-chat-avatar img,
.wx-chat-avatar .avatar-fallback {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.wx-chat-content {
  min-width: 0;
}

.wx-file-bubble,
.wx-image-bubble {
  display: block;
  width: min(296px, 100%);
}

.wx-file-bubble {
  color: inherit;
}

.wx-file-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px;
  gap: 14px;
  align-items: center;
  padding: 14px 14px 12px;
  border-radius: 10px 10px 0 0;
  background: #f3f3f5;
}

.wx-file-main {
  min-width: 0;
}

.wx-file-icon-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  min-width: 56px;
}

.wx-file-icon-image {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.wx-file-name {
  font-size: 16px;
  line-height: 1.42;
  color: #22252b;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
}

.wx-file-size {
  margin-top: 6px;
  color: #9b9fa8;
  font-size: 13px;
}

.wx-file-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid #e6e7ea;
  border-radius: 0 0 10px 10px;
  background: #f3f3f5;
  color: #a5a9b1;
  font-size: 12px;
}

.wx-file-footer-icon {
  width: 15px;
  height: 15px;
  object-fit: contain;
}

.wx-image-bubble img {
  width: 100%;
  border-radius: 10px;
  background: #f4f6f8;
}

.wx-catalog-bubble {
  width: min(260px, 100%);
}

.wx-text-message {
  width: min(560px, 100%);
  color: #2b2d31;
  font-size: 16px;
  line-height: 1.5;
}

.wx-text-message p {
  margin: 0 0 6px;
}

.wechat-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-bottom: 8px;
  border-bottom: 1px solid #d9d9d9;
  color: var(--wechat-title);
  background: var(--bg-wechat);
}

.wechat-topbar-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.wechat-back {
  position: absolute;
  left: 6px;
  color: #2a2a2a;
  font-size: 13px;
  text-decoration: none;
}

.share-hero {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 10px 8px;
}

.share-hero-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.share-hero h1,
.wechat-header h1,
.preview-header h1 {
  margin: 0;
  font-size: 20px;
  color: var(--wechat-title);
  font-weight: 700;
}

.avatar-wrap,
.avatar-wrap img,
.avatar-fallback {
  width: 52px;
  height: 52px;
  border-radius: 16px;
}

.share-avatar-wrap {
  flex-shrink: 0;
}

.avatar-wrap img,
.catalog-image,
.image-card img,
.preview-image {
  object-fit: cover;
}

.avatar-fallback {
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #d9f7e7 0%, #c2e8d0 100%);
  color: #27714a;
  font-weight: 700;
  font-size: 18px;
}

.wechat-header-subtitle {
  margin: 0;
  color: var(--wechat-subtitle);
  font-size: 12px;
  letter-spacing: 0.2px;
}

.wechat-section {
  padding: 14px;
  border-radius: 18px;
  background: white;
}

.wechat-section-soft {
  border: 1px solid var(--border-soft);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
}

.wechat-section h2 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: #334155;
}

.wechat-section p {
  margin: 0 0 8px;
  line-height: 1.7;
  font-size: 14px;
}

.catalog-image {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--border-soft);
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
}

.image-grid-tight {
  gap: 12px;
}

.image-card {
  display: grid;
  gap: 6px;
  color: inherit;
}

.image-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
}

.image-card span {
  font-size: 12px;
  color: #475569;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wechat-file-list {
  display: grid;
  gap: 10px;
}

.wechat-file-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
  background: #ffffff;
  color: inherit;
  border: 1px solid #edf0f5;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
}

.preview-file-row {
  pointer-events: none;
}

.wechat-file-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: white;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.file-ext-pdf {
  background: linear-gradient(180deg, #ff6b6b 0%, #e03131 100%);
}

.file-ext-doc {
  background: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%);
}

.file-ext-ppt {
  background: linear-gradient(180deg, #fb923c 0%, #ea580c 100%);
}

.file-ext-file {
  background: linear-gradient(180deg, #94a3b8 0%, #64748b 100%);
}

.wechat-file-meta {
  min-width: 0;
  display: grid;
  gap: 6px;
  align-content: start;
}

.wechat-file-title {
  display: block;
  min-width: 0;
  font-size: 15px;
  color: #111827;
  font-weight: 700;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.wechat-file-subline {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #94a3b8;
}

.wechat-file-arrow {
  color: #94a3b8;
  font-size: 18px;
  font-weight: 700;
}

.preview-card {
  padding: 12px;
  border-radius: 22px;
  background: #f5f5f5;
  box-shadow: none;
}

.preview-card-embedded {
  padding: 0;
  overflow: hidden;
}

.preview-image,
.document-frame {
  width: 100%;
  border: 0;
  background: #0f172a;
}

.preview-image {
  max-height: 80vh;
  border-radius: 18px;
}

.document-frame {
  min-height: 74vh;
}

.document-frame-full {
  display: block;
  min-height: calc(100vh - 132px);
  border-radius: 0 0 22px 22px;
}

.document-reader {
  min-height: calc(100vh - 132px);
  padding: 16px 12px 18px;
  background: #e7ebf0;
  overflow-y: auto;
}

.document-reader-status {
  padding: 18px 16px;
  margin: 0 4px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  color: #475569;
  text-align: center;
  font-size: 14px;
  box-shadow: var(--shadow-soft);
}

.document-reader-status.is-error {
  color: #b91c1c;
  background: #fff1f2;
  border: 1px solid #fecdd3;
}

.document-reader-pages {
  display: grid;
  gap: 14px;
  justify-items: center;
}

.document-reader-page {
  width: 100%;
  display: grid;
  gap: 8px;
  justify-items: center;
}

.document-reader-page-label {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
}

.document-reader-canvas {
  max-width: 100%;
  height: auto;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.document-preview-fullscreen {
  padding: 0;
  background: #ffffff;
}

.preview-shell-document-fullscreen {
  width: 100%;
  max-width: none;
  margin: 0;
}

.document-preview-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 16px 10px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid #e5e7eb;
}

.document-preview-title {
  margin: 0;
  max-width: min(960px, 100%);
  font-size: 18px;
  line-height: 1.45;
  font-weight: 700;
  color: #111827;
  text-align: center;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.document-preview-fullscreen .document-frame,
.document-preview-fullscreen .document-frame-full {
  min-height: calc(100vh - 62px);
  height: calc(100vh - 62px);
  border-radius: 0;
  background: #ffffff;
}

.document-preview-fullscreen .office-frame-shell {
  position: relative;
  width: 100%;
  min-height: calc(100vh - 62px);
  overflow: hidden;
  background: #ffffff;
}

.document-preview-fullscreen .office-frame {
  display: block;
  width: 100%;
}

@media (max-width: 820px) {
  .document-preview-fullscreen .office-frame-shell-word {
    height: calc(100vh - 62px);
    min-height: calc(100vh - 62px);
  }

  .document-preview-fullscreen .office-frame-word {
    width: 150%;
    height: calc((100vh - 62px) / 0.66);
    min-height: calc((100vh - 62px) / 0.66);
    transform: scale(0.66);
    transform-origin: top left;
  }
}

.document-preview-fullscreen .document-reader {
  min-height: 100vh;
  height: 100vh;
  padding: 0;
  background: #ffffff;
}

.document-preview-fullscreen .document-reader-pages {
  gap: 0;
}

.document-preview-fullscreen .document-reader-page {
  gap: 0;
}

.document-preview-fullscreen .document-reader-page-label {
  display: none;
}

.document-preview-fullscreen .document-reader-canvas {
  border-radius: 0;
  box-shadow: none;
}

.preview-note,
.preview-empty {
  display: grid;
  gap: 12px;
  padding: 18px;
  margin: 12px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid var(--border-soft);
}

.preview-note[hidden],
.preview-empty[hidden] {
  display: none !important;
}

.preview-empty h2,
.preview-note strong {
  margin: 0;
}

.preview-note p {
  margin: 0;
}

.preview-empty-compact {
  margin: 16px;
}

.code-block {
  display: block;
  padding: 12px;
  border-radius: 12px;
  background: #111827;
  color: #f9fafb;
  overflow-wrap: anywhere;
}

@keyframes focusFlash {
  0% {
    box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.5);
    border-color: #38bdf8;
  }
  100% {
    box-shadow: var(--shadow-soft);
    border-color: var(--border);
  }
}

@media (max-width: 900px) {
  .editor-layout {
    grid-template-columns: 1fr;
  }

  .editor-preview-card {
    position: static;
  }

  .share-desktop-shell {
    width: 100%;
  }

  .wx-chat-page {
    border-radius: 0;
    border: 0;
    box-shadow: none;
  }
}

@media (max-width: 720px) {
  .share-body {
    padding: 0 0 32px;
  }

  .wx-page-header {
    padding: 14px 16px 14px;
  }

  .wx-page-title {
    font-size: 16px;
  }

  .wx-chat-list {
    padding: 8px 12px 22px;
  }

  .wx-chat-row {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 10px;
  }

  .wx-chat-avatar {
    width: 40px;
    height: 40px;
  }

  .wx-chat-avatar img,
  .wx-chat-avatar .avatar-fallback {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .wx-file-bubble,
  .wx-image-bubble {
    width: min(280px, 100%);
  }

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

  .selection-summary-board {
    grid-template-columns: 1fr;
  }

  .content-order-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .content-order-kind,
  .content-order-actions {
    grid-column: 2;
    justify-self: start;
  }

  .media-block-body {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .content-order-row-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-header,
  .preview-header,
  .asset-item,
  .document-list li {
    flex-direction: column;
    align-items: stretch;
  }

  .asset-item-controls,
  .asset-order-actions {
    align-items: stretch;
    justify-content: flex-start;
  }

  .table thead {
    display: none;
  }

  .table,
  .table tbody,
  .table tr,
  .table td {
    display: block;
    width: 100%;
  }

  .table tr {
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
  }

  .table td {
    border: 0;
    padding: 6px 0;
  }

  .wechat-file-row {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 10px;
  }

  .wechat-file-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    font-size: 11px;
  }

  .document-frame {
    min-height: 68vh;
  }

  .document-frame-full {
    min-height: calc(100vh - 120px);
  }
}

/* 2026-04-18 admin/share improvements */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.compact-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.user-admin-card,
.showcase-list-card {
  margin-top: 18px;
}

.admin-header-dashboard {
  margin-bottom: 28px;
  padding: 26px 28px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(245, 248, 253, 0.92) 58%, rgba(238, 250, 243, 0.92) 100%);
  box-shadow:
    0 18px 42px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.admin-eyebrow {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1d8f57;
}

.dashboard-overview-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

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

.account-profile-card,
.dashboard-metrics-panel {
  margin-bottom: 0;
}

.dashboard-summary-card {
  display: grid;
  gap: 18px;
}

.account-profile-card {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(7, 193, 96, 0.16), transparent 32%),
    radial-gradient(circle at bottom right, rgba(37, 99, 235, 0.1), transparent 34%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 250, 255, 0.96) 58%, rgba(247, 252, 249, 0.98) 100%);
}

.account-profile-card::after {
  content: "";
  position: absolute;
  inset: auto -40px -56px auto;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: rgba(7, 193, 96, 0.08);
  filter: blur(10px);
  pointer-events: none;
}

.account-profile-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.dashboard-role-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(7, 193, 96, 0.12);
  color: #137b4a;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.account-profile-body {
  display: grid;
  gap: 18px;
}

.account-profile-media {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.account-profile-copy {
  display: grid;
  gap: 6px;
}

.account-profile-copy strong {
  font-size: 30px;
  line-height: 1;
}

.account-profile-copy .muted {
  font-size: 15px;
}

.account-profile-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dashboard-mini-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(199, 214, 232, 0.84);
  color: #516074;
  font-size: 12px;
  font-weight: 700;
}

.account-profile-avatar,
.subaccount-avatar {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  object-fit: cover;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: linear-gradient(180deg, #ffffff 0%, #eff4fb 100%);
  box-shadow: var(--shadow-soft);
}

.subaccount-avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
}

.default-avatar-form {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid rgba(29, 143, 87, 0.14);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(244, 251, 247, 0.95) 100%),
    radial-gradient(circle at top right, rgba(7, 193, 96, 0.12), transparent 38%);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.05);
}

.default-avatar-form label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

.dashboard-metrics-panel {
  padding: 22px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 250, 255, 0.95) 60%, rgba(247, 252, 249, 0.98) 100%);
}

.dashboard-metric-card {
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: 168px;
  padding: 20px 18px;
  border-radius: 24px;
  border: 1px solid rgba(221, 228, 238, 0.92);
  box-shadow:
    0 16px 30px rgba(15, 23, 42, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.dashboard-metric-showcase {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(244, 249, 255, 0.98) 100%),
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.14), transparent 42%);
}

.dashboard-metric-document {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 248, 255, 0.98) 100%),
    radial-gradient(circle at top left, rgba(99, 102, 241, 0.12), transparent 42%);
}

.dashboard-metric-image {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 252, 248, 0.98) 100%),
    radial-gradient(circle at top left, rgba(22, 163, 74, 0.12), transparent 42%);
}

.dashboard-metric-label {
  font-size: 13px;
  font-weight: 700;
  color: #4b5563;
}

.dashboard-metric-value {
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1;
  letter-spacing: 0;
}

.subaccount-avatar-cell {
  width: 64px;
}

.showcase-table-wrap {
  overflow-x: auto;
}

.showcase-title-cell {
  display: grid;
  gap: 4px;
  min-width: 180px;
}

.account-avatar-note {
  border-style: solid;
  border-color: rgba(29, 143, 87, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 252, 248, 0.98) 100%),
    radial-gradient(circle at top right, rgba(7, 193, 96, 0.08), transparent 40%);
}

.subaccount-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(180px, 220px);
  gap: 14px;
  margin: 18px 0 22px;
  padding: 18px;
  border: 1px solid rgba(7, 193, 96, 0.12);
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(7, 193, 96, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(249, 252, 250, 0.98) 100%);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.04);
}

.subaccount-form label {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid rgba(203, 213, 225, 0.78);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.subaccount-form label:nth-child(4) {
  grid-column: 1 / span 3;
}

.subaccount-form input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid #d7deea;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: inset 0 1px 2px rgba(148, 163, 184, 0.08);
}

.subaccount-form input::placeholder {
  color: #94a3b8;
}

.subaccount-form input:hover {
  border-color: #b7c4d8;
}

.subaccount-form input:focus {
  outline: none;
  border-color: rgba(7, 193, 96, 0.72);
  box-shadow:
    0 0 0 4px rgba(7, 193, 96, 0.12),
    inset 0 1px 2px rgba(148, 163, 184, 0.08);
}

.subaccount-form input[type="file"] {
  overflow: hidden;
  padding: 9px 12px;
  color: #64748b;
}

.subaccount-form input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 700;
  cursor: pointer;
}

.subaccount-form .btn {
  grid-column: 4;
  grid-row: 1 / span 2;
  align-self: stretch;
  min-height: auto;
  padding-inline: 18px;
  border-radius: 22px;
  box-shadow: 0 16px 30px rgba(7, 193, 96, 0.2);
}

.subaccount-form .btn:hover {
  box-shadow: 0 16px 28px rgba(7, 193, 96, 0.22);
}

.subaccount-table-wrap,
.showcase-table {
  overflow-x: auto;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.status-pill-active {
  background: rgba(53, 180, 109, 0.14);
  color: #1a8f54;
}

.status-pill-muted {
  background: rgba(148, 163, 184, 0.16);
  color: #5b6474;
}

.dashboard-bulk-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.settings-layout {
  display: grid;
  gap: 20px;
}

.settings-card {
  margin-bottom: 0;
}

.preview-settings-form {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.preview-settings-form label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.preview-settings-form select {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.settings-note {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(29, 143, 87, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 252, 248, 0.98) 100%),
    radial-gradient(circle at top right, rgba(7, 193, 96, 0.08), transparent 40%);
}

.settings-note strong,
.settings-note p {
  margin: 0;
}

.table-check-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.col-check {
  width: 54px;
}

.share-link-cell {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
  max-width: 520px;
}

.share-link-details {
  display: grid;
  gap: 8px;
  min-width: 0;
  flex: 1 1 260px;
}

.share-link-details a {
  overflow-wrap: anywhere;
}

.share-qr-link {
  display: grid;
  gap: 8px;
  justify-items: center;
  min-width: 116px;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid rgba(223, 227, 234, 0.88);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: var(--shadow-soft);
  color: var(--muted);
}

.share-qr-link:hover {
  color: var(--text);
}

.share-qr-code {
  width: 96px;
  height: 96px;
  border-radius: 12px;
  background: #fff;
}

.share-qr-caption {
  font-size: 12px;
  font-weight: 600;
}

.btn-small {
  padding: 6px 12px;
  font-size: 13px;
}

.copy-feedback.is-success,
.drop-zone-feedback.is-success {
  color: #1a8f54;
}

.copy-feedback.is-warning,
.drop-zone-feedback.is-warning {
  color: #b45309;
}

.share-link-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.legacy-catalog-btn[hidden],
.legacy-catalog-tip[hidden] {
  display: none !important;
}

.editor-drop-zone {
  margin: 16px 0;
  padding: 18px;
  border: 1px dashed rgba(53, 180, 109, 0.45);
  border-radius: 18px;
  background: rgba(240, 253, 244, 0.86);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.editor-drop-zone.is-dragover {
  border-color: #1a8f54;
  background: rgba(220, 252, 231, 0.96);
  transform: translateY(-1px);
}

.preview-note-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.preview-action-stack {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .compact-heading,
  .share-link-box,
  .preview-note-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-overview-grid,
  .dashboard-metrics-grid {
    grid-template-columns: 1fr;
  }

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

  .subaccount-form label:nth-child(4),
  .subaccount-form .btn {
    grid-column: auto;
    grid-row: auto;
  }

  .subaccount-form .btn {
    min-height: 54px;
  }

  .account-profile-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .account-profile-media {
    align-items: flex-start;
  }

  .share-link-cell {
    max-width: none;
  }
}
