:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-soft: rgba(255, 255, 255, 0.86);
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(0, 0, 0, 0.08);
  --gold: #d9a327;
  --blue: #0066cc;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(217, 163, 39, 0.16), transparent 32rem),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 44%, #f1f4f8 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

svg {
  display: block;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
}

.nav-shell,
.shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.nav-shell {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-size: 15px;
  font-weight: 760;
  text-decoration: none;
  letter-spacing: 0;
}

.brand img {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 50%;
  object-fit: contain;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.brand span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-box {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.user-copy {
  min-width: 0;
  text-align: right;
}

.user-copy strong,
.user-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-copy strong {
  max-width: 220px;
  font-size: 14px;
  font-weight: 760;
}

.user-copy small {
  max-width: 220px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.logout-form {
  margin: 0;
}

.ghost-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 16px;
  color: var(--text);
  background: #ffffff;
  font-size: 13px;
  font-weight: 760;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.ghost-button:hover,
.ghost-button:focus-visible {
  border-color: rgba(0, 102, 204, 0.32);
  box-shadow: 0 10px 24px rgba(0, 102, 204, 0.12);
  transform: translateY(-1px);
}

.shell {
  padding: 78px 0 40px;
}

.hero {
  max-width: 920px;
  margin: 0 auto 42px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 18px;
  color: #8a6a1f;
  font-size: 12px;
  font-weight: 820;
  letter-spacing: 0.12em;
}

h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 86px);
  font-weight: 820;
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 760px;
  margin: 22px auto 0;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 23px);
  line-height: 1.45;
}

.hero-meta {
  margin: 19px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.hero-meta span::before {
  content: "-";
  margin: 0 9px;
}

.notice {
  max-width: 760px;
  margin: 0 auto 28px;
  display: grid;
  gap: 8px;
  border: 1px solid rgba(217, 163, 39, 0.26);
  border-radius: 20px;
  padding: 18px 20px;
  background: rgba(255, 250, 238, 0.9);
  box-shadow: 0 14px 36px rgba(126, 88, 12, 0.08);
}

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

.notice span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.notice a {
  width: fit-content;
  color: var(--blue);
  font-size: 14px;
  font-weight: 760;
  text-decoration: none;
}

.toolbar {
  max-width: 720px;
  margin: 0 auto 34px;
}

.search {
  height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  padding: 0 20px;
  background: var(--surface-soft);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

.search svg {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
}

.search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 16px;
}

.search:focus-within {
  border-color: rgba(0, 102, 204, 0.38);
  box-shadow: 0 18px 44px rgba(0, 102, 204, 0.13);
}

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

.system-card {
  min-width: 0;
  min-height: 260px;
}

.system-card[hidden] {
  display: none;
}

.card-link {
  min-height: 260px;
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 28px;
  padding: 26px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.card-link:hover,
.card-link:focus-visible {
  border-color: rgba(217, 163, 39, 0.45);
  box-shadow: 0 22px 58px rgba(15, 23, 42, 0.12);
  transform: translateY(-3px);
}

.card-link:focus-visible,
.ghost-button:focus-visible,
.notice a:focus-visible {
  outline: 3px solid rgba(0, 102, 204, 0.25);
  outline-offset: 3px;
}

.icon {
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 17px;
  color: var(--text);
  background: linear-gradient(145deg, #fff7da, #ffffff);
  border: 1px solid rgba(217, 163, 39, 0.22);
}

.icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-body {
  flex: 1;
  display: block;
  margin-top: 27px;
}

.card-body strong {
  display: block;
  font-size: 26px;
  font-weight: 820;
  line-height: 1.08;
  letter-spacing: 0;
}

.card-body small {
  display: -webkit-box;
  margin-top: 10px;
  overflow: hidden;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.card-action {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 28px;
  color: var(--blue);
  font-size: 15px;
  font-weight: 760;
}

.card-action em {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 650;
}

.card-action svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.empty-state {
  margin: 32px auto;
  color: var(--muted);
  text-align: center;
  font-size: 15px;
}

.footer {
  margin-top: 44px;
  padding: 20px 0 8px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 980px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .nav-shell,
  .shell {
    width: min(100% - 24px, 1180px);
  }

  .nav-shell {
    min-height: 66px;
    gap: 12px;
  }

  .brand {
    gap: 10px;
    font-size: 14px;
  }

  .brand img {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .user-box {
    gap: 10px;
  }

  .user-copy strong,
  .user-copy small {
    max-width: 150px;
  }

  .ghost-button {
    min-height: 38px;
    padding: 0 13px;
  }

  .shell {
    padding: 52px 0 28px;
  }

  .hero {
    margin-bottom: 30px;
  }

  h1 {
    font-size: 44px;
    line-height: 1.02;
  }

  .hero-copy {
    font-size: 18px;
  }

  .hero-meta span {
    display: block;
    margin-top: 6px;
  }

  .hero-meta span::before {
    content: "";
    margin: 0;
  }

  .search {
    height: 54px;
    padding: 0 17px;
  }

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

  .system-card,
  .card-link {
    min-height: 230px;
  }

  .card-link {
    border-radius: 24px;
    padding: 23px;
  }

  .card-body strong {
    font-size: 24px;
  }

  .footer {
    flex-direction: column;
  }
}

@media (max-width: 430px) {
  .brand span {
    max-width: 100px;
  }

  .user-copy strong,
  .user-copy small {
    max-width: 112px;
  }

  h1 {
    font-size: 38px;
  }

  .card-action {
    flex-wrap: wrap;
  }

  .card-action em {
    width: 100%;
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
