:root {
  --bg: #f4ecdd;
  --bg-deep: #e6d7bf;
  --panel: rgba(255, 250, 242, 0.86);
  --panel-strong: #fff9f1;
  --line: rgba(44, 62, 55, 0.12);
  --line-strong: rgba(44, 62, 55, 0.2);
  --text: #14322d;
  --muted: #5e6f69;
  --accent: #ef5f3c;
  --accent-2: #1f8a70;
  --shadow: 0 24px 60px rgba(67, 41, 19, 0.14);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(239, 95, 60, 0.14), transparent 26%),
    radial-gradient(circle at bottom right, rgba(31, 138, 112, 0.18), transparent 32%),
    linear-gradient(180deg, #f7f0e4 0%, #efe1c7 100%);
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", sans-serif;
}

body {
  position: relative;
}

.aurora {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(239, 95, 60, 0.12), transparent 35%),
    linear-gradient(300deg, rgba(31, 138, 112, 0.1), transparent 40%);
  pointer-events: none;
}

.hidden {
  display: none !important;
}

.app-shell {
  position: relative;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto 24px;
  max-width: 1580px;
}

.eyebrow,
.panel-kicker {
  margin: 0;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--muted);
}

h1,
h2,
h3 {
  margin: 8px 0 0;
  font-family: ui-serif, Georgia, "Songti SC", "STSong", serif;
  font-weight: 700;
  line-height: 1.05;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
}

h2 {
  font-size: clamp(1.8rem, 2.5vw, 2.8rem);
}

h3 {
  font-size: 1.25rem;
}

p {
  margin: 0;
}

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

.role-chip,
button,
input,
select {
  font: inherit;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.role-chip {
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(20, 50, 45, 0.08);
  border: 1px solid rgba(20, 50, 45, 0.1);
}

.desktop-layout,
.mobile-layout {
  margin: 0 auto;
  max-width: 1580px;
}

.hero-panel,
.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-panel {
  display: grid;
  grid-template-columns: 1.4fr 380px;
  gap: 24px;
  padding: 28px;
  margin-bottom: 24px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hero-stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.metric {
  min-width: 120px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(20, 50, 45, 0.08);
}

.metric-value {
  display: block;
  font-family: ui-serif, Georgia, serif;
  font-size: 1.9rem;
}

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

.join-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 18px;
  border-radius: 22px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  min-height: 100%;
}

.qr-image {
  width: 220px;
  height: 220px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: white;
  object-fit: cover;
}

.join-url {
  font-size: 0.92rem;
  text-align: center;
  word-break: break-all;
  color: var(--muted);
}

.join-actions,
.inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  cursor: pointer;
  transition:
    transform 180ms ease,
    background 180ms ease,
    opacity 180ms ease;
}

button:hover {
  transform: translateY(-1px);
}

.secondary-btn {
  background: var(--accent);
  color: white;
}

.ghost-btn {
  background: rgba(20, 50, 45, 0.08);
  color: var(--text);
}

.content-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
}

.panel {
  padding: 22px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.live-panel,
.gallery-panel,
.annotate-panel,
.files-panel {
  min-height: 320px;
}

.command-panel {
  grid-row: span 2;
}

.live-stage {
  position: relative;
  min-height: 320px;
  border-radius: 20px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(20, 50, 45, 0.92), rgba(40, 73, 64, 0.92)),
    #14322d;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

#remote-video,
.local-video {
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
  display: block;
  background: #10201c;
}

.empty-state {
  display: grid;
  place-items: center;
  padding: 32px;
  min-height: 220px;
  border-radius: 18px;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  text-align: center;
}

.large-empty {
  min-height: 520px;
}

.blackout-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.92);
  color: white;
  font-size: 1.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.command-list,
.file-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.command-item,
.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(20, 50, 45, 0.08);
}

.command-item strong,
.file-item strong {
  display: block;
}

.command-meta,
.file-meta {
  font-size: 0.92rem;
  color: var(--muted);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.photo-card {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(20, 50, 45, 0.12);
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.photo-card:hover,
.photo-card.selected {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(39, 25, 11, 0.12);
  border-color: rgba(239, 95, 60, 0.55);
}

.photo-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: rgba(20, 50, 45, 0.08);
}

.photo-card-body {
  padding: 12px;
}

.photo-card-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.photo-card-meta {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 4px;
}

.annotation-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(20, 50, 45, 0.8);
  color: white;
  font-size: 0.8rem;
}

.canvas-wrap {
  position: relative;
  overflow: auto;
  border-radius: 18px;
  background: #fffdf8;
  border: 1px solid rgba(20, 50, 45, 0.12);
  min-height: 520px;
}

#image-canvas,
#annotation-canvas {
  display: block;
}

#annotation-canvas {
  position: absolute;
  inset: 0;
  touch-action: none;
  cursor: crosshair;
}

.tool-select,
.color-picker,
input[type="range"] {
  border: 1px solid rgba(20, 50, 45, 0.12);
  border-radius: 999px;
  padding: 10px 14px;
  background: white;
}

.color-picker {
  padding: 0;
  width: 44px;
  height: 44px;
}

.file-link {
  text-decoration: none;
  color: var(--accent-2);
  font-weight: 600;
}

.mobile-layout {
  max-width: 760px;
}

.mobile-hero {
  padding: 22px;
  margin-bottom: 20px;
}

.mobile-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.quick-panel {
  padding: 20px;
}

.upload-tile {
  display: grid;
  place-items: center;
  min-height: 132px;
  border-radius: 22px;
  border: 1px dashed rgba(20, 50, 45, 0.24);
  background: linear-gradient(135deg, rgba(239, 95, 60, 0.08), rgba(255, 255, 255, 0.4));
  cursor: pointer;
  color: var(--text);
  font-weight: 600;
}

.upload-tile.alt {
  background: linear-gradient(135deg, rgba(31, 138, 112, 0.08), rgba(255, 255, 255, 0.4));
}

.upload-tile input {
  display: none;
}

.status-line {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.94rem;
}

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

.control-btn {
  min-height: 72px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(20, 50, 45, 0.1);
}

.control-btn.accent {
  background: var(--accent);
  color: white;
}

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

.mobile-recent-tile {
  border-radius: 18px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(20, 50, 45, 0.1);
}

.mobile-recent-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 1120px) {
  .hero-panel,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .command-panel {
    grid-row: auto;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 18px;
  }

  .topbar {
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .join-actions,
  .inline-actions {
    width: 100%;
  }

  .inline-actions > * {
    flex: 1;
  }
}
