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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* 美化的头部 */
.main-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px 30px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    margin-bottom: 20px;
    color: white;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 2rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.logo-text h1 {
    font-size: 1.5rem;
    margin: 0;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.tagline {
    font-size: 0.75rem;
    margin: 3px 0 0 0;
    opacity: 0.9;
    font-weight: 400;
}

.main-nav {
    display: flex;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    color: white;
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.nav-item:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.4);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.nav-item.active {
    background: white;
    color: #667eea;
    border-color: white;
    font-weight: 600;
}

.nav-icon {
    font-size: 1.1rem;
}

.nav-text {
    font-size: 0.9rem;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

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

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 15px;
}

.nav-links {
    margin-top: 15px;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 8px 20px;
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    display: inline-block;
    transition: all 0.3s;
}

.nav-link:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.main-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.section {
    margin-bottom: 30px;
}

.section h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #667eea;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

/* 录音人输入区 */
.recorder-form {
    display: flex;
    gap: 15px;
    align-items: center;
}

.name-input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1.1rem;
    transition: all 0.3s;
}

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

/* 按钮 */
.btn {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

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

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
}

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

.btn-success:hover:not(:disabled) {
    background: #218838;
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

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

.btn-info:hover:not(:disabled) {
    background: #138496;
    box-shadow: 0 5px 15px rgba(23, 162, 184, 0.3);
}

.btn-warning {
    background: #ffc107;
    color: #333;
    font-weight: 600;
}

.btn-warning:hover:not(:disabled) {
    background: #e0a800;
    box-shadow: 0 5px 15px rgba(255, 193, 7, 0.3);
}

/* 列表区域头部 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 15px;
    position: sticky;
    top: 0;
    z-index: 50;
    background: white;
    padding: 15px;
    margin: -15px -15px 20px -15px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header-left {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.header-right {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.selection-info {
    display: flex;
    gap: 20px;
    font-size: 0.95rem;
    color: #666;
}

.selection-info #selectionCount {
    color: #667eea;
    font-weight: 600;
}

.recorder-info strong {
    color: #667eea;
}

.page-size-control {
    display: flex;
    align-items: center;
    gap: 6px;
}

.page-size-control label {
    font-size: 0.85rem;
    color: #666;
    white-space: nowrap;
    font-weight: 500;
}

.filter-controls {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-size: 0.95rem;
    color: #666;
    white-space: nowrap;
}

.filter-select,
.page-size-select {
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.3s;
    cursor: pointer;
    background-color: white;
    min-width: 120px;
}

.filter-select:focus,
.page-size-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-select:hover,
.page-size-select:hover {
    border-color: #667eea;
}

/* 批量操作和分页 */
.pagination-and-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    gap: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-wrapper span {
    font-size: 0.95rem;
    color: #333;
}

/* 表头全选框样式 */
.checkbox-wrapper-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    user-select: none;
}

.checkbox-wrapper-header input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.select-all-label {
    font-size: 0.85rem;
    color: #666;
    white-space: nowrap;
}

/* 表格容器 */
.table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
    margin-bottom: 20px;
}

/* 表格头部控件 */
.table-header-controls {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 5;
    background: white;
    padding: 5px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.data-table thead {
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
}

.data-table tbody tr {
    transition: all 0.3s;
}

.data-table tbody tr:hover:not(.disabled-row) {
    background: #f8f9ff;
}

.selected-row {
    background: #e7f3ff !important;
}

.disabled-row {
    background: #f5f5f5;
    opacity: 0.6;
}

.disabled-row input[type="checkbox"]:disabled {
    cursor: not-allowed;
}

.center-cell {
    text-align: center;
}

.text-cell {
    line-height: 1.6;
}

.empty-cell {
    text-align: center;
    padding: 40px !important;
    color: #999;
}

.audio-player {
    height: 32px;
    max-width: 200px;
}

.no-recording {
    color: #999;
    font-size: 0.9rem;
}

/* 消息提示样式 */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 9999;
    animation: slideInRight 0.3s ease-out;
    max-width: 300px;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 密码弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease-out;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 450px;
    animation: slideInDown 0.3s ease-out;
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px 12px 0 0;
    color: white;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.close-modal {
    font-size: 28px;
    font-weight: bold;
    color: white;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.close-modal:hover {
    opacity: 1;
}

.modal-body {
    padding: 30px 25px;
}

.modal-hint {
    margin-bottom: 20px;
    color: #666;
    font-size: 0.95rem;
}

.password-input {
    width: 100%;
    padding: 12px 15px;
    font-size: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s;
}

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

.modal-error {
    margin-top: 10px;
    padding: 10px;
    background-color: #f8d7da;
    color: #721c24;
    border-radius: 6px;
    font-size: 0.9rem;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 分页 */
.pagination {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.pagination-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.pagination-info {
    font-size: 1rem;
    color: #333;
    font-weight: 600;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

.pagination-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-page {
    padding: 8px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background: white;
    color: #333;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 40px;
}

.btn-page:hover:not(:disabled) {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-1px);
}

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

.btn-page.disabled,
.btn-page:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-ellipsis {
    padding: 8px;
    color: #999;
}

/* 响应式设计 - 移动端优化 */
@media (max-width: 768px) {
    /* 基础布局 */
    body {
        padding: 10px;
    }
    
    .container {
        padding: 5px;
    }
    
    /* 头部优化 - 极度紧凑 */
    .main-header {
        padding: 8px;
        margin-bottom: 8px;
    }
    
    .header-content {
        flex-direction: row;
        gap: 8px;
        align-items: center;
        justify-content: space-between;
    }
    
    .logo-section {
        gap: 6px;
        flex: 1;
    }
    
    .logo-icon {
        font-size: 1.5rem;
    }
    
    .logo-text h1 {
        font-size: 1.1rem;
    }
    
    .tagline {
        display: none; /* 移动端隐藏标语 */
    }
    
    /* 导航优化 */
    .main-nav {
        display: flex;
        gap: 4px;
    }
    
    .nav-item {
        padding: 6px 10px;
        font-size: 0.8rem;
        border-radius: 6px;
    }
    
    .nav-icon {
        font-size: 1rem;
    }
    
    .nav-text {
        display: none; /* 只显示图标 */
    }
    
    /* 录音人输入区 */
    .section {
        padding: 8px;
        margin-bottom: 8px;
    }
    
    .recorder-form {
        flex-direction: row;
        gap: 6px;
    }
    
    .name-input {
        flex: 1;
        font-size: 16px; /* 防止iOS自动缩放 */
        padding: 8px;
    }
    
    .recorder-form .btn {
        padding: 8px 12px;
    }
    
    /* 列表头部优化 */
    .section-header {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
        position: sticky;
        top: 0;
        background: white;
        z-index: 10;
        padding: 8px;
        margin: -8px -8px 8px -8px;
        border-bottom: 2px solid #e9ecef;
    }
    
    .header-left {
        width: 100%;
    }
    
    .header-left h2 {
        font-size: 1.1rem;
        margin-bottom: 4px;
    }
    
    .selection-info {
        flex-direction: row;
        gap: 8px;
        flex-wrap: wrap;
        font-size: 0.8rem;
    }
    
    /* 按钮区域优化 - 单行四个按钮 */
    .header-right {
        width: 100%;
        flex-direction: row;
        flex-wrap: nowrap; /* 强制单行 */
        gap: 4px;
        overflow-x: auto; /* 如果太窄可以横向滚动 */
        -webkit-overflow-scrolling: touch;
    }
    
    .header-right .btn {
        flex: 1;
        min-width: fit-content;
        justify-content: center;
        padding: 6px 8px;
        font-size: 0.8rem;
        white-space: nowrap;
    }
    
    .header-right .btn span {
        font-size: 0.9rem; /* 图标稍小 */
        margin-right: 2px;
    }
    
    /* 筛选器优化 - 单行紧凑 */
    .filter-controls {
        flex-direction: row;
        gap: 4px;
        margin-top: 6px;
        align-items: center;
    }
    
    .filter-group {
        display: flex;
        gap: 3px;
        align-items: center;
    }
    
    .filter-group label {
        font-size: 0.7rem;
        white-space: nowrap;
        min-width: fit-content;
    }
    
    .filter-select,
    .page-size-select {
        font-size: 13px;
        padding: 4px 6px;
        min-width: 70px;
    }
    
    /* 表格优化 - 横向滚动 */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* iOS平滑滚动 */
        margin: 0 -8px; /* 表格撑满容器 */
    }
    
    .data-table {
        font-size: 0.75rem;
        min-width: 650px; /* 稍微减小最小宽度 */
    }
    
    .data-table th,
    .data-table td {
        padding: 6px 4px;
        white-space: nowrap;
    }
    
    .text-cell {
        max-width: 180px;
        white-space: normal;
        word-break: break-all;
        font-size: 0.7rem;
    }
    
    /* 复选框优化 - 增大点击区域 */
    .checkbox-wrapper-header {
        padding: 5px;
    }
    
    .checkbox-wrapper-header input[type="checkbox"],
    .row-checkbox {
        width: 20px;
        height: 20px;
        cursor: pointer;
    }
    
    .select-all-label {
        font-size: 0.75rem;
    }
    
    /* 音频播放器优化 */
    .audio-player {
        height: 28px;
        max-width: 120px;
    }
    
    /* 分页和操作区优化 */
    .pagination-and-actions {
        flex-direction: column;
        gap: 12px;
        padding: 12px;
    }
    
    .checkbox-wrapper {
        font-size: 0.9rem;
    }
    
    .checkbox-wrapper input[type="checkbox"] {
        width: 20px;
        height: 20px;
    }
    
    .pagination-wrapper {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .pagination-info {
        text-align: center;
        font-size: 0.9rem;
    }
    
    .pagination-buttons {
        justify-content: center;
        gap: 6px;
    }
    
    .btn-page {
        padding: 8px 12px;
        font-size: 0.85rem;
        min-width: 36px;
    }
    
    /* 移动端按钮文字简化 */
    #exportBtn,
    #downloadTemplateBtn,
    #importBtn {
        font-size: 0;
    }
    
    #exportBtn::before {
        content: '📊 导出';
        font-size: 0.85rem;
    }
    
    #downloadTemplateBtn::before {
        content: '📄 模板';
        font-size: 0.85rem;
    }
    
    #importBtn::before {
        content: '📥 导入';
        font-size: 0.85rem;
    }
    
    #exportBtn span,
    #downloadTemplateBtn span,
    #importBtn span {
        display: none;
    }
    
    /* 模态框优化 */
    .modal-content {
        width: 95%;
        max-width: none;
        margin: 10px;
    }
    
    .modal-header h3 {
        font-size: 1.1rem;
    }
    
    .modal-body {
        padding: 20px 15px;
    }
    
    .password-input {
        font-size: 16px; /* 防止iOS自动缩放 */
        padding: 12px;
    }
    
    .modal-footer {
        padding: 15px;
        flex-direction: row;
    }
    
    .modal-footer .btn {
        flex: 1;
        padding: 12px;
    }
    
    /* 消息提示优化 */
    .message {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        font-size: 0.9rem;
    }
}

/* 超小屏幕优化 (手机竖屏) */
@media (max-width: 480px) {
    .logo-text h1 {
        font-size: 1rem;
    }
    
    .nav-item {
        padding: 5px 8px;
        font-size: 0.75rem;
    }
    
    .header-right .btn {
        padding: 5px 6px;
        font-size: 0.75rem;
    }
    
    .header-right .btn span {
        font-size: 0.85rem;
        margin-right: 1px;
    }
    
    .filter-group label {
        font-size: 0.65rem;
    }
    
    .filter-select,
    .page-size-select {
        font-size: 12px;
        padding: 3px 4px;
        min-width: 60px;
    }
    
    .data-table {
        font-size: 0.7rem;
    }
    
    .btn-page {
        padding: 5px 8px;
        font-size: 0.75rem;
        min-width: 28px;
    }
    
    .section {
        padding: 6px;
    }
}
