/* Shared typography and form layout. Button appearance stays in the original component/page styles. */
body {
  font-size: var(--font-size-body);
  line-height: 1.6;
}
h1,
body .page-heading,
.scholarship-page-head h1,
.scholarship-review-titlebar h1,
.article-header h1,
.form-heading h1 {
  font-size: var(--font-size-page);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.025em;
}
h2,
body .section-heading {
  font-size: var(--font-size-section);
  line-height: 1.35;
  font-weight: 650;
  letter-spacing: -0.015em;
}
h3 {
  font-size: var(--font-size-card);
  line-height: 1.4;
  font-weight: 650;
}
h4,
h5,
h6 {
  font-size: var(--font-size-body);
  line-height: 1.5;
  font-weight: 650;
}
small,
.field-help,
.field-error {
  font-size: var(--font-size-caption);
  line-height: 1.5;
}
.page-content {
  padding-block: 32px 64px;
}
:is(
  .files-intro,
  .dashboard-intro,
  .community-heading,
  .admin-intro,
  .schedule-intro,
  .notices-intro,
  .links-intro,
  .settings-header,
  .activity-form-intro
) {
  margin-bottom: 24px;
}
:is(
    .files-intro,
    .community-heading,
    .admin-intro,
    .schedule-intro,
    .notices-intro,
    .links-intro,
    .settings-header,
    .activity-intro-copy
  )
  p {
  margin-top: 8px;
  font-size: var(--font-size-small);
  line-height: 1.6;
}

/* Preserve the shared input and select sizing without overriding buttons. */
:where(
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not(
      [type="range"]
    ):not([type="color"]):not([type="submit"]):not([type="reset"]):not(
      [type="button"]
    ),
  select
) {
  height: var(--control-height) !important;
  min-height: var(--control-height) !important;
  max-width: 100%;
  min-width: 0;
  border-radius: var(--control-radius);
  padding: 0 12px;
  border: 1px solid var(--color-hairline-strong);
  background: var(--color-surface);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-size: var(--font-size-small);
  line-height: 20px;
  box-sizing: border-box;
}
textarea {
  border-radius: var(--control-radius);
  padding: 12px;
  font-size: var(--font-size-body);
  line-height: 1.6;
}
input[type="file"] {
  padding: 0;
}
.files-search,
.notice-search-wrap,
.admin-search,
.web-search-field {
  height: var(--control-height) !important;
  min-height: var(--control-height) !important;
  padding: 0 12px;
  margin-block: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--color-hairline-strong);
  border-radius: var(--control-radius);
  background: var(--color-surface);
}
.files-search input,
.notice-search-wrap input,
.admin-search input,
.web-search-field input {
  height: calc(var(--control-height) - 2px) !important;
  min-height: 0 !important;
  padding: 0;
  border: 0;
  background: transparent;
  outline-offset: -2px;
  box-shadow: none;
}
.files-search {
  margin-top: 16px;
}
:is(.files-search, .notice-search-wrap, .admin-search, .web-search-field):focus-within {
  border-color: var(--color-focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-focus) 16%, transparent);
}
:where(
  .community-actions,
  .schedule-actions,
  .reader-actions,
  .review-actions,
  .extended-actions,
  .scholarship-review-actions,
  .scholarship-editor-actions,
  .scholarship-admin-toolbar,
  .source-row-actions,
  .source-search-field > div,
  .web-search,
  .verification-row,
  .folder-tree-actions
) {
  align-items: center;
  gap: 8px;
}
:where(
  .community-actions,
  .review-actions,
  .extended-actions,
  .scholarship-review-actions,
  .scholarship-editor-actions,
  .scholarship-admin-toolbar,
  .source-row-actions
) {
  display: flex;
  flex-wrap: wrap;
}
.community-actions > label,
.community-actions > .community-muted,
.scholarship-admin-cycle-picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--control-height);
  margin-block: 0;
}
.community-actions > label > input[type="checkbox"] {
  flex: none;
}
.community-actions > label:has(select) {
  height: var(--control-height);
}
.community-actions > label:has(select) select {
  flex: 1;
}
.community-field input,
.community-field select {
  margin: 0;
}
.community-dialog footer,
.reader-actions {
  align-items: center;
}
.community-dialog {
  padding: 24px;
}
.community-dialog header h2 {
  font-size: var(--font-size-section);
}
.community-dialog header :is(.icon-button, .close-button) {
  flex: none;
}
.community-dialog .community-grid {
  margin-block: 16px;
  gap: 16px;
  align-items: end;
}
.community-field {
  margin: 12px 0;
}
.member-picker {
  margin: 16px 0;
  padding: 16px;
}
.member-options {
  gap: 8px;
}
.member-options label {
  min-height: 64px;
  padding: 8px 12px;
  border: 1px solid var(--color-hairline);
}
.member-options label:has(:checked) {
  border-color: var(--color-brand-deep);
}

.article-header h1,
.login-content h1 {
  font-size: var(--font-size-page);
}
.article-body h1 {
  font-size: var(--font-size-page);
}
.article-body h2,
.reader-content h2 {
  font-size: var(--font-size-section);
}
.article-body h3,
.reader-content h3 {
  font-size: var(--font-size-card);
}
/* Card headings are one level below section headings, regardless of HTML tag. */
.community-card h2,
.recent-files h2,
.card-header h2,
.panel-heading h2,
.form-section-heading h2,
.activity-preview h2,
.settings-section-heading h2,
.confirmation-panel h2,
.source-summary h2,
.scholarship-admin-cycle-head h3,
.scholarship-empty h2 {
  font-size: var(--font-size-card);
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: -0.015em;
}
.link-group h3 {
  font-size: var(--font-size-body);
  line-height: 1.5;
}
/* These page headers use a grid gap, so a second bottom margin doubles spacing. */
.links-page { gap: 24px; }
.links-page .links-intro { margin-bottom: 0; }
.link-section header p,
.admin-module-heading p,
.review-header p {
  font-size: var(--font-size-small);
  line-height: 1.6;
  margin-top: 8px;
}
.dashboard-summary { font-size: var(--font-size-small); }
.profile-list { margin-block: 0; }

/* Allow long titles and toolbars to wrap within their own column. */
:is(.community-heading, .admin-module-heading, .review-header,
    .scholarship-page-head, .scholarship-review-titlebar) > div,
.admin-module-content,
.web-search > *,
.scholarship-admin-toolbar,
.scholarship-admin-cycle-picker {
  min-width: 0;
}
:is(.community-heading, .admin-module-heading, .review-header,
    .scholarship-page-head, .scholarship-review-titlebar) h1,
:is(.community-heading, .admin-module-heading, .review-header) h2,
.article-header h1,
.form-heading h1 {
  overflow-wrap: anywhere;
}
.admin-workspace .admin-tabs,
.admin-workspace .admin-section { margin-top: 0; }
.admin-workspace .admin-tabs button[aria-selected="true"]::after { display: none; }
.admin-module-heading,
.review-header { flex-wrap: wrap; align-items: flex-start; gap: 16px; }
.admin-module-heading > div:first-child,
.review-header > div:first-child { flex: 1 1 320px; }
.review-header .review-actions { flex: 1 1 100%; justify-content: flex-start; }
.scholarship-admin-toolbar { flex-wrap: wrap; }
.scholarship-admin-cycle-picker { max-width: 100%; }
.scholarship-admin-layout { min-height: 360px; }
.scholarship-admin-placeholder { min-height: 360px; padding: 24px; }
.admin-table-scroll { overscroll-behavior-x: contain; }
.admin-section > .community-card { margin-top: 24px; }

@media (max-width: 900px) {
  :is(.admin-table-scroll, .scholarship-review-table-scroll, .scholarship-final-table-scroll)::before {
    content: "左右滑动表格，查看完整内容与操作";
    display: block;
    position: sticky;
    left: 0;
    padding: 10px 14px;
    border-bottom: 1px solid var(--color-hairline);
    background: var(--color-surface-subtle);
    color: var(--color-secondary);
    font-size: var(--font-size-caption);
  }
  .admin-module-heading > div:first-child,
  .review-header > div:first-child { flex-basis: auto; }
}

@media (max-width: 720px) {
  .link-section > header { align-items: flex-start; }
  .scholarship-admin-toolbar { width: 100%; justify-content: flex-start; }
  .scholarship-admin-cycle-picker { width: 100%; }
  .scholarship-admin-cycle-picker select { flex: 1; }
  .community-actions > label:has(select) { flex-wrap: wrap; height: auto; }
  .community-dialog footer { flex-wrap: wrap; }
  .community-dialog header h2 { overflow-wrap: anywhere; }
  .scholarship-page-links { flex-wrap: wrap; }
}

.article-body,
.reader-content {
  font-size: var(--font-size-body);
}
.login-shell {
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

/* The remaining standalone forms share the same colors and control system. */
.legacy-page {
  background: var(--color-canvas) !important;
  color: var(--color-ink);
  font-family: var(--font-sans);
}
.legacy-page .bg-orb,
.legacy-page .noise-overlay {
  display: none;
}
.legacy-page > .container {
  max-width: 800px;
  margin: 24px auto;
  background: var(--color-surface);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.legacy-page .content {
  background: var(--color-surface);
  border: 0;
  box-shadow: none;
  border-radius: var(--radius-lg);
}
.legacy-page > nav,
.legacy-page > .header {
  background: var(--color-surface);
  color: var(--color-ink);
  border-color: var(--color-hairline);
}
.legacy-page > nav a,
.legacy-page .title,
.legacy-page h1,
.legacy-page h3,
.legacy-page .form-label,
.legacy-page label {
  color: var(--color-ink);
}
.legacy-page .title {
  font-size: var(--font-size-section);
}
.legacy-page .subtitle,
.legacy-page .hint,
.legacy-page .form-hint {
  color: var(--color-secondary);
  font-size: var(--font-size-small);
}
.legacy-page .user-info,
.legacy-page .submitted-info {
  background: var(--color-surface-subtle);
  color: var(--color-ink);
}
.legacy-page .submitted-info .label,
.legacy-page .submitted-info .value {
  color: var(--color-ink);
}
.legacy-page .form-row {
  align-items: end;
}
@media (max-width: 720px) {
  .page-content {
    padding-block: 24px 48px;
  }
  .community-dialog {
    padding: 16px;
  }
  .community-heading {
    gap: 16px;
  }
  .notice-toolbar,
  .schedule-toolbar {
    min-height: 0;
    align-items: flex-start;
  }
  .community-actions {
    gap: 8px;
  }
  .community-actions > label:has(select) {
    width: auto;
  }
  .review-actions {
    width: 100%;
  }
  .admin-module-heading {
    align-items: flex-start;
  }
  .legacy-page .header {
    flex-wrap: wrap;
    padding: 16px;
  }
  .legacy-page > .container {
    width: calc(100% - 32px);
    margin: 16px;
    padding: 16px;
  }
}

.legacy-page input,
.legacy-page select,
.legacy-page textarea {
  background: var(--color-surface);
  color: var(--color-ink);
  border-color: var(--color-hairline-strong);
}

[hidden] {
  display: none !important;
}
.community-status:empty {
  display: none;
}

.mobile-drawer:not(.is-open) {
  visibility: hidden;
  box-shadow: none;
}

/* Page titles carry the editorial serif voice; controls keep the readable sans. */
body h1, body .page-heading { font-family:var(--font-display); font-weight:500; letter-spacing:.025em; }
body .page-header { display:flex; align-items:center; justify-content:space-between; gap:24px; margin:0 0 24px; }
.page-header > div { min-width:0; }
.page-header h1 { margin:0; }
body .page-header p { margin:8px 0 0; color:var(--color-secondary); font-size:var(--font-size-small); line-height:1.6; }
.page-header .page-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; flex:none; }
.section-back { display:inline-block; margin-bottom:20px; font-size:var(--font-size-small); color:var(--color-secondary); text-decoration:none; }
/* A shared filter component for notices and games, independent of action buttons. */
.section-tabs { display:flex; flex-wrap:nowrap; align-items:center; align-self:auto; gap:4px; min-width:0; max-width:100%; overflow-x:auto; padding:4px; margin:0; border:1px solid var(--color-hairline); border-radius:var(--radius-lg); background:var(--color-surface-subtle); scrollbar-width:thin; }
.section-tabs button { display:inline-flex; align-items:center; justify-content:center; flex:none; gap:6px; min-height:40px; padding:8px 14px; margin:0; border:0; border-radius:var(--radius-md); background:transparent; color:var(--color-secondary); font-family:var(--font-sans); font-size:var(--font-size-small); font-weight:600; line-height:24px; white-space:nowrap; cursor:pointer; box-shadow:none; }
.section-tabs button:hover { background:var(--color-surface); color:var(--color-ink); }
.section-tabs button:is([aria-selected="true"],[aria-pressed="true"]) { background:var(--color-surface); color:var(--color-brand-ink); box-shadow:var(--shadow-sm); }
.section-tabs button:focus-visible { outline:2px solid var(--color-focus); outline-offset:-2px; }
.games-main.page-container { max-width:none; padding-bottom:48px; }
.games-main .rooms-heading { margin-top:0; }
.games-main .room-topline h1 { font-family:var(--font-display); }
.games-main .room-search input { height:100%!important; min-height:0!important; border:0; border-radius:0; padding:0; background:transparent; }
.games-main .section-heading { font-family:var(--font-sans); }
.shell-login { min-height:36px; }
@media(max-width:720px) {
  body .page-header { align-items:flex-start; flex-wrap:wrap; gap:16px; }
  .page-header .page-actions { flex-wrap:wrap; }
  .games-main.page-container { padding-top:24px; }
}

.games-main.page-container { padding-inline:32px; }
@media(max-width:959px) { .games-main.page-container { padding-inline:24px; } }
@media(max-width:639px) { .games-main.page-container { padding-inline:16px; } }

[data-app-shell] { min-height:64px; }

@font-face { font-family:"Ecolony Title Mark"; src:url('/assets/fonts/ecolony-mark/ecolony-title-mark.ttf') format('truetype'); font-weight:400; font-style:normal; font-display:swap; }
.title-mark { display:inline-block; font-family:"Ecolony Title Mark",serif; font-size:1em; font-weight:400; font-style:normal; font-synthesis:none; letter-spacing:0; color:var(--button-primary); margin-right:.18em; }
