/* 本域直播 · 企业主页（手机 App 形态，不包含平台公域样式） */
:root {
  --org-bg: #f4f6f8;
  --org-surface: #ffffff;
  --org-ink: #101828;
  --org-ink-2: #5b6779;
  --org-ink-3: #8b96a8;
  --org-line: #e6e9ef;
  --org-accent: #0f766e;
  --org-accent-soft: #e6f4f1;
  --org-warm: #c2410c;
  --org-danger: #dc2626;
  --org-radius: 18px;
  --org-tabbar-h: 58px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
}

body.org-app {
  min-height: 100vh;
  background: #e9edf2;
  color: var(--org-ink);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.org-shell {
  position: relative;
  width: 100%;
  max-width: 680px;
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: calc(var(--org-tabbar-h) + env(safe-area-inset-bottom, 0px) + 18px);
  background: var(--org-bg);
}

.org-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 14px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(230, 233, 239, 0.7);
  backdrop-filter: blur(12px);
}

.org-identity {
  display: flex;
  flex: 1;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.org-logo {
  display: grid;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--org-line);
  border-radius: 15px;
  color: var(--org-accent);
  background: #fff;
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.06);
  font-size: 17px;
  font-weight: 700;
}

.org-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.org-identity-text {
  min-width: 0;
}

.org-identity-text h1 {
  margin: 0 0 3px;
  overflow: hidden;
  color: var(--org-ink);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.org-identity-text p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--org-ink-2);
  font-size: 12px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.org-share {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--org-line);
  border-radius: 50%;
  color: var(--org-ink-2);
  background: #fff;
  cursor: pointer;
}

.org-share:active {
  background: #f2f5f8;
}

.org-main {
  padding: 10px 12px 0;
}

.org-view {
  animation: org-fade-in 0.18s ease both;
}

@keyframes org-fade-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.org-section {
  margin-bottom: 12px;
  padding: 16px 14px;
  border-radius: var(--org-radius);
  background: var(--org-surface);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.org-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.org-section-head h2 {
  margin: 0;
  color: var(--org-ink);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.org-section-head > span {
  color: var(--org-ink-3);
  font-size: 12px;
}

/* 直播间：横向滑动 */
.org-room-track {
  display: flex;
  gap: 12px;
  margin: 0 -2px;
  padding: 2px 2px 4px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.org-room-track::-webkit-scrollbar {
  display: none;
}

.org-room-card {
  position: relative;
  display: block;
  flex: 0 0 72%;
  max-width: 252px;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 16px;
  background: #dfe5ec;
  color: #fff;
  text-decoration: none;
  scroll-snap-align: start;
}

.org-room-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.org-room-card::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 14, 24, 0.02) 35%, rgba(8, 14, 24, 0.76) 100%);
  content: "";
  pointer-events: none;
}

.org-room-fallback {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: var(--org-accent);
  background: linear-gradient(145deg, #e6f4f1, #d8e9e5);
  font-size: 30px;
  font-weight: 700;
}

.org-room-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(16, 24, 40, 0.56);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  backdrop-filter: blur(4px);
}

.org-room-badge.is-live {
  background: #e11d48;
}

.org-room-foot {
  position: absolute;
  right: 12px;
  bottom: 12px;
  left: 12px;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.org-room-title {
  display: -webkit-box;
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.org-room-price {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  backdrop-filter: blur(4px);
}

/* 课程列表 */
.org-course-list {
  display: flex;
  flex-direction: column;
}

.org-course-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--org-line);
  text-decoration: none;
}

.org-course-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.org-course-item:last-child {
  padding-bottom: 0;
}

.org-course-cover {
  display: grid;
  flex: 0 0 auto;
  width: 74px;
  height: 54px;
  overflow: hidden;
  place-items: center;
  border-radius: 10px;
  background: #e8edf3;
  color: var(--org-ink-3);
  font-size: 12px;
  font-weight: 600;
  object-fit: cover;
}

img.org-course-cover {
  display: block;
}

.org-course-main {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  gap: 5px;
}

.org-course-main strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--org-ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.org-course-main small {
  overflow: hidden;
  color: var(--org-ink-3);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.org-course-side {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.org-price {
  color: var(--org-warm);
  font-size: 14px;
  font-weight: 700;
}

.org-price.is-free {
  color: var(--org-accent);
}

.org-owned {
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--org-accent);
  background: var(--org-accent-soft);
  font-size: 11px;
  font-weight: 600;
}

.org-more {
  width: 100%;
  margin-top: 12px;
  padding: 11px;
  border: 1px dashed #cfd8e3;
  border-radius: 12px;
  color: var(--org-ink-2);
  background: #fbfcfd;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.org-more:active {
  background: #f2f5f8;
}

/* 我的 */
.org-me-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 16px;
  border-radius: var(--org-radius);
  background: var(--org-surface);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.org-me-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  overflow: hidden;
  place-items: center;
  border-radius: 50%;
  color: var(--org-accent);
  background: var(--org-accent-soft);
  font-size: 16px;
  font-weight: 700;
}

.org-me-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.org-me-text {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  gap: 3px;
}

.org-me-text strong {
  overflow: hidden;
  font-size: 16px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.org-me-text span {
  overflow: hidden;
  color: var(--org-ink-2);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.org-me-action {
  flex: 0 0 auto;
  padding: 6px 11px;
  border: 1px solid var(--org-line);
  border-radius: 999px;
  color: var(--org-ink-2);
  background: #fff;
  font-size: 12px;
  cursor: pointer;
}

.org-me-tip {
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid #fed7aa;
  border-radius: 14px;
  color: #9a3412;
  background: #fff7ed;
  font-size: 13px;
  line-height: 1.6;
}

.org-me-tip p {
  margin: 0 0 8px;
}

.org-text-button {
  padding: 0;
  border: 0;
  color: var(--org-warm);
  background: none;
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.org-order-list {
  display: flex;
  flex-direction: column;
}

.org-order-item {
  padding: 12px 0;
  border-top: 1px solid var(--org-line);
}

.org-order-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.org-order-item:last-child {
  padding-bottom: 0;
}

.org-order-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.org-order-title {
  overflow: hidden;
  color: var(--org-ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.org-order-amount {
  flex: 0 0 auto;
  color: var(--org-ink);
  font-size: 14px;
  font-weight: 700;
}

.org-order-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  color: var(--org-ink-3);
  font-size: 12px;
}

.org-order-status {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: #f1f4f8;
  color: var(--org-ink-2);
  font-size: 11px;
  font-weight: 600;
}

.org-order-status.is-paid {
  color: #047857;
  background: #e7f6ef;
}

.org-order-status.is-pending {
  color: #b45309;
  background: #fff4e5;
}

.org-order-status.is-cancelled {
  color: var(--org-ink-3);
  background: #f1f4f8;
}

/* 空状态 / 加载 / 错误 */
.org-empty {
  margin: 8px 0 2px;
  padding: 18px 10px;
  color: var(--org-ink-3);
  text-align: center;
  font-size: 13px;
}

.org-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 42px 16px;
  color: var(--org-ink-3);
  font-size: 13px;
}

.org-loading--compact {
  padding: 20px 16px;
}

.org-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #d7dee8;
  border-top-color: var(--org-accent);
  border-radius: 50%;
  animation: org-spin 0.8s linear infinite;
}

@keyframes org-spin {
  to {
    transform: rotate(360deg);
  }
}

.org-error {
  margin-bottom: 12px;
  padding: 16px;
  border: 1px solid #fecaca;
  border-radius: 14px;
  background: #fef2f2;
}

.org-error strong {
  display: block;
  margin-bottom: 4px;
  color: #991b1b;
  font-size: 14px;
}

.org-error p {
  margin: 0 0 10px;
  color: #b91c1c;
  font-size: 13px;
}

.org-retry {
  padding: 7px 14px;
  border: 1px solid #fca5a5;
  border-radius: 999px;
  color: #991b1b;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

/* 底部导航 */
.org-tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  z-index: 30;
  display: flex;
  width: 100%;
  max-width: 680px;
  height: calc(var(--org-tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  border-top: 1px solid var(--org-line);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(14px);
  transform: translateX(-50%);
}

.org-tab {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0;
  border: 0;
  color: var(--org-ink-3);
  background: none;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.org-tab.is-active {
  color: var(--org-accent);
}

.org-tab:focus-visible,
.org-share:focus-visible,
.org-more:focus-visible,
.org-submit:focus-visible {
  outline: 2px solid var(--org-accent);
  outline-offset: 2px;
}

/* 登录弹层 */
.org-sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.org-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.46);
}

.org-sheet-panel {
  position: relative;
  width: 100%;
  max-width: 680px;
  padding: 20px 18px calc(20px + env(safe-area-inset-bottom, 0px));
  border-radius: 22px 22px 0 0;
  background: #fff;
  box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.18);
  animation: org-sheet-up 0.22s ease both;
}

@keyframes org-sheet-up {
  from {
    transform: translateY(18px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.org-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.org-sheet-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.org-sheet-close {
  padding: 4px 2px;
  border: 0;
  color: var(--org-ink-3);
  background: none;
  font-size: 13px;
  cursor: pointer;
}

.org-sheet-desc {
  margin: 6px 0 16px;
  color: var(--org-ink-2);
  font-size: 13px;
  line-height: 1.6;
}

.org-login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.org-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.org-field > span:first-child {
  color: var(--org-ink-2);
  font-size: 12px;
  font-weight: 600;
}

.org-field input {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 1px solid var(--org-line);
  border-radius: 12px;
  color: var(--org-ink);
  background: #fbfcfd;
  font-size: 15px;
  outline: none;
}

.org-field input:focus {
  border-color: var(--org-accent);
  background: #fff;
}

.org-field input.is-invalid {
  border-color: #f87171;
  background: #fff7f7;
}

.org-code-row {
  display: flex;
  gap: 8px;
}

.org-code-row input {
  flex: 1 1 auto;
  min-width: 0;
}

.org-code-btn {
  flex: 0 0 auto;
  padding: 0 13px;
  border: 1px solid var(--org-line);
  border-radius: 12px;
  color: var(--org-accent);
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.org-code-btn:disabled {
  color: var(--org-ink-3);
  cursor: default;
}

.org-mock {
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  color: #92400e;
  background: #fffbeb;
  font-size: 12px;
}

.org-login-message {
  margin: 0;
  color: var(--org-danger);
  font-size: 13px;
}

.org-login-message.is-success {
  color: #047857;
}

.org-submit {
  height: 46px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--org-accent);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.org-submit:disabled {
  opacity: 0.65;
  cursor: default;
}

.org-legal {
  margin: 0;
  color: var(--org-ink-3);
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}

.org-legal a {
  color: var(--org-ink-2);
}

@media (min-width: 721px) {
  body.org-app {
    background: #dfe5ec;
  }

  .org-shell {
    box-shadow: 0 0 44px rgba(16, 24, 40, 0.12);
  }
}

@media (prefers-reduced-motion: reduce) {
  .org-view,
  .org-sheet-panel {
    animation: none;
  }
}

.org-qr {
  display: grid;
  width: 220px;
  height: 220px;
  margin: 4px auto 10px;
  padding: 10px;
  place-items: center;
  border: 1px solid var(--org-line);
  border-radius: 16px;
  background: #fff;
}

.org-qr svg,
.org-qr img {
  display: block;
  width: 100%;
  height: 100%;
}

.org-qr-status {
  margin: 0 0 10px;
  color: var(--org-ink-3);
  text-align: center;
  font-size: 12px;
}

.org-qr-status.is-error {
  color: var(--org-danger);
}
