/* 共享外壳：V3 设计体系落地（极简现代 Minimalist Modern）
   真实页面以 platform-tokens.css / platform-components.css / platform-design.css 为准。
   本文件只负责 platform-shell.js 注入的外壳元素（用户信息、菜单、加载骨架）。 */

.platform-user {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 18px; padding: 10px 12px;
  border: 1px solid var(--border-default, #E2E8F0); border-radius: var(--radius-sm, 10px);
  background: var(--bg-card, #FFFFFF); color: var(--text-muted, #64748B); font-size: 12px;
}
.platform-user strong { display: block; max-width: 125px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-primary, #0F172A); font-size: 12px; }
.platform-user a, .platform-user button { border: 0; background: transparent; color: var(--accent, #0052FF); cursor: pointer; font-size: 11px; text-decoration: none; white-space: nowrap; }
.platform-user button { color: var(--status-error, #EF4444); }
.platform-user span span { display: block; }

.rail .menu a, .rail .menu button {
  display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: center;
  width: 100%; padding: 10px 12px; border: 1px solid transparent; border-radius: var(--radius-sm, 10px);
  background: transparent; color: var(--text-body, #0F172A); text-decoration: none; text-align: left;
  font: inherit; cursor: pointer; transition: all var(--dur-2, 200ms) var(--ease-out, cubic-bezier(.16,1,.3,1));
}
.rail .menu a:hover, .rail .menu button:hover { background: var(--bg-muted, #F1F5F9); }
.rail .menu a.active, .rail .menu button.active {
  border-color: rgba(0,82,255,.28); background: var(--bg-soft-accent, rgba(0,82,255,.08)); color: var(--accent, #0052FF); font-weight: 600;
}
.rail .menu a .icon, .rail .menu button .icon {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-sm, 10px);
  background: var(--bg-muted, #F1F5F9); color: var(--text-muted, #64748B); font-weight: 600;
}
.rail .menu a.active .icon, .rail .menu button.active .icon {
  background: var(--gradient, linear-gradient(135deg,#0052FF,#4D7CFF)); color: #fff; box-shadow: var(--shadow-accent, 0 4px 14px rgba(0,82,255,.25));
}
.rail .menu small { display: block; color: var(--text-muted, #64748B); font-weight: 400; }

.loading-skeleton {
  min-height: 42px !important; color: transparent !important; border-color: var(--border-default, #E2E8F0) !important;
  background: linear-gradient(100deg, var(--bg-card, #fff) 25%, var(--bg-muted, #F1F5F9) 37%, var(--bg-card, #fff) 63%) !important;
  background-size: 400% 100% !important; animation: loading-shimmer 1.35s ease-in-out infinite !important;
  overflow: hidden !important;
}
@keyframes loading-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.loading-skeleton * { visibility: hidden !important; }
.loading-skeleton[aria-busy="true"] { cursor: progress; }

.platform-shell-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.platform-community-trigger {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 8px 12px;
  border: 1px solid var(--border-default, #E2E8F0); border-radius: var(--radius-sm, 10px);
  background: var(--bg-card, #FFFFFF); color: var(--text-body, #334155); box-shadow: none;
  font: inherit; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer;
  transition: border-color var(--dur-1, 150ms) ease, color var(--dur-1, 150ms) ease, background var(--dur-1, 150ms) ease;
}
.platform-community-trigger svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.platform-community-trigger:hover { border-color: var(--accent, #0052FF); background: var(--bg-soft-accent, #EFF6FF); color: var(--accent, #0052FF); }
.platform-community-trigger:focus-visible, .platform-community-close:focus-visible, .platform-community-confirm:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent, #0052FF) 24%, transparent); outline-offset: 2px;
}
.platform-community-trigger.is-floating { position: fixed; z-index: 900; top: 18px; right: 22px; }
body.platform-community-open { overflow: hidden; }
.platform-community-backdrop[hidden] { display: none !important; }
.platform-community-backdrop {
  position: fixed; z-index: 1200; inset: 0; display: grid; place-items: center; padding: 24px;
  background: rgba(15, 23, 42, .54); overscroll-behavior: contain;
}
.platform-community-dialog {
  width: min(520px, 100%); max-height: min(760px, calc(100vh - 48px)); overflow: auto;
  border: 1px solid var(--border-default, #E2E8F0); border-radius: var(--radius-lg, 18px);
  background: var(--bg-card, #FFFFFF); color: var(--text-primary, #0F172A);
  box-shadow: 0 28px 72px rgba(15, 23, 42, .24);
}
.platform-community-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 25px 26px 21px; border-bottom: 1px solid var(--border-default, #E2E8F0); }
.platform-community-dialog-head h2 { margin: 4px 0 0; color: var(--text-primary, #0F172A); font-size: clamp(21px, 3vw, 26px); line-height: 1.25; }
.platform-community-dialog-head p:not(.platform-community-eyebrow) { max-width: 390px; margin: 9px 0 0; color: var(--text-muted, #64748B); font-size: 14px; line-height: 1.65; }
.platform-community-eyebrow { margin: 0; color: var(--accent, #0052FF); font-family: var(--font-mono, ui-monospace, monospace); font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.platform-community-close { display: grid; flex: none; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid transparent; border-radius: 50%; background: transparent; color: var(--text-muted, #64748B); cursor: pointer; }
.platform-community-close:hover { border-color: var(--border-default, #E2E8F0); background: var(--bg-muted, #F1F5F9); color: var(--text-primary, #0F172A); }
.platform-community-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.8; }
.platform-community-content { padding: 22px 26px 20px; text-align: center; }
.platform-community-qr { display: grid; place-items: center; width: min(310px, 100%); aspect-ratio: 1; margin: 0 auto; overflow: hidden; border: 1px solid var(--border-default, #E2E8F0); border-radius: var(--radius-md, 14px); background: var(--bg-subtle, #F8FAFC); }
.platform-community-qr img { display: block; width: 100%; height: 100%; padding: 14px; object-fit: contain; background: #FFFFFF; }
.platform-community-placeholder { display: grid; place-items: center; gap: 7px; width: calc(100% - 32px); height: calc(100% - 32px); padding: 24px; border: 1px dashed var(--border-strong, #CBD5E1); border-radius: var(--radius-sm, 10px); color: var(--text-body, #334155); }
.platform-community-placeholder::before { display: block; width: 44px; height: 44px; border: 2px solid var(--border-strong, #CBD5E1); border-radius: 10px; content: ""; }
.platform-community-placeholder span { font-size: 15px; font-weight: 700; }
.platform-community-placeholder small { color: var(--text-muted, #64748B); font-size: 12px; }
.platform-community-group { margin: 13px 0 0; color: var(--text-body, #334155); font-size: 13px; font-weight: 600; }
.platform-community-expiry { margin: 5px 0 0; color: var(--text-muted, #64748B); font-size: 12px; }
.platform-community-dialog-foot { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 26px; border-top: 1px solid var(--border-default, #E2E8F0); }
.platform-community-dialog-foot span { color: var(--text-muted, #64748B); font-size: 12px; line-height: 1.55; }
.platform-community-confirm { flex: none; min-height: 38px; padding: 8px 18px; border: 1px solid var(--accent, #0052FF); border-radius: var(--radius-sm, 10px); background: var(--accent, #0052FF); color: #FFFFFF; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.platform-community-confirm:hover { background: var(--accent-hover, #0047E0); }

@media (max-width: 760px) {
  .platform-community-trigger { min-width: 40px; padding-inline: 10px; }
  .platform-community-label { font-size: 0; }
  .platform-community-label::after { font-size: 12px; content: "交流"; }
  .platform-community-backdrop { align-items: end; padding: 0; }
  .platform-community-dialog { width: 100%; max-height: min(88vh, 720px); border-right: 0; border-bottom: 0; border-left: 0; border-radius: 18px 18px 0 0; }
  .platform-community-dialog-head { padding: 20px 18px 17px; }
  .platform-community-content { padding: 18px; }
  .platform-community-qr { width: min(280px, 78vw); }
  .platform-community-dialog-foot { align-items: stretch; flex-direction: column; padding: 15px 18px calc(15px + env(safe-area-inset-bottom)); }
  .platform-community-dialog-foot span { text-align: center; }
  .platform-community-confirm { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
