:root {
  --ink: #101114;
  --muted: #68707f;
  --soft: #8a93a4;
  --line: rgba(15, 23, 42, 0.1);
  --hairline: rgba(15, 23, 42, 0.065);
  --panel: rgba(255, 255, 255, 0.74);
  --panel-strong: rgba(255, 255, 255, 0.92);
  --blue: #315ff4;
  --green: #24a148;
  --red: #d93f35;
  --amber: #b7791f;
  --violet: #6b4eff;
  --shadow: 0 24px 80px rgba(31, 41, 55, 0.1);
  --card-shadow: 0 14px 44px rgba(31, 41, 55, 0.08);
  --radius: 8px;
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #f7f8fb 0%, #edf1f7 48%, #f8faf6 100%);
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.version-switch {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 168px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 32px rgba(31, 41, 55, 0.1);
  backdrop-filter: blur(18px);
}

.switch-option {
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.switch-option.active {
  color: #fff;
  background: #111827;
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.18);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 86px;
  padding-top: 18px;
  padding-right: max(28px, calc((100vw - 1180px) / 2));
  padding-bottom: 18px;
  padding-left: max(214px, calc((100vw - 1180px) / 2));
  background: rgba(247, 249, 252, 0.72);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(20px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.logo-mark {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #eef2ff url("../Logo.png") center 40% / 230% auto no-repeat;
  box-shadow: 0 10px 24px rgba(56, 103, 255, 0.18);
}

.brand span {
  display: grid;
  gap: 2px;
}

.brand strong {
  font-size: 21px;
  line-height: 1.05;
}

.brand small {
  color: var(--muted);
  font-size: 13px;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link,
.ghost-button,
.danger-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}

.nav-link,
.ghost-button {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.62);
  border-color: var(--line);
}

.danger-button {
  color: #b42318;
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(217, 63, 53, 0.2);
}

.primary-button {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 14px 26px rgba(56, 103, 255, 0.28);
}

.primary-button:disabled,
.ghost-button:disabled,
.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}

.app-shell {
  width: min(1180px, calc(100vw - 40px));
  margin: 28px auto 64px;
  transition: max-width 180ms ease, width 180ms ease;
}

.public-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 348px;
  gap: 22px;
  align-items: start;
}

.board-panel,
.composer-panel,
.login-panel,
.admin-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.board-panel,
.admin-panel {
  padding: 26px;
}

.composer-panel,
.login-panel {
  padding: 18px;
}

.composer-panel {
  position: sticky;
  top: 110px;
  background: rgba(255, 255, 255, 0.78);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.section-head.compact {
  margin-bottom: 12px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(34px, 5vw, 56px);
  line-height: 0.96;
}

h2 {
  font-size: 23px;
  line-height: 1.08;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(36, 161, 72, 0.26);
  border-radius: 999px;
  color: var(--green);
  background: rgba(36, 161, 72, 0.08);
  font-weight: 700;
}

.live-pill span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(36, 161, 72, 0.13);
}

.rumor-list,
.admin-list {
  display: grid;
  gap: 16px;
}

.rumor-card,
.admin-row,
.draft-form {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: var(--radius);
  background: var(--panel-strong);
  box-shadow: var(--card-shadow);
}

.rumor-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
}

.rumor-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  content: "";
  background: linear-gradient(180deg, rgba(49, 95, 244, 0.88), rgba(36, 161, 72, 0.78));
}

.rumor-meta,
.admin-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.rumor-meta span {
  color: var(--ink);
  font-weight: 760;
}

.rumor-meta time {
  color: var(--soft);
}

.rumor-content {
  margin: 16px 0 18px;
  white-space: pre-wrap;
  font-size: 17px;
  line-height: 1.58;
}

.reaction-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reaction-button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  flex: 0 1 auto;
  min-width: 96px;
  min-height: 44px;
  padding: 5px 6px 5px 5px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(248, 250, 252, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 8px 18px rgba(31, 41, 55, 0.045);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.reaction-button:hover {
  transform: translateY(-1px);
  border-color: rgba(49, 95, 244, 0.26);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.96), 0 12px 24px rgba(31, 41, 55, 0.075);
}

.reaction-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  font-size: 16px;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(31, 41, 55, 0.08);
}

.reaction-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-align: left;
  white-space: nowrap;
}

.reaction-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(15, 23, 42, 0.055);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.reaction-button.active {
  color: #fff;
  border-color: transparent;
  background: #111827;
  box-shadow: 0 14px 28px rgba(17, 24, 39, 0.18);
}

.reaction-button.active .reaction-icon {
  background: rgba(255, 255, 255, 0.16);
  box-shadow: none;
}

.reaction-button.active .reaction-label {
  color: rgba(255, 255, 255, 0.78);
}

.reaction-button.active .reaction-count {
  color: #111827;
  background: rgba(255, 255, 255, 0.92);
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.11);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  outline: none;
}

textarea:focus,
input:focus,
select:focus {
  border-color: rgba(56, 103, 255, 0.58);
  box-shadow: 0 0 0 4px rgba(56, 103, 255, 0.12);
}

textarea {
  min-height: 166px;
  resize: vertical;
  padding: 15px;
  line-height: 1.5;
}

input {
  min-height: 44px;
  padding: 0 12px;
}

select {
  min-height: 44px;
  padding: 0 34px 0 12px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.post-form,
.admin-form,
.draft-form {
  display: grid;
  gap: 14px;
}

.post-form .primary-button {
  min-width: 74px;
}

.draft-form {
  margin-bottom: 16px;
  padding: 16px;
}

.form-row,
.admin-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.status-text,
.row-status {
  min-height: 18px;
  color: var(--muted);
  font-size: 13px;
}

.status-text.error,
.row-status.error {
  color: var(--red);
}

.status-text.success,
.row-status.success {
  color: var(--green);
}

.admin-view {
  display: none;
}

body.admin-mode .public-grid {
  display: none;
}

body.admin-mode .admin-view {
  display: block;
}

.login-panel {
  width: min(460px, 100%);
  margin: 56px auto;
}

.admin-row {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: #fff;
  background: var(--amber);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.status-badge.published {
  background: var(--green);
}

.source-name {
  overflow: hidden;
  max-width: 58%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-content {
  min-height: 130px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 1px dashed rgba(15, 23, 42, 0.18);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.5);
  text-align: center;
}

body.phone-preview .app-shell {
  width: min(430px, calc(100vw - 24px));
}

body.phone-preview .public-grid {
  grid-template-columns: 1fr;
}

body.phone-preview .topbar {
  align-items: flex-start;
  min-height: 92px;
  padding: 76px 14px 14px;
}

body.phone-preview .logo-mark {
  width: 42px;
  height: 42px;
}

body.phone-preview .brand strong {
  font-size: 18px;
}

body.phone-preview h1 {
  font-size: 38px;
}

body.phone-preview .section-head {
  align-items: flex-start;
  flex-direction: column;
}

body.phone-preview .composer-panel {
  position: static;
}

body.phone-preview .reaction-row {
  gap: 8px;
}

body.phone-preview .reaction-button {
  min-height: 48px;
}

@media (max-width: 820px) {
  .version-switch {
    top: 12px;
    left: 12px;
  }

  .topbar {
    align-items: flex-start;
    min-height: 92px;
    padding: 76px 14px 14px;
  }

  .logo-mark {
    width: 42px;
    height: 42px;
  }

  .brand strong {
    font-size: 18px;
  }

  .app-shell {
    width: min(100vw - 24px, 480px);
    margin-top: 16px;
  }

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

  .board-panel,
  .composer-panel,
  .login-panel,
  .admin-panel {
    padding: 16px;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .composer-panel {
    position: static;
  }

  h1 {
    font-size: 38px;
  }

  .reaction-row {
    gap: 8px;
  }

  .reaction-button {
    min-height: 48px;
  }

  .form-row,
  .admin-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button,
  .ghost-button,
  .danger-button {
    width: 100%;
  }
}
