:root {
  --bg-global: #e4e3ee;
  --bg-container: #f7f6fb;
  --text-main: #3f3c56;
  --text-muted: #8e8ba3;
  --color-primary: #6669ac;
  --color-primary-bg: #ececf5;
  --color-child: #e9b850;
  --border-radius-lg: 20px;
  --border-radius-md: 14px;
  --shadow-light: 0 8px 24px rgba(102, 105, 172, 0.05);
  --transition-smooth: all 0.25s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  background-color: var(--bg-global);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
}

#portal-container {
  width: min(390px, 100vw);
  height: min(844px, 100vh);
  background-color: var(--bg-container);
  border: 8px solid #fff;
  border-radius: 40px;
  box-shadow: 0 20px 50px rgba(63, 60, 86, 0.15);
  overflow: hidden;
}

.home-screen {
  height: 100%;
  padding: 20px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: none;
}

.home-screen::-webkit-scrollbar {
  display: none;
}

.home-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.home-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.home-brand-icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(102, 105, 172, 0.1));
}

.home-brand-title {
  font-size: 18px;
  font-weight: 900;
  color: var(--text-main);
}

.home-brand-subtitle {
  margin-top: 1px;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 700;
}

.home-welcome-card {
  width: 100%;
  background: linear-gradient(135deg, #f0eff7 0%, #e2ebf5 100%);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--border-radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-light);
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.home-announcement-list {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.announcement-card {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(245, 154, 114, 0.52);
  border-radius: var(--border-radius-md);
  background: #fff1ec;
  padding: 12px;
  box-shadow: 0 8px 24px rgba(214, 95, 50, 0.08);
}

.announcement-card.notice {
  border-color: rgba(228, 184, 77, 0.62);
  background: #fff8df;
  box-shadow: 0 8px 24px rgba(169, 109, 0, 0.07);
}

.announcement-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.announcement-tag {
  width: fit-content;
  border-radius: 999px;
  background: #ffe0d3;
  color: #d65f32;
  padding: 2px 8px;
  font-size: 9px;
  font-weight: 900;
}

.notice .announcement-tag,
.maintenance .announcement-tag {
  background: #fcf0c8;
  color: #a96d00;
}

.announcement-close {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: #f2f1f7;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 900;
}

.announcement-title {
  color: var(--text-main);
  font-size: 13px;
}

.announcement-content {
  color: var(--text-muted);
  font-size: 11.5px;
  line-height: 1.55;
}

.announcement-action {
  width: fit-content;
  border-radius: 10px;
  background: #d65f32;
  color: #fff;
  padding: 6px 10px;
  text-decoration: none;
  font-size: 11px;
  font-weight: 900;
}

.announcement-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(30, 28, 42, 0.44);
  backdrop-filter: blur(4px);
}

.announcement-modal {
  width: min(340px, 100%);
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  background: #fff;
  box-shadow: 0 24px 70px rgba(31, 28, 44, 0.24);
}

.announcement-modal.maintenance {
  background: #fffaf0;
}

.announcement-modal header,
.announcement-modal footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.announcement-modal h2 {
  margin: 0;
  color: var(--text-main);
  font-size: 19px;
  line-height: 1.35;
}

.announcement-modal p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.7;
}

.announcement-modal-close,
.announcement-modal-secondary {
  border: 0;
  background: #f2f1f7;
  color: var(--text-main);
  font-weight: 900;
}

.announcement-modal-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 18px;
}

.announcement-modal-action,
.announcement-modal-secondary {
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 12px;
  text-decoration: none;
}

.announcement-modal-action {
  background: var(--color-primary);
  color: #fff;
  font-weight: 900;
}

.home-welcome-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(#6669ac 0.5px, transparent 0.5px);
  background-size: 12px 16px;
  opacity: 0.08;
  pointer-events: none;
}

.welcome-tag,
.welcome-title,
.welcome-desc {
  position: relative;
  z-index: 1;
}

.welcome-tag {
  display: inline-block;
  margin-bottom: 8px;
  padding: 2px 8px;
  background-color: var(--color-primary);
  color: #fff;
  border-radius: 10px;
  font-size: 9px;
  font-weight: 800;
}

.welcome-title {
  margin-bottom: 6px;
  font-size: 15px;
  font-weight: 800;
}

.welcome-desc {
  color: var(--text-muted);
  font-size: 11.5px;
  font-style: italic;
  line-height: 1.6;
}

.home-section-title {
  margin-bottom: 12px;
  font-size: 13.5px;
  font-weight: 800;
}

.home-portal-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.portal-card {
  color: inherit;
  text-decoration: none;
  background-color: #fff;
  border: 1px solid #ececf5;
  border-radius: var(--border-radius-lg);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-light);
  transition: var(--transition-smooth);
}

.portal-card:hover,
.portal-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--color-primary);
  box-shadow: 0 10px 24px rgba(102, 105, 172, 0.08);
  outline: none;
}

.portal-card.entering {
  border-color: var(--color-primary);
  background-color: #f5f5fb;
  pointer-events: none;
  transform: translateY(-1px);
}

.portal-card.inactive {
  cursor: not-allowed;
  filter: grayscale(0.8);
  opacity: 0.58;
  pointer-events: none;
}

.portal-card-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.portal-icon-box {
  width: 46px;
  height: 46px;
  border-radius: var(--border-radius-md);
  background-color: var(--color-primary-bg);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.portal-icon-box img,
.portal-icon-box .portal-icon {
  width: 24px;
  height: 24px;
  display: block;
}

.portal-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.portal-status-tag {
  width: fit-content;
  background-color: #fcf7e9;
  color: #b58410;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 9px;
  font-weight: 800;
}

.portal-status-tag.inactive {
  background-color: #eeeef4;
  color: var(--text-muted);
}

.portal-title {
  font-size: 13.5px;
  font-weight: 800;
}

.portal-desc {
  max-width: 220px;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-card-right {
  color: var(--text-muted);
  font-size: 20px;
  font-weight: 900;
  transition: var(--transition-smooth);
}

.portal-card.entering .portal-card-right {
  width: 18px;
  height: 18px;
  border: 3px solid #d8d8ec;
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: portal-spin 0.7s linear infinite;
}

.portal-card:hover .portal-card-right,
.portal-card:focus-visible .portal-card-right {
  color: var(--color-primary);
  transform: translateX(3px);
}

.portal-card.entering:hover .portal-card-right,
.portal-card.entering:focus-visible .portal-card-right {
  transform: none;
}

@keyframes portal-spin {
  to {
    transform: rotate(360deg);
  }
}

.home-footer {
  margin-top: auto;
  padding-top: 10px;
  text-align: center;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
}

@media (max-width: 500px) {
  #portal-container {
    width: 100vw;
    height: 100vh;
    border: 0;
    border-radius: 0;
  }
}
