/* 全局样式 */
body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

header {
    background: rgba(255, 255, 255, 0.9);
    padding: 1rem;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

nav {
    background: rgba(255, 255, 255, 0.8);
    padding: 0.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

nav ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

nav ul li {
    margin: 0.25rem 0.5rem;
}

nav ul li a {
    text-decoration: none;
    color: #333;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

nav ul li a:hover, nav ul li a.active {
    background-color: #007bff;
    color: white;
}

/* 标签页中的日期时间显示 */
nav ul li.datetime-tab {
    margin: 0.25rem 0.5rem;
    padding: 0.5rem 1rem;
    background-color: #e9ecef;
    border-radius: 4px;
    display: flex;
    align-items: center;
}

.datetime-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.85rem;
}

.datetime-display span {
    margin: 0.1rem 0;
}

.datetime-display #tab-current-date {
    font-weight: bold;
}

.datetime-display #tab-current-weekday {
    color: #007bff;
}

.datetime-display #tab-current-time {
    font-family: 'Courier New', monospace;
    color: #28a745;
}

main {
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

h1, h2, h3 {
    color: #333;
}

.order-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
}

.menu-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

/* 菜单项样式 */
.menu-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.menu-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-color: #667eea;
}

.menu-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 10px;
}

.menu-item h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
    color: #333;
}

.menu-item .portion {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: #666;
}

.menu-item .price {
    font-size: 18px;
    font-weight: bold;
    color: #e74c3c;
}

.order-cart {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    background: white;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.order-total {
    margin: 1rem 0;
    text-align: right;
}

button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #0056b3;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: bold;
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.payment-options {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.payment-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.payment-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.payment-btn img {
    width: 50px;
    height: 50px;
    margin-bottom: 0.5rem;
}

#qrcode-display {
    text-align: center;
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
}

#payment-qrcode {
    max-width: 200px;
    height: 200px;
    margin: 0 auto;
}

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

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 8px;
}

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

.close:hover,
.close:focus {
    color: black;
}

.employee-functions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.employee-functions button {
    padding: 1rem;
    font-size: 1rem;
}

.attendance-header {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.attendance-controls {
    flex: 1;
    min-width: 200px;
}

.attendance-controls button {
    padding: 10px 15px;
    margin-right: 10px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.attendance-controls button:hover {
    background-color: #0056b3;
}

.calendar-container {
    flex: 2;
    min-width: 300px;
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

#attendance-calendar {
    width: 100%;
}

#attendance-calendar table {
    width: 100%;
    border-collapse: collapse;
}

#attendance-calendar th,
#attendance-calendar td {
    padding: 8px;
    text-align: center;
    border: 1px solid #dee2e6;
}

#attendance-calendar th {
    background-color: #e9ecef;
    font-weight: bold;
}

#attendance-calendar .today {
    background-color: #007bff;
    color: white;
}

#attendance-calendar .punched {
    background-color: #d4edda;
    color: #155724;
}

.attendance-data {
    overflow-x: auto;
}

#attendance-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

#attendance-table th,
#attendance-table td {
    padding: 12px;
    text-align: left;
    border: 1px solid #dee2e6;
}

#attendance-table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

#attendance-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

#attendance-table tbody tr:hover {
    background-color: #e9ecef;
}

.status-normal {
    color: #28a745;
    font-weight: bold;
}

.status-absent {
    color: #dc3545;
    font-weight: bold;
}

.status-early {
    color: #ffc107;
    font-weight: bold;
}

.status-late {
    color: #fd7e14;
    font-weight: bold;
}

.attendance-table-actions button {
    padding: 5px 10px;
    margin-right: 5px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.edit-btn {
    background-color: #ffc107;
    color: #000;
}

.edit-btn:hover {
    background-color: #e0a800;
}

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

.delete-btn:hover {
    background-color: #c82333;
}

/* 考勤编辑模态框样式 */
#attendance-edit-modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
}

#attendance-edit-modal .modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 5px;
}

#attendance-edit-modal .close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

#attendance-edit-modal .close:hover,
#attendance-edit-modal .close:focus {
    color: black;
}

#attendance-edit-modal h3 {
    margin-top: 0;
}

/* 平台音乐样式 */
.platform-music-section {
    margin-top: 2rem;
}

.platform-music-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.platform-music-item {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0.5rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    max-width: 300px;
}

.platform-music-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.music-cover {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    overflow: hidden;
    margin-right: 0.5rem;
}

.music-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.music-info {
    flex: 1;
}

.music-name {
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.music-platform {
    font-size: 0.8rem;
    color: #666;
}

.no-cover {
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #cccccc, #eeeeee);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #999999;
}

/* 本地音乐样式 */
.local-music-section {
    margin-top: 2rem;
}

.local-music-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.local-music-item {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0.5rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    max-width: 300px;
}

.local-music-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* 音乐播放器样式 */
.player-container {
    margin-top: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    background: white;
}

.music-player {
    display: flex;
    flex-direction: column;
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.player-header h3 {
    margin: 0;
}

#close-player {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-content {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.album-art {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
}

.album-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.track-info {
    flex: 1;
    min-width: 200px;
}

.embedded-player {
    width: 100%;
    margin-top: 1rem;
}

.player-controls {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

/* 库存管理样式 */
.inventory-functions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.inventory-functions button {
    padding: 1rem;
    font-size: 1rem;
}

.local-music-upload, .platform-music-upload {
    margin-bottom: 2rem;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f8f9fa;
}

.local-music-upload h4, .platform-music-upload h4 {
    margin-top: 0;
}

.cover-options {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.cover-option {
    flex: 1;
    min-width: 200px;
}

/* 友情链接展示样式 */
.friend-links-section {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.friend-links-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.friend-link-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    cursor: pointer;
}

.friend-link-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.friend-link-cover {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.friend-link-name {
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: #333;
}

.friend-link-url {
    color: #007bff;
    text-decoration: none;
    word-break: break-all;
    font-size: 0.8rem;
}

.friend-link-url:hover {
    text-decoration: underline;
}

.card-color-1 { background-color: #e3f2fd; }
.card-color-2 { background-color: #e8f5e9; }
.card-color-3 { background-color: #fff3e0; }
.card-color-4 { background-color: #fce4ec; }
.card-color-5 { background-color: #f3e5f5; }
.card-color-6 { background-color: #e0f2f1; }
.card-color-7 { background-color: #fff8e1; }
.card-color-8 { background-color: #efebe9; }

/* 响应式设计 */
@media (max-width: 768px) {
    .order-section {
        grid-template-columns: 1fr;
    }
    
    nav ul {
        flex-direction: column;
        align-items: center;
    }
    
    nav ul li {
        margin: 0.25rem 0;
    }
    
    .employee-functions, 
    .finance-functions,
    .inventory-functions {
        flex-direction: column;
    }
    
    .attendance-header {
        flex-direction: column;
    }
    
    .report-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .cover-options {
        flex-direction: column;
    }
    
    .player-content {
        flex-direction: column;
        align-items: center;
    }
    
    .album-art {
        width: 150px;
        height: 150px;
    }
}

/* 星空背景动画 */
@keyframes twinkle {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}

.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.star {
    position: absolute;
    background-color: white;
    border-radius: 50%;
    animation: twinkle var(--duration, 5s) infinite ease-in-out;
}

.datetime {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}