* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    padding: 30px 0;
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.stats-bar {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.stat-item {
    background: rgba(255,255,255,0.95);
    padding: 12px 20px;
    border-radius: 10px;
    text-align: center;
    min-width: 90px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 2px;
}

.stat-item:nth-child(1) .stat-value {
    color: #667eea;
}

.stat-item:nth-child(2) .stat-value {
    color: #ffc107;
}

.stat-item:nth-child(3) .stat-value {
    color: #28a745;
}

.stat-label {
    color: #666;
    font-size: 0.8rem;
}

.nav-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 30px;
    border: none;
    background: rgba(255,255,255,0.2);
    color: white;
    font-size: 1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: rgba(255,255,255,0.3);
}

.tab-btn.active {
    background: white;
    color: #667eea;
    font-weight: bold;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.table-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.table-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    cursor: pointer;
}

.table-card.available {
    border-left: 5px solid #28a745;
}

.table-card.in-use {
    border-left: 5px solid #ffc107;
}

.table-card.my-table {
    border-left: 5px solid #667eea;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.table-name {
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
}

.table-status {
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
}

.table-status.available {
    background: #d4edda;
    color: #28a745;
}

.table-status.in-use {
    background: #fff3cd;
    color: #856404;
}

.table-info {
    color: #666;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.table-info.overdue {
    color: #dc3545;
    font-weight: bold;
}

.table-info span {
    display: inline-block;
    margin-right: 15px;
}

.table-info i {
    margin-right: 5px;
}

.table-btn {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.table-btn.join {
    background: #28a745;
    color: white;
}

.table-btn.join:hover {
    background: #218838;
}

.table-btn.leave {
    background: #dc3545;
    color: white;
}

.table-btn.leave:hover {
    background: #c82333;
}

.table-btn.small {
    width: 100%;
    padding: 10px;
    margin-top: 8px;
    font-size: 0.95rem;
    background: #667eea;
    color: white;
    text-align: center;
}

.table-btn.small:hover {
    background: #5a6fd6;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 25px;
    border-radius: 15px;
    width: 85%;
    max-width: 420px;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

.modal-table-name {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #333;
}

.modal-info {
    margin-bottom: 15px;
    color: #666;
}

.modal-info.overdue {
    color: #dc3545;
    font-weight: bold;
}

.modal-btn {
    width: 100%;
    padding: 15px;
    margin-top: 20px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.modal-btn.primary {
    background: #667eea;
    color: white;
}

.modal-btn.primary:hover {
    background: #5568d3;
}

.player-list {
    margin-top: 15px;
}

.player-item {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: center;
}

#duration-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

#extend-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.duration-option {
    padding: 15px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.duration-option:hover {
    border-color: #667eea;
}

.duration-option.selected {
    border-color: #667eea;
    background: #e8ebff;
}

.duration-option .minutes {
    font-size: 1.8rem;
    font-weight: bold;
    color: #333;
}

.duration-option .label {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
}

.custom-duration {
    margin-bottom: 20px;
    width: 100%;
}

.custom-duration input {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1.1rem;
    outline: none;
    transition: border-color 0.3s;
    text-align: center;
    background: #fff;
    color: #333;
    font-family: 'Microsoft YaHei', sans-serif;
}

.custom-duration input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.custom-duration input::placeholder {
    color: #aaa;
}

.modal-footer {
    display: flex;
    gap: 12px;
}

.modal-footer .modal-btn {
    flex: 1;
    margin-top: 0;
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8rem;
    }

    .modal-content {
        width: 78%;
        padding: 20px;
    }

    #duration-options {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-bar {
        gap: 8px;
    }

    .stat-item {
        padding: 10px 15px;
        min-width: 80px;
    }

    .stat-value {
        font-size: 1.3rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    .tab-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .table-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .table-card {
        padding: 15px;
    }

    .table-name {
        font-size: 1.1rem;
    }

    .modal-content {
        margin: 20% auto;
        width: 95%;
        padding: 20px;
    }
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 0;
}

.back-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.back-btn:hover {
    background: rgba(255,255,255,0.3);
}

.detail-content {
    padding: 10px;
}

.detail-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.detail-status {
    font-size: 1.2rem;
    margin-bottom: 15px;
    padding: 8px 20px;
    border-radius: 20px;
    display: inline-block;
    font-weight: bold;
}

.detail-status.available {
    background: #d4edda;
    color: #28a745;
}

.detail-status.in-use {
    background: #fff3cd;
    color: #856404;
}

.detail-time-display {
    font-size: 3rem;
    font-weight: bold;
    color: #333;
}

.detail-time-display.overdue {
    color: #dc3545;
}

.detail-info-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.detail-info-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.detail-info-item:last-child {
    border-bottom: none;
}

.info-label {
    color: #666;
    font-size: 0.95rem;
}

.info-value {
    color: #333;
    font-weight: 500;
    font-size: 0.95rem;
}

.detail-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.action-btn {
    flex: 1;
    min-width: 120px;
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.action-btn.open {
    background: #667eea;
    color: white;
}

.action-btn.open:hover {
    background: #5a6fd6;
}

.action-btn.extend {
    background: #17a2b8;
    color: white;
}

.action-btn.extend:hover {
    background: #138496;
}

.action-btn.end {
    background: #dc3545;
    color: white;
}

.action-btn.end:hover {
    background: #c82333;
}

@media (max-width: 768px) {
    .detail-header {
        padding: 15px 0;
    }

    .detail-card {
        padding: 25px 20px;
    }

    .detail-time-display {
        font-size: 2.5rem;
    }

    .detail-info-section {
        padding: 20px;
    }

    .detail-actions {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .app {
        padding: 10px;
    }

    .header {
        padding: 20px 0;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .nav-tabs {
        gap: 5px;
    }

    .tab-btn {
        padding: 8px 15px;
        font-size: 0.8rem;
    }

    .table-grid {
        gap: 10px;
    }

    .table-card {
        padding: 12px;
    }

    .table-name {
        font-size: 1rem;
    }
}

.close-shop-btn {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
}

.close-shop-btn button {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(238, 90, 90, 0.4);
    transition: all 0.3s;
}

.close-shop-btn button:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(238, 90, 90, 0.5);
}

@media (max-width: 768px) {
    .close-shop-btn button {
        padding: 12px 30px;
        font-size: 1rem;
    }
}

.reminder-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.reminder-btn.on {
    background: #28a745;
    color: white;
}

.reminder-btn.off {
    background: #6c757d;
    color: white;
}

.reminder-btn:hover {
    opacity: 0.8;
}