/* ========================================= */
/* [Global] Reset, Variables & Base Styles   */
/* ========================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* Skip to main content link (a11y) */
.skip-link {
  position: absolute; top: -100%; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff; padding: 8px 16px;
  border-radius: 0 0 var(--radius-md) var(--radius-md); font-weight: 700; z-index: 99999;
  text-decoration: none; transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* Variables are now defined in theme.css */

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-primary);
  line-height: 1.75;
  overflow-x: hidden;
  position: relative;
}

/* ========================================= */
/* [Component] Background Effects & Loader   */
/* ========================================= */
/* particle-bg and dynamic-light removed — no decorative background effects */

#preloader {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background-color: var(--bg-primary); display: flex; align-items: center;
  justify-content: center; z-index: 9999; opacity: 1;
  transition: opacity 0.5s ease-out;
}

.loader {
  width: 48px; height: 48px; border: 4px solid var(--border-color);
  border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(200deg) scale(0.9); }
  100% { transform: rotate(360deg) scale(1); }
}

/* ========================================= */
/* [Component] Marquee Announcement          */
/* ========================================= */
#marquee-announcement {
  position: fixed; top: 100px; left: 50%; transform: translateX(-50%);
  width: 90%; max-width: 800px; z-index: 1001;
  background: var(--bg-card);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-color); border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  display: flex; align-items: center; padding: 12px 20px; overflow: hidden;
  opacity: 0; transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

#marquee-announcement.visible { opacity: 1; }
#marquee-announcement.hidden { opacity: 0; pointer-events: none; }

.marquee-content {
  display: flex; align-items: center; flex-grow: 1; overflow: hidden; position: relative;
  mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}

.marquee-content i.fa-bullhorn {
  font-size: 1.2rem; margin-right: 20px; color: var(--accent);
  flex-shrink: 0; z-index: 2;
}

.marquee-text-wrapper {
  display: flex; white-space: nowrap; position: relative; height: 1.5em; width: 100%;
}

.marquee-text-wrapper > span {
  display: inline-block; position: absolute; left: 0; will-change: transform; white-space: nowrap; width: max-content;
}

.marquee-text-wrapper a { display: inline-flex; align-items: center; text-decoration: none; }

@keyframes marquee-pixel-perfect {
  0% { transform: translateX(var(--marquee-start, 100%)); }
  100% { transform: translateX(var(--marquee-end, -100%)); }
}

.marquee-close {
  background: transparent; border: none; color: var(--text-muted); font-size: 1.2rem;
  cursor: pointer; padding: 5px; margin-left: 20px; flex-shrink: 0;
  transition: color 0.3s, transform 0.3s; z-index: 3;
}
.marquee-close:hover { color: var(--text-primary); transform: scale(1.2); }

/* Override inline marquee text colors for theme support */
.marquee-text-wrapper a span { color: var(--text-secondary) !important; }
.marquee-text-wrapper a span[style*="color: #ff9800"],
.marquee-text-wrapper a span[style*="color:#ff9800"] { color: var(--color-warning) !important; }
.marquee-text-wrapper a span[style*="color: #ccc"],
.marquee-text-wrapper a span[style*="color:#ccc"] { color: var(--text-secondary) !important; }

/* ========================================= */
/* [Layout] Main Navigation & Header         */
/* ========================================= */
#main-header {
  position: sticky; top: 0; width: 100%;
  background: var(--bg-secondary);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  padding: 16px 0; z-index: 1000;
  border-bottom: 1px solid var(--border-color); box-shadow: var(--shadow-sm);
}

#mainNav {
  max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; padding: 0 20px; position: relative;
}

.logo { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); }
#mainNav ul { display: flex; justify-content: center; list-style: none; }
#mainNav ul li { margin: 0 22px; }

#mainNav ul li a {
  color: var(--text-muted); text-decoration: none; font-weight: 700;
  transition: color var(--transition-speed) var(--transition-timing), text-shadow var(--transition-speed) var(--transition-timing);
  padding: 10px 6px; position: relative; letter-spacing: 0.6px;
}

#mainNav ul li a::after {
  content: ''; position: absolute; width: 0; height: 2px; display: block; margin-top: 5px; left: 50%;
  transform: translateX(-50%); background: var(--accent); border-radius: 2px;
  transition: width var(--transition-speed) var(--transition-timing);
}

#mainNav ul li a:hover::after, #mainNav ul li a.active::after { width: 100%; left: 0; transform: translateX(0); }
#mainNav ul li a:hover, #mainNav ul li a.active { color: var(--text-primary); }

.nav-links { display: flex; gap: 15px; list-style: none; margin: 0 auto; }

/* ========================================= */
/* [Section] Hero Section                    */
/* ========================================= */
#hero {
  position: relative; min-height: 90vh; padding: 40px 20px; overflow: hidden;
  display: grid; place-items: center; width: 100vw;
  left: 50%; right: 50%; margin-left: -50vw; margin-right: -50vw;
}

#hero > * { grid-column: 1 / -1; grid-row: 1 / -1; }

#hero-video-bg {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1;
  filter: brightness(var(--hero-video-brightness)) contrast(1.1); transition: opacity 0.5s ease-out;
}
#hero-video-bg.hidden { opacity: 0; }

#hero-static-bg {
  width: 100%; height: 100%; background: var(--hero-static-bg); z-index: 2;
}

#hero::after {
  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none;
  background: radial-gradient(ellipse 90% 50% at 50% 50%, transparent 40%, var(--bg-primary) 80%);
}

.hero-content {
  z-index: 4; max-width: 950px; opacity: 0; animation: fadeInUp 1.2s ease-out forwards;
}

body.loaded .hero-content { animation-delay: 0.5s; }

#typewriter {
  font-family: var(--font-pixel); font-size: clamp(2.2rem, 6vw, 3.5rem); margin-bottom: 35px;
  line-height: 1.35; color: var(--text-primary); min-height: 1.35em;
}

.hero-content p {
  font-size: clamp(1.1rem, 3vw, 1.4rem); margin-bottom: 50px;
  color: var(--text-muted); max-width: 750px; margin-left: auto; margin-right: auto;
}
.hero-buttons { display: flex; gap: 30px; justify-content: center; flex-wrap: wrap; }

/* ========================================= */
/* [Layout] General Sections & Text Styles   */
/* ========================================= */
main { background-color: var(--bg-primary); }

.content-section {
  padding: var(--section-padding) 20px; border-top: 1px solid var(--border-color); overflow: hidden;
  position: relative; max-width: var(--content-max-width); margin: 0 auto;
}

.content-section h2.gradient-text, .page-title {
  font-family: var(--font-pixel); font-size: clamp(2rem, 5vw, 2.4rem); text-align: center;
  margin-bottom: 25px; position: relative; display: block; padding-bottom: 20px;
}
.page-title { margin-top: 20px; }

.content-section h2::after, .page-title::after {
  content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 60px; height: 3px; background: var(--accent);
  border-radius: 2px;
}

.section-subtitle {
  text-align: center; color: var(--text-muted); font-size: 1.15rem;
  margin-bottom: 60px; max-width: 800px; margin-left: auto; margin-right: auto;
}

/* gradient-text removed — use plain color */
.gradient-text {
  color: var(--accent-text);
  display: inline-block; padding-bottom: 0.2em; margin-bottom: -0.2em; line-height: 1.4;
}

/* ========================================= */
/* [UI] Buttons & Utility Classes            */
/* ========================================= */
.btn {
  padding: 12px 28px; border: 2px solid transparent; text-decoration: none; font-weight: 700; cursor: pointer;
  transition: all var(--transition-speed) var(--transition-timing); letter-spacing: 0.5px;
  border-radius: var(--radius-md); font-size: 1rem; display: inline-flex; align-items: center;
  justify-content: center; gap: 10px; position: relative; overflow: hidden; box-shadow: var(--shadow-sm);
}

.btn i { font-size: 1.1em; transition: transform var(--transition-speed) var(--transition-timing); }
.btn:hover i { transform: scale(1.05); }

.btn.primary {
  background: var(--accent); color: #fff;
}
.btn.primary:hover {
  background: var(--accent-hover); transform: translateY(-2px); box-shadow: var(--shadow-md);
}

.btn.secondary {
  background: var(--bg-elevated); border: 1px solid var(--border-color); color: var(--text-secondary);
}
.btn.secondary:hover {
  border-color: var(--accent); color: var(--text-primary);
  transform: translateY(-2px); box-shadow: var(--shadow-sm);
}

/* ========================================= */
/* [Component] Features & Spec Cards         */
/* ========================================= */
.features-grid, .spec-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 40px; margin: 60px auto 0;
}

.feature-item, .spec-card {
  background-color: var(--bg-card); padding: var(--card-padding); text-align: center;
  border: 1px solid var(--border-color); border-radius: var(--radius-lg);
  transition: all var(--transition-speed) var(--transition-timing);
  border-bottom: 3px solid var(--accent); position: relative;
}

.feature-item:hover, .spec-card:hover {
  transform: translateY(var(--hover-lift)); box-shadow: var(--shadow-md);
  background-color: var(--bg-card-hover);
}

.feature-item i {
  font-size: 2.4rem; color: var(--accent); margin-bottom: 20px; display: block; transition: transform 0.2s ease;
}
.feature-item:hover i { transform: scale(1.05); }
.feature-item h3 { font-size: 1.3rem; margin-bottom: 12px; color: var(--text-primary); }
.feature-item p { font-size: 1rem; color: var(--text-secondary); line-height: 1.8; }

.spec-card .spec-title { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 10px; font-weight: 700; }
.spec-card .spec-value { font-size: 1.6rem; color: var(--accent-text); margin-bottom: 15px; font-weight: 700; }
.spec-card .spec-desc { font-size: 0.9rem; color: var(--text-secondary); }

/* ========================================= */
/* [Component] Join Page & Steps             */
/* ========================================= */
.steps-container {
  display: flex; flex-direction: column; gap: 40px; max-width: 800px; margin: 60px auto 0;
}

.step-card {
  background-color: var(--bg-card); padding: var(--card-padding); text-align: center;
  border: 1px solid var(--border-color); border-radius: var(--radius-lg);
  position: relative; overflow: hidden;
}

.step-card .step-title { font-size: 1.6rem; font-weight: 700; color: var(--accent-text); margin-bottom: 15px; }
.step-card .step-desc { color: var(--text-secondary); margin-bottom: 30px; }

.step-card ol, .step-card ul {
  text-align: left; max-width: 450px; margin: 20px auto 0; padding-left: 20px; line-height: 1.8;
}
.step-card code {
  background-color: var(--bg-primary); color: var(--accent-text); padding: 3px 6px; border-radius: var(--radius-sm); font-family: var(--font-mono);
}

.ip-block {
  display: flex; align-items: stretch; max-width: 400px; margin: 20px auto;
  border: 1px solid var(--border-color); border-radius: var(--radius-md); overflow: hidden;
}

.ip-block #server-ip {
  padding: 12px 20px; background-color: var(--bg-primary); color: var(--text-primary);
  font-family: var(--font-mono); font-size: 1.1rem; flex-grow: 1; text-align: left;
}

.ip-block .copy-ip-btn {
  background: var(--accent); color: #fff; border: none; padding: 0 20px; font-weight: 700;
  cursor: pointer; transition: background-color 0.2s; display: flex; align-items: center; gap: 8px;
}
.ip-block .copy-ip-btn:hover { background-color: var(--accent-hover); }
.ip-block .copy-ip-btn.copied { background-color: var(--color-success); }

.warning-box {
  background: rgba(255, 152, 0, 0.1); border: 1px solid #FF9800; border-left: 4px solid #FF9800;
  border-radius: var(--radius-md); padding: 20px; margin-bottom: 40px; text-align: center;
}
.warning-box .warning-title {
  color: #FFC107; font-size: 1.5rem; font-weight: 700; margin-bottom: 10px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.warning-box p { color: var(--text-muted); font-size: 1.1rem; }

.ip-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-top: 20px;
}
.ip-block.disabled { opacity: 0.5; pointer-events: none; position: relative; overflow: hidden; }
.ip-block.disabled::after {
  content: '暫停招募'; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotate(-15deg); background: #ff5566; color: #fff;
  font-weight: 700; padding: 8px 20px; border-radius: 5px; font-size: 1.2rem; z-index: 2;
}

.secrecy-card {
  background-color: var(--bg-card); border: 1px solid var(--color-error);
  padding: 24px; text-align: center; border-radius: var(--radius-lg); margin-top: 40px;
}
.secrecy-card .secrecy-title {
  color: var(--color-error); font-size: 1.5rem; font-weight: 700; margin-bottom: 15px;
}

/* ========================================= */
/* [Component] Video Showcase                */
/* ========================================= */
.video-container {
  position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;
  max-width: 1000px; margin: 60px auto 0; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.video-container iframe {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  border: 1px solid var(--border-color); border-radius: var(--radius-lg);
}

.video-credit { text-align: right; margin-top: 15px; font-size: 0.9rem; }
.video-credit a {
  color: var(--text-muted); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; transition: color 0.3s;
}
.video-credit a:hover { color: var(--text-primary); }
.video-credit .fa-youtube { color: #FF0000; font-size: 1.2rem; }

/* ========================================= */
/* [Component] News Page & API Badges        */
/* ========================================= */
.news-list { display: flex; flex-direction: column; gap: 40px; max-width: 900px; margin: 60px auto 0; }

.news-post {
  box-shadow: var(--shadow-sm); background-color: var(--bg-card); padding: 24px;
  border: 1px solid var(--border-color); border-radius: var(--radius-lg);
  border-left: 3px solid var(--accent); position: relative;
  transition: transform var(--transition-speed) var(--transition-timing), box-shadow var(--transition-speed) var(--transition-timing);
}

.news-post:hover {
  transform: translateY(var(--hover-lift)); box-shadow: var(--shadow-md);
}

.news-post .post-date { font-family: var(--font-mono); color: var(--text-muted); margin-bottom: 10px; display: block; }
.news-post .post-title { font-size: 1.6rem; color: var(--text-primary); margin-bottom: 15px; }

.news-post .post-content {
  color: var(--text-muted); font-size: 1rem; line-height: 1.8;
  white-space: pre-wrap; word-wrap: break-word; overflow-wrap: break-word; word-break: break-word; padding: 10px 0;
}

.news-post .post-content img { max-width: 100%; height: auto; border-radius: 5px; margin: 10px 0; }
.news-post .post-content p { margin-bottom: 10px; }

/* [關鍵修復] 確保公告內的清單有樣式 */
.news-post .post-content ul, .news-post .post-content ol { 
    margin: 15px 0 15px 40px; 
    list-style-position: outside; 
}
.news-post .post-content ul { list-style-type: disc; }
.news-post .post-content ol { list-style-type: decimal; }
.news-post .post-content li { margin-bottom: 5px; }

/* [新增] 引用區塊樣式 */
.news-post .post-content blockquote {
    border-left: 3px solid var(--accent);
    margin: 15px 0;
    padding: 10px 20px;
    background: var(--accent-subtle);
    color: var(--text-secondary);
    font-style: italic;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.news-post .post-content strong { color: var(--text-primary); }

/* [關鍵修復] 確保公告內的水平線可見 */
.news-post .post-content hr {
    display: block;
    height: 1px;
    border: 0;
    border-top: 1px solid var(--divider-color-strong);
    margin: 20px 0;
    padding: 0;
}

/* [關鍵修復] 確保影片 (iframe) 寬度正確 */
.news-post .post-content iframe {
    max-width: 100%;
}

.news-category {
  padding: 2px 8px; border-radius: 4px; font-size: 0.85em; color: white; background-color: var(--text-muted); display: inline-block;
}
.badge-maintenance { background-color: #e84118; }
.badge-event { background-color: #9c88ff; }
.badge-update { background-color: #00a8ff; }

.urgent-tag {
  color: #ff4757; font-weight: bold; font-size: 0.9em; display: inline-flex; align-items: center; gap: 5px; animation: pulse-red 2s infinite;
}
.news-post.urgent { border: 1px solid #ff4757; }
.news-post.urgent:hover { border-color: #ff6b81; }

@keyframes pulse-red {
  0% { opacity: 0.8; } 50% { opacity: 1; text-shadow: 0 0 5px #ff4757; } 100% { opacity: 0.8; }
}

/* ========================================= */
/* [Layout] Footer & Back To Top             */
/* ========================================= */
footer {
  padding: 50px 20px; text-align: center; background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color); font-size: 0.95rem; color: var(--text-muted);
}

.footer-content {
  max-width: 1200px; margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start;
  text-align: left; padding-top: 20px;
}

footer .col { flex: 1; min-width: 250px; margin: 0 15px 30px 15px; }

footer .col h4 {
  color: var(--accent-text); font-size: 1.2rem; margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color); padding-bottom: 10px;
}

footer .col ul { list-style: none; padding: 0; }
footer .col ul li { margin-bottom: 10px; }

footer .col ul li a, footer .col p {
  color: var(--text-muted); text-decoration: none; transition: color var(--transition-speed) var(--transition-timing);
  display: flex; align-items: center; gap: 10px;
}
footer .col ul li a:hover { color: var(--accent-text); }
footer .col ul li i { color: var(--accent-text); font-size: 1rem; }

.footer-bottom-text {
  width: 100%; text-align: center; margin-top: 40px; padding-top: 20px;
  border-top: 1px solid var(--border-color); color: var(--text-muted); font-size: 0.9rem;
}

.footer-links { margin-top: 10px; }
.footer-links a {
  color: var(--text-muted); text-decoration: none; margin: 0 12px; transition: color var(--transition-speed) var(--transition-timing);
}
.footer-links a:hover { color: var(--accent-text); }

/* Discord ID copy row */
.discord-id-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  color: var(--text-muted); position: relative;
}
.discord-id-row i { color: var(--accent-text); font-size: 1rem; }
.discord-id-row code {
  background: var(--bg-card); color: var(--accent-text); padding: 3px 10px;
  border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 0.95rem;
  border: 1px solid var(--border-color); user-select: all; letter-spacing: 1px;
}
.copy-id-btn {
  background: transparent; border: 1px solid var(--border-color); color: var(--text-muted);
  padding: 4px 8px; border-radius: 6px; cursor: pointer; font-size: 0.85rem;
  transition: all 0.25s ease; display: inline-flex; align-items: center; gap: 4px;
}
.copy-id-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-subtle); }
.copy-id-btn.copied { color: var(--color-success); border-color: var(--color-success); }
.copy-toast {
  position: absolute; right: 0; top: -28px;
  background: var(--color-success); color: #fff; padding: 3px 10px;
  border-radius: var(--radius-sm); font-size: 0.75rem; font-weight: 700;
  opacity: 0; transform: translateY(6px); pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.copy-toast.show { opacity: 1; transform: translateY(0); }

/* Footer social icons */
.footer-social { margin-top: 18px; display: flex; gap: 14px; }
.footer-social a {
  width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid var(--border-color); color: var(--text-muted);
  font-size: 1.1rem; transition: all 0.3s ease; text-decoration: none;
}
.footer-social a:hover { color: var(--text-on-dark); background: var(--accent); border-color: var(--accent); transform: translateY(-2px); }

#backToTop {
  position: fixed; bottom: 30px; right: 30px; width: 44px; height: 44px;
  background: var(--accent); color: #fff; border: none; border-radius: 50%; font-size: 1.2rem; cursor: pointer;
  box-shadow: var(--shadow-md); z-index: 999;
  opacity: 0; visibility: hidden; transform: translateY(20px); transition: all 0.3s ease;
}
#backToTop.visible { opacity: 1; visibility: visible; transform: translateY(0); }
#backToTop:hover { background: var(--accent-hover); transform: translateY(-2px); }

/* ========================================= */
/* [Global] Page Transitions & Animations    */
/* ========================================= */
#page-wrapper { animation: fadeIn 0.5s ease-in-out; }
#page-wrapper.page-fade-out { opacity: 0; transition: opacity 0.4s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.hidden-anim { opacity: 0; transform: translateY(16px); }
.visible-anim {
  transition: opacity 0.8s var(--transition-timing), transform 0.8s var(--transition-timing);
  transition-delay: var(--animation-delay, 0s); opacity: 1; transform: translateY(0);
}
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ========================================= */
/* [Component] Music Player & Modal          */
/* ========================================= */
.music-modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(5px);
  z-index: 9999; display: flex; justify-content: center; align-items: center;
  opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease;
}
.music-modal-overlay.show { opacity: 1; visibility: visible; }

.music-modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color); padding: 2rem; border-radius: var(--radius-lg);
  text-align: center; max-width: 400px; width: 90%; box-shadow: var(--shadow-lg);
  transform: scale(0.95); transition: transform 0.2s ease;
}
.music-modal-overlay.show .music-modal-content { transform: scale(1); }

.music-icon-wrapper { font-size: 2.5rem; color: var(--accent); margin-bottom: 1rem; }
.music-modal-content h3 {
  color: var(--text-primary); margin-bottom: 0.5rem; font-family: var(--font-pixel); font-size: 1.2rem; line-height: 1.5;
}
.music-modal-content p { color: var(--text-secondary); margin-bottom: 1.5rem; font-size: 0.9rem; line-height: 1.6; }
.music-modal-buttons { display: flex; gap: 1rem; justify-content: center; }

.music-modal-buttons .btn {
  padding: 0.6rem 1.2rem; font-size: 0.9rem; cursor: pointer; border-radius: 5px;
  border: none; transition: all 0.3s ease; display: flex; align-items: center; gap: 0.5rem; text-decoration: none; color: white;
}
.music-modal-buttons .btn.primary { background: var(--accent); }
.music-modal-buttons .btn.primary:hover { transform: translateY(-2px); background: var(--accent-hover); }
.music-modal-buttons .btn.secondary { background: var(--btn-neutral-bg); }
.music-modal-buttons .btn.secondary:hover { background: var(--btn-neutral-bg-hover); }

.music-control-container {
  position: fixed; bottom: 80px; right: 20px; z-index: 990; display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.music-control-container.hidden { display: none; }

.music-trigger-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--bg-card); border: 1px solid var(--accent); color: var(--accent); font-size: 1.2rem;
  cursor: pointer; box-shadow: var(--shadow-sm); transition: all 0.2s ease;
  display: flex; justify-content: center; align-items: center;
}
.music-trigger-btn:hover {
  background: var(--accent); color: #fff; transform: scale(1.05);
}
.fa-spin-pulse { animation-duration: 3s; }

.audio-panel {
  background: var(--bg-card); backdrop-filter: blur(8px);
  border: 1px solid var(--border-color); padding: 15px; border-radius: var(--radius-lg);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  box-shadow: var(--shadow-md); opacity: 0; visibility: hidden;
  transform: translateY(10px); transition: all 0.2s ease;
  position: absolute; bottom: 60px; right: 0; width: 40px; overflow: hidden;
}
.audio-panel.active { opacity: 1; visibility: visible; transform: translateY(0) scale(1); width: 160px; height: auto; }

.panel-control-btn {
  background: transparent; border: 1px solid var(--border-color); color: var(--text-primary); width: 36px; height: 36px;
  border-radius: 50%; cursor: pointer; transition: all 0.2s; display: flex; justify-content: center; align-items: center;
}
.panel-control-btn:hover { background: var(--accent); border-color: var(--accent); }

.volume-slider-wrapper { display: flex; align-items: center; gap: 8px; width: 100%; }
.volume-icon-small { font-size: 0.8rem; color: #888; }

input[type=range] { -webkit-appearance: none; width: 100%; background: transparent; }
input[type=range]:focus { outline: none; }
input[type=range]::-webkit-slider-runnable-track {
  width: 100%; height: 4px; cursor: pointer; background: var(--slider-track); border-radius: 2px;
}
input[type=range]::-webkit-slider-thumb {
  height: 14px; width: 14px; border-radius: 50%; background: var(--accent); cursor: pointer;
  -webkit-appearance: none; margin-top: -5px; transition: transform 0.1s;
}
input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.3); }

/* ========================================= */
/* [Component] User Menu & Dropdown          */
/* ========================================= */
.user-menu-container { position: relative; margin-left: 20px; flex-shrink: 0; }

.user-avatar-btn {
  width: 40px; height: 40px; border-radius: 50%; background: var(--bg-elevated);
  border: 2px solid var(--border-color); display: flex; justify-content: center; align-items: center;
  cursor: pointer; transition: all 0.2s ease; overflow: hidden;
  padding: 0; font: inherit; color: inherit;
}
.user-avatar-btn:hover { border-color: var(--accent); }
.user-avatar-btn i { font-size: 1.5rem; color: var(--text-muted); }
.user-avatar-btn img { width: 100%; height: 100%; object-fit: cover; }

.user-dropdown {
  position: absolute; top: 55px; right: 0; width: 220px;
  background: var(--bg-card); backdrop-filter: blur(10px);
  border: 1px solid var(--border-color); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 10px;
  opacity: 0; visibility: hidden; transform: translateY(-10px);
  transition: all 0.2s ease; z-index: 1001;
}
.user-dropdown.show { opacity: 1; visibility: visible; transform: translateY(0); }

.dropdown-header {
  padding: 10px; border-bottom: 1px solid var(--border-color-subtle); margin-bottom: 5px;
  color: var(--text-primary); font-weight: bold; text-align: center;
}
.dropdown-item {
  display: flex; align-items: center; gap: 10px; padding: 12px 15px; color: var(--text-muted);
  text-decoration: none; border-radius: 5px; transition: all 0.2s; font-size: 0.95rem; cursor: pointer;
}
.dropdown-item:hover { background: var(--accent-subtle); color: var(--text-primary); transform: translateX(3px); }
.dropdown-item i { width: 20px; text-align: center; color: var(--accent); }
.dropdown-logout {
  color: #ff4757; border-top: 1px solid var(--divider-color-strong); margin-top: 5px; padding-top: 10px;
}
.dropdown-logout:hover { color: #ff6b81; }
.dropdown-login { cursor: pointer; }

/* Admin Panel Link */
.admin-panel-link {
  background: var(--accent) !important;
  color: white !important;
  font-weight: bold;
  margin-top: 8px;
}
.admin-panel-link:hover {
  transform: translateX(3px) !important;
  background: var(--accent-hover) !important;
}
.admin-panel-link i {
  color: white !important;
}

/* ========================================= */
/* [Library] Flatpickr Calendar Overrides    */
/* ========================================= */
.flatpickr-calendar {
  z-index: 9999 !important; background: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important; box-shadow: var(--shadow-lg) !important;
}
#date-range {
  cursor: pointer !important; background-color: var(--bg-primary) !important; color: var(--text-primary) !important; z-index: 10; position: relative;
}
.flatpickr-mobile { z-index: 9999 !important; }

/* ========================================= */
/* [Page] Profile Dashboard                  */
/* ========================================= */
.profile-dashboard {
  display: flex; flex-direction: column; gap: 30px; max-width: 950px; margin: 0 auto; animation: fadeInUp 0.6s ease-out;
}
@media (min-width: 768px) {
  .profile-dashboard { flex-direction: row; align-items: stretch; }
}

.profile-identity {
  flex: 1; background: var(--bg-card);
  border: 1px solid var(--border-color); border-radius: var(--radius-lg);
  padding: 40px 30px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.profile-identity::before {
  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 3px; background: var(--accent);
}

.avatar-wrapper { position: relative; margin-bottom: 20px; }
#profile-avatar {
  width: 120px; height: 120px; border-radius: 50%; border: 3px solid var(--border-color);
  object-fit: cover; transition: transform 0.2s ease;
}
.profile-identity:hover #profile-avatar {
  transform: scale(1.03);
}

.profile-name { margin-top: 10px; color: var(--text-primary); font-size: 1.8rem; font-weight: 700; }
.discord-badge {
  display: inline-flex; align-items: center; gap: 8px; background: rgba(88, 101, 242, 0.15);
  color: #5865F2; padding: 6px 14px; border-radius: 20px; font-size: 0.9rem; margin-top: 15px;
  border: 1px solid rgba(88, 101, 242, 0.3); transition: background 0.3s;
}
.discord-badge:hover { background: rgba(88, 101, 242, 0.25); }

.profile-settings {
  flex: 1.5; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg);
  padding: 40px; display: flex; flex-direction: column; justify-content: center;
  box-shadow: var(--shadow-sm); position: relative;
}
.settings-header {
  margin-bottom: 30px; padding-bottom: 15px; border-bottom: 1px solid var(--border-color-subtle);
}
.settings-title { font-size: 1.4rem; color: var(--text-primary); display: flex; align-items: center; gap: 10px; }
.settings-group { margin-bottom: 25px; }
.settings-label { color: var(--text-muted); font-weight: 600; display: block; margin-bottom: 10px; font-size: 0.95rem; }

.input-wrapper { position: relative; }
.custom-input {
  width: 100%; padding: 14px 15px 14px 45px; background: var(--bg-primary);
  border: 1px solid var(--border-color); color: var(--text-primary); border-radius: var(--radius-md);
  font-family: var(--font-mono); font-size: 1rem; transition: all 0.2s ease;
}
.custom-input:focus {
  border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-subtle); outline: none;
}
.custom-input:invalid:not(:placeholder-shown) {
  border-color: #ff4757; box-shadow: 0 0 0 3px rgba(255, 71, 87, 0.15);
}
.input-icon {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 1.1rem; transition: color 0.3s;
}
.custom-input:focus + .input-icon { color: var(--accent); }
.input-hint {
  color: var(--text-muted); font-size: 0.85rem; margin-top: 8px; display: flex; align-items: flex-start; gap: 6px; line-height: 1.4;
}
.input-hint i { color: var(--accent); margin-top: 3px; }

.btn-group { display: flex; flex-direction: column; gap: 15px; margin-top: 10px; }
.btn-danger-ghost {
  background: transparent; border: 1px solid var(--color-error); color: var(--color-error); transition: all 0.2s ease;
}
.btn-danger-ghost:hover {
  background: rgba(220, 38, 38, 0.1); transform: translateY(-2px);
}

/* ========================================= */
/* [Page] Leave System Dashboard             */
/* ========================================= */
.leave-dashboard {
  max-width: 1200px; margin: 0 auto; animation: fadeInUp 0.6s ease-out; display: flex; gap: 30px; align-items: flex-start;
}

.leave-card {
  flex: 1.6; background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); padding: 40px;
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}

.history-section {
  flex: 1; background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); padding: 30px; position: relative;
  max-height: 800px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--scrollbar-thumb) transparent;
}

.leave-card::before, .history-section::before {
  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 3px; background: var(--accent);
}

.notice-box {
  background: var(--accent-subtle); border-left: 3px solid var(--accent);
  padding: 15px 20px; border-radius: var(--radius-sm); margin-bottom: 30px;
  display: flex; align-items: center; gap: 12px; color: var(--text-primary); font-size: 0.95rem;
}
.notice-box i { color: var(--accent); font-size: 1.2rem; }

.form-row { display: flex; gap: 20px; margin-bottom: 25px; }
.form-group { flex: 1; display: flex; flex-direction: column; }

.form-label {
  color: var(--text-primary); font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; font-size: 0.95rem;
}
.form-label i { color: var(--text-muted); }

.leave-input {
  width: 100%; padding: 14px 15px; background: var(--bg-primary); border: 1px solid var(--border-color);
  color: var(--text-primary); border-radius: var(--radius-md); font-size: 1rem;
  font-family: inherit; transition: all 0.2s ease;
}
.leave-input:focus {
  border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-subtle); outline: none;
}
textarea.leave-input { resize: vertical; min-height: 120px; }

.history-title {
  color: var(--text-primary); font-size: 1.2rem; border-bottom: 1px solid var(--border-color);
  padding-bottom: 15px; margin-bottom: 20px; display: flex; align-items: center; gap: 10px;
  position: sticky; top: 0; background: var(--bg-card);
}

#history-list .history-item {
  background: var(--surface-tint); border: 1px solid var(--border-color);
  border-radius: 8px; padding: 15px; margin-bottom: 15px; transition: transform 0.2s, border-color 0.2s, background 0.2s;
}
#history-list .history-item:hover {
  border-color: var(--accent); transform: translateX(3px); background: var(--bg-card-hover);
}
#history-list .status-badge {
  padding: 3px 8px; border-radius: 12px; font-size: 0.8rem; font-weight: bold; display: inline-block; margin-bottom: 5px;
}
#history-list p { font-size: 0.9rem; color: var(--text-muted); margin: 3px 0; }
#history-list strong { color: var(--text-primary); }

/* ========================================= */
/* [Global] Responsive Media Queries         */
/* ========================================= */
@media (max-width: 992px) {
  #mainNav .logo { display: none; }
  footer .col { flex: 1 1 45%; margin: 0 10px 30px 10px; }
  .footer-content { justify-content: center; }
  .leave-dashboard { flex-direction: column; gap: 40px; }
  .leave-card, .history-section { width: 100%; flex: none; }
}

@media (max-width: 768px) {
  #mainNav { justify-content: center; }
  #mainNav ul li { margin: 5px 10px; }
  #mainNav ul li a { font-size: 0.9rem; }
  .nav-links { display: none; }
  .user-menu-container { margin-left: auto; }
  #typewriter { font-size: 1.9rem; }

  #hero-static-bg { display: none; }
  #hero-video-bg {
    width: 100%; height: auto; aspect-ratio: 16 / 9; position: absolute;
    top: 50%; left: 0; transform: translateY(-50%); object-fit: contain;
    filter: brightness(var(--hero-video-brightness)) contrast(1.1); z-index: 1;
  }
  #hero::after {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none;
    background: radial-gradient(ellipse 67% 20% at 50% 50%, transparent 10%, var(--hero-gradient-mid) 45%, var(--bg-primary) 80%);
  }

  .hero-content { padding-left: 20px; padding-right: 20px; width: 100%; position: relative; z-index: 5; }
  .hero-content p { font-size: 1.15rem; }
  .content-section h2.gradient-text, .page-title { font-size: 1.8rem; }
  .section-subtitle { font-size: 1.05rem; }
  .features-grid, .spec-grid { grid-template-columns: 1fr; gap: 30px; }
  #marquee-announcement { width: 95%; max-width: none; }
  footer .col { flex: 1 1 100%; margin: 0 0 30px 0; text-align: center;}
  footer .col ul li a, footer .col p { justify-content: center; }
  .leave-card { padding: 25px 20px; }
  .history-section { padding: 25px 20px; max-height: 500px; }
  .form-row { flex-direction: column; gap: 20px; }
  .form-label { font-size: 1rem; }
  .leave-input { font-size: 16px; padding: 12px; }
  .discord-id-row {
    justify-content: center;
    text-align: center;
  }
  .col li {
    display: flex;
    justify-content: center;
  }
  .copy-toast {
    left: 50%;
    right: auto;
    transform: translateX(-50%) translateY(6px);
  }
  .copy-toast.show {
    transform: translateX(-50%) translateY(0);
  }
}

@media (max-width: 480px) {
  body { line-height: 1.7; }
  #mainNav ul { flex-wrap: wrap; }
  #mainNav ul li { margin: 2px 8px; }
  #typewriter { font-size: 1.6rem; }
  .hero-buttons { flex-direction: column; gap: 20px; align-items: center; }
  .btn { width: 90%; max-width: 300px; }
  .content-section { padding: 80px 15px; }
  #backToTop { width: 45px; height: 45px; bottom: 20px; right: 20px;}
  #hero::after {
    background: radial-gradient(ellipse 80% 15% at 50% 50%, transparent 10%, var(--hero-gradient-mid-strong) 40%, var(--bg-primary) 60%);
  }
  #hero-video-bg { width: 100%; aspect-ratio: 16 / 9; height: auto; top: 50%; transform: translateY(-50%); }
  .discord-id-row {
    justify-content: center;
  }
  .col ul {
    padding-left: 0;
    list-style: none;
    text-align: center;
  }
  .col li {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
  }
  .copy-toast {
    right: auto;
    left: 50%;
    transform: translateX(-50%) translateY(6px);
  }
  .copy-toast.show {
    transform: translateX(-50%) translateY(0);
  }
}

/* ========================================= */
/* [Page] News Page                          */
/* ========================================= */

.news-page-section {
  padding: 40px 20px 100px;
  max-width: 1300px;
  margin: 0 auto;
}

.news-page-header {
  text-align: center;
  margin-bottom: 40px;
}

.news-page-header .page-title {
  margin-top: 20px;
}

.news-page-header .section-subtitle {
  margin-bottom: 0;
}

/* --- layout: sidebar + main --- */
.news-page-layout {
  display: flex;
  gap: 30px;
  align-items: flex-start;
  position: relative;
}

/* --- sidebar (tool panel) --- */
.news-sidebar {
  width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: 90px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  background: var(--accent-subtle);
  flex-shrink: 0;
}

.sidebar-header i {
  color: var(--accent);
  font-size: 1rem;
}

/* sidebar tool panel */
.sidebar-tools {
  padding: 16px;
}

/* search box */
.news-search-box {
  position: relative;
  margin-bottom: 14px;
}

.news-search-box input {
  width: 100%;
  padding: 9px 10px 9px 34px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.news-search-box input:focus {
  border-color: var(--accent);
}

.news-search-box input::placeholder {
  color: var(--text-muted);
}

.news-search-box i {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.82rem;
  pointer-events: none;
}

/* filter pills */
.news-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.filter-pill {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.filter-pill:hover {
  border-color: var(--accent);
  color: var(--accent-text);
}

.filter-pill.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.pill-count {
  font-size: 0.72rem;
  opacity: 0.7;
  margin-left: 2px;
}

.filter-pill.active .pill-count {
  opacity: 0.9;
}

/* stats */
.news-stats {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

/* --- main content area --- */
.news-main-content {
  flex: 1;
  min-width: 0;
}

/* CLS fix: reserve space before content loads */
#news-posts-container {
  min-height: 400px;
}

.news-main-content .news-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin: 0;
  max-width: none;
}

/* post cards */
.news-main-content .news-post {
  opacity: 1;
  transform: none;
}

.news-post .post-meta {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.post-updated {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-left: auto;
}

.post-updated i {
  margin-right: 3px;
  font-size: 0.72rem;
}

/* highlight animation for hash navigation */
.news-highlight {
  animation: highlightFlash 2s ease-out;
}

@keyframes highlightFlash {
  0%   { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.6); }
  20%  { box-shadow: 0 0 30px 5px rgba(37, 99, 235, 0.4); }
  100% { box-shadow: var(--shadow-md); }
}

/* empty state */
.news-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 80px 20px;
  color: var(--text-muted);
  text-align: center;
}

.news-empty-state i {
  font-size: 2.4rem;
  opacity: 0.4;
}

.news-empty-state p {
  font-size: 1rem;
  margin: 0;
}

.news-clear-filter {
  padding: 8px 20px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.88rem;
  transition: all 0.2s;
}

.news-clear-filter:hover {
  border-color: var(--accent);
  color: var(--accent-text);
}

/* loading placeholder */
.news-loading-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  padding: 60px 20px;
  color: var(--text-muted);
}

.news-loading-placeholder .spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* --- pagination --- */
.news-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 36px;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.88rem;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent-text);
}

.page-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.page-ellipsis {
  padding: 0 4px;
  color: var(--text-muted);
  font-size: 0.85rem;
  user-select: none;
}

/* --- responsive: tablet --- */
@media (max-width: 992px) {
  .news-page-layout {
    flex-direction: column;
  }

  .news-sidebar {
    width: 100%;
    position: relative;
    top: 0;
    border-radius: var(--radius-md);
  }

  .sidebar-header {
    cursor: pointer;
    user-select: none;
    justify-content: space-between;
  }

  .sidebar-header::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
  }

  .news-sidebar.expanded .sidebar-header::after {
    transform: rotate(180deg);
  }

  .sidebar-tools {
    max-height: 0;
    padding: 0 16px;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
  }

  .news-sidebar.expanded .sidebar-tools {
    max-height: 300px;
    padding: 16px;
    overflow-y: auto;
  }
}

/* --- responsive: mobile --- */
@media (max-width: 768px) {
  .news-page-section {
    padding: 20px 12px 80px;
  }

  .news-page-header .page-title {
    font-size: 1.6rem;
  }

  .news-page-header .section-subtitle {
    font-size: 1rem;
  }

  .news-main-content .news-list {
    gap: 18px;
  }

  .news-post {
    padding: 20px 16px;
  }

  .news-post .post-title {
    font-size: 1.3rem;
  }

  .post-updated {
    margin-left: 0;
    width: 100%;
  }

  .news-pagination {
    gap: 4px;
    margin-top: 28px;
  }

  .page-btn {
    min-width: 32px;
    height: 32px;
    font-size: 0.82rem;
  }
}