/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

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

/* 标签头部样式 */
.tags-header {
    background-color: #e8e8e8;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: min-height 0.3s ease;
}

.tags-header.has-bg {
    background-color: transparent;
}

.tags-header.has-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    filter: brightness(0.7);
    z-index: 0;
}

.header-settings {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 100;
}

.settings-btn {
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.settings-btn:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.settings-panel {
    display: none;
    position: absolute;
    top: 45px;
    right: 0;
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    min-width: 200px;
}

.settings-panel.active {
    display: block;
}

.settings-panel label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: #333;
}

.settings-panel input[type="file"] {
    display: block;
    margin-bottom: 10px;
    width: 100%;
}

.settings-panel button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.3s;
}

.settings-panel button:hover {
    background-color: #45a049;
}

#removeBgBtn {
    background-color: #f44336 !important;
    margin-top: 5px;
}

#removeBgBtn:hover {
    background-color: #d32f2f !important;
}

.header-content {
    position: relative;
    z-index: 1;
    padding: 30px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tags-header h1 {
    text-align: center;
    margin-bottom: 15px;
    color: #555;
}

.has-bg .tags-header h1,
.has-bg .header-content h1,
.has-bg .tags-label,
.has-bg .tag-item {
    color: white;
}

.has-bg .tag-item {
    background-color: rgba(255, 255, 255, 0.3);
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.tags-label {
    font-weight: bold;
    color: #666;
}

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

.tag-item {
    background-color: #e0e0e0;
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tag-item .remove-tag {
    cursor: pointer;
    color: #999;
    font-size: 16px;
}

.tag-item .remove-tag:hover {
    color: #f44336;
}

.add-tag-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.add-tag-btn:hover {
    background-color: #45a049;
}

/* 文章卡片容器 */
.articles-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* 文章卡片样式 */
.article-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.article-thumbnail {
    height: 180px;
    background-color: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
}

.article-content {
    padding: 15px;
}

.article-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.article-excerpt {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.4;
}

.article-meta {
    font-size: 12px;
    color: #999;
    display: flex;
    justify-content: space-between;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 400px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.modal h2 {
    margin-bottom: 20px;
    color: #333;
}

#tagInput {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

#saveTagBtn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

#saveTagBtn:hover {
    background-color: #45a049;
}

/* 标签列表页面样式 */
.wptags-list-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.tags-list-header {
    background-color: #f0f0f0;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tags-list-header h1 {
    color: #555;
    font-size: 24px;
}

.tags-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.tags-grid .tag-item {
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
    text-decoration: none;
    color: #333;
    display: block;
}

.tags-grid .tag-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    background-color: #f5f5f5;
}

.tag-count {
    font-size: 12px;
    color: #999;
    margin-left: 5px;
}

.no-tags {
    grid-column: 1 / -1;
    text-align: center;
    color: #999;
    padding: 40px 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header-content {
        padding: 20px 15px;
    }
    
    .tags-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .tags-list {
        width: 100%;
    }
    
    .add-tag-btn {
        align-self: flex-start;
    }
    
    .articles-container {
        grid-template-columns: 1fr;
    }
    
    .tags-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .articles-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tags-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
}