/* 補充 portal.html 行內樣式 */
.user-main {
  font-weight: bold;
  font-size: 0.8em;
}
.user-email {
  font-size: 0.65em;
  color: #666;
}
.user-info-block {
  display: none;
}
hr {
  margin: 0.7em 0 0.5em 0;
  opacity: 0.2;
}
/* 使用者資訊下拉選單美化 */
#user-panel {
  position: absolute;
  top: 1rem;
  right: 2rem;
  color: #222;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 10;
}
.user-dropdown {
  position: relative;
  display: inline-block;
}
.user-dropdown-btn {
  background: #f5f5f5;
  border: 1px solid #ccc;
  border-radius: 20px;
  padding: 0.3rem 1rem;
  cursor: pointer;
  font-weight: 500;
  min-width: 120px;
  color: #222;
  transition: background 0.2s;
}
.user-dropdown-btn:hover {
  background: #eaeaea;
}
.user-dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  top: 110%;
  background: #fff;
  min-width: 120px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  border-radius: 8px;
  border: 1px solid #eee;
  padding: 0.7rem 1.2rem 0.7rem 1.2rem;
  z-index: 100;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5em;
}
.user-dropdown.show .user-dropdown-content {
  display: block;
}

/* 個人卡片風格 user info block */
.user-dropdown-content .user-info-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 0.2em;
}
.user-dropdown-content .user-main {
  font-weight: bold;
  font-size: 1.15em;
  color: #222;
  margin-bottom: 0.1em;
}
.user-dropdown-content .user-email {
  font-size: 0.98em;
  color: #666;
  margin-bottom: 0.1em;
  word-break: break-all;
}
.user-dropdown-content .user-role-auth {
  font-size: 0.95em;
  color: #888;
  margin-bottom: 0.2em;
}
.user-dropdown-content hr {
  width: 100%;
  border: none;
  border-top: 1px solid #eee;
  margin: 0.7em 0 0.5em 0;
}
.user-dropdown-content button {
  width: 100%;
  margin: 0.2em 0;
  padding: 0.5em 0.8em;
  border-radius: 6px;
  border: none;
  background: #f5f5f5;
  color: #222;
  cursor: pointer;
  font-size: 1em;
  font-weight: 500;
  letter-spacing: 1px;
  transition: background 0.2s;
}


#header-flex, .header-flex {
  display: flex;
  align-items: center;
  width: 100%;
}
.logo {
  margin-right: 2rem;
}
.nav-links {
  margin-right: 0.5rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
}
#user-panel {
  display: flex;
  align-items: center;
}
/* 按鈕群組橫向排列與間距 */
.btn-group {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  align-items: center;
  margin-top: 1.2rem;
}

/* 第二個按鈕灰色樣式 */
.btn-enter.secondary {
  background: #888;
  color: #fff;
}
/*
  Edgecore Portal - 系統入口 CSS
  從 portal.html 獨立出來
*/

:root {
  --primary-red: #e60012;
  --pure-white: #ffffff;
  --deep-black: #181a1b;
  --light-gray: #f8f9fa;
  --border-color: #eeeeee;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Montserrat', 'Noto Sans TC', sans-serif;
  background-color: var(--pure-white);
  color: var(--deep-black);
  line-height: 1.6;
  overflow-x: hidden;
}

.bg-decoration {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 90% 10%, rgba(230, 0, 18, 0.03) 0%, transparent 40%),
    radial-gradient(circle at 10% 90%, rgba(24, 26, 27, 0.02) 0%, transparent 40%);
  z-index: -1;
}

header {
  padding: 0.5rem 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  border-bottom: 4px solid var(--primary-red);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(4px);
}

.logo img {
  height: 40px;
  display: block;
}

.nav-links a {
  text-decoration: none;
  color: var(--deep-black);
  font-weight: 700;
  font-size: 0.9rem;
  margin-left: 2rem;
  letter-spacing: 1px;
  transition: all 0.3s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-red);
  transition: width 0.3s;
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-links a:hover {
  color: var(--primary-red);
}

.portal-hero {
  text-align: center;
  padding: 6rem 1rem 4rem;
  position: relative;
  overflow: hidden;
}

.portal-hero-bg-bevel {
  position: absolute;
  top: -130px;
  left: -300px;
  transform: skew(-22deg);
  width: 785px;
  height: 420px;
  background: #cccccc;
  opacity: 0.85;
  z-index: -1;
  pointer-events: none;
}

.portal-hero h1 {
  font-size: 3.8rem;
  font-weight: 900;
  color: var(--deep-black);
  margin-bottom: 1rem;
  letter-spacing: -1px;
  position: relative;
  z-index: 2;
}

.portal-hero h1 span {
  color: var(--primary-red);
  position: relative;
  z-index: 1;
}

.portal-hero h1::before {
  content: '';
  position: absolute;
  right: 0.2em;
  bottom: -0.85em;
  width: 25.5em;
  height: 0.6em;
  background: #323232;
  transform: skew(-28deg);
  border-radius: 0px;
  z-index: 0;
}

.portal-hero p {
  font-size: 1.25rem;
  color: #ebe9e9;
  max-width: 700px;
  margin: 0 auto;
  font-weight: 400;
  position: relative;
  z-index: 2;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto 6rem;
  padding: 0 2rem;
}

.portal-card {
  background: var(--pure-white);
  border: 1px solid var(--border-color);
  padding: 4rem 2rem;
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 420px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.03);
  position: relative;
}

.portal-card:hover {
  transform: translateY(-12px);
  box-shadow: 0 30px 60px rgba(230, 0, 18, 0.08);
  border-color: var(--primary-red);
}

.portal-card-icon {
  font-size: 3.5rem;
  color: var(--primary-red);
  margin-bottom: 2.5rem;
  transition: transform 0.4s ease, color 0.3s;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 64px;
}

/* 讓第一個按鈕 hover 時，icon 變色 */
.portal-card .btn-enter:first-child:hover ~ .btn-enter.secondary ~ .portal-card-icon i,
.portal-card .btn-enter:first-child:hover ~ .portal-card-icon i,
.portal-card .btn-enter:first-child:hover ~ i,
.portal-card .btn-enter:first-child:hover ~ .portal-card-icon > i,
.portal-card .btn-enter:first-child:hover ~ div > i {
  color: #181a1b;
}

/* 更簡單且兼容性高的寫法：用 JS 動態加 class，這裡先用純 CSS 方案 */
.portal-card .btn-enter:first-child:hover ~ .portal-card-icon {
  color: #181a1b;
}

.portal-card-icon img {
  height: 56px;
  max-width: 100%;
  display: block;
  margin: 0 auto;
}

.portal-card:hover .portal-card-icon {
  transform: scale(1.15) rotate(5deg);
}

.portal-card-title {
  font-size: 1.6rem;
  font-weight: 900;
  margin-bottom: 1.2rem;
  color: var(--deep-black);
}

.portal-card-desc {
  font-size: 0.95rem;
  color: #666;
  line-height: 1.8;
  margin-bottom: 2rem;
}

.btn-enter {
  margin-top: auto;
  padding: 0.9rem 2.8rem;
  background: var(--deep-black);
  color: var(--pure-white);
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  transition: all 0.3s;
  border: none;
  display: inline-block;
  margin-right: 0.5rem;
}

.btn-enter.secondary {
  background: var(--pure-white);
  color: var(--primary-red);
  border: 2px solid var(--primary-red);
  margin-right: 0;
}
.btn-enter.secondary:hover {
  background: var(--primary-red);
  color: var(--pure-white);
}

.portal-card:hover .btn-enter {
  background: var(--primary-red);
  box-shadow: 0 10px 20px rgba(230, 0, 18, 0.2);
}

footer {
  background: var(--deep-black);
  color: var(--pure-white);
  padding: 0.3rem 5%;
  text-align: center;
}

.footer-logo {
  height: 35px;
  /* filter: brightness(0) invert(1); */
  margin-bottom: 2rem;
  opacity: 0.9;
}

.copyright {
  font-size: 0.8rem;
  opacity: 0.5;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

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

.animate {
  opacity: 0;
  animation: fadeInUp 1s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

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

@media (max-width: 768px) {
  .portal-hero h1 {
    font-size: 2.8rem;
  }
  .portal-grid {
    grid-template-columns: 1fr;
  }
  .portal-hero {
    padding: 4rem 1rem 2rem;
  }
}
