* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #00c300 0%, #00b300 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    width: 100%;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #00c300, #00b300, #00a300);
}

.logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #00c300, #00b300);
    border-radius: 50%;
    margin: 0 auto 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 195, 0, 0.3);
}

.logo svg {
    width: 40px;
    height: 40px;
    fill: white;
}

.title {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin-bottom: 15px;
    letter-spacing: -0.5px;
}

.subtitle {
    color: #666;
    font-size: 16px;
    margin-bottom: 30px;
    line-height: 1.5;
}

#msg {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    min-height: 120px;
    border: 1px solid #e9ecef;
    text-align: left;
    font-size: 14px;
    line-height: 1.6;
    color: #495057;
    position: relative;
    overflow-y: auto;
    max-height: 200px;
}

#msg:empty::before {
    content: "正在初始化 LINE 登入...";
    color: #6c757d;
    font-style: italic;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #00c300;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    background: #28a745;
    border-radius: 50%;
    margin-right: 8px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

.footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    font-size: 12px;
    color: #6c757d;
}

.hidden-form {
    display: none;
}

/* 響應式設計 */
@media (max-width: 480px) {
    .container {
        padding: 30px 20px;
        margin: 10px;
    }

    .title {
        font-size: 24px;
    }

    .subtitle {
        font-size: 14px;
    }

    #msg {
        padding: 15px;
        min-height: 100px;
    }
}

/* 深色模式支援 */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    }

    .container {
        background: #2d2d2d;
        color: #fff;
    }

    .title {
        color: #fff;
    }

    .subtitle {
        color: #ccc;
    }

    #msg {
        background: #3d3d3d;
        border-color: #555;
        color: #fff;
    }

    .footer {
        border-color: #555;
        color: #ccc;
    }
}

/* 動畫效果 */
.fade-in {
    animation: fadeIn 0.6s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
