:root {
  --ink: #172026;
  --muted: #64727d;
  --line: #dce4e7;
  --paper: #f7faf9;
  --white: #fff;
  --green: #0f8b65;
  --green-dark: #076247;
  --coral: #e75c45;
  --gold: #f2b84b;
  --blue: #2878b8;
  --shadow: 0 18px 50px rgba(23, 32, 38, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  letter-spacing: 0;
}
body.locked { overflow: hidden; }
body.role-student [data-admin-only],
body.role-admin [data-student-only],
body.role-admin .apply-btn,
body.role-admin #joinTeamBtn,
body.role-admin #feedbackForm {
  display: none !important;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: auto;
}
.login-screen.hidden { display: none; }
.login-bg, .login-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.login-bg { object-fit: cover; }
.login-overlay { background: linear-gradient(115deg, rgba(7,34,28,.88), rgba(7,34,28,.56) 48%, rgba(7,34,28,.2)); }
.login-card {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  padding: 30px;
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 8px;
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}
.login-brand .brand-mark {
  width: 46px;
  height: 46px;
  font-size: 20px;
}
.login-brand h1 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 30px;
  line-height: 1.1;
}
.login-brand p, .login-hint {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}
.role-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
  padding: 4px;
  border-radius: 8px;
  background: #eef4f6;
}
.role-tab {
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  color: #52626c;
  background: transparent;
  cursor: pointer;
  font-weight: 700;
}
.role-tab.active {
  color: #fff;
  background: var(--green);
}
.login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 14px;
}
.remember-line {
  display: flex;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.remember-line input {
  width: 16px;
  height: 16px;
  padding: 0;
}
.login-row a { color: var(--green-dark); font-weight: 700; }
.login-submit { width: 100%; min-height: 46px; }
.login-hint { margin-top: 14px; font-size: 13px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  padding: 0 clamp(18px, 5vw, 64px);
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid rgba(220,228,231,.8);
  backdrop-filter: blur(14px);
}

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: #fff;
  background: var(--green);
}

.nav { display: flex; gap: 24px; font-size: 14px; color: #34434c; }
.nav a:hover { color: var(--green); }
.menu-btn { display: none; }
.user-area { display: flex; align-items: center; gap: 10px; }
.user-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--green-dark);
  background: #e8f5ef;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.logout-btn { min-height: 34px; padding: 0 12px; }
.sync-status, .clock-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.clock-badge {
  color: var(--green-dark);
  background: #e8f5ef;
  border-color: #d4ecdf;
}

.hero {
  position: relative;
  min-height: calc(100vh - 68px);
  display: flex;
  align-items: center;
  padding: 64px clamp(22px, 7vw, 92px) 118px;
  overflow: hidden;
}

.hero-slider, .hero-img, .hero-overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-img {
  object-fit: cover;
  opacity: 0;
  transition: opacity .7s ease;
}
.hero-img.active { opacity: 1; }
.hero-overlay { background: linear-gradient(90deg, rgba(9,34,29,.82), rgba(9,34,29,.42) 48%, rgba(9,34,29,.08)); }
.hero-content { position: relative; z-index: 1; max-width: 680px; color: #fff; }
.eyebrow { margin: 0 0 10px; color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.hero .eyebrow { color: #9ff0c8; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 18px; font-size: clamp(52px, 8vw, 92px); line-height: 1; letter-spacing: 0; }
h2 { margin-bottom: 0; font-size: 34px; line-height: 1.18; }
h3 { margin-bottom: 8px; font-size: 18px; }
.hero-copy { max-width: 620px; color: rgba(255,255,255,.9); font-size: 19px; line-height: 1.75; }
.hero-controls {
  position: absolute;
  left: clamp(22px, 7vw, 92px);
  bottom: 34px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 14px;
}
.slider-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255,255,255,.44);
  border-radius: 50%;
  color: #fff;
  background: rgba(255,255,255,.16);
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
  backdrop-filter: blur(10px);
}
.slider-btn:hover { background: rgba(255,255,255,.28); }
.hero-dots { display: flex; align-items: center; gap: 8px; }
.hero-dot {
  width: 34px;
  height: 8px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.42);
  cursor: pointer;
}
.hero-dot.active { background: #fff; }

.hero-actions, .check-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.primary-btn, .secondary-btn, .chip, .icon-btn {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: .2s ease;
}
.primary-btn { display: inline-flex; align-items: center; justify-content: center; padding: 0 18px; color: #fff; background: var(--green); font-weight: 700; }
.primary-btn:hover { background: var(--green-dark); transform: translateY(-1px); }
.secondary-btn { display: inline-flex; align-items: center; justify-content: center; padding: 0 18px; color: var(--green-dark); background: #e8f5ef; font-weight: 700; }
.secondary-btn:hover { background: #d4ecdf; }

.stats-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}
.stats-band div { padding: 26px clamp(18px, 4vw, 48px); background: #fff; }
.stats-band strong { display: block; font-size: 30px; color: var(--green-dark); }
.stats-band span { color: var(--muted); font-size: 14px; }

.section { padding: 76px clamp(18px, 5vw, 72px); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 26px; }
.filters, .toolbar { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { padding: 0 14px; background: #fff; border: 1px solid var(--line); color: #41515b; }
.chip.active { color: #fff; background: var(--green); border-color: var(--green); }
.toolbar { margin-bottom: 22px; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}
input, select { height: 44px; padding: 0 12px; }
textarea { resize: vertical; padding: 12px; }
.toolbar input { max-width: 430px; }
.toolbar select { max-width: 170px; }

.activity-grid, .team-grid, .metric-grid, .admin-grid, .about-grid, .base-grid, .principle-grid, .portal-grid, .workspace-grid {
  display: grid;
  gap: 18px;
}
.activity-grid {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  padding-bottom: 6px;
  scrollbar-width: none;
}
.activity-grid::-webkit-scrollbar { display: none; }
.activity-grid .activity-card {
  flex: 0 0 min(360px, 84vw);
  scroll-snap-align: start;
}
.activity-scrollbar {
  position: relative;
  width: min(520px, 100%);
  height: 18px;
  margin: 18px auto 0;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 6px 18px rgba(23,32,38,.08);
  cursor: pointer;
  touch-action: none;
}
.activity-scroll-thumb {
  position: absolute;
  top: 50%;
  left: var(--scroll-progress, 0%);
  width: 46px;
  height: 10px;
  border-radius: 999px;
  background: var(--green);
  transform: translate(-50%, -50%);
  transition: left .12s ease-out, width .16s ease, background .16s ease;
}
.activity-scrollbar:hover .activity-scroll-thumb,
.activity-scrollbar.dragging .activity-scroll-thumb {
  width: 58px;
  background: var(--green-dark);
}
.activity-scrollbar.dragging .activity-scroll-thumb {
  transition: none;
}
.activity-card, .team-card, .service-card, .admin-panel, .metric, .about-copy, .principle-grid div, .base-grid article, .portal-card, .work-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(23,32,38,.06);
}
.activity-card { overflow: hidden; }
.activity-card img { width: 100%; height: 168px; object-fit: cover; display: block; }
.activity-empty-cover {
  display: grid;
  place-items: center;
  width: 100%;
  height: 168px;
  color: var(--muted);
  background: #eef4f6;
  font-size: 14px;
  font-weight: 800;
}
.activity-body { padding: 18px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.tag { padding: 4px 8px; border-radius: 6px; background: #eef4f6; color: #52626c; font-size: 12px; }
.activity-meta { display: grid; gap: 8px; color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.activity-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.quota { color: var(--coral); font-weight: 800; }
.history-label {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  color: var(--green-dark);
  background: #e8f5ef;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.history-label:hover { background: #d4ecdf; }

.workbench-section { background: #f1f6f4; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.portal-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 22px; }
.portal-card {
  min-height: 156px;
  padding: 20px;
  border: 1px solid var(--line);
  text-align: left;
  cursor: pointer;
}
.portal-card:hover { transform: translateY(-2px); border-color: rgba(15,139,101,.42); }
.portal-card span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 16px;
  border-radius: 8px;
  color: #fff;
  background: var(--green);
  font-weight: 800;
}
.portal-card strong { display: block; margin-bottom: 8px; font-size: 17px; }
.portal-card em { display: block; color: var(--muted); font-style: normal; line-height: 1.55; }
.workspace-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.work-panel { padding: 22px; min-width: 0; }
.message-panel { grid-column: span 2; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-title h3 { margin-bottom: 0; }
.panel-title span { color: var(--muted); font-size: 13px; font-weight: 700; }
.table-wrap { overflow-x: auto; }
.honor-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.honor-board-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.honor-title-input { height: 36px; font-weight: 800; }
.honor-lists h4 { margin: 8px 0 12px; font-size: 15px; }
.honor-lists ol { display: grid; gap: 10px; margin: 0; padding-left: 22px; }
.honor-lists li { padding: 10px 12px; border-radius: 8px; background: #f7faf9; color: var(--muted); }
.honor-lists strong { color: var(--ink); }
.honor-edit-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr 82px auto;
  gap: 8px;
  margin-top: 10px;
}
.honor-person-input {
  height: 34px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 13px;
}
.message-list { display: grid; gap: 12px; margin-top: 14px; }
.message-item { padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #f7faf9; }
.message-item h4 { margin: 0 0 6px; font-size: 15px; }
.message-item p { margin-bottom: 8px; color: var(--muted); line-height: 1.6; }
.message-item time { color: var(--coral); font-size: 12px; font-weight: 800; }

.split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr); gap: 28px; align-items: start; }
.profile-panel { display: flex; align-items: center; gap: 16px; margin: 24px 0; }
.avatar { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; color: #fff; background: var(--blue); font-weight: 800; font-size: 28px; }
.metric-grid { grid-template-columns: repeat(4, 1fr); }
.metric { padding: 18px; }
.metric strong { display: block; font-size: 28px; color: var(--green-dark); }
.metric span, label { color: var(--muted); font-size: 14px; }
.service-card, .admin-panel { padding: 22px; }
.about-section { background: #fff; }
.about-grid { grid-template-columns: 1.1fr .9fr; align-items: stretch; }
.about-copy { padding: 24px; }
.about-copy p { color: var(--muted); line-height: 1.8; }
.principle-grid { grid-template-columns: repeat(2, 1fr); }
.principle-grid div { padding: 20px; }
.principle-grid span { display: block; margin-bottom: 8px; color: var(--coral); font-size: 13px; font-weight: 800; }
.principle-grid strong { display: block; line-height: 1.55; color: var(--ink); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-head span { padding: 6px 10px; border-radius: 999px; color: #7a4d00; background: #fff4d9; font-size: 13px; font-weight: 700; }
label { display: grid; gap: 8px; margin: 14px 0; }
.hour-form { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.file-list {
  margin: -4px 0 12px;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #f7faf9;
  font-size: 13px;
  line-height: 1.6;
}

.team-grid { grid-template-columns: repeat(3, 1fr); }
.team-card { padding: 22px; min-height: 170px; }
.team-card span { display: inline-block; margin-top: 14px; color: var(--green-dark); font-weight: 800; }
.bases-section { background: #eef4f6; }
.base-grid { grid-template-columns: repeat(4, 1fr); }
.base-grid article { padding: 20px; min-height: 168px; }
.base-grid p { color: var(--muted); line-height: 1.7; }
.notice-list { display: grid; gap: 14px; margin-top: 22px; }
.notice-list article { display: grid; grid-template-columns: 72px 1fr; gap: 16px; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.notice-list time { color: var(--coral); font-weight: 800; }
.notice-list p, .team-card p, .profile-panel p { color: var(--muted); line-height: 1.6; margin-bottom: 0; }
.notice-admin-form {
  display: grid;
  grid-template-columns: 90px 1fr 1.4fr auto;
  gap: 10px;
  margin-top: 20px;
}
.notice-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.notice-result {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #c9e2d6;
  border-radius: 8px;
  background: #f3fbf6;
  color: var(--green-dark);
  font-weight: 700;
  font-size: 14px;
}
.notice-title-input,
.notice-content-input {
  width: 100%;
  margin-bottom: 10px;
}
.notice-content-input {
  min-height: 86px;
  resize: vertical;
}

.admin-section { background: #fff; border-top: 1px solid var(--line); }
.admin-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.admin-grid { grid-template-columns: 1.3fr .7fr; }
.review-admin-panel { grid-column: span 2; }
.activity-admin-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}
.activity-admin-form label:nth-of-type(6),
.activity-admin-form button {
  grid-column: span 2;
}
.activity-admin-list { margin-top: 18px; }
.review-admin-photos {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0 18px;
}
.review-admin-photos figure {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}
.review-admin-photos img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.review-admin-photos button {
  position: absolute;
  right: 8px;
  bottom: 8px;
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 13px 10px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-weight: 700; }
.mini-btn { min-height: 32px; border: 0; border-radius: 7px; padding: 0 10px; color: #fff; background: var(--blue); cursor: pointer; }
.muted-btn { color: #52626c; background: #eef4f6; }
.inline-input {
  min-width: 120px;
  height: 34px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 13px;
}
.inline-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.bar-row { display: grid; grid-template-columns: 88px 1fr 44px; align-items: center; gap: 10px; margin: 20px 0; color: var(--muted); font-size: 14px; }
.bar-row b { display: block; height: 10px; border-radius: 999px; background: linear-gradient(90deg, var(--green), var(--gold)); }
.bar-row em { font-style: normal; color: var(--ink); font-weight: 800; }

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100vw - 44px));
  padding: 13px 16px;
  border-radius: 8px;
  color: #fff;
  background: rgba(23,32,38,.92);
  box-shadow: var(--shadow);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: .22s ease;
}
.toast.show { transform: translateY(0); opacity: 1; }

dialog { width: min(520px, calc(100vw - 32px)); border: 0; border-radius: 8px; padding: 0; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(23,32,38,.48); }
dialog form { padding: 24px; }
.review-dialog { width: min(920px, calc(100vw - 32px)); }
.team-dialog { width: min(820px, calc(100vw - 32px)); }
.review-dialog form { position: relative; }
.review-edit-btn {
  position: absolute;
  top: 24px;
  right: 66px;
  min-height: 34px;
}
.review-date { color: var(--coral); font-size: 14px; font-weight: 800; }
.review-copy { color: var(--muted); line-height: 1.8; }
.review-inline-editor {
  display: none;
  margin: 14px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}
.review-inline-editor.open { display: block; }
.review-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
}
.review-edit-grid input,
.review-inline-editor textarea {
  width: 100%;
}
.review-photos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.review-photos figure {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}
.review-photos img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}
.review-photos figcaption {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
}
.empty-photos {
  grid-column: 1 / -1;
  padding: 30px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  background: #f7faf9;
}
.review-inline-remove {
  position: absolute;
  right: 10px;
  top: 10px;
}
.team-leader-list {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}
.leader-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}
.leader-view strong { display: inline-block; margin-right: 8px; color: var(--ink); }
.leader-view span { color: var(--green-dark); font-weight: 800; }
.leader-view p { margin: 8px 0; color: var(--muted); line-height: 1.6; }
.leader-view em { color: var(--coral); font-style: normal; font-weight: 800; }
.leader-edit {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.4fr auto;
  gap: 8px;
  margin-top: 12px;
}
.leader-input {
  height: 34px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 13px;
}
.close-btn { float: right; width: 34px; height: 34px; border: 0; border-radius: 8px; background: #eef4f6; cursor: pointer; font-size: 22px; }
menu { display: flex; justify-content: flex-end; gap: 10px; padding: 0; margin: 18px 0 0; }

/* Layout polish */
body {
  background:
    linear-gradient(180deg, #f6faf8 0%, #eef5f2 46%, #f7faf9 100%);
}
.topbar {
  height: 64px;
  padding: 0 clamp(18px, 4vw, 56px);
}
.brand span:last-child {
  white-space: nowrap;
}
.nav {
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(220,228,231,.72);
  border-radius: 999px;
  background: rgba(247,250,249,.86);
}
.nav a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
}
.nav a:hover {
  color: var(--green-dark);
  background: #e8f5ef;
}
.user-area {
  min-width: 0;
}
.hero {
  min-height: calc(92vh - 64px);
  padding-top: 58px;
}
.hero-content {
  padding: 4px 0;
}
.hero-copy {
  max-width: 700px;
}
.section {
  max-width: 1480px;
  margin: 0 auto;
  width: 100%;
  padding-block: 66px;
}
.workbench-section,
.about-section,
.bases-section,
.admin-section {
  max-width: none;
}
.workbench-section > *,
.about-section > *,
.bases-section > *,
.admin-section > * {
  max-width: 1480px;
  margin-left: auto;
  margin-right: auto;
}
.section-head {
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(220,228,231,.78);
}
.section-head h2 {
  font-size: clamp(28px, 3vw, 38px);
}
.toolbar {
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.76);
}
.toolbar input {
  flex: 1 1 320px;
}
.activity-card,
.team-card,
.service-card,
.admin-panel,
.metric,
.about-copy,
.principle-grid div,
.base-grid article,
.portal-card,
.work-panel {
  box-shadow: 0 10px 28px rgba(23,32,38,.055);
}
.activity-card:hover,
.team-card:hover,
.base-grid article:hover,
.portal-card:hover,
.work-panel:hover {
  box-shadow: 0 16px 34px rgba(23,32,38,.09);
}
.activity-grid {
  gap: 20px;
  padding: 4px 2px 10px;
}
.activity-grid .activity-card {
  flex-basis: min(382px, 86vw);
}
.activity-card img,
.activity-empty-cover {
  height: 190px;
}
.activity-body {
  padding: 20px;
}
.activity-body h3 {
  min-height: 48px;
  line-height: 1.35;
}
.portal-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.portal-card {
  min-height: 178px;
}
.workspace-grid {
  gap: 20px;
}
.work-panel {
  padding: 24px;
}
.message-panel {
  grid-column: 1 / -1;
}
.panel-title {
  min-height: 40px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(220,228,231,.72);
}
.table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
table {
  min-width: 720px;
}
th {
  background: #f7faf9;
}
th:first-child,
td:first-child {
  padding-left: 14px;
}
th:last-child,
td:last-child {
  padding-right: 14px;
}
.honor-lists {
  gap: 18px;
}
.notice-list article,
.message-item,
.leader-card {
  box-shadow: 0 8px 20px rgba(23,32,38,.045);
}
.admin-grid {
  align-items: start;
}
.review-dialog,
.team-dialog {
  max-height: calc(100vh - 36px);
  overflow: auto;
}
.toast {
  z-index: 120;
}

body.device-tablet .section {
  padding-inline: 32px;
}
body.device-tablet .portal-grid,
body.device-tablet .base-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
body.device-tablet .admin-grid,
body.device-tablet .split,
body.device-tablet .about-grid,
body.device-tablet .workspace-grid {
  grid-template-columns: 1fr;
}
body.device-tablet .team-grid,
body.device-tablet .metric-grid,
body.device-tablet .stats-band {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
body.device-mobile .topbar {
  min-height: 64px;
}
body.device-mobile .section {
  padding-inline: 16px;
}
body.device-mobile .activity-grid,
body.device-mobile .portal-grid,
body.device-mobile .team-grid,
body.device-mobile .base-grid,
body.device-mobile .admin-grid,
body.device-mobile .split,
body.device-mobile .about-grid,
body.device-mobile .workspace-grid,
body.device-mobile .review-edit-grid {
  grid-template-columns: 1fr;
}
body.device-mobile button,
body.device-mobile .primary-btn,
body.device-mobile .secondary-btn,
body.device-mobile input,
body.device-mobile select {
  min-height: 44px;
}
body.device-mobile textarea {
  min-height: 96px;
}
body.device-mobile dialog {
  width: calc(100vw - 20px);
  max-height: calc(100vh - 20px);
}

@media (max-width: 940px) {
  .nav { display: none; position: absolute; left: 18px; right: 18px; top: 72px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
  .nav.open { display: grid; gap: 12px; }
  .nav a { border-radius: 8px; }
  .menu-btn { display: grid; place-items: center; width: 42px; background: #eef4f6; }
  .activity-grid, .team-grid, .admin-grid, .split, .about-grid, .base-grid, .workspace-grid { grid-template-columns: 1fr; }
  .portal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .message-panel { grid-column: auto; }
  .review-admin-panel { grid-column: auto; }
  .activity-admin-form,
  .activity-admin-form label:nth-of-type(6),
  .activity-admin-form button { grid-column: auto; }
  .stats-band, .metric-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  body { font-size: 15px; }
  .login-screen { padding: 16px; align-items: end; }
  .login-card { padding: 20px; margin-bottom: 10px; }
  .login-brand h1 { font-size: 26px; }
  .login-brand p { font-size: 13px; }
  .role-tabs { gap: 6px; }
  .login-row { align-items: flex-start; flex-direction: column; }
  .topbar { height: 58px; padding: 0 10px; gap: 8px; }
  .brand { gap: 8px; }
  .brand span:last-child { max-width: 72px; overflow: hidden; text-overflow: ellipsis; }
  .brand-mark { width: 30px; height: 30px; }
  .sync-status, .clock-badge { display: none; }
  .user-area { gap: 6px; margin-left: auto; }
  .user-badge { max-width: 88px; overflow: hidden; text-overflow: ellipsis; min-height: 30px; padding: 0 8px; font-size: 12px; }
  .logout-btn { display: none; }
  .menu-btn { width: 38px; min-width: 38px; }
  .nav { left: 10px; right: 10px; top: 62px; }
  .hero { min-height: calc(100vh - 58px); padding: 82px 18px 94px; align-items: flex-end; }
  h1 { font-size: clamp(44px, 18vw, 64px); }
  .hero-copy { font-size: 16px; line-height: 1.7; }
  .hero-actions { width: 100%; gap: 10px; }
  .hero-actions a { flex: 1 1 130px; }
  .hero-controls { left: 18px; right: 18px; bottom: 22px; justify-content: space-between; }
  .slider-btn { width: 38px; height: 38px; font-size: 24px; }
  .hero-dot { width: 24px; }
  .section { padding: 48px 14px; }
  .section-head { gap: 12px; margin-bottom: 18px; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .filters { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .chip { flex: 0 0 auto; }
  .stats-band, .metric-grid, .principle-grid, .honor-lists, .review-admin-photos, .honor-edit-row, .leader-edit, .notice-admin-form, .portal-grid { grid-template-columns: 1fr; }
  .stats-band div { padding: 20px 18px; }
  .activity-foot, .card-head { align-items: flex-start; flex-direction: column; }
  .activity-grid { gap: 14px; scroll-padding-left: 2px; }
  .activity-scrollbar.dragging + .activity-grid,
  .activity-grid {
    scroll-snap-type: none;
  }
  .activity-grid .activity-card { flex-basis: min(318px, 86vw); }
  .activity-card img, .activity-empty-cover { height: 172px; }
  .activity-body { padding: 16px; }
  .activity-body h3 { min-height: auto; }
  .activity-meta { font-size: 13px; }
  .activity-scrollbar { width: 86%; height: 16px; }
  .toolbar { padding: 12px; display: grid; grid-template-columns: 1fr; }
  .toolbar input, .toolbar select { max-width: none; }
  .portal-card { min-height: auto; padding: 18px; }
  .portal-card span { width: 38px; height: 38px; margin-bottom: 12px; }
  .work-panel, .service-card, .admin-panel, .about-copy { padding: 18px; }
  .profile-panel { align-items: flex-start; }
  .avatar { width: 52px; height: 52px; font-size: 22px; }
  .notice-list article { grid-template-columns: 1fr; gap: 8px; padding: 16px; }
  .notice-list time { font-size: 13px; }
  .message-item { padding: 13px; }
  .inline-actions { flex-wrap: wrap; }
  .mini-btn { min-height: 34px; }
  .review-photos { grid-template-columns: 1fr; }
  dialog form { padding: 18px; }
  .review-edit-btn { position: static; margin: 4px 0 12px; }
  .review-copy { line-height: 1.7; }
  .team-leader-list { margin: 14px 0; }
  h2 { font-size: 28px; }
  h3 { font-size: 17px; }
  .bar-row { grid-template-columns: 1fr; }
  table { min-width: 640px; }
  th, td { padding: 11px 9px; font-size: 13px; }
  .toast { left: 14px; right: 14px; bottom: 14px; max-width: none; text-align: center; }
}
