/* 全局樣式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 導航欄 */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-logo i {
    margin-right: 10px;
    font-size: 2rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    align-items: center;
}

.nav-item {
    margin-left: 2rem;
    position: relative;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #ffd700;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 5px;
    min-width: 150px;
    display: none;
    z-index: 1001;
}

.nav-item:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    color: #333;
    padding: 10px 15px;
    display: block;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.dropdown-menu a:hover {
    background-color: #f5f5f5;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 3px 0;
    transition: 0.3s;
}

/* 主頁英雄區域 */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 120px 0 80px;
    display: flex;
    align-items: center;
    min-height: 100vh;
}

.hero-content {
    flex: 1;
    max-width: 600px;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    animation: fadeInUp 1s ease 0.2s both;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image i {
    font-size: 15rem;
    opacity: 0.3;
    animation: float 3s ease-in-out infinite;
}

/* 按鈕樣式 */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #333;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* 區段樣式 */
.section {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #333;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

/* 比賽資訊 */
.competitions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.competition-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-left: 5px solid #667eea;
}

.competition-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.competition-card h3 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.competition-info {
    margin-bottom: 1rem;
}

.competition-info span {
    font-weight: 600;
    color: #666;
}

.competition-status {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.status-upcoming {
    background: #e3f2fd;
    color: #1976d2;
}

.status-ongoing {
    background: #e8f5e8;
    color: #388e3c;
}

.status-completed {
    background: #f3e5f5;
    color: #7b1fa2;
}

/* 計分系統 */
.scores-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    margin-top: 2rem;
}

.scores-table {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.scores-table h3 {
    color: #667eea;
    margin-bottom: 1.5rem;
    text-align: center;
}

.table-hint {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    padding: 8px;
    background: #e3f2fd;
    border-radius: 5px;
    border-left: 3px solid #1976d2;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

tr:hover {
    background: #f8f9fa;
    transition: background-color 0.3s ease;
}

.score-stats {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.score-stats h3 {
    color: #667eea;
    margin-bottom: 1.5rem;
    text-align: center;
}

.stats-grid {
    display: grid;
    gap: 1.5rem;
}

.stat-card {
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-card i {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.stat-card h4 {
    color: #333;
    margin-bottom: 0.5rem;
}

.stat-card p {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
}

/* 關於我們 */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text h3 {
    color: #667eea;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.about-text p {
    margin-bottom: 1rem;
    line-height: 1.8;
    color: #666;
}

.about-features {
    display: grid;
    gap: 2rem;
}

.feature {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.feature:hover {
    transform: translateY(-5px);
}

.feature i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.feature h4 {
    color: #333;
    margin-bottom: 1rem;
}

.feature p {
    color: #666;
}

/* 模態框 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

.modal h2 {
    color: #667eea;
    margin-bottom: 1.5rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: #666;
}

.form-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* 練習記錄模態框 */
.practice-history-modal {
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
}

.practice-records {
    margin-bottom: 2rem;
}

.practice-record-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid #667eea;
}

.record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.record-header h4 {
    color: #667eea;
    margin: 0;
}

.record-date {
    color: #666;
    font-size: 0.9rem;
}

.record-score {
    margin-bottom: 1rem;
}

.record-score .score {
    font-size: 2rem;
    font-weight: bold;
    color: #28a745;
}

.record-score .max-score {
    font-size: 1.2rem;
    color: #666;
}

.record-notes {
    color: #555;
    line-height: 1.6;
}

.practice-stats {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    border: 2px solid #e9ecef;
}

.practice-stats h3 {
    color: #667eea;
    margin-bottom: 1rem;
    text-align: center;
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.stat-label {
    display: block;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
}

/* 管理員面板 */
.admin-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 20px rgba(0,0,0,0.1);
    z-index: 1500;
    overflow-y: auto;
    animation: slideInRight 0.3s ease;
}

.admin-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h3 {
    margin: 0;
}

.admin-content {
    padding: 2rem;
}

.admin-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #eee;
}

.admin-section:last-child {
    border-bottom: none;
}

.admin-section h4 {
    color: #667eea;
    margin-bottom: 1rem;
}

.admin-section h5 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.user-list {
    max-height: 300px;
    overflow-y: auto;
}

.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    margin-bottom: 10px;
}

/* 練習記錄摘要 */
.practice-records-summary {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.summary-stat {
    text-align: center;
    padding: 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.8rem;
    color: #666;
}

/* 任務管理相關樣式 */
.task-summary {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.task-summary h5 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1rem;
}

/* 任務管理模態框 */
.task-management-modal {
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
}

.task-management-actions {
    margin-bottom: 2rem;
    text-align: center;
}

.tasks-list {
    display: grid;
    gap: 1rem;
}

.task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.task-info h4 {
    color: #667eea;
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.task-info p {
    color: #666;
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
}

.task-max-score {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.task-actions {
    display: flex;
    gap: 0.5rem;
}

/* 任務得分詳情模態框 */
.task-score-modal {
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
}

.task-score-summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    text-align: center;
}

.total-score-display {
    margin-bottom: 1rem;
}

.total-score {
    font-size: 3rem;
    font-weight: bold;
    color: #ffd700;
}

.max-total-score {
    font-size: 1.5rem;
    opacity: 0.8;
}

.score-date {
    font-size: 0.9rem;
    opacity: 0.9;
}

.task-scores-list {
    margin-bottom: 2rem;
}

.task-score-item {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid #667eea;
    transition: transform 0.3s ease;
}

.task-score-item:hover {
    transform: translateY(-2px);
}

.task-score-item.score-excellent {
    border-left-color: #28a745;
}

.task-score-item.score-good {
    border-left-color: #ffc107;
}

.task-score-item.score-needs-improvement {
    border-left-color: #dc3545;
}

.task-score-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.task-score-header h4 {
    color: #333;
    margin: 0;
    font-size: 1.1rem;
}

.task-score-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #667eea;
}

.task-score-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.score-progress {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.task-score-percentage {
    text-align: right;
    font-size: 0.9rem;
    color: #666;
    font-weight: 600;
}

.task-score-stats {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    border: 2px solid #e9ecef;
}

.task-score-stats h3 {
    color: #667eea;
    margin-bottom: 1rem;
    text-align: center;
}

/* 頁腳 */
.footer {
    background: #2c3e50;
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: #ffd700;
    margin-bottom: 1rem;
}

.footer-section p {
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    color: white;
    font-size: 1.5rem;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: #ffd700;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #34495e;
    opacity: 0.8;
}

/* 動畫 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

/* 響應式設計 */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: #667eea;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-item {
        margin: 1rem 0;
    }
    
    .hero {
        flex-direction: column;
        text-align: center;
        padding: 100px 0 60px;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero-image i {
        font-size: 8rem;
    }
    
    .scores-container {
        grid-template-columns: 1fr;
    }
    
    .about-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .admin-panel {
        width: 100%;
    }
    
    .competitions-grid {
        grid-template-columns: 1fr;
    }
    
    .practice-history-modal {
        max-width: 95%;
        margin: 2% auto;
    }
    
    .task-management-modal {
        max-width: 95%;
        margin: 2% auto;
    }
    
    .task-score-modal {
        max-width: 95%;
        margin: 2% auto;
    }
    
    .stats-summary {
        grid-template-columns: 1fr;
    }
    
    .summary-stats {
        grid-template-columns: 1fr;
    }
    
    .task-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .task-actions {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .modal-content {
        margin: 10% auto;
        padding: 1.5rem;
    }
    
    .practice-record-item {
        padding: 1rem;
    }
    
    .record-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .task-score-summary {
        padding: 1.5rem;
    }
    
    .total-score {
        font-size: 2.5rem;
    }
    
    .task-score-item {
        padding: 1rem;
    }
    
    .task-score-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
} 

/* 新增：任務得分叠加相關樣式 */
.task-score-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 10px;
}

.task-score-attempts,
.task-score-best {
    font-size: 12px;
    color: #666;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
    margin-right: 8px;
}

/* 新增：用戶管理相關樣式 */
.user-management-modal {
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
}

.users-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.user-info h4 {
    margin: 0 0 8px 0;
    color: #333;
}

.user-info p {
    margin: 5px 0;
    color: #666;
    font-size: 14px;
}

.user-actions {
    display: flex;
    gap: 10px;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #c82333;
}

/* 新增：權限設置樣式 */
.permission-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.permission-checkboxes label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.permission-checkboxes input[type="checkbox"] {
    margin: 0;
}

/* 新增：用戶統計樣式 */
.user-summary {
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    color: white;
}

.user-summary h5 {
    margin: 0 0 15px 0;
    text-align: center;
}

/* 響應式調整 */
@media (max-width: 768px) {
    .user-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .user-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .permission-checkboxes {
        flex-direction: row;
        flex-wrap: wrap;
    }
} 