/* ========================================
   COMPONENT STYLES
   ======================================== */

/* ========== SIDEBAR COMPONENTS ========== */

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #262626;
    flex: 1;
    overflow-y: auto;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #262626;
    background: #0a0a0a;
    margin-top: auto;
    position: relative;
    top: -8px;
}

/* ===== Logo Section ===== */
.logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 10px 20px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.logo-section:hover {
    transform: translateX(2px);
}

/* ⭐ Company Logo with Animation */
.company-logo {
    width: 48px;
    height: 48px;
    background: #3f3f46;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e4e4e7;
    font-weight: 600;
    font-size: 14px;
    background-image: url('https://static.wixstatic.com/media/5662a2_0dd8c17d7b4240658c264855ed4f454f~mv2.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

/* ⭐ Logo 閃光動畫 */
.company-logo::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        105deg,
        transparent 40%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 60%
    );
    animation: logoShine 8s ease-in-out infinite;
    transform: rotate(25deg);
}

/* ⭐ Hover 時加速閃光 */
.logo-section:hover .company-logo::after {
    animation-duration: 0.5s;
    animation-iteration-count: 1;
}

/* ⭐ App Title (Slogan) with Animation */
.app-title {
    font-size: 14px;
    font-weight: 500;
    color: #a1a1aa;
    font-style: italic;
    position: relative;
    overflow: hidden;
    flex: 1;
    line-height: 1.4;
}

/* ⭐ Slogan 閃光動畫 */
.app-title::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 100%
    );
    animation: textShine 10s ease-in-out infinite;
}

/* ⭐ Hover 時加速閃光 */
.logo-section:hover .app-title::after {
    animation-duration: 0.8s;
    animation-iteration-count: 1;
}

/* ===== Navigation Menu ===== */
.nav-menu {
    padding: 0 20px;
}

/* ⭐ 修正按鈕文字樣式 */
.export-btn {
    width: 100%;
    padding: 10px;
    background: #18181b;
    border: 1px solid #27272a;
    border-radius: 6px;
    color: #e4e4e7;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.export-btn:hover {
    background: #27272a;
    border-color: #3f3f46;
}

.export-btn span {
    font-weight: 500;
}

.manual-btn {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid #27272a;
    border-radius: 6px;
    color: #a1a1aa;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.manual-btn:hover {
    background: #18181b;
    border-color: #3f3f46;
    color: #e4e4e7;
}

.manual-btn span {
    font-weight: 500;
}

/* ===== Privacy Settings Section ===== */
.sidebar-section {
    margin: 15px 0;
    padding: 15px 10px;
    border-top: 1px solid rgba(51, 65, 85, 0.3);
    border-bottom: 1px solid rgba(51, 65, 85, 0.3);
}

.sidebar-section label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #cbd5e1;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    padding: 8px;
    background: rgba(30, 41, 59, 0.3);
    border-radius: 6px;
    transition: background 0.2s;
}

.sidebar-section label:hover {
    background: rgba(30, 41, 59, 0.5);
}

#storageStatus {
    margin-top: 10px;
    padding: 8px;
    font-size: 11px;
    font-weight: 400;
    color: #94a3b8;
    background: rgba(15, 23, 42, 0.3);
    border-radius: 4px;
    line-height: 1.5;
}

/* ========== HEADER COMPONENTS ========== */

.chat-header {
    padding: 15px 20px;
    background: rgba(23, 23, 23, 0.95);
    border-bottom: 1px solid #27272a;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.model-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #e4e4e7;
    font-weight: 500;
    justify-content: flex-start;
}

.status-indicator {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.session-info-badge {
    padding: 6px 12px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 6px;
    font-size: 12px;
    color: #93c5fd;
    white-space: nowrap;
    justify-self: center;
}

.session-info-badge.warning {
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.3);
    color: #fbbf24;
}

.session-info-badge.danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

#sessionInfoText {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.language-selector {
    justify-self: end;
}

.language-selector select {
    padding: 6px 12px;
    background: rgba(39, 39, 42, 0.8);
    border: 1px solid #3f3f46;
    border-radius: 6px;
    color: #e4e4e7;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}

.language-selector select:hover {
    background: rgba(63, 63, 70, 0.8);
    border-color: #52525b;
}

.language-selector select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* ========== MESSAGE COMPONENTS ========== */

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    width: 100%;
    scroll-behavior: smooth;
}

.message-wrapper {
    padding: 24px 0;
    border-bottom: 1px solid #1a1a1a;
    width: 100%;
    position: relative;
    padding-right: 80px;
}

.message-wrapper.user {
    background: #18181b;
}

.message-wrapper.system {
    background: #141414;
    border-left: 3px solid #fbbf24;
}

.message-wrapper.di-personal {
    background: linear-gradient(135deg, #18181b 0%, #1a1a2e 100%);
    border-left: 3px solid #8b5cf6;
}

.message {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    gap: 16px;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.message.user .message-avatar,
.message-wrapper.user .message-avatar {
    background: #3f3f46;
    color: #e4e4e7;
}

.message.assistant .message-avatar,
.message-wrapper.assistant .message-avatar,
.message-wrapper.system .message-avatar,
.message-wrapper.di-personal .message-avatar {
    background: #18181b;
    border: 1px solid #27272a;
    color: #a1a1aa;
}

.message-content {
    flex: 1;
    color: #e4e4e7;
    line-height: 1.8;
    font-size: 15px;
    font-weight: 400;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
}

.message-content p {
    margin: 0 0 1em 0;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content h1 {
    font-size: 1.8em;
    font-weight: 600;
    margin: 1.5em 0 0.8em 0;
    color: #ffffff;
    border-bottom: 1px solid #3a3a3a;
    padding-bottom: 0.3em;
}

.message-content h2 {
    font-size: 1.5em;
    font-weight: 600;
    margin: 1.3em 0 0.7em 0;
    color: #ffffff;
}

.message-content h3 {
    font-size: 1.3em;
    font-weight: 600;
    margin: 1.2em 0 0.6em 0;
    color: #f0f0f0;
}

.message-content code {
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 4px;
    padding: 0.2em 0.4em;
    font-size: 0.9em;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Menlo, Consolas, 'Courier New', monospace;
    color: #f0f0f0;
}

.message-content pre {
    background: #1a1a1a;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    padding: 1em;
    margin: 1em 0;
    overflow-x: auto;
}

.message-content pre code {
    background: transparent;
    border: none;
    padding: 0;
    font-size: 0.9em;
    color: #e4e4e7;
}

.message-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.message-wrapper:hover .message-actions {
    opacity: 1;
}

.copy-btn {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 6px;
    padding: 4px 8px;
    color: #60a5fa;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.copy-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: #60a5fa;
    transform: scale(1.05);
}

.copy-btn.copied {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.5);
    color: #4ade80;
}

/* ========== TYPING INDICATOR ========== */

.typing-indicator {
    display: none;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 24px;
}

.typing-indicator.active {
    display: flex;
    gap: 16px;
}

.typing-dots {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #52525b;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* ========== WARNING MESSAGES ========== */

.limit-warning {
    margin: 10px auto;
    padding: 12px 16px;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid #fbbf24;
    border-radius: 8px;
    color: #fbbf24;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 800px;
    text-align: center;
}

.limit-warning.warning {
    background: rgba(251, 191, 36, 0.15);
    border: 2px solid #fbbf24;
    color: #fde047;
}

.limit-warning.danger {
    background: rgba(239, 68, 68, 0.15);
    border: 2px solid #ef4444;
    color: #fca5a5;
}

.limit-warning.critical {
    background: rgba(220, 38, 38, 0.2);
    border: 2px solid #dc2626;
    color: #fca5a5;
    font-weight: bold;
    animation: pulse 2s infinite;
}

/* ========== INPUT COMPONENTS ========== */

.input-container {
    border-top: 1px solid #262626;
    background: #0a0a0a;
    padding: 16px 0;
    width: 100%;
}

.input-wrapper {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 0 24px;
}

.input-box {
    background: #171717;
    border: 1px solid #27272a;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    width: 100%;
}

.input-box:focus-within {
    border-color: #3f3f46;
    box-shadow: 0 0 0 1px #3f3f46;
}

.input-box.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.chat-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #e4e4e7;
    font-size: 16px;
    line-height: 1.6;
    outline: none;
    resize: none;
    max-height: 200px;
    font-family: inherit;
    width: 100%;
    min-width: 0;
}

.chat-input::placeholder {
    color: #52525b;
}

.chat-input:disabled {
    cursor: not-allowed;
}

.input-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

/* ========== FILE COMPONENTS ========== */

.file-staging-area {
    display: none;
    padding: 8px;
    margin-bottom: 8px;
    background: #0a0a0a;
    border: 2px dashed #3f3f46;
    border-radius: 6px;
    width: 100%;
}

.file-staging-area.active {
    display: block;
}

.staged-file {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    margin: 4px;
    background: #18181b;
    border: 1px solid #27272a;
    border-radius: 4px;
    font-size: 13px;
    color: #a1a1aa;
}

.staged-file .remove-file {
    cursor: pointer;
    color: #ef4444;
    margin-left: 4px;
}

.staged-file .remove-file:hover {
    color: #dc2626;
}

.file-attachment {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 6px;
    margin: 8px 0;
    font-size: 14px;
    color: #60a5fa;
}

.file-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.95);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s, visibility 0.3s;
    margin-bottom: 8px;
    z-index: 10000;
    min-width: 160px;
    line-height: 1.4;
}

.file-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.95);
}

.upload-wrapper:hover .file-tooltip {
    opacity: 1;
    visibility: visible;
}

/* ========== BUTTONS ========== */

.action-btn {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: #71717a;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.action-btn:hover {
    background: #27272a;
    color: #a1a1aa;
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.send-btn {
    background: #27272a;
    color: #e4e4e7;
}

.send-btn:hover:not(:disabled) {
    background: #3f3f46;
}

.stop-btn {
    background: #dc2626;
    color: white;
    display: none;
}

.stop-btn.active {
    display: flex;
}

.stop-btn:hover:not(:disabled) {
    background: #b91c1c;
}

.sidebar-toggle {
    position: fixed;
    top: 120px;
    left: 245px;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #18181b 0%, #27272a 100%);
    border: 1px solid #3f3f46;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1002;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.sidebar-toggle:hover {
    background: linear-gradient(135deg, #27272a 0%, #3f3f46 100%);
    transform: scale(1.15);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

.sidebar-toggle svg {
    color: #e4e4e7;
    transition: transform 0.3s ease;
}

.sidebar.collapsed ~ .main-content .sidebar-toggle {
    left: 15px;
}

.chevron-right {
    display: none;
}

.sidebar.collapsed ~ .main-content .sidebar-toggle .chevron-left {
    display: none;
}

.sidebar.collapsed ~ .main-content .sidebar-toggle .chevron-right {
    display: block;
}

.scroll-to-top {
    position: fixed;
    bottom: 90px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: rgba(59, 130, 246, 0.9);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-to-top:hover {
    background: rgba(37, 99, 235, 1);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

/* ========== TRAINING STATUS ========== */

.training-status {
    position: fixed;
    top: 50%;
    left: calc(50vw + 130px);
    transform: translate(-50%, -50%);
    width: 280px;
    padding: 40px 30px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border: 2px solid #3b82f6;
    border-radius: 20px;
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease, left 0.3s ease;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(59, 130, 246, 0.4);
}

.training-status.active {
    display: block;
    opacity: 1;
    animation: fadeInScale 0.5s ease forwards;
}

.training-status.active::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 20px;
    background: transparent;
    border: 2px solid transparent;
    animation: breathingGlow 3s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

.training-status.fading-out {
    animation: fadeOutShrink 1s ease-out forwards;
}

.sidebar.collapsed ~ .main-content ~ .training-status {
    left: 50vw !important;
}

.training-logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

.training-logo {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    background-image: url('https://static.wixstatic.com/media/5662a2_0dd8c17d7b4240658c264855ed4f454f~mv2.jpg');
    background-size: cover;
    background-position: center;
    position: relative;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
    animation: breathingScale 3s ease-in-out infinite;
}

.training-percentage-large {
    text-align: center;
    font-size: 48px;
    font-weight: 700;
    color: #60a5fa;
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(96, 165, 250, 0.5);
    animation: percentagePulse 2s ease-in-out infinite;
}

/* ========== LANGUAGE SPLASH ========== */

.language-splash {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(14, 14, 14, 0.98);
    backdrop-filter: blur(20px);
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.language-splash.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.language-splash.exiting .language-splash-content {
    animation: shrinkExit 0.6s ease-out forwards;
}

.language-splash-content {
    text-align: center;
    animation: fadeInScale 0.6s ease-out;
}

.language-splash-branding {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 50px;
}

.brand-title {
    font-size: 36px;
    font-weight: 700;
    color: #e4e4e7;
    letter-spacing: 1.5px;
    position: relative;
    overflow: hidden;
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.1);
}

.brand-title::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    animation: brandShine 8s ease-in-out infinite;
}

.brand-logo {
    width: 80px;
    height: 80px;
    background: #3f3f46;
    border-radius: 12px;
    background-image: url('https://static.wixstatic.com/media/5662a2_0dd8c17d7b4240658c264855ed4f454f~mv2.jpg');
    background-size: cover;
    background-position: center;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.brand-logo::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        105deg,
        transparent 40%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 60%
    );
    animation: brandShine 8s ease-in-out infinite;
    transform: rotate(25deg);
}

.brand-slogan {
    font-size: 16px;
    font-weight: 500;
    color: #a1a1aa;
    font-style: italic;
    position: relative;
    overflow: hidden;
}

.brand-slogan::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 100%
    );
    animation: brandShine 8s ease-in-out infinite;
}

.language-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

.language-option {
    padding: 24px 32px;
    background: rgba(39, 39, 42, 0.5);
    border: 2px solid #3f3f46;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.language-option::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #3b82f6, #8b5cf6, #3b82f6);
    border-radius: 12px;
    opacity: 0;
    z-index: -1;
    background-size: 200% 200%;
    animation: breathingBorder 3s ease-in-out infinite;
    transition: opacity 0.3s ease;
}

.language-option:hover::before {
    opacity: 1;
}

.language-option:hover {
    background: rgba(63, 63, 70, 0.8);
    border-color: #3b82f6;
    transform: scale(1.05);
}

.language-option-name {
    font-size: 20px;
    color: #e4e4e7;
    font-weight: 500;
    margin-bottom: 8px;
    transition: color 0.3s ease;
}

.language-option:hover .language-option-name {
    color: #ffffff;
}

.language-option-native {
    font-size: 14px;
    color: #a1a1aa;
    transition: color 0.3s ease;
}

.language-option:hover .language-option-native {
    color: #cbd5e1;
}

/* ========== ACCESS DENIED ========== */

.access-denied-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #0e0e0e;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.access-denied-content {
    text-align: center;
    padding: 40px;
    max-width: 500px;
}

.access-denied-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid #ef4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ef4444;
}

.access-denied-title {
    font-size: 28px;
    color: #ef4444;
    margin-bottom: 16px;
}

.access-denied-message {
    color: #a1a1aa;
    font-size: 16px;
    margin-bottom: 32px;
    line-height: 1.6;
}

.access-denied-btn {
    padding: 12px 24px;
    background: #3b82f6;
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s;
}

.access-denied-btn:hover {
    background: #2563eb;
}

/* ========================================
   ANIMATIONS (關鍵！)
   ======================================== */

/* 訓練框顯示動畫 - 必須包含 translate(-50%, -50%) */
@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
        filter: blur(5px);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
        filter: blur(0);
    }
}

/* 訓練框消失動畫 - 必須包含 translate(-50%, -50%) */
@keyframes fadeOutShrink {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
        filter: blur(0);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
        filter: blur(5px);
    }
}

/* 光暈呼吸動畫 */
@keyframes breathingGlow {
    0%, 100% {
        border-color: rgba(59, 130, 246, 0.8);
        box-shadow: 
            0 0 20px rgba(59, 130, 246, 0.3),
            0 0 40px rgba(59, 130, 246, 0.2),
            0 0 60px rgba(59, 130, 246, 0.1);
    }
    50% {
        border-color: rgba(96, 165, 250, 1);
        box-shadow: 
            0 0 30px rgba(96, 165, 250, 0.6),
            0 0 60px rgba(96, 165, 250, 0.4),
            0 0 90px rgba(96, 165, 250, 0.2);
    }
}

/* Logo 呼吸縮放動畫 */
@keyframes breathingScale {
    0%, 100% { 
        transform: scale(1); 
    }
    50% { 
        transform: scale(1.08); 
    }
}

/* 百分比脈動動畫 */
@keyframes percentagePulse {
    0%, 100% {
        color: #60a5fa;
        text-shadow: 0 0 20px rgba(96, 165, 250, 0.5);
    }
    50% {
        color: #93c5fd;
        text-shadow: 0 0 30px rgba(147, 197, 253, 0.8);
    }
}

/* Logo 閃光動畫 */
@keyframes logoShine {
    0%, 100% {
        left: -50%;
        transform: rotate(25deg);
    }
    15% {
        left: 150%;
        transform: rotate(25deg);
    }
}

/* 文字閃光動畫 */
@keyframes textShine {
    0%, 100% {
        left: -100%;
    }
    15% {
        left: 100%;
    }
}

/* 品牌閃光動畫 */
@keyframes brandShine {
    0%, 100% {
        left: -100%;
        transform: translateX(0) rotate(25deg);
    }
    15% {
        left: 100%;
        transform: translateX(0) rotate(25deg);
    }
}

/* 呼吸邊框動畫 */
@keyframes breathingBorder {
    0%, 100% {
        opacity: 0.6;
        filter: blur(8px);
    }
    50% {
        opacity: 1;
        filter: blur(12px);
    }
}

/* 縮小退出動畫 */
@keyframes shrinkExit {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.8);
    }
}

/* 脈衝動畫 */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

/* 打字動畫 */
@keyframes typing {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}
