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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    text-align: center;
    padding: 40px 20px;
    color: white;
}

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

.header h1 i {
    margin-right: 10px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 搜索区域 */
.search-section {
    margin: 30px 0;
}

.search-form {
    max-width: 600px;
    margin: 0 auto;
}

.search-wrapper {
    display: flex;
    background: white;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.search-input {
    flex: 1;
    padding: 18px 25px;
    border: none;
    font-size: 16px;
    outline: none;
    background: transparent;
}

.search-btn {
    padding: 18px 35px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4192 100%);
}

/* 卡片通用样式 */
.card {
    background: white;
    border-radius: 15px;
    margin-bottom: 25px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
}

.card-header {
    padding: 20px 25px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.card-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #444;
}

.card-header h2 i {
    margin-right: 8px;
    color: #667eea;
}

.card-body {
    padding: 25px;
}

/* 翻译显示 */
.translation-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    color: white;
    margin-bottom: 20px;
}

.chinese, .english {
    font-size: 1.8rem;
    font-weight: 700;
}

.arrow {
    font-size: 2rem;
    opacity: 0.7;
}

.common-greetings h3 {
    font-size: 1rem;
    color: #666;
    margin-bottom: 12px;
}

.greeting-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    padding: 6px 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* 语音朗读 */
.btn-play {
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-play:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.voice-hint {
    display: inline-block;
    margin-left: 15px;
    color: #999;
    font-size: 0.9rem;
}

/* 音标显示 */
.phonetic-display {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ipa {
    font-size: 1.5rem;
    font-family: 'Arial', sans-serif;
    color: #667eea;
    font-weight: 600;
}

/* 场景列表 */
.scenes-list {
    display: grid;
    gap: 15px;
}

.scene-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.scene-label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.scene-badge {
    padding: 3px 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.expression {
    font-weight: 600;
    color: #333;
}

.example {
    color: #666;
    font-style: italic;
    padding-left: 5px;
}

.example i {
    color: #667eea;
    margin-right: 8px;
    opacity: 0.6;
}

/* 文化注释 */
.culture-content {
    display: grid;
    gap: 20px;
}

.culture-content h3 {
    font-size: 1rem;
    color: #667eea;
    margin-bottom: 8px;
}

.culture-content p {
    color: #666;
    line-height: 1.8;
}

/* 拼写练习 */
.spelling-input-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.spelling-input {
    flex: 1;
    padding: 12px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

.spelling-input:focus {
    border-color: #667eea;
}

.btn-check {
    padding: 12px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.3s;
}

.btn-check:hover {
    opacity: 0.9;
}

.spelling-result {
    margin-top: 15px;
    padding: 12px;
    border-radius: 8px;
    display: none;
}

.spelling-result.correct {
    display: block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.spelling-result.incorrect {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 历史记录 */
.history-list {
    display: grid;
    gap: 8px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s;
}

.history-item:hover {
    background: #e9ecef;
    transform: translateX(3px);
}

.history-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-chinese {
    font-weight: 600;
    color: #333;
}

.history-arrow {
    color: #667eea;
    font-size: 0.9rem;
}

.history-english {
    color: #667eea;
    font-weight: 500;
}

.history-time {
    color: #999;
    font-size: 0.85rem;
}

.empty-history {
    text-align: center;
    color: #999;
    padding: 30px;
}

/* 按钮通用 */
.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s;
    color: #666;
    font-size: 1.1rem;
}

.btn-icon:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.btn-sm {
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.btn-sm:hover {
    opacity: 0.9;
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px;
    color: white;
    opacity: 0.8;
}

/* 管理后台样式 */
.admin-login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

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

.login-card h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 1.8rem;
}

.login-card h1 i {
    color: #667eea;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #555;
}

.form-group label i {
    margin-right: 6px;
    color: #667eea;
}

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

.form-group input:focus, .form-group textarea:focus {
    border-color: #667eea;
    outline: none;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-login:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.back-link {
    display: block;
    text-align: center;
    margin-top: 20px;
    color: #667eea;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

/* 管理面板 */
.admin-page {
    background: #f5f7fa;
}

.admin-container {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 250px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 20px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.admin-sidebar h2 {
    font-size: 1.3rem;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.admin-sidebar nav a {
    display: block;
    padding: 12px 15px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 5px;
    transition: all 0.3s;
}

.admin-sidebar nav a:hover, .admin-sidebar nav a.active {
    background: rgba(255,255,255,0.15);
    color: white;
}

.admin-sidebar nav a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.admin-main {
    flex: 1;
    margin-left: 250px;
    padding: 30px;
}

.admin-main h1 {
    color: #333;
    margin-bottom: 30px;
    font-size: 2rem;
}

.admin-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.admin-section h2 {
    color: #444;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.admin-section h2 i {
    color: #667eea;
    margin-right: 8px;
}

/* 表格样式 */
.table-wrapper {
    overflow-x: auto;
}

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

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

.admin-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
}

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

/* 表单样式 */
.admin-form {
    max-width: 800px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
}

.scene-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.scene-row input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.scene-row input.wide {
    flex: 2;
}

.btn-primary {
    padding: 14px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* 提示消息 */
.alert {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

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

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

.empty-data {
    text-align: center;
    color: #999;
    padding: 30px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .translation-display {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .chinese, .english {
        font-size: 1.4rem;
    }
    
    .arrow {
        transform: rotate(90deg);
    }
    
    .admin-container {
        flex-direction: column;
    }
    
    .admin-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 20px;
    }
    
    .admin-main {
        margin-left: 0;
        padding: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .scene-row {
        flex-direction: column;
    }
}