:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #18212f;
  --muted: #687386;
  --line: #d9e0e8;
  --blue: #246bfe;
  --green: #107c5a;
  --red: #b42318;
  --amber: #a05a00;
  --teal: #087ea4;
  --shadow: 0 14px 34px rgba(20, 33, 52, 0.08);
  --ui-font: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.lang-switcher {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  border: 1px solid rgba(217, 224, 232, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 28px rgba(20, 33, 52, 0.12);
  backdrop-filter: blur(10px);
}

.lang-switcher.floating {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 80;
}

.lang-switcher button {
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: 140ms ease;
}

.lang-switcher-trigger {
  display: inline-flex;
  width: 44px;
  height: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 14px;
}

.lang-switcher-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}

.lang-switcher-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lang-switcher-trigger:hover,
.lang-switcher.open .lang-switcher-trigger {
  color: var(--ink);
  background: rgba(36, 107, 254, 0.08);
}

.lang-switcher-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: none;
  min-width: 180px;
  padding: 6px;
  border: 1px solid rgba(217, 224, 232, 0.95);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(20, 33, 52, 0.16);
}

.lang-switcher.open .lang-switcher-menu {
  display: grid;
  gap: 4px;
}

.lang-switcher-option {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  color: var(--ink);
  font-weight: 700;
  text-align: left;
}

.lang-switcher-option:hover {
  background: rgba(36, 107, 254, 0.08);
}

.lang-switcher-option.active {
  color: #fff;
  background: var(--blue);
}

.auth-screen {
  display: grid;
  min-height: 100%;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at top left, rgba(36, 107, 254, 0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(8, 126, 164, 0.16), transparent 30%),
    #eef3f7;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(420px, 0.9fr);
  width: min(1180px, 100%);
  min-height: min(820px, calc(100vh - 56px));
  border: 1px solid rgba(217, 224, 232, 0.9);
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 28px 80px rgba(17, 24, 39, 0.14);
}

.auth-hero,
.auth-panel {
  min-width: 0;
}

.auth-hero {
  display: grid;
  align-content: space-between;
  gap: 28px;
  padding: 34px;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(9, 19, 33, 0.24), rgba(9, 19, 33, 0.72)),
    linear-gradient(135deg, rgba(36, 107, 254, 0.36), rgba(8, 126, 164, 0.24)),
    url("https://images.unsplash.com/photo-1516321318423-f06f85e504b3?auto=format&fit=crop&w=1600&q=80");
  background-position: center;
  background-size: cover;
}

.auth-hero-copy {
  width: min(620px, 100%);
}

.auth-hero-copy h1 {
  margin-top: 12px;
  font-size: 44px;
  line-height: 1.08;
}

.auth-hero-copy p {
  margin-top: 18px;
  color: #e7edf6;
  font-size: 16px;
  line-height: 1.8;
}

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

.auth-highlight {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
}

.auth-highlight p {
  margin-top: 8px;
  color: #e7edf6;
  line-height: 1.7;
}

.auth-panel {
  display: grid;
  align-items: center;
  padding: 34px;
}

.auth-card {
  width: min(480px, 100%);
  margin: 0 auto;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 20px 56px rgba(20, 33, 52, 0.12);
}

.auth-card-head p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.7;
}

.auth-brand {
  margin-bottom: 20px;
  color: #fff;
}

.auth-brand small {
  color: rgba(231, 237, 246, 0.84);
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 22px 0 18px;
}

.auth-tab {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: #f8fafc;
  white-space: nowrap;
  cursor: pointer;
  transition: 140ms ease;
}

.auth-tab.active {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

.auth-tab:hover {
  border-color: #bfd1ef;
  color: var(--ink);
}

.auth-form {
  display: none;
  gap: 12px;
}

.auth-form.active {
  display: grid;
}

.auth-form label {
  display: grid;
  gap: 7px;
  font-weight: 700;
}

.auth-form input:not([type="checkbox"]),
.auth-form textarea,
.auth-form select,
.portal-form input:not([type="checkbox"]),
.portal-form textarea,
.portal-form select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.auth-form input:not([type="checkbox"]):focus,
.auth-form textarea:focus,
.auth-form select:focus,
.portal-form input:not([type="checkbox"]):focus,
.portal-form textarea:focus,
.portal-form select:focus,
.form-field input:not([type="checkbox"]):focus,
.form-field textarea:focus,
.form-field select:focus {
  border-color: #8fb0ff;
  outline: 2px solid rgba(36, 107, 254, 0.14);
  background: #fff;
}

.auth-link-row {
  display: flex;
  justify-content: flex-end;
}

.auth-link {
  padding: 0;
  border: 0;
  color: var(--blue);
  background: transparent;
  cursor: pointer;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-submit {
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
  border-radius: 10px;
  font-weight: 700;
}

.auth-hint {
  color: var(--muted);
  line-height: 1.6;
}

.success-message {
  color: var(--green);
  font-weight: 700;
}

.app-shell {
  min-height: 100%;
}

.top-actions {
  display: flex;
  gap: 8px;
}

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

.permission-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.permission-option span {
  line-height: 1.5;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--ui-font);
  font-size: 14px;
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  padding: 22px 16px;
  background: #111827;
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: #28a0b8;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 1;
}

.brand small {
  display: block;
  margin-top: 2px;
  color: #b7c0cf;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  color: #cdd5e1;
  background: transparent;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  color: #fff;
  background: #243044;
}

.shell {
  min-height: 100%;
  margin-left: 248px;
  padding: 22px 26px 36px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 0 14px;
  margin-bottom: 18px;
  background: rgba(244, 246, 248, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(217, 224, 232, 0.9);
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.search-box input {
  width: min(280px, 34vw);
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.2;
}

h2 {
  font-size: 16px;
}

h3 {
  font-size: 15px;
}

.topbar p,
.muted {
  margin-top: 6px;
  color: var(--muted);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric {
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 26px;
}

.layout.two,
.split {
  display: grid;
  gap: 16px;
}

.layout.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.split {
  grid-template-columns: minmax(420px, 0.95fr) minmax(420px, 1.05fr);
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.detail-panel {
  min-height: 620px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover,
tbody tr.selected {
  background: #eef5ff;
}

.button,
.icon-button {
  min-height: 36px;
  border: 1px solid var(--blue);
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
  cursor: pointer;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 108px;
  padding: 0 14px;
  white-space: nowrap;
  text-align: center;
  text-decoration: none;
}

.button.ghost {
  color: var(--ink);
  border-color: var(--line);
  background: #fff;
}

.button.danger {
  border-color: var(--red);
  background: var(--red);
}

.button.small {
  min-height: 30px;
  min-width: 88px;
  padding: 0 10px;
}

.button:disabled,
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.icon-button {
  display: inline-flex;
  position: relative;
  width: 36px;
  height: 36px;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: transparent;
  text-align: center;
}

.icon-button::before,
.icon-button::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  color: #fff;
  left: 50%;
  top: 50%;
  transform-origin: center;
}

.icon-button::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.icon-button::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.status,
.flag {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status {
  color: #174a36;
  background: #dff7ec;
}

.status.review {
  color: #154f76;
  background: #e0f2ff;
}

.status.warning,
.flag.warning {
  color: #7a4200;
  background: #fff2d8;
}

.status.done {
  color: #14532d;
  background: #dcfce7;
}

.status.rejected,
.flag.danger {
  color: #8f1d18;
  background: #ffe3e0;
}

.detail {
  padding: 16px;
}

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

.field {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.field small {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.actions .button {
  flex: 0 0 154px;
}

.timeline,
.compact-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.timeline-item,
.compact-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.timeline-item.overdue {
  border-color: #f2b8a8;
  background: #fff4f2;
}

.timeline-item small,
.compact-item small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.empty-state {
  padding: 24px;
}

.empty-state p {
  max-width: 760px;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.7;
}

dialog {
  width: min(840px, calc(100vw - 32px));
  border: 0;
  border-radius: 18px;
  padding: 0;
  box-shadow: 0 24px 70px rgba(12, 20, 34, 0.28);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
}

.modal {
  background: #fff;
}

.modal-head,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.top-actions .button,
.panel-head .button,
.modal-actions .button {
  min-width: 112px;
}

#modalBody {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-height: min(68vh, 680px);
  overflow: auto;
  padding: 18px;
  background: #f8fafc;
}

.form-field {
  display: grid;
  gap: 8px;
}

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

.form-field label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.label-text {
  display: inline-flex;
  align-items: center;
}

.required-star {
  display: inline-block;
  margin-right: 4px;
  color: var(--red);
  font-weight: 800;
}

.form-field input:not([type="checkbox"]),
.form-field textarea,
.form-field select {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.form-field input[type="file"],
.auth-form input[type="file"],
.portal-form input[type="file"] {
  padding: 10px;
  background: #fff;
}

.form-field textarea {
  min-height: 96px;
  resize: vertical;
}

.form-field small {
  color: var(--muted);
  line-height: 1.6;
}

.checkbox-field {
  align-content: center;
}

.checkbox-row {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.checkbox-row span {
  line-height: 1.5;
}

.checkbox-row input[type="checkbox"],
.permission-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--blue);
  flex: 0 0 auto;
}

.upload-preview {
  width: min(220px, 100%);
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f8fb;
}

.site-body {
  min-height: 100%;
  background: #f6f8fb;
}

.site-nav {
  position: fixed;
  z-index: 5;
  inset: 0 0 auto;
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 30px;
  color: #fff;
  background: rgba(12, 20, 34, 0.82);
  backdrop-filter: blur(12px);
}

.site-brand,
.site-nav nav,
.site-home-actions,
.site-actions,
.site-footer,
.site-split {
  display: flex;
  align-items: center;
  gap: 14px;
}

.site-brand,
.site-nav a {
  color: inherit;
  text-decoration: none;
}

.site-brand {
  font-weight: 800;
}

.site-nav nav {
  flex-wrap: wrap;
}

.site-nav nav a {
  display: inline-flex;
  min-width: 88px;
  justify-content: center;
  color: #dbe5f2;
  white-space: nowrap;
}

.site-nav .lang-switcher,
.portal-brand .lang-switcher,
.top-actions .lang-switcher {
  flex-shrink: 0;
}

.site-home-actions {
  gap: 10px;
}

.site-home-actions .lang-switcher {
  flex-shrink: 0;
  border-radius: 8px;
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
  backdrop-filter: none;
}

.site-home-actions .lang-switcher-trigger {
  width: 38px;
  height: 36px;
  min-height: 36px;
  border-radius: 7px;
}

.site-home-actions .lang-switcher-icon {
  color: #fff;
}

.site-home-actions .lang-switcher-icon svg {
  width: 16px;
  height: 16px;
}

.top-actions .lang-switcher {
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
  backdrop-filter: none;
}

.top-actions .lang-switcher-trigger {
  width: 36px;
  height: 36px;
  min-height: 36px;
  border-radius: 8px;
}

.top-actions .lang-switcher-icon svg {
  width: 16px;
  height: 16px;
}

.site-login,
.button.light {
  min-width: 112px;
  border-color: rgba(255, 255, 255, 0.6);
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.site-hero {
  display: flex;
  min-height: 88vh;
  align-items: flex-end;
  padding: 128px 30px 72px;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(9, 19, 33, 0.88), rgba(9, 19, 33, 0.38)),
    url("https://images.unsplash.com/photo-1497366811353-6870744d04b2?auto=format&fit=crop&w=1800&q=82");
  background-position: center;
  background-size: cover;
}

.site-hero-content {
  width: min(860px, 100%);
}

.site-kicker {
  color: #28a0b8;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.site-hero h1 {
  margin-top: 10px;
  font-size: 62px;
  line-height: 1;
}

.site-hero p:not(.site-kicker) {
  max-width: 720px;
  margin-top: 18px;
  color: #e7edf6;
  font-size: 18px;
  line-height: 1.7;
}

.site-actions {
  flex-wrap: wrap;
  margin-top: 26px;
}

.site-actions .button {
  flex: 0 0 220px;
}

.site-actions-compact {
  margin-top: 0;
}

.site-actions-compact .button {
  flex: 0 0 200px;
}

.site-section,
.site-band {
  padding: 58px 30px;
}

.site-section {
  background: #fff;
}

.site-section-head,
.site-section > .site-grid,
.site-band,
.site-split {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.site-section-head h2,
.site-band h2 {
  margin-top: 8px;
  font-size: 30px;
}

.site-grid {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.site-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.site-feature,
.site-steps li {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.site-feature {
  padding: 18px;
}

.site-feature p,
.site-split p,
.site-steps p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.7;
}

.site-band {
  display: grid;
  grid-template-columns: minmax(280px, 0.7fr) minmax(420px, 1.3fr);
  gap: 28px;
}

.site-band-copy {
  margin-top: 12px;
  color: #425067;
  line-height: 1.8;
}

.phase-grid {
  align-content: start;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 0;
}

.site-phase {
  padding: 18px;
  border: 1px solid rgba(219, 229, 242, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.site-phase h3 {
  margin-top: 12px;
  font-size: 20px;
  color: var(--ink);
}

.site-phase-tag,
.site-pill {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.site-phase-tag {
  color: #e4f8fd;
  background: rgba(40, 160, 184, 0.24);
}

.site-pill {
  color: #15576b;
  background: #dff5fb;
}

.site-checklist {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.site-checklist li {
  position: relative;
  padding-left: 18px;
  color: #334155;
  line-height: 1.7;
}

.site-checklist li::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #28a0b8;
}

.site-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-steps li {
  padding: 16px;
}

.site-steps span {
  display: block;
  margin-bottom: 10px;
  color: var(--teal);
  font-weight: 800;
}

.site-split {
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}

.site-split p {
  max-width: 760px;
}

.site-section-muted {
  background: #f6f8fb;
}

.journals-page {
  padding-top: 68px;
}

.journals-hero {
  padding: 48px 30px 30px;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(9, 19, 33, 0.84), rgba(9, 19, 33, 0.46)),
    url("https://images.unsplash.com/photo-1455390582262-044cdead277a?auto=format&fit=crop&w=1800&q=80");
  background-position: center;
  background-size: cover;
}

.journals-hero-inner,
.journals-list-head,
.pagination-bar {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.journals-hero-inner h1 {
  margin-top: 10px;
  font-size: 44px;
  line-height: 1.08;
}

.journals-hero-inner p {
  max-width: 760px;
  margin-top: 16px;
  color: #e7edf6;
  font-size: 16px;
  line-height: 1.8;
}

.journals-list-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.journals-summary {
  max-width: 420px;
  color: var(--muted);
  line-height: 1.7;
  text-align: right;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

.pagination-pages {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pagination-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  white-space: nowrap;
  cursor: pointer;
}

.pagination-page.active {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

.site-steps-wide {
  width: min(1180px, 100%);
  margin: 24px auto 0;
}

.journal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  width: min(1180px, 100%);
  margin: 24px auto 0;
}

.journal-card,
.journal-empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  box-shadow: var(--shadow);
}

.journal-card {
  display: flex;
  min-height: 420px;
  flex-direction: column;
  overflow: hidden;
}

.journal-card-cover {
  display: grid;
  min-height: 220px;
  place-items: center;
  background: linear-gradient(135deg, #e7eef8, #d4e6ef);
}

.journal-card-cover-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.journal-card-cover-placeholder {
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: #246bfe;
  font-size: 34px;
  font-weight: 800;
}

.journal-card-body {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
}

.journal-card-head {
  display: flex;
  width: 100%;
  min-height: 94px;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.journal-card-summary {
  width: 100%;
}

.journal-card-summary h3 {
  display: -webkit-box;
  overflow: hidden;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  text-overflow: ellipsis;
  line-height: 1.35;
}

.journal-card-summary p {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 8px;
  color: var(--muted);
  line-clamp: 1;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  text-overflow: ellipsis;
  line-height: 1.6;
}

.journal-card-actions {
  display: flex;
  width: 100%;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}

.journal-empty {
  grid-column: 1 / -1;
  padding: 24px;
}

.journal-empty p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.7;
}

.site-footer {
  justify-content: space-between;
  min-height: 72px;
  padding: 22px 30px;
  color: #dbe5f2;
  background: #111827;
}

.portal-body {
  min-height: 100%;
  background: #eef3f7;
}

.portal-shell {
  display: block;
  min-height: 100%;
}

.portal-cover {
  display: flex;
  min-height: clamp(360px, 58vh, 560px);
  flex-direction: column;
  justify-content: flex-start;
  gap: 28px;
  padding: 28px 28px 72px;
  color: #fff;
  background-position: center;
  background-size: cover;
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.portal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.portal-home-link {
  min-width: 136px;
}

.portal-title {
  display: grid;
  gap: 14px;
  max-width: 760px;
}

.portal-title h1 {
  margin-top: 0;
  font-size: 42px;
  line-height: 1.08;
}

.portal-title p {
  max-width: 620px;
  margin-top: 12px;
  color: #e8eef8;
  font-size: 16px;
  line-height: 1.7;
}

.portal-cover-content {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  align-items: end;
  gap: 28px;
  margin-top: auto;
}

.portal-cover-card {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 54px rgba(9, 16, 29, 0.28);
  backdrop-filter: blur(6px);
}

.portal-cover-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portal-summary-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.portal-summary-item {
  min-width: 132px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
}

.portal-summary-item span {
  display: block;
  color: rgba(233, 240, 248, 0.86);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.portal-summary-item strong {
  display: block;
  margin-top: 8px;
  font-size: 15px;
}

.portal-workspace {
  display: grid;
  align-content: start;
  gap: 16px;
  width: min(1180px, calc(100% - 40px));
  min-height: calc(100vh - 320px);
  margin: -36px auto 0;
  padding: 28px;
  background: #fff;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -8px 28px rgba(15, 23, 42, 0.08);
  overflow: visible;
  position: relative;
  z-index: 1;
}

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

.portal-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfe;
  box-shadow: var(--shadow);
}

.portal-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.portal-actions-panel {
  padding: 16px;
}

.portal-actions-panel .portal-panel-head {
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line);
}

.portal-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.portal-actions-row .button {
  display: inline-flex;
  flex: 1 1 240px;
  min-width: 0;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  text-align: center;
  white-space: normal;
}

.portal-action-primary {
  box-shadow: 0 10px 20px rgba(35, 91, 173, 0.2);
}

.portal-action-secondary {
  background: #fff;
}

.portal-introduction-content {
  padding: 18px 20px;
  color: var(--muted);
  line-height: 1.8;
  white-space: pre-line;
}

.portal-profile-card,
.portal-member-grid {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.portal-member-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portal-person-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.portal-person-card p {
  color: var(--muted);
  line-height: 1.7;
}

.portal-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portal-form.active {
  display: grid;
}

.portal-form .full,
.portal-form .button,
.portal-form .auth-hint,
.portal-form .compact-list {
  grid-column: 1 / -1;
}

.portal-form textarea {
  min-height: 96px;
  resize: vertical;
}

.portal-note {
  margin-top: -4px;
}

@media (max-width: 1040px) {
  .sidebar {
    position: static;
    width: auto;
  }

  .shell {
    margin-left: 0;
  }

  .portal-cover-content,
  .auth-shell,
  .portal-member-grid,
  .metrics,
  .layout.two,
  .split,
  .site-grid.three,
  .phase-grid,
  .site-band,
  .site-steps,
  .journal-grid {
    grid-template-columns: 1fr;
  }

  .portal-cover {
    min-height: auto;
  }

  .portal-cover-content {
    min-height: auto;
  }

  .portal-workspace {
    width: min(100%, calc(100% - 24px));
    margin-top: -24px;
    padding: 22px;
  }

  .auth-shell {
    min-height: auto;
  }

  .auth-panel {
    padding: 28px;
  }

  .auth-hero-copy h1 {
    font-size: 36px;
  }
}

@media (max-width: 640px) {
  .portal-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .portal-cover {
    padding: 18px;
  }

  .portal-cover-card {
    max-width: 240px;
  }

  .portal-workspace {
    width: 100%;
    margin-top: 0;
    padding: 18px;
    border-radius: 0;
  }

  .auth-screen,
  .auth-panel,
  .auth-hero {
    padding: 18px;
  }

  .auth-card {
    padding: 22px;
    border-radius: 14px;
  }

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

  .auth-hero-copy h1 {
    font-size: 30px;
  }

  .portal-title h1 {
    font-size: 32px;
  }

  .portal-summary-item {
    min-width: calc(50% - 6px);
  }

  .shell {
    padding: 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    color: var(--ink);
    background: #fff;
  }

  .site-nav nav {
    width: 100%;
  }

  .site-nav nav a {
    color: var(--muted);
  }

  .lang-switcher.floating {
    top: 12px;
    right: 12px;
  }

  .site-login {
    color: var(--ink);
    border-color: var(--line);
    background: #fff;
  }

  .site-hero {
    min-height: 76vh;
    padding-top: 56px;
  }

  .site-hero h1 {
    font-size: 44px;
  }

  .site-split,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .journals-page {
    padding-top: 0;
  }

  .journals-hero {
    padding: 30px 18px;
  }

  .journals-hero-inner h1 {
    font-size: 32px;
  }

  .journals-list-head,
  .pagination-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .journals-summary {
    max-width: none;
    text-align: left;
  }

  .journal-card-head,
  .journal-card-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  #modalBody,
  .detail-grid,
  .portal-shell,
  .portal-form,
  .portal-tabs {
    grid-template-columns: 1fr;
  }

  .portal-actions-row {
    flex-direction: column;
  }

  .portal-cover {
    min-height: 54vh;
  }

  .portal-title h1 {
    font-size: 32px;
  }
}
