:root {
  --ink: #111827;
  --muted: #667085;
  --line: #dfe6f0;
  --paper: #f3f6fb;
  --white: #fff;
  --blue: #245ee8;
  --blue-soft: #eaf1ff;
  --green: #08784b;
  --green-soft: #e8f8ef;
  --amber: #9a6508;
  --amber-soft: #fff3d8;
  --red: #b50d35;
  --red-soft: #fff0f3;
  --shadow: 0 24px 70px rgba(28, 38, 60, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(36, 94, 232, 0.12), transparent 34rem),
    linear-gradient(180deg, #fff 0%, var(--paper) 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.notice-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(18px, 5vw, 72px);
  background: rgba(7, 20, 58, 0.84);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 18px 48px rgba(7, 20, 58, 0.18);
  backdrop-filter: blur(22px) saturate(145%);
}

.notice-brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: #fff;
  font-weight: 950;
}

.notice-brand img {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.notice-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.notice-header nav a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 15px;
  color: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 850;
}

.notice-header nav a[aria-current="page"],
.notice-header nav a:hover {
  color: #07143a;
  background: #fff;
}

.notice-page {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(26px, 5vw, 56px) 0 64px;
}

.notice-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: end;
  margin-bottom: 22px;
}

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

.notice-hero h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 86px);
  line-height: 0.92;
}

.notice-hero p {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.45;
}

.primary-action,
.soft-action,
.icon-button {
  cursor: pointer;
  border: 0;
  font-weight: 950;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 24px;
  color: #fff;
  background: #10131b;
  border-radius: 999px;
  box-shadow: 0 16px 42px rgba(16, 19, 27, 0.18);
}

.soft-action {
  min-height: 46px;
  padding: 0 20px;
  color: #17335e;
  background: #fff;
  border: 1px solid #bfd1ff;
  border-radius: 999px;
  box-shadow: 0 14px 30px rgba(36, 94, 232, 0.1);
}

.notice-tools {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  margin: 0 auto 22px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 16px 50px rgba(20, 34, 61, 0.08);
}

.notice-tools div {
  display: grid;
  gap: 3px;
  padding: 13px 16px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.notice-tools strong {
  font-size: 15px;
}

.notice-tools span,
.section-heading h2,
.notice-meta span {
  color: var(--muted);
}

.notice-section {
  margin-top: 26px;
}

.section-heading {
  margin-bottom: 14px;
}

.section-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1;
}

.notice-wall {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

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

.notice-card {
  display: grid;
  gap: 14px;
  align-content: start;
  min-height: 240px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.notice-topline,
.notice-title-row,
.notice-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.notice-title-row span,
.notice-card strong {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 950;
}

.notice-topline time,
.notice-meta span {
  font-size: 12px;
  font-weight: 850;
}

.notice-topline time {
  color: var(--muted);
}

.delete-notice {
  min-height: 32px;
  padding: 0 12px;
  color: var(--red);
  background: #fff;
  border: 1px solid #ffc8d4;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 950;
}

.notice-card h3 {
  flex: 1 1 100%;
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1;
}

.notice-title-row {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.notice-card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.notice-message-preview {
  width: 100%;
  padding: 0;
  color: var(--muted);
  text-align: left;
  white-space: pre-wrap;
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  line-height: 1.5;
}

.notice-message-preview:hover {
  color: var(--ink);
}

.notice-card.important {
  background: linear-gradient(180deg, #fff 0%, var(--amber-soft) 100%);
  border-color: #f3d48a;
}

.notice-card.important span,
.notice-card.important strong {
  color: var(--amber);
  background: #fff8e8;
}

.notice-card.info {
  background: linear-gradient(180deg, #fff 0%, var(--blue-soft) 100%);
  border-color: #bfd1ff;
}

.notice-card.info span,
.notice-card.info strong {
  color: var(--blue);
  background: #f5f8ff;
}

.notice-card.success {
  background: linear-gradient(180deg, #fff 0%, var(--green-soft) 100%);
  border-color: #bfead2;
}

.notice-card.success span,
.notice-card.success strong {
  color: var(--green);
  background: #f1fff7;
}

.notice-links,
.attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.notice-links a,
.attachment.file {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 12px;
  color: #17335e;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.attachment-thumb {
  display: grid;
  align-content: end;
  width: 100px;
  height: 88px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.attachment-thumb.image img {
  width: 100%;
  height: 58px;
  object-fit: cover;
}

.attachment-thumb span {
  display: block;
  padding: 5px 7px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-thumb.file {
  gap: 4px;
  align-content: center;
  justify-items: center;
  padding: 8px;
  color: #17335e;
}

.attachment-thumb.file b {
  padding: 7px 9px;
  background: var(--blue-soft);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 950;
}

.soft-action.mini {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.notice-group {
  margin-bottom: 22px;
}

.notice-group > h3 {
  margin: 0 0 12px;
  font-size: 22px;
}

.notice-empty {
  margin: 12px 0 0;
  padding: 18px;
  color: var(--muted);
  text-align: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  font-weight: 850;
}

.notice-modal[hidden],
.toast[hidden] {
  display: none;
}

.notice-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 15, 30, 0.58);
  backdrop-filter: blur(14px);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: min(92vh, 920px);
  overflow: auto;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.22);
}

.viewer-panel {
  width: min(960px, 100%);
}

.attachment-gallery-panel {
  width: min(1180px, 100%);
  max-height: min(94vh, 980px);
}

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

.modal-head h2 {
  margin: 0;
  font-size: 34px;
}

.icon-button {
  width: 44px;
  height: 44px;
  color: var(--ink);
  background: #f3f6fb;
  border-radius: 50%;
}

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

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.field.full {
  grid-column: 1 / -1;
}

.field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  color: var(--ink);
  background: #f8fbff;
  border: 1px solid #ccd8e8;
  border-radius: 16px;
  font-weight: 760;
}

.field textarea {
  resize: vertical;
}

.check-row {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  background: var(--green-soft);
  border: 1px solid #bfead2;
  border-radius: 999px;
  color: var(--green);
  font-weight: 950;
}

.form-hint {
  margin: 14px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.viewer-message {
  margin: 0 0 18px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.viewer-attachments {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.viewer-attachments figure {
  margin: 0;
  overflow: hidden;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 18px;
}

.viewer-attachments .attachment-thumb {
  width: 100%;
  height: 210px;
}

.viewer-attachments .attachment-thumb.image img {
  height: 160px;
  object-fit: contain;
  background: #fff;
}

.viewer-attachments img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  background: #fff;
}

.viewer-attachments figcaption {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.viewer-file {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 18px;
}

.viewer-file b {
  padding: 8px 10px;
  color: var(--red);
  background: var(--red-soft);
  border-radius: 10px;
  font-weight: 950;
}

.viewer-file span {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-file a {
  padding: 8px 10px;
  color: var(--blue);
  background: #fff;
  border: 1px solid #bfd1ff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 950;
}

.viewer-actions {
  margin-top: 18px;
}

.attachment-gallery-stage {
  display: grid;
  place-items: center;
  min-height: 58vh;
  overflow: hidden;
  background: linear-gradient(180deg, #f8fbff 0%, #eef3fa 100%);
  border: 1px solid var(--line);
  border-radius: 24px;
}

.attachment-gallery-stage img,
.attachment-gallery-stage iframe {
  display: block;
  width: 100%;
  height: min(68vh, 720px);
  border: 0;
  object-fit: contain;
  background: #fff;
}

.attachment-gallery-stage iframe {
  border-radius: 18px;
}

.attachment-gallery-empty {
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 36px;
  color: var(--muted);
  text-align: center;
}

.attachment-gallery-empty b {
  color: var(--ink);
  font-size: 28px;
}

.attachment-gallery-footer {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.attachment-gallery-footer span {
  color: var(--muted);
  text-align: center;
  font-weight: 950;
}

.attachment-gallery-footer .soft-action:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 80;
  width: min(520px, calc(100% - 32px));
  transform: translateX(-50%);
  padding: 16px 20px;
  color: #fff;
  text-align: center;
  background: #10131b;
  border-radius: 20px;
  box-shadow: var(--shadow);
  font-weight: 950;
}

.toast[data-tone="warn"] {
  color: #4f3500;
  background: #ffe9b5;
}

.toast[data-tone="error"] {
  background: var(--red);
}

@media (max-width: 980px) {
  .notice-hero,
  .notice-tools,
  .notice-wall,
  .notice-wall.compact {
    grid-template-columns: 1fr;
  }

  .notice-header {
    justify-content: center;
  }

  .primary-action {
    width: 100%;
  }
}

@media (max-width: 620px) {
  .notice-page {
    width: min(100% - 22px, 1280px);
  }

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

  .notice-topline,
  .notice-title-row,
  .notice-meta,
  .modal-actions,
  .viewer-file {
    align-items: stretch;
    flex-direction: column;
  }

  .viewer-attachments {
    grid-template-columns: 1fr;
  }

  .attachment-gallery-panel {
    padding: 14px;
    border-radius: 22px;
  }

  .attachment-gallery-stage {
    min-height: 54vh;
  }

  .attachment-gallery-stage img,
  .attachment-gallery-stage iframe {
    height: 58vh;
  }

  .attachment-gallery-footer {
    grid-template-columns: 1fr 1fr;
  }

  .attachment-gallery-footer span,
  .attachment-gallery-footer .primary-action {
    grid-column: 1 / -1;
  }
}
