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

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

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 10px 10px 80px 10px;
    min-height: 100vh;
}

/* 头部样式 */
.header {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 20px;
    border-radius: 15px;
    margin: 30px 0 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
}

.header h1 {
    color: #4a5568;
    font-size: 1.5rem;
    font-weight: bold;
}

.admin-btn {
    background: #4299e1;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.admin-btn:hover {
    background: #3182ce;
    transform: translateY(-2px);
}

.admin-link {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: inline-block;
}

.admin-link:hover {
    background-color: #f5f5f5;
    color: #333;
}

/* 页面底部样式 */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    padding: 6px;
    text-align: center;

    backdrop-filter: blur(10px);
    z-index: 100;
}

/* 菜单区域样式 */
.menu-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.main-menu {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    justify-content: center;
    align-items: center;
}

.menu-btn {
    flex: 1;
    max-width: 200px;
    min-width: 150px;
    padding: 15px 25px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    color: #4a5568;
    text-align: center;
}

.menu-btn.active {
    background: #4299e1;
    color: white;
    border-color: #4299e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
}

.menu-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.unit-menu {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    min-height: 60px;
}

.unit-container {
    position: relative;
    display: inline-block;
}

.unit-btn {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    color: #4a5568;
    width: 100%;
}

.unit-btn:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
    transform: translateY(-2px);
}

.unit-btn.active {
    background: #48bb78;
    color: white;
    border-color: #48bb78;
}

.delete-unit-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    border: none;
    background: #e53e3e;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.delete-unit-btn:hover {
    background: #c53030;
    transform: scale(1.1);
}

/* 播放器区域样式 */
.player-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.audio-player {
    margin-bottom: 20px;
}

.player-info {
    text-align: center;
    margin-bottom: 15px;
}

.current-info {
    font-size: 1.1rem;
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 8px;
}

.time-display {
    font-size: 0.9rem;
    color: #718096;
}

.progress-container {
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: #4299e1;
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s ease;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.control-btn {
    padding: 12px 20px;
    border: none;
    background: #4299e1;
    color: white;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 80px;
}

.control-btn:hover {
    background: #3182ce;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
}

.control-btn:active {
    transform: translateY(0);
}

.page-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.page-btn {
    padding: 10px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #4a5568;
}

.page-btn:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
    transform: translateY(-1px);
}

.page-btn.active {
    background: #ed8936;
    color: white;
    border-color: #ed8936;
}

.page-btn.no-audio {
    background: #f7fafc;
    color: #a0aec0;
    border-color: #e2e8f0;
    cursor: default;
}

.page-btn.no-audio:hover {
    background: #f7fafc;
    border-color: #e2e8f0;
    transform: none;
}

.page-btn.loading {
    background: #4299e1;
    color: white;
    border-color: #4299e1;
    cursor: wait;
}

.loading-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 5px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 模态框样式 */
.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: 15% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

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

.close:hover {
    color: #000;
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #2d3748;
    text-align: center;
}

.modal-content form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-content input {
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
}

.modal-content button {
    padding: 12px;
    background: #4299e1;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.3s ease;
}

.modal-content button:hover {
    background: #3182ce;
}

/* 管理员面板样式 */
.admin-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

.admin-header h2 {
    color: #2d3748;
    font-size: 1.5rem;
}

.exit-btn {
    background: #e53e3e;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s ease;
}

.exit-btn:hover {
    background: #c53030;
}

.admin-content {
    display: grid;
    gap: 30px;
}

.admin-section {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.admin-section h3 {
    margin-bottom: 20px;
    color: #2d3748;
    font-size: 1.2rem;
}

.admin-section form {
    display: grid;
    gap: 15px;
}

.admin-section input,
.admin-section select {
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
}

.admin-section button {
    padding: 12px;
    background: #48bb78;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.3s ease;
}

.admin-section button:hover {
    background: #38a169;
}

/* 删除音频区域样式 */
.delete-audio-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid #e2e8f0;
}

.delete-audio-section h4 {
    margin-bottom: 15px;
    color: #e53e3e;
    font-size: 1.1rem;
    font-weight: 600;
}

.delete-form {
    display: grid;
    gap: 15px;
}

.delete-btn {
    background: #e53e3e !important;
    color: white;
    padding: 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.3s ease;
}

.delete-btn:hover {
    background: #c53030 !important;
}

.danger-btn {
    background: #dc2626 !important;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 10px;
}

.danger-btn:hover {
    background: #b91c1c !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.warning-box {
    background: #fef3c7;
    border: 2px solid #f59e0b;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.warning-box p {
    color: #92400e;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 5px;
    }
    
    .header {
        padding: 10px 15px;
    }
    
    .header h1 {
        font-size: 1.2rem;
    }
    
    .menu-section,
    .player-section {
        padding: 15px;
    }
    
    .main-menu {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }
    
    .menu-btn {
        flex: 1;
        max-width: 48%;
        min-width: 140px;
        padding: 10px 16px;
    }
    
    .unit-menu {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    
    .controls {
        gap: 10px;
    }
    
    .control-btn {
        padding: 10px 16px;
        font-size: 0.8rem;
        min-width: 70px;
    }
    
    .page-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .modal-content {
        margin: 20% auto;
        padding: 20px;
    }
    
    .admin-panel {
        padding: 10px;
    }
    
    .admin-section {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1rem;
    }
    
    .admin-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .unit-menu {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .controls {
        gap: 8px;
    }
    
    .control-btn {
        padding: 10px 25px;
        font-size: 1rem;
        min-width: 80px;
    }
    
    .page-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .page-btn {
        padding: 8px 4px;
        font-size: 0.9rem;
        min-height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.player-section {
    animation: fadeIn 0.5s ease;
}

/* 加载状态 */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #4299e1;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 内部通知样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #48bb78;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification.success {
    background: #48bb78;
}

.notification.error {
    background: #e53e3e;
}

.notification.warning {
    background: #ed8936;
}

@keyframes slideInOut {
    0% {
        opacity: 0;
        transform: translateX(100%);
    }
    10%, 90% {
        opacity: 1;
        transform: translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateX(100%);
    }
}