/* 全局样式 */
body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f9f9f9;
    color: #333;
    white-space: normal;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

.hidden {
    display: none;
}

.visible {
    display: block;
}

a {
    color: #0066cc;
    text-decoration: none;
    white-space: normal;
}

a:hover {
    text-decoration: underline;
}

/* 顶部区域样式 */
.header-container {
    display: flex;
    justify-content: center;
    margin: 0 auto;
    width: 800px;
    background-color: #2c3e50;
}

.header-content {
    padding: 20px 0;
    text-align: center;
    width: 100%;
}

.logo-container {
    margin-bottom: 15px;
}

.logo {
    color: white;
    margin: 0;
    font-size: 28px;
}

.logo-description {
    color: #bdc3c7;
    margin: 5px 0 15px;
    font-size: 14px;
    white-space: pre-wrap;
}

/* 搜索框样式 */
.search-container {
    margin: 0 auto;
    max-width: 600px;
}

.search-form {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.search-box {
    display: flex;
    width: 100%;
}

.search-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 16px;
    outline: none;
}

.search-input:focus {
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
}

.search-button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.search-button:hover {
    background-color: #2980b9;
}

.search-button:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

.search-button.loading {
    position: relative;
    padding-left: 35px;
}

.search-button.loading::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

.search-tips {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 5px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: pre-wrap;
}

.search-tips.error {
    color: #e74c3c;
    background-color: #ffebee;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #ef9a9a;
    opacity: 1;
}

/* 主内容区域样式 */
.main-container {
    padding: 20px 0;
    width: 800px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 22px;
}

.site-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    padding: 0;
    list-style: none;
}

.site-item {
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px 15px;
    text-align: center;
    transition: box-shadow 0.2s; /* 仅保留阴影过渡（实际已无阴影） */
    display: block;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-item:hover {
    /* 已移除阴影特效 */
    text-decoration: none;
}

.site-info {
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: left;
}

.site-info h3 {
    margin-top: 0;
    color: #2c3e50;
    font-size: 20px;
}

/* 核心修复：链接换行对齐逻辑 */
.site-detail {
    margin: 8px 0;
    display: flex;
    align-items: flex-start;
    width: 100%;
}

.site-detail strong {
    width: 120px;
    color: #7f8c8d;
    font-weight: normal;
    flex-shrink: 0;
    padding-top: 2px;
}

.site-detail .site-content {
    flex: 1;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: normal;
}

.site-detail .site-content a,
.site-detail .site-content span {
    white-space: normal;
}

.site-description {
    line-height: 1.6;
    margin-top: 15px;
    white-space: pre-wrap;
}

/* TAG标签页样式 */
.tag-cloud {
    text-align: center;
    padding: 20px 0;
}

.tag-item {
    display: inline-block;
    margin: 5px;
    padding: 5px 15px;
    background-color: #ecf0f1;
    border-radius: 15px;
    transition: background-color 0.3s;
}

.tag-item:hover {
    background-color: #bdc3c7;
    text-decoration: none;
}

/* 底部区域样式 */
.footer-container {
    display: flex;
    justify-content: center;
    margin: 0 auto;
    width: 800px;
    background-color: #2c3e50;
    margin-top: 30px;
}

.footer-content {
    padding: 20px 0;
    text-align: center;
    color: white;
    width: 100%;
    white-space: pre-wrap;
}

.footer-links {
    margin-bottom: 15px;
}

.footer-link {
    color: white;
    margin: 0 10px;
    display: inline-block;
    margin-bottom: 8px;
}

.footer-text {
    font-size: 14px;
    color: #bdc3c7;
}

/* 返回顶部按钮 */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

#back-to-top.visible {
    opacity: 1;
}

#back-to-top:hover {
    background-color: #2980b9;
}

/* 响应式布局 */
@media (max-width: 800px) {
    .header-container,
    .main-container,
    .footer-container {
        width: 100%;
        padding: 0 15px;
        box-sizing: border-box;
    }

    .site-list {
        grid-template-columns: 1fr;
    }

    .site-detail strong {
        width: 80px;
    }
}

h3 {
    text-align: center;
    margin: 0 auto;
    width: fit-content;
}

a.special-link {
  display: inline-block;
  padding: 4px 16px;
  border: 2px solid #6495ED;
  border-radius: 50px;
  background-color: #6495ED;
  color: white;
  text-decoration: none;
  transition: all 0.3s ease;
  line-height: 1;
}

a.special-link:hover {
  background-color: #4876FF;
  border-color: #4876FF;
}

/* 站长工具区域样式 */
.tools-section {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.tools-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.tool-item {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px 10px;
    text-align: center;
    transition: all 0.3s ease;
    display: block;
    color: #333;
    border: 1px solid #eee;
    font-weight: 500;
}

.tool-item:hover {
    /* 已移除阴影特效 */
    text-decoration: none;
    color: #3498db;
    border-color: #3498db;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .tools-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .tools-list {
        grid-template-columns: 1fr;
    }
    
    .tool-item {
        padding: 15px 10px;
        font-size: 14px;
    }
}