:root {
  color-scheme: light;
  --hero-image: url("./assets/hero.jpg");
  --avatar-image: url("./assets/avatar.jpg");
  --logo-image: url("./assets/logo.png");
  --mascot-image: url("./assets/mascot.png");
  --bg: #eef7fb;
  --bg-soft: #f7fbfd;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: rgba(255, 255, 255, 0.94);
  --line: rgba(72, 132, 158, 0.18);
  --text: #223345;
  --muted: #678093;
  --blue: #53b8dd;
  --blue-strong: #1f93bd;
  --teal: #8ad9dc;
  --peach: #f3a68d;
  --lavender: #a99de8;
  --danger: #d95d72;
  --shadow: 0 18px 42px rgba(67, 117, 143, 0.16);
  --radius-card: 8px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  background:
    linear-gradient(180deg, rgba(238, 247, 251, 0.74), rgba(247, 251, 253, 0.96) 32rem),
    linear-gradient(135deg, #dff3fb, #fff8f4 58%, #eef1ff);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(58, 124, 154, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(58, 124, 154, 0.05) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent 78%);
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

code {
  color: var(--blue-strong);
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 58px;
  padding: 0.6rem clamp(1rem, 4vw, 3.2rem);
  color: #1c3446;
  background: rgba(255, 255, 255, 0.54);
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 10px 34px rgba(70, 126, 154, 0.1);
  backdrop-filter: blur(18px);
}

.home-page .site-nav,
.auth-page .site-nav {
  position: fixed;
  width: 100%;
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  max-width: min(52vw, 30rem);
  color: #21394a;
  font-weight: 820;
  text-decoration: none;
}

.brand-name {
  min-width: 0;
  display: block;
  overflow-wrap: anywhere;
  line-height: 1.18;
}

.brand-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 50%;
  background-image: var(--logo-image), linear-gradient(135deg, #ffffff, #bfe9f5 48%, #ffe0d3);
  background-position: center;
  background-size: cover;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 18px rgba(67, 117, 143, 0.22);
}

.nav-links,
.top-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links a,
.nav-links button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.75rem;
  color: #294b5d;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.nav-links a:hover,
.nav-links button:hover {
  color: #0d6387;
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(83, 184, 221, 0.24);
}

.media-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.media-hero > :not(.hero-video):not(.hero-overlay) {
  position: relative;
  z-index: 2;
}

.hero-video {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  background: transparent;
  transition: opacity 280ms ease;
}

.hero-video.is-ready {
  opacity: 1;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.hero .hero-overlay {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(223, 243, 251, 0.68) 75%, rgba(238, 247, 251, 0.96)),
    linear-gradient(90deg, rgba(59, 123, 153, 0.18), rgba(255, 255, 255, 0.12));
}

.auth-visual .hero-overlay {
  background: linear-gradient(180deg, rgba(30, 83, 112, 0.08), rgba(35, 77, 104, 0.35));
}

.sub-hero .hero-overlay {
  background: linear-gradient(180deg, rgba(45, 105, 137, 0.06), rgba(57, 111, 139, 0.34));
}

.hero {
  min-height: clamp(430px, 58vh, 650px);
  display: grid;
  place-items: center;
  padding: 6rem 1rem 5.5rem;
  position: relative;
  overflow: hidden;
  color: #ffffff;
  background-image:
    var(--hero-image),
    linear-gradient(135deg, #9fd8f4, #eefbff 42%, #ffd8ca);
  background-position: center;
  background-size: cover;
}

.hero-copy {
  width: min(720px, 100%);
  text-align: center;
  text-shadow: 0 10px 28px rgba(29, 77, 103, 0.34);
}

.eyebrow {
  margin: 0 0 0.6rem;
  color: rgba(33, 67, 88, 0.68);
  font-size: 0.78rem;
  font-weight: 820;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow,
.auth-visual .eyebrow,
.sub-hero .eyebrow {
  color: rgba(255, 255, 255, 0.9);
}

.hero h1,
.auth-visual h1,
.sub-hero h1 {
  margin: 0;
  font-size: clamp(2.8rem, 8vw, 5.4rem);
  line-height: 1;
  font-weight: 880;
  letter-spacing: 0;
}

.site-title {
  display: grid;
  gap: 0.22rem;
}

.hero .site-title {
  font-size: clamp(2.2rem, 7vw, 4.9rem);
  line-height: 1.08;
}

.auth-visual .site-title {
  font-size: clamp(2rem, 5.4vw, 4rem);
  line-height: 1.08;
  text-wrap: balance;
}

.site-title span {
  display: block;
}

.hero p:last-child,
.auth-visual p:last-child {
  margin: 0.9rem 0 0;
  font-size: clamp(1rem, 2.4vw, 1.35rem);
  color: rgba(255, 255, 255, 0.92);
}

.mizuki-shell {
  width: min(1280px, calc(100% - 2rem));
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 250px;
  align-items: start;
  gap: 1rem;
  margin: -4.7rem auto 0;
  padding-bottom: 2rem;
  position: relative;
  z-index: 5;
}

.shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 2rem;
}

.profile-panel,
.stats-panel,
.content-panel {
  min-width: 0;
}

.profile-panel,
.stats-panel {
  display: grid;
  gap: 1rem;
}

.avatar-card,
.side-note,
.widget,
.file-card,
.auth-card,
.admin-card,
.empty,
.player-empty,
.video-stage,
.file-preview-panel,
.video-info-panel,
.comments-panel,
.modal-card {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.avatar-card {
  overflow: hidden;
  text-align: center;
  padding-bottom: 1rem;
}

.avatar-art {
  width: 100%;
  aspect-ratio: 1 / 1;
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.62)),
    var(--avatar-image),
    linear-gradient(135deg, #e6f7ff, #f7e7ff 52%, #ffe5dc);
  background-position: center;
  background-size: cover;
}

.avatar-card h2 {
  margin: 0.9rem 0 0.25rem;
  padding: 0 0.75rem;
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.avatar-card p,
.side-note span,
.widget p,
.file-card p,
.admin-card p,
.auth-card p,
.comments-head p,
.file-preview-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.side-note,
.widget {
  padding: 1rem;
}

.side-note {
  display: grid;
  gap: 0.35rem;
}

.widget h2 {
  margin: 0 0 0.85rem;
  font-size: 1rem;
}

.widget.compact {
  background: rgba(255, 255, 255, 0.64);
}

.widget dl {
  display: grid;
  gap: 0.75rem;
  margin: 0;
}

.widget dl div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

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

.widget dd {
  margin: 0;
  font-weight: 820;
  color: #2d6d8a;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.search,
.auth-form label {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.search input,
.auth-form input,
.auth-form textarea,
.comment-form textarea,
.upload-box input {
  width: 100%;
  min-height: 44px;
  padding: 0.72rem 0.85rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(91, 151, 178, 0.22);
  border-radius: 8px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.search input,
.auth-form input {
  height: 44px;
  padding-block: 0;
}

.auth-form textarea,
.comment-form textarea {
  resize: vertical;
  line-height: 1.55;
}

.search input::placeholder,
.auth-form input::placeholder,
.auth-form textarea::placeholder,
.comment-form textarea::placeholder {
  color: rgba(94, 126, 145, 0.62);
}

.search input:focus,
.auth-form input:focus,
.auth-form textarea:focus,
.comment-form textarea:focus {
  background: #ffffff;
  border-color: rgba(31, 147, 189, 0.72);
  box-shadow: 0 0 0 4px rgba(83, 184, 221, 0.16);
}

.summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  color: var(--muted);
  white-space: nowrap;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

.file-card {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.85rem;
  padding: 0.95rem;
  overflow: hidden;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.file-card:hover,
.admin-card:hover,
.auth-card:hover {
  transform: translateY(-2px);
  border-color: rgba(83, 184, 221, 0.45);
  box-shadow: 0 20px 48px rgba(67, 117, 143, 0.2);
}

.file-badge,
.file-preview-badge,
.status-pill {
  width: fit-content;
  min-width: 54px;
  max-width: 100%;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.55rem;
  color: #10516b;
  background: rgba(138, 217, 220, 0.3);
  border: 1px solid rgba(83, 184, 221, 0.36);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 820;
}

.file-badge.video {
  color: #8b4860;
  background: rgba(243, 166, 141, 0.27);
  border-color: rgba(243, 166, 141, 0.48);
}

.file-card h2 {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.38;
  overflow-wrap: anywhere;
}

.file-card p {
  margin-top: 0.25rem;
  font-size: 0.83rem;
}

.file-meta {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.84rem;
}

.stat-pills,
.video-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.stat-pills span,
.video-metrics span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.22rem 0.58rem;
  color: #31576b;
  background: rgba(238, 247, 251, 0.88);
  border: 1px solid rgba(91, 151, 178, 0.16);
  border-radius: 999px;
  font-size: 0.8rem;
  white-space: nowrap;
}

.actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(72px, 1fr));
  gap: 0.5rem;
}

.button,
.icon-button,
.control-button,
.back-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  padding: 0 0.9rem;
  color: #255064;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(91, 151, 178, 0.22);
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button.primary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), var(--lavender));
  border-color: rgba(255, 255, 255, 0.65);
  font-weight: 820;
  box-shadow: 0 12px 24px rgba(83, 184, 221, 0.22);
}

.button.danger,
.danger {
  color: #9e3149;
  border-color: rgba(217, 93, 114, 0.32);
  background: rgba(255, 231, 235, 0.84);
}

.button.small {
  min-height: 34px;
  padding: 0 0.78rem;
  font-size: 0.9rem;
}

.button.full {
  width: 100%;
}

.icon-button {
  width: 40px;
  padding: 0;
  font-weight: 820;
}

.button:hover,
.icon-button:hover,
.control-button:hover,
.back-link:hover {
  transform: translateY(-1px);
  background: #ffffff;
  border-color: rgba(31, 147, 189, 0.55);
  box-shadow: 0 12px 26px rgba(67, 117, 143, 0.16);
}

.empty,
.player-empty {
  margin-top: 1rem;
  padding: 1.35rem;
  color: var(--muted);
}

.empty h2,
.player-empty h1,
.admin-card h2,
.auth-card h1,
.comments-head h2,
.modal-head h2 {
  margin: 0 0 0.45rem;
  color: var(--text);
  letter-spacing: 0;
}

.auth-page {
  display: grid;
  place-items: center;
  padding: 1rem;
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(238, 247, 251, 0.88)),
    var(--hero-image),
    linear-gradient(135deg, #9fd8f4, #eefbff 42%, #ffd8ca);
  background-size: cover;
  background-position: center;
}

.auth-shell {
  width: min(980px, 100%);
  min-height: min(680px, calc(100vh - 2rem));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
  align-items: stretch;
  gap: 1rem;
}

.auth-visual {
  min-height: 520px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.1rem;
  color: #ffffff;
  border-radius: var(--radius-card);
  background-image:
    var(--hero-image),
    linear-gradient(135deg, #9fd8f4, #eefbff 42%, #ffd8ca);
  background-position: center;
  background-size: cover;
  box-shadow: var(--shadow);
}

.auth-brand {
  color: #ffffff;
  text-shadow: 0 8px 20px rgba(20, 80, 110, 0.24);
}

.auth-card {
  display: grid;
  align-content: center;
  gap: 1rem;
  padding: clamp(1.2rem, 5vw, 2rem);
}

.auth-card h1 {
  font-size: clamp(1.6rem, 5vw, 2.15rem);
}

.auth-form {
  display: grid;
  gap: 0.85rem;
}

.auth-message {
  min-height: 1.45rem;
  color: #31576b;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.sub-hero {
  min-height: 260px;
  display: flex;
  align-items: end;
  padding: 5.2rem clamp(1rem, 4vw, 3.2rem) 2rem;
  color: #ffffff;
  background-image:
    var(--hero-image),
    linear-gradient(135deg, #95d4f1, #effbff 48%, #ffd8ca);
  background-position: center;
  background-size: cover;
}

.sub-hero h1 {
  max-width: 900px;
  font-size: clamp(2rem, 5vw, 3.7rem);
  text-shadow: 0 10px 28px rgba(29, 77, 103, 0.3);
}

.admin-shell {
  max-width: 1180px;
}

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

.admin-card {
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

.admin-card.wide {
  grid-column: 1 / -1;
}

.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.section-heading h2 {
  margin-bottom: 0.35rem;
}

.announcement-form {
  gap: 1rem;
}

.announcement-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  align-items: center;
  gap: 0.8rem;
}

.announcement-meta,
.storage-panel,
.upload-form {
  padding: 0.85rem 0;
  color: var(--muted);
  border-top: 1px solid rgba(91, 151, 178, 0.14);
  border-bottom: 1px solid rgba(91, 151, 178, 0.14);
}

.storage-panel {
  display: grid;
  gap: 0.75rem;
}

.storage-head,
.storage-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.storage-head div {
  min-width: 0;
  display: grid;
  gap: 0.25rem;
}

.storage-head span,
.storage-stats span {
  color: var(--muted);
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}

#storagePercent {
  color: #ffffff;
  padding: 0.32rem 0.68rem;
  background: linear-gradient(135deg, var(--blue), var(--lavender));
  border-radius: 999px;
  white-space: nowrap;
}

.storage-bar {
  height: 14px;
  overflow: hidden;
  background: rgba(220, 237, 246, 0.9);
  border: 1px solid rgba(91, 151, 178, 0.16);
  border-radius: 999px;
}

.storage-bar span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--teal), var(--peach));
  border-radius: inherit;
  transition: width 220ms ease;
}

.upload-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.85rem;
}

.upload-box {
  display: grid;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.upload-form .auth-message {
  grid-column: 1 / -1;
}

.file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.file-table {
  min-width: 780px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

th,
td {
  padding: 0.78rem;
  border-bottom: 1px solid rgba(91, 151, 178, 0.14);
  text-align: left;
  vertical-align: middle;
}

th {
  color: #517285;
  font-size: 0.82rem;
  font-weight: 780;
}

td {
  color: var(--text);
  overflow-wrap: anywhere;
}

.export-actions {
  max-width: 540px;
}

.player-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.player-nav {
  background: rgba(255, 255, 255, 0.76);
}

.player-title {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  font-weight: 780;
  color: #294b5d;
}

.player-shell {
  width: min(1180px, calc(100% - 2rem));
  flex: 1;
  display: grid;
  align-items: start;
  gap: 1rem;
  margin: 0 auto;
  padding: 1.25rem 0 2rem;
}

.video-stage {
  width: 100%;
  display: grid;
  gap: 0;
  overflow: hidden;
  background: #071016;
}

.video-stage video {
  width: 100%;
  max-height: calc(100vh - 190px);
  aspect-ratio: 16 / 9;
  display: block;
  background: #000;
  object-fit: contain;
}

.player-controls {
  display: grid;
  grid-template-columns: auto auto minmax(80px, 1fr) auto auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem;
  color: #d9f4ff;
  background: rgba(7, 16, 22, 0.94);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.control-button {
  color: #d9f4ff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
}

.time {
  min-width: 48px;
  color: rgba(217, 244, 255, 0.78);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.range {
  width: 100%;
  accent-color: var(--blue);
}

.range:disabled {
  opacity: 0.45;
}

.video-stage:fullscreen {
  width: 100vw;
  height: 100vh;
  border: 0;
  border-radius: 0;
  background: #000;
}

.video-stage:fullscreen video {
  height: calc(100vh - 58px);
  max-height: none;
  aspect-ratio: auto;
}

.file-preview-panel {
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

.file-preview-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.file-preview-head h1 {
  margin: 0.45rem 0 0.25rem;
  overflow-wrap: anywhere;
  font-size: clamp(1.25rem, 4vw, 1.8rem);
  letter-spacing: 0;
}

.file-preview-body {
  min-height: 170px;
  max-height: min(58vh, 680px);
  margin: 0;
  overflow: auto;
  padding: 1rem;
  color: var(--text);
  background: rgba(247, 251, 253, 0.88);
  border: 1px solid rgba(91, 151, 178, 0.14);
  border-radius: 8px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.6;
}

.file-preview-body.text-preview {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", "Microsoft YaHei Mono", monospace;
  font-size: 0.92rem;
  white-space: pre-wrap;
}

.video-info-panel,
.comments-panel {
  padding: 1rem;
}

.comments-panel {
  display: grid;
  gap: 1rem;
}

.comments-head,
.comment-form-actions,
.modal-head,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.comments-head p {
  margin-top: 0.3rem;
  font-size: 0.9rem;
}

.comment-form {
  display: grid;
  gap: 0.75rem;
}

.comment-editor {
  overflow: hidden;
  background: rgba(247, 251, 253, 0.86);
  border: 1px solid rgba(91, 151, 178, 0.16);
  border-radius: 8px;
}

.comment-editor textarea {
  min-height: 128px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.comment-editor textarea:focus {
  box-shadow: none;
}

.comment-editor:focus-within {
  border-color: rgba(31, 147, 189, 0.55);
  box-shadow: 0 0 0 4px rgba(83, 184, 221, 0.13);
}

.comment-editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem;
  background: rgba(238, 247, 251, 0.74);
  border-top: 1px solid rgba(91, 151, 178, 0.12);
}

.comment-editor-footer span {
  color: var(--muted);
  font-size: 0.86rem;
  white-space: nowrap;
}

.comment-list {
  display: grid;
  gap: 0.75rem;
}

.comment-item,
.comment-empty {
  padding: 0.85rem;
  background: rgba(247, 251, 253, 0.86);
  border: 1px solid rgba(91, 151, 178, 0.14);
  border-radius: 8px;
}

.comment-item {
  display: grid;
  gap: 0.65rem;
}

.comment-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.comment-item-head span,
.comment-empty {
  color: var(--muted);
  font-size: 0.86rem;
}

.comment-item p {
  margin: 0;
  color: var(--text);
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.comment-item .button {
  justify-self: start;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(38, 72, 91, 0.34);
  backdrop-filter: blur(12px);
}

.modal-backdrop.is-hidden,
.modal-backdrop[hidden] {
  display: none !important;
}

.modal-card {
  width: min(620px, 100%);
  display: grid;
  gap: 1rem;
  padding: 1.2rem;
}

.announcement-mark {
  width: fit-content;
  padding: 0.26rem 0.65rem;
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), var(--lavender));
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 850;
}

.announcement-body {
  max-height: min(48vh, 430px);
  overflow: auto;
  color: var(--text);
  line-height: 1.62;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 1rem;
  background: rgba(247, 251, 253, 0.86);
  border: 1px solid rgba(91, 151, 178, 0.14);
  border-radius: 8px;
}

.modal-actions {
  justify-content: flex-end;
}

@media (max-width: 1080px) {
  .mizuki-shell {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .stats-panel {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .site-nav {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.55rem;
  }

  .home-page .site-nav {
    position: absolute;
  }

  .nav-links {
    width: 100%;
    justify-content: flex-start;
  }

  .brand {
    max-width: 100%;
  }

  .hero {
    min-height: 500px;
    padding-top: 7rem;
  }

  .mizuki-shell,
  .admin-grid,
  .auth-shell,
  .stats-panel {
    grid-template-columns: 1fr;
  }

  .mizuki-shell {
    margin-top: -3.8rem;
  }

  .profile-panel {
    display: none;
  }

  .toolbar,
  .file-card,
  .upload-form,
  .announcement-tools {
    grid-template-columns: 1fr;
  }

  .summary {
    justify-content: flex-start;
    min-height: auto;
  }

  .file-meta {
    grid-column: auto;
  }

  .auth-visual {
    min-height: 300px;
  }

  .comments-head,
  .comment-form-actions,
  .comment-editor-footer,
  .modal-head,
  .modal-actions,
  .section-heading,
  .file-preview-head,
  .storage-head,
  .storage-stats {
    align-items: stretch;
    flex-direction: column;
  }

  .comments-head .button,
  .comment-form-actions .button,
  .comment-editor-footer .button,
  .modal-actions .button,
  .upload-form .button,
  .file-preview-head .button {
    width: 100%;
  }

  .player-controls {
    grid-template-columns: auto 1fr auto;
    gap: 0.55rem;
  }

  .player-controls .range {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .player-controls .control-button:first-child {
    grid-column: 1;
    grid-row: 2;
  }

  .player-controls .time {
    grid-row: 2;
  }

  .player-controls .control-button:last-child {
    grid-column: 3;
    grid-row: 2;
  }
}

@media (max-width: 460px) {
  .actions,
  .export-actions {
    grid-template-columns: 1fr;
  }

  .button,
  .control-button,
  .back-link {
    padding-inline: 0.72rem;
  }

  .hero-copy {
    text-align: left;
  }

  .hero .site-title,
  .auth-visual .site-title {
    font-size: clamp(2rem, 12vw, 3.05rem);
  }
}
