@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&family=Noto+Sans+TC:wght@300;400;500;700;900&display=swap');

:root {
    /* Color Palette - Premium Slate & Gold/Cyan Theme */
    --bg-main: #020617;
    --bg-surface: #0f172a;
    --bg-card: rgba(15, 23, 42, 0.7);

    --primary: #38bdf8;
    /* Sky Blue - Truth/Clarity */
    --primary-glow: rgba(56, 189, 248, 0.4);
    --secondary: #fbbf24;
    /* Amber - High Alert/Value */
    --accent: #818cf8;
    /* Indigo - Institutional/Serious */

    --text-primary: #ffffff;
    --text-secondary: #ffffff;
    --text-muted: #ffffff;

    --error: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;

    /* System Defaults */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-glow: 0 0 20px var(--primary-glow);

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Inter', 'Noto Sans TC', sans-serif;
    font-size: 1.1rem;
    line-height: 1.6;
    overflow-x: hidden;
    background-image:
        radial-gradient(circle at 0% 0%, rgba(56, 189, 248, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(129, 140, 248, 0.05) 0%, transparent 50%);
    background-attachment: fixed;
}

h1,
h2,
h3,
h4,
.font-outfit {
    font-family: 'Outfit', 'Noto Sans TC', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

a {
    transition: var(--transition);
}

/* Glassmorphism Classes */
.glass {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: var(--shadow-lg);
}

.glass-accent {
    border: 1px solid rgba(56, 189, 248, 0.2);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 2rem auto 0;
    padding: 2rem;
    padding-top: 5.5rem;
    /* Reduced from 7rem to shorten distance from header */
}

.hero {
    padding: 1.5rem 0;
    text-align: center;
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 0.25rem;
}

/* Navigation - Modern Floating Style */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    position: sticky;
    top: calc(2.5rem + 0.5rem);
    margin: 0 1rem;
    z-index: 1000;
    border-radius: var(--radius-lg);
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-lg);
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
    border-radius: var(--radius-full);
}

/* Hamburger button - hidden on desktop */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.nav-hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

/* X 動畫 */
nav.nav-open .nav-hamburger span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

nav.nav-open .nav-hamburger span:nth-child(2) {
    opacity: 0;
}

nav.nav-open .nav-hamburger span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* BUTTONS - Unified Specification */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #000;
    box-shadow: 0 4px 14px 0 var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 var(--primary-glow);
    filter: brightness(1.1);
}

.btn-secondary {
    background: rgba(56, 189, 248, 0.1);
    color: var(--primary);
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.btn-secondary:hover {
    background: rgba(56, 189, 248, 0.2);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(56, 189, 248, 0.05);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: var(--error);
    color: white;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
}

.btn-full {
    width: 100%;
}

/* FORMS */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
textarea,
select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
    background: rgba(15, 23, 42, 0.8);
}

/* Premium Select Styling */
select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2338bdf8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 1rem center !important;
    background-size: 1.2rem !important;
    padding-right: 3rem !important;
    cursor: pointer;
}

select option {
    background-color: #0f172a;
    color: #ffffff;
    padding: 12px;
}

.title-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.title-main {
    font-size: 1.8rem;
    line-height: 1.2;
}

.title-sub {
    font-size: 1.1rem;
    opacity: 0.8;
    font-weight: 500;
}

/* 防止瀏覽器自動填入時將背景變為白色 */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #0f172a inset !important;
    -webkit-text-fill-color: #ffffff !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Cards */
.card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: var(--shadow-lg);
    margin-bottom: 1.5rem;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, #ffffff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--primary);
    /* Fallback */
    display: inline-block;
}

.hero-subtitle {
    font-size: 1.25rem !important;
    font-weight: 500;
    opacity: 0.9;
    margin-top: 0;
    font-family: 'Outfit', 'Noto Sans TC', sans-serif;
    background: linear-gradient(135deg, var(--primary) 0%, #ffffff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--primary);
    display: inline-block;
}

.section-title-gradient {
    font-family: 'Outfit', 'Noto Sans TC', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, #ffffff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--primary);
    margin: 0;
    display: inline-block;
}

/* Dashboard / Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

tr:hover td {
    background: rgba(56, 189, 248, 0.02);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-up {
    animation: fadeInUp 0.6s ease forwards;
}

/* Status Banners */
.status-banner {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid transparent;
    backdrop-filter: blur(8px);
}

.status-active {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.status-expired {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.pulse {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    position: relative;
}

.pulse-green {
    background: var(--success);
}

.pulse-red {
    background: var(--error);
}

.pulse::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    top: 0;
    left: 0;
    animation: pulse-ring 2s infinite;
}

.pulse-green::after {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
}

.pulse-red::after {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 0.8;
    }

    70% {
        transform: scale(2.5);
        opacity: 0;
    }

    100% {
        transform: scale(0.8);
        opacity: 0;
    }
}

/* Announcement Cards */
.announcement-item {
    margin-bottom: 1.25rem;
    cursor: pointer;
}

.announcement-link {
    display: block;
    color: inherit;
    text-decoration: none;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.announcement-link:hover {
    background: rgba(56, 189, 248, 0.05);
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.announcement-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-family: 'Outfit', sans-serif;
}

.announcement-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.announcement-content,
.announcement-excerpt {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    line-clamp: 5;
    /* Standard property for better compatibility */
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    /* Better for CJk and long words */
    white-space: pre-wrap;
    text-overflow: ellipsis;
    max-height: 7.8em;
    /* 1.6 * 5 lines */
}

/* Announcement Card Preview (Homepage) */
.announcement-card-preview {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

/* Announcement Card for List/Admin */
.announcement-card {
    padding: 2rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.announcement-card:hover {
    background: rgba(56, 189, 248, 0.05);
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.announcement-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.announcement-tag {
    display: inline-block;
    background: rgba(56, 189, 248, 0.1);
    color: var(--primary);
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

/* Info Cards for announcements page */
.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.info-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    padding: 1.75rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: var(--transition);
}

.info-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
}

.info-card h3 {
    color: var(--primary);
    font-size: 1rem;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Specific Page Styling - Auth */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.auth-card {
    width: 100%;
    max-width: 480px;
    padding: 3rem;
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    color: var(--secondary);
}

/* Particles */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: var(--primary);
    opacity: 0.1;
    animation: float 8s infinite ease-in-out;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-30px) rotate(180deg);
    }
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    display: none;
    border: 1px solid transparent;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

/* Dividers */
.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

/* Password Toggle Support */
.password-field {
    position: relative;
}

.password-field input {
    padding-right: 3rem;
}

.toggle-password {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-password:hover {
    color: var(--primary);
}

.toggle-password .icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.toggle-password.is-visible .icon-eye {
    display: none;
}

.toggle-password:not(.is-visible) .icon-eye-off {
    display: none;
}

/* Terms Box for Register */
.terms-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    max-height: 250px;
    overflow-y: auto;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.terms-box h4 {
    color: var(--primary);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.terms-box h4:first-child {
    margin-top: 0;
}

.agree-row {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(56, 189, 248, 0.05);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: var(--radius-md);
    cursor: pointer;
    margin-bottom: 1.5rem;
}

.agree-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--primary);
}

.agree-label {
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Dashboard / Management Components */
.no-team-card {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.05), rgba(129, 140, 248, 0.05));
}

.no-team-icon {
    width: 6rem;
    height: 6rem;
    border-radius: 50%;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    color: var(--primary);
}

.no-team-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.no-team-desc {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 2.5rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.invite-section {
    background: rgba(56, 189, 248, 0.03);
    border: 1px solid rgba(56, 189, 248, 0.1);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.invite-section h3 {
    font-size: 1rem;
    color: var(--primary);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.team-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.team-header-info h2 {
    font-size: 2.8rem;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.team-header-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Admin Specific */
.toggle-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.toggle-btn:hover {
    background: rgba(56, 189, 248, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

.toggle-btn.active svg {
    transform: rotate(180deg);
}

.member-expand-row {
    background: rgba(0, 0, 0, 0.2) !important;
}

.expand-container {
    padding: 1.5rem;
    border-left: 2px solid var(--primary);
    margin: 1rem 0;
}

.quick-add {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* File Management Components */
.upload-dropzone {
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 3rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.02);
}

.upload-dropzone:hover {
    border-color: var(--primary);
    background: rgba(56, 189, 248, 0.05);
}

.upload-dropzone.dragover {
    border-color: var(--secondary);
    background: rgba(251, 191, 36, 0.05);
}

.upload-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.upload-dropzone.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    border-color: rgba(255, 255, 255, 0.05);
}

.pending-list {
    margin-top: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.pending-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

.pending-file-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.pending-file-name {
    font-size: 0.95rem;
    font-weight: 500;
}

.pending-file-size {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.pending-remove-btn {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.pending-remove-btn:hover {
    background: var(--error);
    color: white;
}

/* Page Specific Helper */
.no-team-hint {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 500;
}

/* Profile / Personal Center Components */
.profile-card {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.08), rgba(129, 140, 248, 0.08));
    border-radius: var(--radius-lg);
    border: 1px solid rgba(56, 189, 248, 0.2);
    margin-bottom: 2.5rem;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    color: white;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}

.profile-info h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.profile-info p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.section-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: block;
    opacity: 0.8;
}

.team-status-no-team {
    text-align: center;
    padding: 3rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

/* Informational / Rules Box */
.rules-box {
    background: rgba(56, 189, 248, 0.05);
    border: 1px solid rgba(56, 189, 248, 0.15);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.rules-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rules-box li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.rules-box li:last-child {
    margin-bottom: 0;
}

.rules-box .icon-check {
    color: var(--secondary);
    flex-shrink: 0;
    margin-top: 0.2rem;
}

/* Success / Status Animations */
@keyframes checkBounce {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    60% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-indicator {
    text-align: center;
    padding: 2rem 0;
    animation: checkBounce 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.success-indicator svg {
    color: var(--secondary);
    filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.4));
}

.success-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    margin: 1rem 0 0.5rem;
}

/* Reveal Effect for Landing */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: var(--transition-slow);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    background: var(--bg-surface);
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-lg);
    text-align: center;
    animation: modalSlide 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlide {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.modal-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
}

.modal-btn {
    flex: 1;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.modal-btn-cancel {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
}

.modal-btn-confirm {
    background: var(--error);
    color: white;
}

.modal-btn-confirm:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

.modal-btn-primary {
    background: var(--primary);
    color: #000;
    font-weight: 600;
}

.modal-btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

/* Admin Team List Expansion */
.team-row {
    cursor: pointer;
    transition: var(--transition);
}

.team-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.toggle-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.toggle-btn:hover {
    color: var(--primary);
    background: rgba(56, 189, 248, 0.1);
}

.toggle-btn.active {
    transform: rotate(180deg);
    background: var(--primary);
    color: white;
}

.member-expand-row {
    display: none;
    background: rgba(0, 0, 0, 0.2);
}

.member-expand-row.active {
    display: table-row;
}

.expand-container {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    animation: slideInDown 0.3s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Scroll-to-top Button ===== */
#scroll-top {
    position: fixed;
    bottom: 6.5rem;
    right: calc(2rem + 4px);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #000;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(56, 189, 248, 0.4);
    z-index: 999;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    pointer-events: none;
}

#scroll-top svg {
    width: 22px;
    height: 22px;
    fill: #000;
}

#scroll-top.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#scroll-top:hover {
    box-shadow: 0 6px 28px rgba(56, 189, 248, 0.6);
    transform: translateY(-4px);
}

/* ===== Login Page Brand Title ===== */
.brand-title {
    font-size: 3.5rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    display: block;
    width: fit-content;
    margin: 0 auto 0.4rem;
    text-align: center;
    line-height: 1.1;
    filter: drop-shadow(0 4px 12px rgba(56, 189, 248, 0.4));
}

.brand-sub {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 2rem;
    letter-spacing: 0.05em;
}

/* ===== Post-login Pages: Larger Text ===== */
.container p,
.container li,
.container td,
.container .announcement-content,
.container .announcement-excerpt {
    font-size: 1.05rem;
}

.container h2 {
    font-size: 2rem;
}

.container .card p,
.container .card li {
    font-size: 1.05rem;
    line-height: 1.75;
}

/* ===== LINE Float Button ===== */
.line-float-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #06C755;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(6, 199, 85, 0.45);
    z-index: 998;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
}

.line-float-btn:hover {
    transform: translateY(-4px) scale(1.08);
    box-shadow: 0 10px 30px rgba(6, 199, 85, 0.6);
}

.line-float-btn svg {
    width: 30px;
    height: 30px;
}

@media (max-width: 768px) {
    .line-float-btn {
        bottom: 1rem;
        right: 1rem;
        width: 44px;
        height: 44px;
        box-shadow: 0 4px 14px rgba(6, 199, 85, 0.4);
    }

    .line-float-btn svg {
        width: 22px;
        height: 22px;
    }

    #scroll-top {
        bottom: 4.5rem !important;
        right: 1.1rem !important;
        width: 40px !important;
        height: 40px !important;
    }

    #scroll-top svg {
        width: 18px !important;
        height: 18px !important;
    }
}

/* ===== Download Secret Link (Hero) ===== */
.download-secret-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--secondary);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    padding: 0.5rem 1.2rem;
    border: 1px solid rgba(251, 191, 36, 0.35);
    border-radius: var(--radius-full);
    background: rgba(251, 191, 36, 0.07);
    transition: var(--transition);
}

.download-secret-link:hover {
    background: rgba(251, 191, 36, 0.18);
    border-color: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(251, 191, 36, 0.25);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
        padding-top: 5rem;
    }

    nav {
        padding: 0.875rem 1rem;
        flex-wrap: wrap;
        top: 0;
        margin: 0;
        border-radius: 0;
        gap: 0;
    }

    .nav-hamburger {
        display: flex;
    }

    /* nav-links 預設隱藏，開啟後展開 */
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 0;
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    nav.nav-open .nav-links {
        display: flex;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: block;
        padding: 0.75rem 0.5rem;
        font-size: 0.95rem;
        border-radius: 8px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .nav-links a:hover,
    .nav-links a.active {
        background: rgba(56, 189, 248, 0.08);
        padding-left: 0.75rem;
    }

    .nav-links a.active::after {
        display: none;
    }

    .auth-card {
        padding: 2rem;
    }

    /* Profile card: 手機版改直排 */
    .profile-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1.25rem;
        margin-bottom: 1.5rem;
    }

    .profile-card>div[style] {
        margin-left: 0 !important;
        width: 100%;
    }

    .profile-card>div[style] .btn {
        width: 100%;
        justify-content: center;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        table-layout: auto;
        width: 100%;
    }

    th,
    td {
        word-break: normal;
        overflow-wrap: break-word;
        white-space: normal;
    }

    .quick-add {
        flex-wrap: wrap;
    }

    .quick-add>* {
        width: 100%;
    }

    .team-header-row {
        align-items: flex-start;
    }

    #admin-team-filter {
        align-items: stretch !important;
        gap: 0.75rem !important;
    }

    #admin-team-filter>div {
        width: 100% !important;
        min-width: 0 !important;
        flex: 1 1 100% !important;
    }

    #admin-team-filter input,
    #admin-team-filter select {
        width: 100% !important;
        min-width: 0 !important;
    }
}

/* --- 調整首頁按鈕群組的間距 --- */
/* --- 調整首頁按鈕群組的間距並置中 --- */
.cta-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    /* <-- 加入這一行，按鈕就會水平置中 */
    gap: 1.5rem;
    margin-top: 2rem;
    align-items: center;
    width: 100%;
    /* 確保容器撐滿寬度，置中才會準確 */
}

/* ── 跑馬燈公告條 ─────────────────────────────────────────────── */
@keyframes tickerDot {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.2;
    }
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-100%);
    }
}

#top-announcement-bar {
    background: var(--bg-card);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0 1.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    gap: 0;
    font-size: 0.875rem;
    overflow: hidden;
    position: sticky;
    top: 0;
    z-index: 1001;
    cursor: pointer;
}

.ticker-badge {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
    min-width: 100px;
    padding-right: 1rem;
}

.ticker-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
    animation: tickerDot 1.2s ease-in-out infinite;
}

.ticker-label {
    color: var(--primary);
    font-weight: 600;
    white-space: nowrap;
    font-size: 0.8rem;
    letter-spacing: 0.03em;
}

.ticker-divider {
    width: 1px;
    height: 1.2rem;
    background: rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
    margin-right: 1rem;
}

.ticker-scroll {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.ticker-track {
    display: inline-block;
    white-space: nowrap;
    color: var(--text-primary);
    padding-left: 100%;
    animation: marquee 60s linear infinite;
}

#top-ann-link {
    color: var(--primary);
    text-decoration: none;
    flex-shrink: 0;
    white-space: nowrap;
    transition: opacity 0.2s;
    margin-left: 1rem;
    font-size: 0.8rem;
}

#top-ann-link:hover {
    opacity: 0.75;
}

@media (max-width: 767px) {
    #top-announcement-bar {
        display: none !important;
    }
}