/**
 * 公用样式文件
 * 包含导航链接、首页按钮、生词按钮、生词本页面样式
 */

/* 导航链接样式 */
.nav-link {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9em;
    transition: background 0.3s;
}

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

/* 深色背景的导航链接 */
.nav-link-dark {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 16px;
    background: rgba(44, 62, 80, 0.2);
    color: #2c3e50;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9em;
    transition: background 0.3s;
}

.nav-link-dark:hover {
    background: rgba(44, 62, 80, 0.3);
}

/* 返回首页按钮 */
.back-home {
    position: absolute;
    top: 20px;
    left: 20px;
    display: inline-block;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9em;
    transition: background 0.3s;
    z-index: 10;
}

.back-home:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 深色背景的返回首页按钮 */
.back-home-dark {
    position: absolute;
    top: 20px;
    left: 20px;
    display: inline-block;
    padding: 8px 16px;
    background: rgba(44, 62, 80, 0.2);
    color: #2c3e50;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9em;
    transition: background 0.3s;
    z-index: 10;
}

.back-home-dark:hover {
    background: rgba(44, 62, 80, 0.3);
}

/* 生词按钮样式 */
.add-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 6px 12px;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    transition: background 0.3s;
    z-index: 5;
}

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

.add-btn.added {
    background: #95a5a6 !important;
    cursor: default;
}

/* 生词本页面样式 */
.vocabulary-book-container {
    padding: 20px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state .icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.empty-state h3 {
    font-size: 1.3em;
    margin-bottom: 10px;
    color: #666;
}

.word-card {
    position: relative;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
}

.word-header {
    display: flex;
    align-items: baseline;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 10px;
}

.word-en {
    font-weight: 700;
    color: #2c3e50;
    font-size: 1.1em;
}

.word-cn {
    color: #667eea;
    font-size: 0.95em;
    font-weight: 500;
}

.word-details {
    color: #555;
    font-size: 0.9em;
    margin-bottom: 8px;
    line-height: 1.5;
}

.example-box {
    background: #e8eaf6;
    padding: 10px 12px;
    border-radius: 6px;
    margin-top: 8px;
}

.example-en {
    color: #5c6bc0;
    font-style: italic;
    margin-bottom: 4px;
    font-size: 0.95em;
}

.example-cn {
    color: #7986cb;
    font-size: 0.9em;
}

.added-time {
    margin-top: 10px;
    font-size: 0.8em;
    color: #999;
    font-style: italic;
}

.delete-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border: none;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1em;
    line-height: 1;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-btn:hover {
    background: #ff3838;
    transform: scale(1.1);
}

.clear-all-btn {
    background: linear-gradient(135deg, #ff4757, #ff3838);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s;
}

.clear-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.3);
}

.vocabulary-count {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    font-weight: 600;
}

/* 短语组样式 */
.phrase-group {
    margin-bottom: 25px;
}

.phrase-group h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.1em;
    padding-bottom: 8px;
    border-bottom: 2px solid #667eea;
}

.phrase-item {
    background: #f8f9fa;
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: 6px;
    position: relative;
    border-left: 3px solid #667eea;
}

.phrase-en {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 1em;
}

.phrase-cn {
    color: #666;
    font-size: 0.9em;
}

/* 响应式调整 */
@media (max-width: 600px) {
    .back-home,
    .back-home-dark {
        top: 15px;
        left: 15px;
        padding: 6px 12px;
        font-size: 0.85em;
    }
    
    .add-btn {
        top: 8px;
        right: 8px;
        padding: 5px 10px;
        font-size: 0.8em;
    }
    
    .word-header {
        flex-direction: column;
    }
}
