/*=================================================================================
 方言语音库 - 通用样式
=================================================================================*/

/* 基础设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* 导航栏 */
.navbar {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar .logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #333;
    font-size: 1.2rem;
    font-weight: bold;
}

.nav-menu {
    display: flex;
    gap: 0.5rem;
}

.nav-menu a {
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: #666;
    border-radius: 6px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.nav-menu a:hover,
.nav-menu a.active {
    background: #1890ff;
    color: #fff;
}

/* 主内容区 */
.main-content {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* 统计卡片 */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.stat-icon.hanzi {
    background: #e6f7ff;
    color: #1890ff;
}

.stat-icon.voice {
    background: #f6ffed;
    color: #52c41a;
}

.stat-icon.dialect {
    background: #fffbe6;
    color: #faad14;
}

.stat-info .stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
}

.stat-info .stat-label {
    color: #666;
    font-size: 0.9rem;
}

/* 方言选择器 */
.dialect-selector {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.dialect-selector h3 {
    margin-bottom: 1rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dialect-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.dialect-tab {
    padding: 0.6rem 1.2rem;
    background: #f0f0f0;
    color: #333;
    text-decoration: none;
    border-radius: 20px;
    transition: all 0.3s;
}

.dialect-tab:hover,
.dialect-tab.active {
    background: #1890ff;
    color: #fff;
}

/* 汉字网格 */
.hanzi-grid {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.hanzi-grid h2 {
    margin-bottom: 1.5rem;
    color: #333;
}

.hanzi-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.hanzi-item {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s;
    cursor: pointer;
}

.hanzi-item:hover {
    background: #e6f7ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.hanzi-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.hanzi-icon {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hanzi-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hanzi-icon i {
    font-size: 1.5rem;
    color: #999;
}

.hanzi-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.hanzi-char {
    font-size: 1.8rem;
    font-weight: bold;
    color: #1890ff;
    line-height: 1.2;
}

.hanzi-pinyin {
    color: #666;
    font-size: 0.95rem;
    font-family: 'Courier New', monospace;
}

.hanzi-english {
    color: #999;
    font-size: 0.85rem;
    font-style: italic;
}

.hanzi-right {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.hanzi-actions {
    display: none;
}

/* 按钮 */
.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    text-decoration: none;
}

.btn-primary {
    background: #1890ff;
    color: #fff;
}

.btn-primary:hover {
    background: #096dd9;
}

.btn-secondary {
    background: #52c41a;
    color: #fff;
}

.btn-secondary:hover {
    background: #389e0d;
}

.btn-danger {
    background: #ff4d4f;
    color: #fff;
}

.btn-danger:hover {
    background: #cf1322;
}

.btn-play {
    background: #1890ff;
    color: #fff;
}

.btn-record {
    background: #52c41a;
    color: #fff;
}

.btn-stop {
    background: #ff4d4f;
    color: #fff;
}

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    padding: 0;
}

.btn-close:hover {
    color: #333;
}

.modal-body {
    padding: 1.5rem;
}

/* 录音预览 */
.record-preview {
    text-align: center;
    margin-bottom: 2rem;
}

.preview-char {
    font-size: 4rem;
    font-weight: bold;
    color: #1890ff;
    margin-bottom: 1rem;
}

.preview-info {
    margin-bottom: 1rem;
}

.preview-text {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.dialect-name {
    color: #1890ff;
    font-weight: bold;
}

.preview-tips {
    color: #666;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 录音控制 */
.record-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.btn-record-main {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* 录音状态 */
.record-status {
    text-align: center;
    margin-top: 1.5rem;
}

.timer {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 1rem;
}

.waveform {
    display: flex;
    justify-content: center;
    gap: 0.3rem;
    height: 60px;
    align-items: center;
}

.wave {
    width: 6px;
    height: 20px;
    background: #1890ff;
    border-radius: 3px;
    animation: wave 1s ease-in-out infinite;
}

.wave:nth-child(1) { animation-delay: 0s; }
.wave:nth-child(2) { animation-delay: 0.1s; }
.wave:nth-child(3) { animation-delay: 0.2s; }

@keyframes wave {
    0%, 100% { height: 20px; }
    50% { height: 60px; }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #999;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
}

.empty-state p {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.page-link {
    padding: 0.6rem 1.2rem;
    background: #fff;
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.page-link:hover,
.page-link.active {
    background: #1890ff;
    color: #fff;
}

.page-dots {
    padding: 0.6rem 1.2rem;
    color: #999;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 1.25rem;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-close:hover {
    color: #333;
}

.modal-body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.6rem 1rem;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

.record-preview {
    background: #f0f5ff;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.preview-char {
    font-size: 4rem;
    font-weight: bold;
    color: #1890ff;
    margin-bottom: 0.5rem;
}

.preview-info {
    color: #666;
}

.preview-text {
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.dialect-name {
    color: #1890ff;
    font-weight: bold;
}

.preview-tips {
    font-size: 0.9rem;
    color: #999;
}

.audio-preview {
    margin-bottom: 1.5rem;
}

.audio-preview audio {
    width: 100%;
    margin: 0.5rem 0;
}

.btn-retry {
    margin-top: 0.5rem;
}

.record-controls {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.btn-record-main {
    background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
    color: #fff;
    padding: 0.8rem 2rem;
    font-size: 1rem;
}

.btn-record-main:hover {
    background: linear-gradient(135deg, #096dd9 0%, #0050b3 100%);
}

.btn-stop {
    background: #ff4d4f;
    color: #fff;
    padding: 0.8rem 2rem;
    font-size: 1rem;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.btn-submit {
    background: #52c41a;
    color: #fff;
    padding: 0.8rem 2rem;
    font-size: 1rem;
}

.btn-submit:hover {
    background: #389e0d;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.record-status {
    display: none;
    text-align: center;
    padding: 1rem;
    background: #f5f5f5;
    border-radius: 8px;
}

.record-status.show {
    display: block;
}

.waveform {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    height: 40px;
    align-items: center;
    margin-top: 0.5rem;
}

.wave {
    width: 8px;
    height: 15px;
    background: #1890ff;
    border-radius: 4px;
    animation: wave 1s ease-in-out infinite;
}

.wave:nth-child(1) { animation-delay: 0s; }
.wave:nth-child(2) { animation-delay: 0.1s; }
.wave:nth-child(3) { animation-delay: 0.2s; }
.wave:nth-child(4) { animation-delay: 0.3s; }
.wave:nth-child(5) { animation-delay: 0.4s; }

@keyframes wave {
    0%, 100% { height: 15px; }
    50% { height: 40px; }
}

.record-tips {
    background: #fff7e6;
    border-left: 4px solid #faad14;
    padding: 1rem;
    border-radius: 6px;
}

.tip-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

.tip-item:last-child {
    margin-bottom: 0;
}

.tip-item i {
    color: #faad14;
}

/* 响应式 */
@media (max-width: 768px) {
    .navbar-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-menu a {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .hanzi-item {
        padding: 0.8rem 1rem;
    }
    
    .hanzi-icon {
        width: 40px;
        height: 40px;
    }
    
    .hanzi-char {
        font-size: 1.5rem;
    }
    
    .hanzi-pinyin {
        font-size: 0.85rem;
    }
    
    .hanzi-english {
        font-size: 0.75rem;
    }
    
    .hanzi-right {
        flex-direction: column;
        gap: 0.3rem;
    }
    
    .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .dialect-tabs {
        justify-content: center;
    }
    
    .dialect-tab {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .record-controls {
        flex-direction: column;
    }
    
    .record-controls .btn {
        width: 100%;
        justify-content: center;
    }
    
    .preview-char {
        font-size: 3rem;
    }
    
    .record-tips {
        padding: 0.75rem;
    }
}

/* 录音列表 */
.recording-item {
    background: #f9f9f9;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.recording-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.recording-hanzi {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
}

.recording-dialect {
    color: #666;
    font-size: 0.9rem;
}

.status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-approved {
    background: #e6f7e6;
    color: #52c41a;
}

.status-pending {
    background: #fffbe6;
    color: #faad14;
}

.status-rejected {
    background: #fff1f0;
    color: #ff4d4f;
}

.recording-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
}
