/* 重置樣式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
    background: #FFFFFF;
    color: #1A1A1A;
    line-height: 1.6;
}

/* 主頁面背景 */
#mainPage {
    background: 
        radial-gradient(ellipse 1100px 750px at 65% 25%, rgba(30, 120, 200, 0.5) 0%, rgba(30, 90, 160, 0.25) 40%, transparent 70%),
        radial-gradient(ellipse 850px 650px at 25% 75%, rgba(139, 92, 46, 0.2) 0%, transparent 60%),
        radial-gradient(ellipse 950px 850px at 50% 50%, rgba(10, 40, 80, 0.35) 0%, transparent 70%),
        linear-gradient(180deg, #000000 0%, #0a0e1a 30%, #0d1520 60%, #000000 100%);
    min-height: 100vh;
    position: relative;
}

/* 主頁面的撲克牌裝飾 - 模擬圖片風格 */
#mainPage::before,
#mainPage::after {
    content: '';
    position: fixed;
    border-radius: 12px;
    pointer-events: none;
    z-index: 0;
    transition: opacity 0.5s ease;
    
    background: 
        linear-gradient(135deg, rgba(18, 18, 32, 0.98) 0%, rgba(28, 28, 42, 0.95) 50%, rgba(22, 22, 38, 0.98) 100%),
        repeating-conic-gradient(from 0deg at 50% 50%, 
            rgba(255, 180, 50, 0.18) 0deg, 
            rgba(200, 140, 30, 0.12) 22.5deg, 
            rgba(255, 180, 50, 0.18) 45deg,
            rgba(200, 140, 30, 0.12) 67.5deg
        ),
        repeating-radial-gradient(circle at 50% 50%, 
            transparent 0px, 
            transparent 10px, 
            rgba(255, 180, 50, 0.05) 10px, 
            rgba(255, 180, 50, 0.05) 11px
        );
    border: 3px solid rgba(255, 180, 50, 0.6);
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.75),
        inset 0 0 40px rgba(255, 180, 50, 0.12),
        inset 0 2px 6px rgba(255, 255, 255, 0.08),
        0 0 30px rgba(255, 180, 50, 0.35),
        0 0 60px rgba(30, 120, 200, 0.2);
}

#mainPage::before {
    width: 150px;
    height: 210px;
    top: 15%;
    right: 5%;
    transform: rotate(-20deg);
    animation: floatSlow 10s ease-in-out infinite;
}

#mainPage::after {
    width: 140px;
    height: 195px;
    bottom: 20%;
    left: 3%;
    transform: rotate(25deg);
    animation: floatSlow 12s ease-in-out infinite reverse;
}

#mainPage:hover::before,
#mainPage:hover::after {
    opacity: 0.8;
}

@keyframes floatSlow {
    0%, 100% {
        transform: translateY(0) rotate(var(--rotation, 0deg));
        opacity: 0.6;
    }
    50% {
        transform: translateY(-15px) rotate(calc(var(--rotation, 0deg) + 3deg));
        opacity: 0.8;
    }
}

/* 頁面切換 */
.page {
    display: none !important;
}

.page.active {
    display: flex !important;
}

#loginPage {
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

#mainPage.active {
    display: block !important;
}

/* 按鈕基礎樣式 */
button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.2s ease;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: #000000;
    color: #FFFFFF;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    width: 100%;
}

.btn-primary:hover:not(:disabled) {
    background: #333333;
}

.btn-secondary {
    background: rgba(218, 165, 32, 0.1);
    color: #DAA520;
    padding: 8px 16px;
    border-radius: 4px;
    border: 1px solid rgba(218, 165, 32, 0.3);
    font-size: 14px;
}

.btn-secondary:hover {
    background: rgba(218, 165, 32, 0.2);
    border-color: rgba(218, 165, 32, 0.5);
}

/* 輸入框 */
input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #E0E0E0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: #1A1A1A;
}

/* 訊息提示 */
.message {
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
    margin: 10px 0;
    display: none;
}

.message.show {
    display: block;
}

.message.error {
    background: #FFE6E6;
    color: #C00000;
    border: 1px solid #FFB3B3;
}

.message.success {
    background: #E6F7E6;
    color: #006600;
    border: 1px solid #B3E6B3;
}

.message.info {
    background: #E6F2FF;
    color: #0066CC;
    border: 1px solid #B3D9FF;
}

/* Header */
.header {
    background: rgba(10, 22, 40, 0.95);
    border-bottom: 1px solid rgba(218, 165, 32, 0.3);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 100;
}

.header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #DAA520;
    text-shadow: 0 2px 10px rgba(218, 165, 32, 0.5);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info,
.expiry-info {
    font-size: 14px;
    color: #B8B8B8;
}

/* 主內容區 */
.main-content {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 20px;
    padding: 20px;
    max-width: 1600px;
    margin: 0 auto;
    min-height: calc(100vh - 70px);
}

/* 面板通用樣式 */
.left-panel,
.right-panel {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(218, 165, 32, 0.2);
    border-radius: 12px;
    padding: 20px;
    height: fit-content;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(218, 165, 32, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 10;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.left-panel:hover,
.right-panel:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 15px 50px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(218, 165, 32, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.panel-section {
    margin-bottom: 24px;
}

.panel-section:last-child {
    margin-bottom: 0;
}

.panel-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #E0E0E0;
}

/* 響應式設計 */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 350px 1fr;
    }
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
    }
}
