:root {
  --bg: #edf3f7;
  --bg-deep: #d8e6ee;
  --surface: #ffffff;
  --surface-soft: #f5f9fc;
  --text-main: #1a2633;
  --text-muted: #5d6a78;
  --primary: #0b6aa9;
  --primary-deep: #084f80;
  --line: #d2dde6;
  --success: #0a8f6a;
  --danger: #b13838;
  --shadow: 0 10px 30px rgba(13, 42, 66, 0.08);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at 15% 10%, rgba(15, 92, 149, 0.12), transparent 40%),
    radial-gradient(circle at 85% 20%, rgba(41, 156, 140, 0.14), transparent 45%),
    linear-gradient(160deg, var(--bg) 0%, #f8fbfd 55%, var(--bg-deep) 100%);
  min-height: 100vh;
}

.home-body {
  padding: 18px 0 30px;
}

.bg-orb {
  position: fixed;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  filter: blur(80px);
  z-index: -1;
}

.orb-a {
  background: rgba(35, 147, 255, 0.2);
  top: -40px;
  left: -80px;
}

.orb-b {
  background: rgba(19, 204, 160, 0.18);
  right: -100px;
  top: 20%;
}

.shell {
  width: min(1220px, 94vw);
  margin: 0 auto;
}

.card,
.panel,
.admin-card,
.admin-login-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.home-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.sidebar-banner {
  position: sticky;
  top: 14px;
  padding: 18px;
  display: grid;
  gap: 16px;
  max-height: calc(100vh - 30px);
  overflow: auto;
}

.banner-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-mark {
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--primary-deep);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.75);
}

.lang-switch {
  display: inline-flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.7);
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.lang-btn {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 600;
  padding: 7px 12px;
}

.lang-btn.is-active {
  background: var(--primary);
  color: #fff;
}

.identity-block {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: var(--surface-soft);
}

.banner-name {
  margin: 0;
  font-family: "Source Serif 4", serif;
  font-size: clamp(1.65rem, 3.2vw, 2.1rem);
  line-height: 1.15;
}

.banner-role {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-weight: 500;
}

.banner-institution {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.banner-education {
  margin: 6px 0 0;
  color: var(--primary-deep);
  font-size: 0.9rem;
  font-weight: 600;
}

.sidebar-section {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
}

.sidebar-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
}

.icon-box,
.info-icon,
.category-icon,
.pub-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.icon-box {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(11, 106, 169, 0.35);
  background: rgba(11, 106, 169, 0.08);
}

.icon-box svg,
.info-icon svg,
.category-icon svg,
.pub-item-icon svg {
  width: 16px;
  height: 16px;
  stroke: var(--primary-deep);
  stroke-width: 1.8;
}

.sidebar-text {
  margin: 10px 0 0;
  color: var(--text-muted);
  line-height: 1.65;
  font-size: 0.92rem;
}

.org-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.org-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 8px;
  background: var(--surface-soft);
}

.org-logo {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  object-fit: contain;
}

.org-name {
  margin: 0;
  line-height: 1.3;
  font-size: 0.9rem;
  font-weight: 600;
}

.org-meta {
  margin: 3px 0 0;
  line-height: 1.3;
  color: var(--text-muted);
  font-size: 0.8rem;
}

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

.info-list li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
}

.info-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.info-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.info-list a {
  color: var(--text-main);
  text-decoration: none;
  word-break: break-all;
  line-height: 1.45;
  font-size: 0.88rem;
}

.info-list a:hover {
  color: var(--primary-deep);
}

.admin-link {
  text-decoration: none;
  color: var(--primary);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.75);
  justify-self: start;
}

.content-column {
  display: grid;
  gap: 14px;
}

.outputs-panel {
  padding: 20px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 6px;
}

.title-with-icon {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.45rem;
  font-family: "Source Serif 4", serif;
}

.stat-chip {
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 8px 12px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.category-block {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: 18px;
}

.category-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.category-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.08rem;
}

.category-icon {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: 0.84rem;
}

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

.pub-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 15px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(13, 42, 66, 0.09);
  transition: transform 0.26s ease, box-shadow 0.26s ease, border-color 0.26s ease;
  animation: floatCard 6.2s ease-in-out infinite;
  will-change: transform;
}

.pub-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(130deg, rgba(11, 106, 169, 0.08), rgba(11, 106, 169, 0));
  opacity: 0;
  transition: opacity 0.26s ease;
  pointer-events: none;
}

.pub-card:nth-child(3n + 1) {
  animation-delay: 0s;
}

.pub-card:nth-child(3n + 2) {
  animation-delay: 0.7s;
}

.pub-card:nth-child(3n + 3) {
  animation-delay: 1.4s;
}

.pub-card:hover {
  transform: translateY(-8px) scale(1.01);
  border-color: rgba(11, 106, 169, 0.42);
  box-shadow: 0 18px 34px rgba(13, 42, 66, 0.18);
}

.pub-card:hover::before {
  opacity: 1;
}

.pub-title-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.pub-item-icon {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  margin-top: 1px;
}

.pub-title {
  margin: 0;
  font-size: 1.03rem;
  line-height: 1.4;
}

.pub-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 10px;
  font-size: 0.87rem;
  color: var(--text-muted);
}

.pub-meta .tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 10px;
  background: var(--surface-soft);
}

.abstract {
  margin: 10px 0;
  font-size: 0.92rem;
  line-height: 1.58;
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  font-size: 0.85rem;
}

.pub-links a {
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.pub-links a:hover {
  border-color: var(--primary);
}

.updated {
  color: var(--text-muted);
}

.empty {
  color: var(--text-muted);
  margin: 8px 0;
}

.site-footer {
  color: var(--text-muted);
  font-size: 0.84rem;
  padding-left: 2px;
}

@keyframes floatCard {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
  100% {
    transform: translateY(0);
  }
}

/* Admin */
.admin-body {
  background:
    radial-gradient(circle at 80% 10%, rgba(11, 106, 169, 0.1), transparent 42%),
    linear-gradient(180deg, #edf3f7 0%, #f8fbfd 60%, #e4eef5 100%);
}

.admin-topbar {
  width: min(1180px, 94vw);
  margin: 20px auto 12px;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  align-items: center;
}

.admin-topbar h1 {
  margin: 0;
  font-size: 1.5rem;
}

.admin-top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.admin-shell {
  width: min(1180px, 94vw);
  margin: 0 auto 24px;
  display: grid;
  gap: 14px;
}

.admin-card {
  padding: 18px;
}

.admin-card h2 {
  margin: 0 0 12px;
  font-size: 1.2rem;
}

.muted {
  color: var(--text-muted);
}

.warn {
  color: #965200;
}

.flash-wrap {
  display: grid;
  gap: 8px;
}

.flash {
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid transparent;
  font-size: 0.92rem;
}

.flash.success {
  background: rgba(10, 143, 106, 0.12);
  border-color: rgba(10, 143, 106, 0.35);
  color: #075f47;
}

.flash.error {
  background: rgba(177, 56, 56, 0.12);
  border-color: rgba(177, 56, 56, 0.35);
  color: #7b2222;
}

.grid-form {
  display: grid;
  gap: 10px;
}

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

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

.grid-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

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

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

input,
textarea,
select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text-main);
  background: #fff;
}

textarea {
  min-height: 86px;
  resize: vertical;
}

.primary-btn,
.ghost-btn,
.danger-btn,
.admin-form button {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.primary-btn,
.admin-form button {
  background: var(--primary);
  color: #fff;
}

.primary-btn:hover,
.admin-form button:hover {
  background: var(--primary-deep);
}

.ghost-btn {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text-main);
}

.danger-btn {
  background: var(--danger);
  color: #fff;
}

.pub-editor {
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.88);
}

.pub-editor summary {
  cursor: pointer;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.sum-title {
  font-weight: 600;
}

.sum-meta {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.pub-editor form {
  padding: 0 14px 14px;
}

.row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-category-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 14px 0 8px;
}

.admin-category-head h3 {
  margin: 0;
  font-size: 1.02rem;
}

.admin-login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.admin-login-card {
  width: min(560px, 100%);
  padding: 24px;
}

.admin-login-card h1 {
  margin: 0 0 12px;
}

.admin-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.admin-form label {
  display: grid;
  gap: 6px;
  color: var(--text-muted);
}

.inline-link {
  margin-top: 14px;
  display: inline-block;
  color: var(--primary);
  text-decoration: none;
}

.lang-en {
  display: none;
}

body[data-lang="en"] .lang-zh {
  display: none !important;
}

body[data-lang="en"] .lang-en {
  display: revert !important;
}

body[data-lang="zh"] .lang-en {
  display: none !important;
}

.reveal {
  animation: riseIn 0.5s ease both;
}

.reveal-fast {
  animation: riseIn 0.35s ease both;
}

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

@media (max-width: 1080px) {
  .home-layout {
    grid-template-columns: 1fr;
  }

  .sidebar-banner {
    position: static;
    max-height: none;
  }

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

  .grid-form.two-col,
  .grid-form.three-col {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .shell,
  .admin-shell,
  .admin-topbar {
    width: min(100vw, 96vw);
  }

  .outputs-panel,
  .admin-card,
  .sidebar-banner {
    padding: 15px;
  }

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

  .pub-editor summary {
    flex-direction: column;
    align-items: flex-start;
  }
}
