/* ===== 全局样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #FF9800;
    --primary-dark: #F57C00;
    --primary-light: #FFE0B2;
    --secondary-color: #FFC107;
    --happy-color: #4CAF50;
    --happy-light: #E8F5E9;
    --normal-color: #2196F3;
    --normal-light: #E3F2FD;
    --sad-color: #9C27B0;
    --sad-light: #F3E5F5;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #f5f5f5;
    --card-bg: #fff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 15px rgba(0, 0, 0, 0.15);
    --radius: 12px;
}

body {
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, var(--primary-light) 0%, #fff 50%, var(--primary-light) 100%);
    min-height: 100vh;
    color: var(--text-color);
    overflow-x: hidden;
    overflow-y: auto;
}

/* ===== 主容器 ===== */
.container {
    max-width: 100%;
    min-height: 100vh;
    margin: 0 auto;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
}

/* ===== 头部 ===== */
.header {
    text-align: center;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--radius);
    color: white;
    margin-bottom: 10px;
    box-shadow: var(--shadow);
    flex-shrink: 0;
}

.header h1 {
    font-size: 1.8em;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.datetime {
    font-size: 1em;
    opacity: 0.9;
}

/* ===== 活动状态栏 ===== */
.activity-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--card-bg);
    padding: 8px 20px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    box-shadow: var(--shadow);
    border-left: 5px solid #9e9e9e;
    flex-shrink: 0;
}

.activity-status.waiting {
    border-left-color: #9e9e9e;
    background: linear-gradient(to right, #f5f5f5, var(--card-bg));
}

.activity-status.active {
    border-left-color: var(--happy-color);
    background: linear-gradient(to right, var(--happy-light), var(--card-bg));
    animation: pulse 2s infinite;
}

.activity-status.ended {
    border-left-color: var(--normal-color);
    background: linear-gradient(to right, var(--normal-light), var(--card-bg));
}

@keyframes pulse {
    0%, 100% { box-shadow: var(--shadow); }
    50% { box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3); }
}

.status-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-icon {
    font-size: 1.5em;
}

.status-text {
    font-size: 1.1em;
    font-weight: 500;
    color: var(--text-color);
}

.countdown {
    font-size: 1.4em;
    font-weight: bold;
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
}

/* ===== 时间设置区 ===== */
.time-settings {
    background: var(--card-bg);
    padding: 10px 20px;
    border-radius: var(--radius);
    margin-bottom: 10px;
    box-shadow: var(--shadow);
    flex-shrink: 0;
}

.time-settings h3 {
    margin-bottom: 8px;
    color: var(--text-color);
    font-size: 1em;
}

.settings-row {
    display: flex;
    align-items: flex-end;
    gap: 15px;
    flex-wrap: wrap;
}

.setting-item {
    flex: 1;
    min-width: 120px;
}

.setting-item label {
    display: block;
    margin-bottom: 4px;
    color: var(--text-light);
    font-size: 0.85em;
}

.setting-item input,
.setting-item select {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #eee;
    border-radius: 8px;
    font-size: 0.95em;
    transition: border-color 0.3s ease;
}

.setting-item input:focus,
.setting-item select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.settings-row .btn {
    height: 38px;
    white-space: nowrap;
    padding: 8px 20px;
}

@media (max-width: 768px) {
    .settings-row {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .setting-item {
        min-width: 45%;
    }
}

/* ===== 音乐播放器 ===== */
.music-player {
    display: none;
    align-items: center;
    justify-content: space-between;
    background: var(--card-bg);
    padding: 8px 20px;
    border-radius: var(--radius);
    margin-bottom: 10px;
    box-shadow: var(--shadow);
    flex-shrink: 0;
}

.music-player.show {
    display: flex;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.music-icon {
    font-size: 1.5em;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

.music-name {
    font-size: 1em;
    font-weight: 500;
    color: var(--text-color);
}

.player-controls {
    display: flex;
    gap: 8px;
}

.player-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.player-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

/* ===== 情绪展示区（并排显示） ===== */
.emotion-display {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 15px;
    flex-shrink: 0;
}

.emotion-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 15px;
    box-shadow: var(--shadow);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.emotion-section:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-hover);
}

.happy-section {
    border-left: 4px solid var(--happy-color);
    background: linear-gradient(to right, var(--happy-light), var(--card-bg));
}

.normal-section {
    border-left: 4px solid var(--normal-color);
    background: linear-gradient(to right, var(--normal-light), var(--card-bg));
}

.sad-section {
    border-left: 4px solid var(--sad-color);
    background: linear-gradient(to right, var(--sad-light), var(--card-bg));
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.section-header h2 {
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.count {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--primary-color);
}

.emoji-wall {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    flex: 1;
    overflow-y: auto;
    align-content: flex-start;
}

.wall-emoji {
    font-size: 2em;
    animation: fadeIn 0.5s ease forwards;
    opacity: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== 统计栏 ===== */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 50px;
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    color: var(--text-light);
    margin-bottom: 5px;
}

.stat-value {
    font-size: 2em;
    font-weight: bold;
    color: var(--primary-color);
}

/* ===== 表情选择区（放在下方） ===== */
.emoji-picker {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    width: 100%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.emoji-picker h3 {
    text-align: center;
    margin-bottom: 10px;
    color: var(--text-color);
    font-size: 1.2em;
}

.picker-sections {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.picker-section {
    text-align: center;
}

.picker-label {
    font-weight: bold;
    padding: 4px 15px;
    border-radius: 20px;
    margin-bottom: 8px;
    display: inline-block;
    font-size: 0.9em;
}

.happy-label {
    background: var(--happy-light);
    color: var(--happy-color);
}

.normal-label {
    background: var(--normal-light);
    color: var(--normal-color);
}

.sad-label {
    background: var(--sad-light);
    color: var(--sad-color);
}

.picker-emojis {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.emoji-btn {
    width: 50px;
    height: 50px;
    font-size: 1.8em;
    border: 2px solid #eee;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emoji-btn:hover {
    transform: scale(1.2);
    box-shadow: var(--shadow);
    border-color: var(--primary-color);
}

.emoji-btn:active {
    transform: scale(1.1);
}

.emoji-btn.clicked {
    animation: clickPulse 0.3s ease;
}

@keyframes clickPulse {
    0% { transform: scale(1); }
    50% { transform: scale(0.8); }
    100% { transform: scale(1.2); }
}

/* ===== 提示框 ===== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-color);
    color: white;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 1.1em;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: var(--happy-color);
}

.toast.error {
    background: #f44336;
}

/* ===== 控制台信息面板（作为页面的一部分） ===== */
.console-section {
    background: #1e1e1e;
    color: #d4d4d4;
    border: 1px solid #3e3e3e;
    border-radius: var(--radius);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    margin-top: 20px;
}

.console-header-inline {
    background: #252526;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #3e3e3e;
    border-radius: var(--radius) var(--radius) 0 0;
}

.console-header-inline span {
    font-weight: 600;
    color: #cccccc;
}

.console-content-inline {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px 15px;
    min-height: 200px;
}

.console-line {
    padding: 4px 0;
    line-height: 1.5;
    word-wrap: break-word;
    border-bottom: 1px solid #2d2d2d;
}

.console-line:last-child {
    border-bottom: none;
}

.console-line.info {
    color: #4ec9b0;
}

.console-line.success {
    color: #4ec9b0;
}

.console-line.warning {
    color: #dcdcaa;
}

.console-line.error {
    color: #f48771;
}

.console-line.debug {
    color: #9cdcfe;
}

.console-timestamp {
    color: #858585;
    margin-right: 8px;
}

/* ===== 上传进度条 ===== */
.upload-progress-container {
    margin: 10px 0;
    display: none;
}

.upload-progress-container.active {
    display: block;
}

.upload-progress-item {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 8px;
    border: 1px solid #e0e0e0;
}

.upload-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 13px;
}

.upload-progress-filename {
    font-weight: 500;
    color: var(--text-color);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-progress-percent {
    color: var(--text-light);
    margin-left: 10px;
    min-width: 50px;
    text-align: right;
}

.upload-progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.upload-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.upload-progress-status {
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-light);
}

.upload-progress-status.success {
    color: var(--happy-color);
}

.upload-progress-status.error {
    color: #f44336;
}

/* ===== 弹窗 ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: var(--radius);
    width: 90%;
    max-width: 400px;
    box-shadow: var(--shadow-hover);
}

.modal-content h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
    text-align: center;
}

.modal-large {
    max-width: 700px;
}

/* ===== 表单样式 ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-color);
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #eee;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.form-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
}

.form-message.error {
    background: #ffebee;
    color: #c62828;
}

.form-message.success {
    background: #e8f5e9;
    color: #2e7d32;
}

/* ===== 按钮样式 ===== */
.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: #eee;
    color: var(--text-color);
}

.btn-secondary:hover {
    background: #ddd;
}

.btn-success {
    background: var(--happy-color);
    color: white;
}

.btn-danger {
    background: #f44336;
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.9em;
}

.btn-block {
    width: 100%;
}

/* ===== 后台管理样式 ===== */
.admin-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.admin-login {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: var(--radius);
    width: 90%;
    max-width: 400px;
    box-shadow: var(--shadow-hover);
    margin: 20px;
}

@media (max-width: 600px) {
    .login-card {
        padding: 25px 20px;
        width: 95%;
        margin: 10px;
    }
    
    .login-card h1 {
        font-size: 1.3em;
        margin-bottom: 20px;
    }
}

.login-card h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #667eea;
}

.back-link {
    display: block;
    text-align: center;
    margin-top: 20px;
    color: var(--text-light);
    text-decoration: none;
}

.back-link:hover {
    color: var(--primary-color);
}

/* 管理面板 */
.admin-dashboard {
    min-height: 100vh;
    background: var(--bg-color);
}

.admin-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.admin-header h1 {
    font-size: 1.5em;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.admin-nav {
    background: white;
    padding: 15px 30px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: #eee;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: #ddd;
}

.nav-btn.active {
    background: #667eea;
    color: white;
}

.admin-content {
    padding: 30px;
}

.tab-content {
    display: none;
    background: white;
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

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

.tab-content h2 {
    margin-bottom: 20px;
    color: #667eea;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.toolbar {
    margin-bottom: 20px;
}

/* 数据表格 */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: var(--text-color);
}

.data-table tr:hover {
    background: #f8f9fa;
}

.total-row {
    background: #f0f0f0 !important;
}

.clickable {
    color: #667eea;
    cursor: pointer;
    text-decoration: underline;
}

.clickable:hover {
    color: #764ba2;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85em;
}

.status-pending {
    background: #fff3e0;
    color: #e65100;
}

.status-approved {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-rejected {
    background: #ffebee;
    color: #c62828;
}

.empty-message {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
    font-size: 1.1em;
}

/* 统计页面 */
.stats-filter {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.stats-filter .form-group {
    margin-bottom: 0;
}

.stats-display {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 900px) {
    .stats-display {
        grid-template-columns: 1fr;
    }
}

.stats-chart {
    display: flex;
    justify-content: center;
    align-items: center;
}

.stats-chart canvas {
    max-width: 400px;
}

.stats-table h3 {
    margin-bottom: 15px;
    color: var(--text-color);
}

.form-card {
    max-width: 500px;
}

/* ===== 音乐管理样式 ===== */
.media-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 25px;
}

.media-section h3 {
    margin: 0 0 8px 0;
    color: #667eea;
    font-size: 1.2em;
}

.section-desc {
    color: var(--text-light);
    font-size: 0.9em;
    margin-bottom: 15px;
}

.upload-area {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.upload-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.upload-item label {
    display: block;
    font-weight: 500;
    margin-bottom: 10px;
    color: var(--text-color);
}

.upload-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.file-input {
    flex: 1;
    min-width: 200px;
    padding: 8px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    background: #fafafa;
}

.file-input:hover {
    border-color: #667eea;
}

.current-file {
    display: block;
    margin-top: 8px;
    font-size: 0.85em;
    color: var(--text-light);
}

.current-file.uploaded {
    color: var(--happy-color);
}

.music-list {
    margin-top: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.music-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: white;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid #eee;
}

.music-item:hover {
    border-color: #667eea;
}

.music-name {
    font-weight: 500;
}

.music-actions {
    display: flex;
    gap: 8px;
}

.empty-hint {
    text-align: center;
    color: var(--text-light);
    padding: 20px;
}

/* ===== 人员统计显示 ===== */
.submit-stats {
    text-align: center;
    padding: 10px;
    background: linear-gradient(135deg, var(--primary-light), #fff);
    border-radius: var(--radius);
    margin-bottom: 12px;
}

.submit-stats .stats-number {
    font-size: 2em;
    font-weight: bold;
    color: var(--primary-color);
}

.submit-stats .stats-label {
    color: var(--text-light);
    font-size: 1em;
}

/* ===== 登录遮罩 ===== */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    overflow-y: auto;
    padding: 20px;
}

.login-overlay.hidden {
    display: none;
}

/* 移动端登录框优化 */
@media (max-width: 600px) {
    .login-overlay {
        padding: 10px;
        align-items: flex-start;
        padding-top: 20px;
    }
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: var(--radius);
    width: 90%;
    max-width: 400px;
    box-shadow: var(--shadow-hover);
}

.login-box h2 {
    text-align: center;
    margin-bottom: 25px;
    color: var(--primary-color);
}

.login-box .tabs {
    display: flex;
    margin-bottom: 25px;
    border-bottom: 2px solid #eee;
}

.login-box .tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    font-size: 1em;
    cursor: pointer;
    color: var(--text-light);
    transition: all 0.3s ease;
}

.login-box .tab-btn.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    margin-bottom: -2px;
}

.login-box .form-panel {
    display: none;
}

.login-box .form-panel.active {
    display: block;
}

.user-info-bar {
    display: none;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 5px 15px;
    background: var(--card-bg);
    border-radius: var(--radius);
    margin-bottom: 8px;
    font-size: 0.9em;
}

.user-info-bar.show {
    display: flex;
}

.user-info-bar .username {
    color: var(--primary-color);
    font-weight: 500;
}

.user-info-bar .logout-btn {
    padding: 4px 12px;
    font-size: 0.85em;
}

/* ===== 响应式设计 ===== */

/* 大屏幕（桌面，1200px以上） */
@media (min-width: 1200px) {
    .container {
        max-width: 1400px;
        padding: 15px 20px;
    }
    
    .emotion-display {
        gap: 20px;
        margin-bottom: 20px;
    }
    
    .emotion-section {
        min-height: 220px;
        padding: 20px;
    }
    
    .emoji-picker {
        padding: 25px;
    }
    
    .picker-sections {
        gap: 25px;
    }
    
    .emoji-btn {
        width: 55px;
        height: 55px;
        font-size: 2em;
    }
}

/* 中等屏幕（平板横屏，768px-1199px） */
@media (min-width: 768px) and (max-width: 1199px) {
    .container {
        padding: 10px 15px;
    }
    
    .header h1 {
        font-size: 1.6em;
    }
    
    .emotion-display {
        gap: 12px;
        margin-bottom: 15px;
    }
    
    .emotion-section {
        min-height: 180px;
    }
    
    .emoji-picker {
        padding: 18px;
    }
    
    .picker-sections {
        gap: 18px;
    }
    
    .emoji-btn {
        width: 52px;
        height: 52px;
        font-size: 1.8em;
    }
}

/* 小屏幕（平板竖屏/大手机，600px-767px） */
@media (min-width: 600px) and (max-width: 767px) {
    .container {
        padding: 8px 12px;
    }
    
    .header {
        padding: 10px 15px;
    }
    
    .header h1 {
        font-size: 1.4em;
    }
    
    .datetime {
        font-size: 0.9em;
    }
    
    .emotion-display {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        margin-bottom: 12px;
    }
    
    .emotion-section {
        min-height: 150px;
        padding: 12px;
    }
    
    .emoji-picker {
        width: 100%;
        padding: 15px;
    }
    
    .picker-sections {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
    
    .emoji-btn {
        width: 50px;
        height: 50px;
        font-size: 1.6em;
    }
    
    .time-settings {
        padding: 12px 15px;
    }
    
    .settings-row {
        flex-wrap: wrap;
    }
    
    .setting-item {
        min-width: calc(50% - 10px);
    }
}

/* 超小屏幕（手机，小于600px） */
@media (max-width: 599px) {
    .container {
        padding: 6px 10px;
    }
    
    .header {
        padding: 8px 12px;
        margin-bottom: 8px;
    }
    
    .header h1 {
        font-size: 1.2em;
        margin-bottom: 4px;
    }
    
    .datetime {
        font-size: 0.85em;
    }
    
    .activity-status {
        padding: 6px 12px;
        margin-bottom: 6px;
        flex-wrap: wrap;
    }
    
    .status-text {
        font-size: 0.95em;
    }
    
    .countdown {
        font-size: 1.1em;
    }
    
    .time-settings {
        padding: 10px 12px;
        margin-bottom: 8px;
    }
    
    .time-settings h3 {
        font-size: 0.95em;
        margin-bottom: 8px;
    }
    
    .settings-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .setting-item {
        width: 100%;
        min-width: 100%;
    }
    
    .setting-item input,
    .setting-item select {
        padding: 10px 12px;
        font-size: 16px; /* 防止iOS自动缩放 */
    }
    
    .settings-row .btn {
        width: 100%;
        height: 44px; /* 触摸友好 */
        padding: 12px;
    }
    
    .emotion-display {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 12px;
    }
    
    .emotion-section {
        min-height: 150px;
        padding: 12px;
    }
    
    .section-header h2 {
        font-size: 1em;
    }
    
    .count {
        font-size: 1.3em;
    }
    
    .emoji-wall {
        gap: 4px;
    }
    
    .wall-emoji {
        font-size: 1.8em;
    }
    
    .emoji-picker {
        width: 100%;
        padding: 10px;
    }
    
    .emoji-picker h3 {
        font-size: 1.1em;
        margin-bottom: 8px;
    }
    
    .submit-stats {
        padding: 8px;
        margin-bottom: 10px;
    }
    
    .submit-stats .stats-number {
        font-size: 1.8em;
    }
    
    .submit-stats .stats-label {
        font-size: 0.9em;
    }
    
    .picker-sections {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .picker-label {
        font-size: 0.85em;
        padding: 4px 12px;
        margin-bottom: 6px;
    }
    
    .picker-emojis {
        gap: 6px;
    }
    
    .emoji-btn {
        width: 44px;
        height: 44px;
        font-size: 1.5em;
        min-width: 44px; /* 触摸友好 */
    }
    
    .music-player {
        padding: 6px 12px;
        flex-wrap: wrap;
    }
    
    .player-info {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .player-controls {
        width: 100%;
        justify-content: center;
    }
    
    .player-btn {
        width: 40px;
        height: 40px;
        font-size: 1em;
    }
    
    .user-info-bar {
        padding: 6px 12px;
        font-size: 0.85em;
        flex-wrap: wrap;
    }
    
    .logout-btn {
        padding: 6px 12px;
        font-size: 0.9em;
        min-height: 36px;
    }
    
    .login-box {
        padding: 25px 20px;
        width: 95%;
        max-width: 100%;
    }
    
    .login-box h2 {
        font-size: 1.3em;
        margin-bottom: 20px;
    }
    
    .form-group input {
        font-size: 16px; /* 防止iOS自动缩放 */
        padding: 12px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 1em;
        min-height: 44px; /* 触摸友好 */
    }
}

/* 后台管理页面响应式 */
@media (max-width: 900px) {
    .admin-nav {
        padding: 10px 15px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .nav-btn {
        padding: 8px 15px;
        font-size: 0.9em;
    }
    
    .admin-content {
        padding: 15px;
    }
    
    .tab-content {
        padding: 15px;
    }
    
    .stats-display {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .stats-filter {
        flex-direction: column;
        gap: 15px;
    }
    
    .stats-filter .form-group {
        width: 100%;
    }
    
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .data-table {
        min-width: 600px;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 12px;
        font-size: 0.9em;
    }
    
    .media-section {
        padding: 15px;
    }
    
    .upload-row {
        flex-direction: column;
    }
    
    .file-input {
        width: 100%;
        min-width: 100%;
    }
    
    .music-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .music-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 600px) {
    .admin-header {
        padding: 15px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .admin-header h1 {
        font-size: 1.2em;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .admin-nav {
        padding: 8px 12px;
    }
    
    .nav-btn {
        padding: 6px 12px;
        font-size: 0.85em;
        flex: 1;
        min-width: calc(50% - 4px);
    }
    
    .admin-content {
        padding: 12px;
    }
    
    .tab-content {
        padding: 12px;
    }
    
    .tab-content h2 {
        font-size: 1.2em;
        margin-bottom: 15px;
    }
    
    .data-table {
        font-size: 0.85em;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 10px;
    }
    
    .modal-content {
        width: 95%;
        padding: 20px 15px;
    }
    
    .modal-large {
        max-width: 95%;
    }
}

/* 横屏优化（手机横屏） */
@media (max-width: 900px) and (orientation: landscape) {
    .container {
        padding: 6px 10px;
    }
    
    .header {
        padding: 6px 12px;
    }
    
    .header h1 {
        font-size: 1.1em;
    }
    
    .emotion-display {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        margin-bottom: 10px;
    }
    
    .emotion-section {
        min-height: 120px;
        padding: 10px;
    }
    
    .emoji-picker {
        padding: 12px;
    }
    
    .picker-sections {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .emoji-btn,
    .btn,
    .player-btn,
    .nav-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .emoji-btn:active {
        transform: scale(0.95);
    }
    
    .btn:active {
        opacity: 0.8;
    }
}
