:root {
  color-scheme: light;
  --brand: #0852ff;
  --brand-deep: #0641cc;
  --brand-soft: #edf3ff;
  --ink: #151923;
  --muted: #747d8c;
  --line: #e5e9f0;
  --surface: #ffffff;
  --canvas: #f5f7fa;
  --danger: #d9485f;
  --success: #16875e;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-soft: 0 14px 42px rgba(27, 42, 74, 0.08);
  --shadow-float: 0 24px 70px rgba(27, 42, 74, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family:
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI",
    -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

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

img {
  max-width: 100%;
}

.is-hidden {
  display: none !important;
}

/* 登录页 */

.auth-page {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 18%, rgba(8, 82, 255, 0.055), transparent 34%),
    radial-gradient(circle at 83% 76%, rgba(98, 201, 137, 0.06), transparent 30%),
    #fbfcfe;
}

.auth-page::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(22, 36, 66, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 36, 66, 0.018) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, transparent, #000 20%, #000 80%, transparent);
  content: "";
}

.auth-shell {
  width: min(1160px, calc(100% - 48px));
  min-height: 620px;
  margin: 0 auto;
  padding: 88px 0 64px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
}

.auth-intro,
.auth-card {
  min-height: 620px;
  border: 1px solid #dce5f5;
  background: rgba(255, 255, 255, 0.92);
}

.auth-intro {
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  border-radius: 28px 0 0 28px;
  background:
    linear-gradient(160deg, rgba(237, 243, 255, 0.8), rgba(255, 255, 255, 0.94) 58%),
    #fff;
  box-shadow: -18px 28px 70px rgba(29, 52, 94, 0.07);
}

.auth-card {
  padding: 54px 56px 44px;
  border-left: 0;
  border-radius: 0 28px 28px 0;
  box-shadow: 18px 28px 70px rgba(29, 52, 94, 0.07);
}

.auth-brand {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 42px;
}

.auth-brand img {
  width: 200px;
  height: auto;
  object-fit: contain;
  object-position: left center;
}

.auth-brand .eyebrow {
  margin: 0;
}

.eyebrow,
.hero-kicker,
.section-heading > p,
.section-heading > div > p,
.usage-section > div > p,
.admin-header p,
.dialog-heading p {
  margin: 0 0 14px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.auth-intro h1 {
  margin: 0;
  max-width: 450px;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.18;
  letter-spacing: -0.045em;
  text-wrap: pretty;
}

.auth-intro-copy {
  max-width: 430px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.auth-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.auth-trust span {
  padding: 8px 11px;
  border: 1px solid #dfe6f2;
  border-radius: 999px;
  color: #667084;
  background: rgba(255, 255, 255, 0.8);
  font-size: 11px;
}

.safe-badge {
  width: fit-content;
  padding: 7px 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #dbe5f8;
  border-radius: 999px;
  color: #58709a;
  background: #f8faff;
  font-size: 11px;
}

.safe-badge i {
  width: 14px;
  height: 16px;
  display: block;
  border: 2px solid var(--brand);
  border-radius: 8px 8px 10px 10px;
  position: relative;
}

.safe-badge i::after {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  position: absolute;
  inset: 4px auto auto 3px;
  background: var(--brand);
  content: "";
}

.auth-tabs {
  margin: 28px 0 30px;
  padding: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: 12px;
  background: #f2f4f7;
}

.auth-tab {
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  color: #79818e;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.auth-tab.is-active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 2px 8px rgba(20, 31, 53, 0.07);
}

.auth-view {
  display: none;
}

.auth-view.is-active {
  display: block;
  animation: auth-in 0.32s ease both;
}

@keyframes auth-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.step-caption {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
}

.auth-heading h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.25;
  letter-spacing: -0.035em;
}

.auth-heading > p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.auth-form {
  margin-top: 30px;
  display: grid;
  gap: 18px;
}

.auth-form label,
.content-form label,
.category-dialog label {
  display: grid;
  gap: 8px;
}

.auth-form label > span,
.content-form label > span,
.category-dialog label > span {
  color: #555f70;
  font-size: 12px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #d9e0ea;
  outline: none;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input,
select {
  min-height: 50px;
  padding: 0 15px;
  border-radius: 11px;
}

textarea {
  padding: 13px 15px;
  resize: vertical;
  border-radius: 11px;
  line-height: 1.65;
}

input::placeholder,
textarea::placeholder {
  color: #aab2bf;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(8, 82, 255, 0.58);
  box-shadow: 0 0 0 4px rgba(8, 82, 255, 0.08);
}

.primary-button,
.secondary-button {
  min-height: 52px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.primary-button {
  border: 1px solid var(--brand);
  color: #fff;
  background: var(--brand);
  box-shadow: 0 10px 24px rgba(8, 82, 255, 0.2);
}

.primary-button:hover {
  background: var(--brand-deep);
  box-shadow: 0 12px 28px rgba(8, 82, 255, 0.25);
  transform: translateY(-1px);
}

.primary-button:active {
  transform: translateY(0);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

.primary-button.compact {
  min-height: 42px;
  width: fit-content;
  padding-inline: 20px;
  font-size: 13px;
}

.secondary-button {
  border: 1px solid var(--line);
  color: #596273;
  background: #fff;
  box-shadow: none;
}

.invite-confirmed {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #cfe9de;
  border-radius: 11px;
  color: var(--success);
  background: #f3fbf7;
  font-size: 12px;
  font-weight: 700;
}

.invite-confirmed button,
.text-button {
  border: 0;
  color: var(--brand);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.form-message,
.admin-message {
  min-height: 20px;
  margin: 14px 0 0;
  color: var(--danger);
  font-size: 12px;
}

.form-message.is-success {
  color: var(--success);
}

.auth-footer {
  padding: 0 24px 30px;
  position: relative;
  color: #9299a5;
  font-size: 11px;
  text-align: center;
}

/* 门户页 */

.portal-page {
  min-height: 100vh;
  background: #fff;
}

.account-area {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.hero-account-area {
  position: absolute;
  top: 22px;
  right: max(24px, calc((100vw - 1180px) / 2));
  z-index: 5;
}

.manage-button,
.permission-button,
.account-button {
  min-height: 38px;
  border-radius: 10px;
  cursor: pointer;
}

.manage-button,
.permission-button {
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  font-size: 12px;
  font-weight: 800;
}

.manage-button:hover,
.permission-button:hover,
.account-button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.account-button {
  padding: 0 10px 0 6px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  font-size: 12px;
}

.account-avatar {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--brand);
  background: #fff;
  font-size: 11px;
  font-weight: 800;
}

.account-menu {
  width: 190px;
  padding: 10px;
  position: absolute;
  top: 46px;
  right: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.account-menu > div {
  padding: 8px 9px 12px;
  display: grid;
  gap: 4px;
}

.account-menu strong {
  font-size: 13px;
}

.account-menu span {
  color: var(--muted);
  font-size: 10px;
}

.account-menu button {
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  color: #606978;
  background: #f5f6f8;
  font-size: 11px;
  cursor: pointer;
}

.portal-hero {
  min-height: 650px;
  padding: 98px 24px 118px;
  position: relative;
  overflow: hidden;
  color: #fff;
}

.hero-shape {
  width: 150%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 50%;
  border-radius: 0 0 50% 50%;
  background: var(--brand);
  transform: translateX(-50%);
}

.hero-shape::before,
.hero-shape::after {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  content: "";
}

.hero-shape::before {
  width: 520px;
  height: 520px;
  top: -280px;
  right: 14%;
}

.hero-shape::after {
  width: 360px;
  height: 360px;
  bottom: -245px;
  left: 17%;
}

.hero-content {
  width: min(760px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
  text-align: center;
}

.hero-brand-lockup {
  min-height: 38px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

.hero-brand-logo {
  height: 32px;
  width: auto;
  display: block;
  object-fit: contain;
}

.hero-brand-logo-hina {
  max-width: 156px;
}

.hero-brand-logo-miaozhao {
  max-width: 104px;
}

.hero-brand-cross {
  color: rgba(255, 255, 255, 0.68);
  font-size: 19px;
  font-weight: 500;
  line-height: 1;
}

.hero-kicker {
  margin-bottom: 14px;
  color: rgba(255, 255, 255, 0.65);
}

.hero-content h1 {
  margin: 0;
  font-size: clamp(38px, 5.2vw, 66px);
  line-height: 1.15;
  letter-spacing: -0.055em;
  text-wrap: pretty;
}

.hero-description {
  margin: 20px 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 15px;
}

.hero-search {
  width: min(570px, 100%);
  margin-top: 34px;
  padding: 5px;
  display: grid;
  grid-template-columns: 1fr auto;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(14px);
}

.hero-search label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.hero-search input {
  min-height: 46px;
  border: 0;
  color: #fff;
  background: transparent;
  box-shadow: none;
}

.hero-search input::placeholder {
  color: rgba(255, 255, 255, 0.62);
}

.hero-search button {
  min-width: 74px;
  border: 0;
  border-radius: 10px;
  color: var(--brand);
  background: #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.latest-updates {
  width: min(570px, 100%);
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.24);
  text-align: left;
}

.updates-heading {
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.62);
  font-size: 10px;
}

.updates-heading a {
  color: rgba(255, 255, 255, 0.86);
}

.latest-updates ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.latest-updates button {
  width: 100%;
  min-height: 30px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  color: rgba(255, 255, 255, 0.92);
  background: transparent;
  font-size: 12px;
  cursor: pointer;
}

.latest-updates time {
  color: rgba(255, 255, 255, 0.55);
  font-variant-numeric: tabular-nums;
}

.hero-quick-links {
  width: min(570px, 100%);
  margin-top: 18px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 10px;
  text-align: left;
}

.hero-quick-links > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.hero-quick-links button {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.08);
  font-size: 10px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.hero-quick-links button:hover {
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.15);
}

.hero-quick-links b {
  margin-left: 3px;
}

.category-section,
.resource-section,
.usage-section {
  width: min(1160px, calc(100% - 48px));
  margin: 0 auto;
}

.category-section {
  padding: 56px 0 108px;
}

.section-heading.centered {
  text-align: center;
}

.section-heading h2,
.usage-section h2 {
  margin: 0;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.25;
  letter-spacing: -0.04em;
}

.category-grid {
  margin-top: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.category-card {
  min-height: 260px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 18px;
  position: relative;
  overflow: hidden;
  color: var(--ink);
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.category-card::after {
  width: 120px;
  height: 120px;
  position: absolute;
  right: -38px;
  bottom: -38px;
  border: 26px solid currentColor;
  border-radius: 50%;
  opacity: 0.055;
  content: "";
}

.category-card:hover {
  border-color: rgba(8, 82, 255, 0.25);
  box-shadow: var(--shadow-soft);
  transform: translateY(-4px);
}

.category-index {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: currentColor;
  background: color-mix(in srgb, currentColor 8%, #fff);
  font-size: 11px;
  font-weight: 800;
}

.category-card strong {
  margin-top: 32px;
  font-size: 20px;
}

.category-card p {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.category-card small {
  margin-top: auto;
  padding-top: 22px;
  color: #697284;
  font-size: 10px;
}

.category-card small b {
  margin-left: 5px;
}

.tone-1 { color: #0852ff; }
.tone-2 { color: #1d8063; }
.tone-3 { color: #9a5e14; }
.tone-4 { color: #6953bb; }

.resource-section {
  padding: 96px 0 110px;
  border-top: 1px solid var(--line);
}

.section-heading.row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.filter-tabs {
  padding: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-radius: 12px;
  background: #f2f4f7;
}

.filter-tabs button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  color: #747c89;
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}

.filter-tabs button.is-active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 2px 7px rgba(22, 30, 48, 0.06);
}

.resource-grid {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.resource-card {
  min-height: 330px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.resource-card:hover,
.resource-card:focus-visible {
  border-color: rgba(8, 82, 255, 0.28);
  outline: none;
  box-shadow: var(--shadow-soft);
  transform: translateY(-3px);
}

.resource-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #8b929d;
  font-size: 10px;
}

.resource-card-mark {
  height: 106px;
  margin: 18px 0 22px;
  display: flex;
  align-items: flex-end;
  padding: 15px;
  border-radius: 13px;
  position: relative;
  overflow: hidden;
  color: currentColor;
  background: color-mix(in srgb, currentColor 7%, #f8faff);
}

.resource-card-mark::after {
  width: 130px;
  height: 130px;
  position: absolute;
  top: -66px;
  right: -20px;
  border: 18px solid currentColor;
  border-radius: 50%;
  opacity: 0.09;
  content: "";
}

.resource-card-mark span {
  font-size: 11px;
  font-weight: 800;
}

.resource-card h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.025em;
}

.resource-card > p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.resource-card > button {
  margin-top: auto;
  padding: 20px 0 0;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 0;
  color: var(--brand);
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.empty-state {
  min-height: 230px;
  margin-top: 36px;
  display: grid;
  place-content: center;
  gap: 8px;
  border: 1px dashed #d6dce6;
  border-radius: 18px;
  color: #737c8b;
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
}

.empty-state span {
  font-size: 12px;
}

.usage-section {
  margin-bottom: 100px;
  padding: 54px;
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 72px;
  border-radius: 24px;
  background: #f4f7fc;
}

.usage-section ol {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 20px;
  list-style: none;
}

.usage-section li {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 16px;
}

.usage-section li > span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--brand);
  background: #fff;
  font-size: 10px;
  font-weight: 800;
}

.usage-section li strong {
  font-size: 14px;
}

.usage-section li p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.site-footer {
  min-height: 78px;
  padding: 24px;
  display: grid;
  place-items: center;
  border-top: 1px solid var(--line);
  background: #fbfcfd;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

/* 后台 */

.admin-open {
  overflow: hidden;
}

.admin-workspace {
  padding: 28px;
  display: grid;
  grid-template-rows: auto 1fr;
  position: fixed;
  inset: 0;
  z-index: 60;
  overflow: hidden;
  background: rgba(244, 247, 251, 0.97);
  backdrop-filter: blur(18px);
  animation: workspace-in 0.26s ease both;
}

@keyframes workspace-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.admin-header {
  padding: 0 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-header p {
  margin-bottom: 4px;
}

.admin-header h2 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.035em;
}

.close-button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.admin-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
}

.category-manager,
.content-form,
.content-list-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 30px rgba(32, 47, 73, 0.05);
}

.category-manager {
  min-height: 0;
  padding: 20px;
  overflow-y: auto;
}

.content-manager {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(460px, 0.95fr) minmax(420px, 1.05fr);
  gap: 18px;
}

.content-form,
.content-list-panel {
  min-height: 0;
  padding: 20px;
  overflow-y: auto;
}

.admin-section-title {
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-section-title > div {
  display: grid;
  gap: 4px;
}

.admin-section-title strong {
  font-size: 14px;
}

.admin-section-title span {
  color: var(--muted);
  font-size: 10px;
}

.admin-section-title > button:not(.text-button) {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #dbe4f4;
  border-radius: 8px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.admin-category-list,
.admin-post-list {
  display: grid;
  gap: 9px;
}

.admin-category-item {
  padding: 13px;
  display: grid;
  gap: 12px;
  border: 1px solid #edf0f4;
  border-radius: 11px;
  background: #fbfcfd;
}

.admin-category-item > div:first-child {
  display: grid;
  gap: 5px;
}

.admin-category-item strong {
  font-size: 12px;
}

.admin-category-item span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.admin-category-item > div:last-child {
  display: flex;
  gap: 12px;
}

.admin-category-item button,
.admin-post-actions button {
  padding: 0;
  border: 0;
  color: var(--brand);
  background: transparent;
  font-size: 10px;
  cursor: pointer;
}

.danger-link {
  color: var(--danger) !important;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-grid .span-2 {
  grid-column: 1 / -1;
}

.content-form input,
.content-form select {
  min-height: 42px;
  font-size: 12px;
}

.content-form textarea {
  font-size: 12px;
}

.content-form .primary-button {
  margin-top: 18px;
}

.check-field {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
}

.check-field input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--brand);
}

.admin-post-item {
  padding: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid #edf0f4;
  border-radius: 11px;
  background: #fbfcfd;
}

.admin-post-item > div:first-child {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.admin-post-item span {
  color: var(--brand);
  font-size: 9px;
}

.admin-post-item strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-post-item p {
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-post-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 11px;
}

.permission-panel {
  width: min(920px, 100%);
  min-height: 0;
  margin: 0 auto;
  padding: 24px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 30px rgba(32, 47, 73, 0.05);
}

.permission-heading,
.permission-user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.permission-heading {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.permission-heading > div,
.permission-user-main {
  display: grid;
  gap: 5px;
}

.permission-heading strong {
  font-size: 15px;
}

.permission-heading span,
.permission-user-main span {
  color: var(--muted);
  font-size: 11px;
}

.permission-user-list {
  display: grid;
  gap: 10px;
}

.permission-user-item {
  min-height: 70px;
  padding: 14px 16px;
  border: 1px solid #edf0f4;
  border-radius: 12px;
  background: #fbfcfd;
}

.permission-user-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.permission-user-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.permission-user-main strong {
  font-size: 13px;
}

.permission-user-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.permission-role,
.permission-status {
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 10px;
}

.permission-role {
  color: var(--brand);
  background: var(--brand-soft);
}

.permission-status {
  color: #10845c;
  background: #eaf8f2;
}

.permission-status.is-disabled {
  color: #8b4d1b;
  background: #fff2e7;
}

.permission-toggle {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

/* 对话框 */

dialog {
  padding: 0;
  border: 0;
  outline: none;
  color: var(--ink);
}

dialog::backdrop {
  background: rgba(16, 24, 40, 0.42);
  backdrop-filter: blur(5px);
}

.category-dialog {
  width: min(460px, calc(100% - 32px));
  border-radius: 18px;
  box-shadow: var(--shadow-float);
}

.category-dialog form {
  padding: 24px;
  display: grid;
  gap: 16px;
}

.dialog-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
}

.dialog-heading p {
  margin-bottom: 5px;
}

.dialog-heading h2 {
  margin: 0;
  font-size: 22px;
}

.dialog-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  color: #707987;
  background: #f2f4f7;
  font-size: 20px;
  cursor: pointer;
}

.dialog-actions {
  padding-top: 4px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.dialog-actions .secondary-button,
.dialog-actions .primary-button {
  min-height: 40px;
}

.resource-dialog {
  width: min(680px, calc(100% - 32px));
  padding: 42px;
  border-radius: 22px;
  box-shadow: var(--shadow-float);
}

.resource-close {
  position: absolute;
  top: 18px;
  right: 18px;
}

.resource-detail-category {
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
}

.resource-dialog h2 {
  margin: 14px 0 0;
  padding-right: 36px;
  font-size: 30px;
  letter-spacing: -0.035em;
}

.resource-detail-summary {
  margin: 16px 0 0;
  color: #5f6878;
  font-size: 14px;
  line-height: 1.75;
}

.resource-detail-body {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: #555f70;
  font-size: 13px;
  line-height: 1.9;
  white-space: pre-wrap;
}

.resource-dialog .primary-button {
  margin-top: 28px;
}

.toast {
  padding: 12px 16px;
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  border: 1px solid rgba(15, 25, 45, 0.08);
  border-radius: 11px;
  color: #fff;
  background: #1b1f28;
  box-shadow: var(--shadow-soft);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.is-error {
  background: var(--danger);
}

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

  .resource-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .content-manager {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .content-form,
  .content-list-panel {
    overflow: visible;
  }
}

@media (max-width: 820px) {
  .auth-shell {
    width: min(600px, calc(100% - 32px));
    padding: 28px 0;
    grid-template-columns: 1fr;
  }

  .auth-intro,
  .auth-card {
    min-height: auto;
  }

  .auth-intro {
    min-height: 230px;
    padding: 36px;
    border-radius: 24px 24px 0 0;
  }

  .auth-card {
    padding: 36px;
    border-top: 0;
    border-left: 1px solid #dce5f5;
    border-radius: 0 0 24px 24px;
  }

  .portal-hero {
    min-height: 610px;
    padding-top: 76px;
  }

  .hero-shape {
    width: 190%;
  }

  .section-heading.row {
    align-items: start;
    flex-direction: column;
  }

  .filter-tabs {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .filter-tabs button {
    flex: 0 0 auto;
  }

  .admin-workspace {
    padding: 18px;
    overflow-y: auto;
  }

  .admin-layout {
    display: block;
  }

  .category-manager {
    margin-bottom: 16px;
    overflow: visible;
  }

  .content-manager {
    display: grid;
  }
}

@media (max-width: 620px) {
  .auth-shell {
    width: calc(100% - 20px);
  }

  .auth-intro {
    min-height: 200px;
    padding: 26px;
  }

  .auth-card {
    padding: 28px 24px;
  }

  .auth-intro h1 {
    font-size: 31px;
  }

  .auth-intro-copy {
    font-size: 13px;
  }

  .account-button > span:last-child {
    display: none;
  }

  .hero-account-area {
    top: 14px;
    right: 14px;
    gap: 6px;
  }

  .manage-button,
  .permission-button {
    min-height: 34px;
    padding: 0 9px;
    font-size: 10px;
  }

  .portal-hero {
    min-height: 580px;
    padding-inline: 18px;
  }

  .hero-brand-lockup {
    gap: 10px;
  }

  .hero-brand-logo {
    height: 25px;
  }

  .hero-brand-cross {
    font-size: 15px;
  }

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

  .hero-description {
    max-width: 290px;
    font-size: 13px;
    line-height: 1.7;
  }

  .hero-quick-links {
    grid-template-columns: 1fr;
  }

  .category-section,
  .resource-section,
  .usage-section {
    width: calc(100% - 32px);
  }

  .permission-heading,
  .permission-user-item,
  .permission-user-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .category-grid,
  .resource-grid {
    grid-template-columns: 1fr;
  }

  .category-card {
    min-height: 220px;
  }

  .resource-card {
    min-height: 310px;
  }

  .usage-section {
    margin-bottom: 50px;
    padding: 28px;
  }

  .admin-workspace {
    padding: 14px;
  }

  .admin-header {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(244, 247, 251, 0.96);
  }

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

  .form-grid .span-2 {
    grid-column: auto;
  }

  .resource-dialog {
    padding: 32px 24px;
  }
}

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