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

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

/* 头部样式 */
.header {
    background-color: #1890ff;
    color: #fff;
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
    min-height: 110px;
}

/* 公告栏样式 */
.announcement-bar {
    background-color: #f0f7ff;
    border-bottom: 1px solid #e6f7ff;
    padding: 5px 0;
    margin-bottom: 0px;
}

.announcement-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: left;
}

.announcement-content p {
    margin: 0;
    color: #000000;
    font-size: 14px;
    font-weight: 500;
}

@media (max-width: 768px) {
    .announcement-content p {
        font-size: 12px;
    }
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
    z-index: 1;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2;
}

.header-left {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    position: relative;
}

.header-links {
    display: flex;
    flex-direction: column;
    gap: 3px;
    position: absolute;
    top: 0;
    right: -5px;
}

.header-link {
    color: #fff;
    text-decoration: none;
    font-size: 12px;
    transition: color 0.3s;
    white-space: nowrap;
}

.header-link:hover {
    color: #e6f7ff;
    text-decoration: underline;
}

.logo {
    flex-shrink: 0;
    position: relative;
    padding-right: 60px; /* 为头部链接留出空间 */
}

.logo img {
    vertical-align: middle;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-search {
    display: flex;
    align-items: center;
}

.header-search form {
    display: flex;
    gap: 5px;
}

.header-search input[type="text"] {
    padding: 6px 10px;
    border: 1px solid #fff;
    border-radius: 4px;
    font-size: 14px;
    width: 200px;
}

.header-search input[type="submit"] {
    padding: 6px 12px;
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid #fff;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.header-search input[type="submit"]:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.ad-space {
    flex-shrink: 0;
}

.ad-space img {
    vertical-align: middle;
    border-radius: 4px;
}

.current-time {
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .header-left {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
    
    .header-links {
        position: static;
        flex-direction: row;
        gap: 15px;
        margin-bottom: 10px;
    }
    
    .header-link {
        font-size: 14px;
    }
    
    .logo {
        padding-right: 0;
    }
    
    .header-right {
        flex-direction: column;
        gap: 10px;
    }
    
    .ad-space img {
        width: 100%;
        max-width: 300px;
        height: auto;
    }
    
    .header-search input[type="text"] {
        width: 150px;
    }
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    gap: 20px;
}

/* 主内容区域 */
.main-content {
    flex: 1;
}

/* 侧边栏 */
.sidebar {
    width: 250px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 20px;
}

/* 侧边栏区块 */
.sidebar-section {
    margin-bottom: 30px;
}

.sidebar-section h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: #1890ff;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 8px;
}

.ad-box {
    display: flex;
    justify-content: center;
    align-items: center;
}

.ad-box img {
    width: 200px;
    height: 200px;
    border-radius: 4px;
    transition: transform 0.3s;
}

.ad-box img:hover {
    transform: scale(1.02);
}

/* 国家列表 */
.country-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    list-style: none;
}

.country-list li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.country-list li:last-child {
    border-bottom: none;
}

.country-list li a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
    display: block;
}

.country-list li a:hover {
    color: #1890ff;
    padding-left: 5px;
}

/* 首页侧边栏国家分类样式 */
.sidebar .country-list {
    display: flex;
    flex-direction: column;
    gap: 0px;
    list-style: none;
}

.sidebar .continent-item {
    margin-bottom: 0px;
}

.sidebar .continent-item h4 {
    font-size: 14px;
    margin-bottom: 0px;
    color: #1890ff;
    font-weight: bold;
    padding-left: 5px;
    border-left: 3px solid #1890ff;
}

.sidebar .continent-countries {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 5px;
    padding-left: 15px;
    align-items: center;
}

.sidebar .country-item {
    padding: 0;
    display: inline;
}

.sidebar .country-item a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
    display: inline;
    font-size: 13px;
}

.sidebar .country-item a:hover {
    color: #1890ff;
    padding-left: 0;
    text-decoration: underline;
}

/* 网站类别网格布局 */
.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.category-item {
    background-color: #f9f9f9;
    border-radius: 4px;
    padding: 8px;
    text-align: center;
    transition: background-color 0.3s;
}

.category-item:hover {
    background-color: #f0f7ff;
}

.category-item a {
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
    display: block;
}

.category-item a:hover {
    color: #1890ff;
}

@media (max-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        order: -1;
    }
}

/* 搜索框样式 */
.search-box {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 30px;
    margin-bottom: 30px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.search-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

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

.search-box input[type="text"] {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #1890ff;
    border-radius: 4px 0 0 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.search-box input[type="text"]:focus {
    outline: none;
    border-color: #40a9ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.search-box input[type="submit"] {
    padding: 12px 24px;
    background-color: #1890ff;
    color: #fff;
    border: none;
    border-radius: 0 4px 4px 0;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-box input[type="submit"]:hover {
    background-color: #40a9ff;
}

/* 分类样式 */
.category {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 10px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.category:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.category h2 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #1890ff;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 5px;
    position: relative;
}

.category h2::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background-color: #1890ff;
}

/* 网站列表样式 */
.websites {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.website-item {
    background-color: #f9f9f9;
    border-radius: 6px;
    padding: 12px;
    transition: all 0.3s;
    border-left: 4px solid transparent;
    text-align: center;
}

.website-item:hover {
    background-color: #f0f7ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-left-color: #1890ff;
}

.website-item h3 {
    font-size: 14px;
    margin: 0;
}

.website-item h3 a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
    display: block;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.website-item h3 a:hover {
    color: #1890ff;
}

.website-item h3 a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: #1890ff;
    transition: width 0.3s;
}

.website-item h3 a:hover::after {
    width: 100%;
}

/* 全球名站导航 */
.global-websites {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 5px;
}

@media (min-width: 1200px) {
    .global-websites {
        grid-template-columns: repeat(8, 1fr);
    }
}

@media (max-width: 768px) {
    .global-websites {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

/* 网站类别导航 */
.category-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.category-row {
    display: flex;
    align-items: center;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 6px;
    transition: background-color 0.3s;
}

.category-row:hover {
    background-color: #f0f7ff;
}

.category-row .category-name {
    width: 70px;
    font-weight: bold;
    margin-right: 10px;
    flex-shrink: 0;
}

.category-name a {
    color: #1890ff;
    text-decoration: none;
    transition: color 0.3s;
}

.category-name a:hover {
    color: #40a9ff;
    text-decoration: underline;
}

.category-websites {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(11, 1fr);
    gap: 10px;
    align-items: center;
}

.category-websites .website-item.small {
    min-width: 0;
}

.category-websites .website-item.small a {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 100%;
}

.website-item.small {
    background: none;
    border: none;
    padding: 0;
    text-align: center;
    box-shadow: none;
    transition: none;
}

.website-item.small:hover {
    background: none;
    transform: none;
    box-shadow: none;
}

.website-item.small a {
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.website-item.small a:hover {
    color: #1890ff;
    text-decoration: underline;
}

/* 网站类别页面样式 */
.category-websites-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.website-row {
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 6px;
    transition: background-color 0.3s;
}

.website-row:hover {
    background-color: #f0f7ff;
}

.website-row h3 {
    font-size: 16px;
    margin-bottom: 8px;
}

.website-row h3 a {
    color: #1890ff;
    text-decoration: none;
    transition: color 0.3s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 100%;
}

.website-row h3 a:hover {
    color: #40a9ff;
    text-decoration: underline;
}

.website-description {
    font-size: 14px;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

/* 分页导航 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    gap: 5px;
    flex-wrap: wrap;
}

.pagination .btn {
    min-width: 30px;
    text-align: center;
    padding: 8px 12px;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    background-color: #fff;
    color: #333;
    text-decoration: none;
    transition: all 0.3s;
}

.pagination span.btn {
    background-color: #f5f5f5;
    border-color: #e8e8e8;
    color: #999;
    cursor: default;
}

.pagination .btn:hover {
    border-color: #1890ff;
    color: #1890ff;
}

.pagination .btn-primary {
    background-color: #1890ff;
    border-color: #1890ff;
    color: #fff;
}

.pagination .btn-primary:hover {
    background-color: #40a9ff;
    border-color: #40a9ff;
}

@media (max-width: 768px) {
    .category-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .category-row .category-name {
        width: 100%;
        margin-right: 0;
        margin-bottom: 5px;
    }
    
    .category-websites {
        grid-template-columns: repeat(5, 1fr);
        gap: 5px;
    }
    
    .website-item.small {
        text-align: center;
    }
    
    .website-item.small a {
        font-size: 12px;
    }
    
    .website-row {
        padding: 12px;
    }
    
    .website-row h3 {
        font-size: 15px;
    }
    
    .website-description {
        font-size: 13px;
    }
}

/* 搜索结果样式 */
.results {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.results h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #1890ff;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.result-item {
    background-color: #f9f9f9;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
    transition: all 0.3s;
    border-left: 4px solid transparent;
    text-align: center;
}

.result-item:hover {
    background-color: #f0f7ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-left-color: #1890ff;
}

.result-item h3 {
    font-size: 14px;
    margin: 0;
}

.result-item h3 a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
    display: block;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.result-item h3 a:hover {
    color: #1890ff;
}

.result-item h3 a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: #1890ff;
    transition: width 0.3s;
}

.result-item h3 a:hover::after {
    width: 100%;
}

/* 无结果提示 */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

/* 返回链接 */
.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #1890ff;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.back-link:hover {
    color: #40a9ff;
    text-decoration: underline;
}

/* 底部样式 */
.footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
    border-top: 4px solid #1890ff;
}

.footer p {
    margin-bottom: 5px;
}

.footer a {
    color: #1890ff;
    text-decoration: none;
    transition: color 0.3s;
}

.footer a:hover {
    color: #40a9ff;
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 28px;
    }
    
    .search-box {
        padding: 20px;
    }
    
    .search-box form {
        flex-direction: column;
    }
    
    .search-box input[type="text"] {
        border-radius: 4px;
        margin-bottom: 10px;
    }
    
    .search-box input[type="submit"] {
        border-radius: 4px;
    }
    
    .websites {
        grid-template-columns: 1fr;
    }
    
    .category h2 {
        font-size: 18px;
    }
}

/* 后台管理样式 */
.admin-header {
    background-color: #1890ff;
    color: #fff;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h1 {
    font-size: 20px;
}

.admin-header a {
    color: #fff;
    text-decoration: none;
}

.admin-container {
    display: flex;
    min-height: calc(100vh - 60px);
}

.admin-sidebar {
    width: 200px;
    background-color: #fff;
    border-right: 1px solid #e8e8e8;
    padding: 20px;
}

.admin-sidebar ul {
    list-style: none;
}

.admin-sidebar li {
    margin-bottom: 10px;
}

.admin-sidebar a {
    display: block;
    padding: 10px;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.admin-sidebar a:hover {
    background-color: #f5f5f5;
}

.admin-sidebar a.active {
    background-color: #e6f7ff;
    color: #1890ff;
}

.admin-main {
    flex: 1;
    padding: 20px;
    background-color: #f0f2f5;
}

.admin-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.admin-card h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #666;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

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

.btn-primary {
    background-color: #1890ff;
    color: #fff;
}

.btn-primary:hover {
    background-color: #40a9ff;
}

.btn-danger {
    background-color: #ff4d4f;
    color: #fff;
}

.btn-danger:hover {
    background-color: #ff7875;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

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

.admin-table td:nth-child(2),
.admin-table td:nth-child(6) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.admin-table th {
    background-color: #f5f5f5;
    font-weight: bold;
    white-space: nowrap;
}

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

.table-responsive {
    overflow-x: auto;
    margin: 20px 0;
}

.search-form {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.form-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

.form-row .form-group {
    flex: 1;
}

.form-row .form-group label {
    display: block;
    margin-bottom: 5px;
    color: #666;
    font-size: 14px;
}

.form-row .form-group input,
.form-row .form-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-row .form-group button {
    width: 100%;
}

.pagination .btn.active {
    background-color: #1890ff;
    color: #fff;
    border-color: #1890ff;
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-row .form-group {
        width: 100%;
    }
    
    .admin-table {
        font-size: 12px;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 8px;
    }
}

/* 登录页面样式 */
.login-container {
    background-color: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    margin: 100px auto;
}

.login-container h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}
