/* ====================================
   民间谚语工具 - 专用样式
   ==================================== */

/* ========== 基础布局 ========== */
.tool-header h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2em;
}

.section-title {
    font-size: 1.8em;
    color: #2c3e50;
    margin: 30px 0 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-subtitle {
    color: #666;
    font-size: 1em;
    margin: -10px 0 20px 0;
}

/* ========== 今日谚语展示区 ========== */
.today-proverb-section {
    margin-bottom: 40px;
}

.today-proverb-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 50px 40px;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.today-proverb-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(102, 126, 234, 0.4);
}

.today-proverb-card::before {
    content: '📜';
    position: absolute;
    top: -30px;
    left: -30px;
    font-size: 150px;
    opacity: 0.1;
}

.proverb-content {
    font-size: 2em;
    color: white;
    line-height: 1.6;
    font-weight: 500;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

.proverb-category {
    display: inline-block;
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    color: white;
    font-size: 0.9em;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.proverb-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

.btn-action {
    padding: 12px 30px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.btn-action:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-action:active {
    transform: translateY(0);
}

.btn-action.favorited {
    background: rgba(255, 100, 100, 0.3);
    border-color: rgba(255, 100, 100, 0.5);
}

/* ========== 搜索区域 ========== */
.search-section {
    margin-bottom: 40px;
}

.search-box {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.search-input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 30px;
    font-size: 1em;
    outline: none;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-primary {
    padding: 15px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    padding: 10px 25px;
    background: #f5f5f5;
    color: #333;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #e8e8e8;
    border-color: #ccc;
}

/* ========== 搜索结果 ========== */
.search-results {
    margin-top: 20px;
}

.search-result-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.search-result-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
    transform: translateX(5px);
}

.search-result-content {
    font-size: 1.2em;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.6;
}

.search-result-content .highlight {
    background: #fff3cd;
    color: #856404;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

.search-result-category {
    display: inline-block;
    padding: 4px 12px;
    background: #f0f0f0;
    color: #666;
    border-radius: 12px;
    font-size: 0.85em;
}

.search-no-results {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 1.1em;
}

/* ========== 分类网格 ========== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.category-card {
    background: white;
    border: 2px solid #f0f0f0;
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.category-card:hover::before {
    transform: scaleX(1);
}

.category-card:hover {
    border-color: #667eea;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
    transform: translateY(-5px);
}

.category-icon {
    font-size: 3em;
    margin-bottom: 15px;
    display: block;
}

.category-name {
    font-size: 1.1em;
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 8px;
}

.category-count {
    font-size: 0.9em;
    color: #999;
}

/* ========== 谚语列表 ========== */
.category-proverbs-section {
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.proverbs-list {
    display: grid;
    gap: 15px;
}

.proverb-item {
    background: white;
    border-left: 4px solid #667eea;
    border-radius: 12px;
    padding: 20px 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.proverb-item:hover {
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.15);
    transform: translateX(5px);
}

.proverb-text {
    flex: 1;
    font-size: 1.15em;
    color: #333;
    line-height: 1.6;
}

.proverb-item-actions {
    display: flex;
    gap: 10px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: #667eea;
    transform: scale(1.1);
}

.btn-icon.favorited {
    background: #ff6b6b;
}

/* ========== 收藏区域 ========== */
.favorites-section {
    margin-bottom: 40px;
    background: #f9f9f9;
    border-radius: 16px;
    padding: 30px;
}

.favorites-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.favorites-header .section-title {
    margin: 0;
}

.favorites-content {
    margin-top: 20px;
}

.favorites-list {
    display: grid;
    gap: 15px;
}

.favorite-item {
    background: white;
    border-radius: 12px;
    padding: 20px 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
}

.favorite-item:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.favorite-content {
    flex: 1;
}

.favorite-text {
    font-size: 1.1em;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.6;
}

.favorite-category {
    display: inline-block;
    padding: 4px 12px;
    background: #f0f0f0;
    color: #666;
    border-radius: 12px;
    font-size: 0.85em;
}

.favorites-empty {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 1.1em;
}

/* ========== 加载动画 ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
    .tool-header h1 {
        font-size: 1.5em;
    }

    .section-title {
        font-size: 1.4em;
    }

    .proverb-content {
        font-size: 1.5em;
    }

    .proverb-actions {
        flex-wrap: wrap;
    }

    .btn-action {
        padding: 10px 20px;
        font-size: 0.9em;
    }

    .search-box {
        flex-direction: column;
        gap: 10px;
    }

    .btn-primary {
        width: 100%;
    }

    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .category-card {
        padding: 20px 15px;
    }

    .category-icon {
        font-size: 2.5em;
    }

    .category-name {
        font-size: 1em;
    }

    .proverb-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .proverb-text {
        font-size: 1.05em;
    }

    .proverb-item-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .favorites-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .favorite-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .today-proverb-card {
        padding: 40px 25px;
    }
}

@media (max-width: 480px) {
    .tool-header h1 {
        font-size: 1.3em;
    }

    .proverb-content {
        font-size: 1.3em;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .today-proverb-card {
        padding: 30px 20px;
    }
}

/* ========== 消息提示 ========== */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    animation: slideInRight 0.3s ease;
}

.toast.success {
    background: #4caf50;
}

.toast.error {
    background: #f44336;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.toast.hide {
    animation: slideOutRight 0.3s ease forwards;
}
