:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #111827;
  --muted: #667085;
  --line: #e5e7eb;

  --navy: #0b1f3a;
  --blue: #1f5eff;
  --blue-soft: #eef4ff;
  --gold: #c89b3c;
  --gold-soft: #fff8e8;

  --shadow: 0 24px 70px rgba(15, 23, 42, 0.08);
  --radius-lg: 28px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

body.portal-body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(31, 94, 255, 0.08), transparent 32%),
    linear-gradient(135deg, #f7f9fc 0%, #eef2f7 100%);
  color: var(--text);
  font-family: "Microsoft JhengHei", "Noto Sans TC", system-ui, sans-serif;
}

/* ===== Landing ===== */

.landing {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.landing-card {
  width: min(520px, 100%);
  padding: 46px;
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  border: 1px solid rgba(229, 231, 235, 0.9);
}

.landing-top {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: var(--navy);
  color: #fff;
  font-weight: 900;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.brand-name {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.landing h1 {
  margin: 0;
  color: var(--navy);
  font-size: 38px;
  letter-spacing: -0.05em;
}

.landing-desc {
  margin: 28px 0 22px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.landing-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 30px;
}

.landing-tags span {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.landing-tags span:nth-child(2) {
  background: var(--gold-soft);
  color: #9a6a13;
}

.landing-tags span:nth-child(3) {
  background: #f1f5f9;
  color: var(--navy);
}

.landing-button {
  width: 100%;
}

/* ===== Common ===== */

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

.portal-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(229, 231, 235, 0.95);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.portal-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 16px;
  background: var(--navy);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: 0.18s ease;
}

.portal-button:hover {
  transform: translateY(-1px);
  background: #122b4d;
}

.portal-button.secondary {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--line);
}

.portal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

/* ===== Login ===== */

.login-panel {
  width: min(500px, calc(100% - 36px));
  margin: 70px auto;
  padding: 38px;
}

.brand-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 8px 13px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

.login-title {
  margin: 0;
  color: var(--navy);
  font-size: 32px;
  letter-spacing: -0.04em;
}

.login-desc {
  margin: 14px 0 26px;
  color: var(--muted);
  line-height: 1.8;
  font-size: 15px;
}

.portal-field {
  margin-bottom: 18px;
}

.portal-field label {
  display: block;
  margin-bottom: 8px;
  font-weight: 800;
  color: var(--navy);
}

.portal-field input {
  width: 100%;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0 16px;
  font-size: 15px;
  outline: none;
}

.portal-field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(31, 94, 255, 0.08);
}

.portal-notice {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--blue-soft);
  color: var(--blue);
  line-height: 1.6;
  font-weight: 800;
}

/* ===== Portal Layout ===== */

.portal-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
}

.portal-sidebar {
  padding: 24px;
  height: fit-content;
  position: sticky;
  top: 24px;
}

.portal-user {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}

.portal-user h1 {
  margin: 0;
  color: var(--navy);
  font-size: 21px;
  letter-spacing: -0.03em;
}

.portal-user p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 13px;
  word-break: break-all;
}

.portal-nav {
  display: grid;
  gap: 8px;
}

.portal-nav a,
.portal-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  border: 0;
  background: transparent;
  color: var(--navy);
  text-decoration: none;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.portal-nav a:hover,
.portal-nav button:hover,
.portal-nav .active {
  background: var(--blue-soft);
  color: var(--blue);
}

.portal-main {
  padding: 34px;
}

.portal-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 28px;
}

.portal-page-title {
  margin: 0 0 8px;
  color: var(--navy);
  font-size: 34px;
  letter-spacing: -0.05em;
}

.portal-page-desc {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
  font-size: 15px;
}

.status-pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: #9a6a13;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
}

.dashboard-section {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
}

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

.section-head h2 {
  margin: 0;
  color: var(--navy);
  font-size: 18px;
}

.section-head a {
  color: var(--blue);
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
}

.project-list,
.notice-list,
.doc-list {
  display: grid;
  gap: 10px;
}

.list-item {
  padding: 14px;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px solid #eef2f7;
}

.list-item strong {
  display: block;
  color: var(--navy);
  margin-bottom: 4px;
}

.list-item span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.action-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.action-card {
  padding: 18px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--navy);
  text-decoration: none;
  transition: 0.18s ease;
}

.action-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

.action-card b {
  display: block;
  margin-top: 8px;
}

.action-card span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.action-icon {
  font-size: 28px;
}

@media (max-width: 940px) {
  .portal-layout,
  .dashboard-grid,
  .action-row {
    grid-template-columns: 1fr;
  }

  .portal-sidebar {
    position: static;
  }

  .portal-header {
    display: block;
  }

  .status-pill {
    display: inline-flex;
    margin-top: 14px;
  }
}
/* ===== Simple Tool Header ===== */

.tool-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(31, 94, 255, 0.06), transparent 30%),
    linear-gradient(135deg, #f7f9fc 0%, #eef2f7 100%);
  color: var(--text);
  font-family: "Microsoft JhengHei", "Noto Sans TC", system-ui, sans-serif;
}

.tool-topbar {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.tool-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--navy);
  font-weight: 900;
  text-decoration: none;
}

.tool-brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--navy);
  color: #fff;
  font-weight: 900;
}

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

.tool-link {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
}

.tool-link:hover {
  background: var(--blue-soft);
  color: var(--blue);
}

.tool-container {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 60px;
}

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

  .tool-actions {
    flex-wrap: wrap;
  }
}
/* ================================
   v2.1 Home：無側欄入口頁
================================ */

.hotai-home {
  display: grid;
  gap: 22px;
}

.home-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.home-title {
  margin: 0;
  color: var(--navy);
  font-size: 34px;
  font-weight: 950;
  letter-spacing: -0.05em;
}

.home-user {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.home-hero {
  padding: 34px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
}

.home-label {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.home-hero h2 {
  margin: 0;
  color: var(--navy);
  font-size: 42px;
  letter-spacing: -0.06em;
}

.home-hero p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

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

.home-card {
  padding: 26px;
  border-radius: 26px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.06);
  color: var(--navy);
  text-decoration: none;
  transition: 0.18s ease;
}

.home-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.10);
}

.home-card-icon {
  font-size: 30px;
  margin-bottom: 16px;
}

.home-card h3 {
  margin: 0 0 10px;
  font-size: 20px;
}

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

.home-section {
  padding: 26px;
}

@media (max-width: 860px) {
  .home-topbar,
  .home-hero {
    display: block;
  }

  .home-topbar .portal-button {
    margin-top: 18px;
  }

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

  .home-hero h2 {
    font-size: 34px;
  }
}