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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Open Sans', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* 弹窗样式 */
.modal {
    display: none; /* 默认隐藏 */
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    border: 1px solid #888;
    border-radius: 8px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    color: #2c3e50;
}

.close-modal {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover, .close-modal:focus {
    color: #000;
    text-decoration: none;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-tool-info {
    margin-bottom: 15px;
}

.modal-tool-description {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.modal-tool-content {
    margin-bottom: 20px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    overflow: hidden;
}

.modal-tool-content iframe {
    width: 100%;
    height: 500px;
    border: none;
}

.modal-tool-meta {
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
}

.modal-tool-meta p {
    margin: 5px 0;
}

.modal-footer {
    padding: 20px;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    border-radius: 0 0 8px 8px;
    text-align: right;
}

/* 按钮样式 */
.btn-view, .btn-edit, .btn-delete, .btn-primary, .btn-secondary {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    font-size: 14px;
    transition: background-color 0.3s, color 0.3s;
}

.btn-view {
    background-color: #3498db;
    color: white;
}

.btn-view:hover {
    background-color: #2980b9;
}

.btn-edit {
    background-color: #2ecc71;
    color: white;
}

.btn-edit:hover {
    background-color: #27ae60;
}

.btn-delete {
    background-color: #e74c3c;
    color: white;
}

.btn-delete:hover {
    background-color: #c0392b;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

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

/* 头部样式 */
header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logo h1 {
    font-size: 24px;
    font-weight: 600;
}

.logo a {
    color: #2c3e50;
    text-decoration: none;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    color: #333;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

nav ul li a:hover, nav ul li a.active {
    background-color: #f0f0f0;
}

/* 主内容样式 */
main {
    padding: 40px 0;
}

/* 搜索区域 */
.search-section {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

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

.search-box form {
    display: flex;
    gap: 10px;
}

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

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

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

/* 分类区域 */
.categories {
    background-color: #fff;
    padding: 20px 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.categories h2 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #2c3e50;
}

.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.category-item {
    padding: 8px 16px;
    background-color: #f0f0f0;
    color: #333;
    text-decoration: none;
    border-radius: 20px;
    font-size: 14px;
    transition: all 0.3s;
}

.category-item:hover, .category-item.active {
    background-color: #3498db;
    color: white;
}

/* 工具网格 */
.tools h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #2c3e50;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.tool-item {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.tool-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.tool-header h3 {
    font-size: 18px;
    margin-bottom: 0;
}

.tool-header a {
    color: #2c3e50;
    text-decoration: none;
}

.category-tag {
    padding: 4px 8px;
    background-color: #3498db;
    color: white;
    border-radius: 4px;
    font-size: 12px;
}

.tool-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
}

.tool-footer {
    text-align: right;
}

.btn-use {
    display: inline-block;
    padding: 8px 16px;
    background-color: #2ecc71;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.3s;
}

.btn-use:hover {
    background-color: #27ae60;
}

/* 工具详情页面 */
.tool-detail {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: 30px;
}

.tool-detail .tool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.tool-detail .tool-info h1 {
    font-size: 28px;
    margin-bottom: 10px;
}

.btn-back {
    display: inline-block;
    padding: 8px 16px;
    background-color: #95a5a6;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.3s;
}

.btn-back:hover {
    background-color: #7f8c8d;
}

.tool-detail .tool-description {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
    line-height: 1.6;
}

.tool-content {
    margin-bottom: 30px;
}

.tool-content iframe {
    width: 100%;
    min-height: 600px;
    border: 1px solid #eee;
    border-radius: 4px;
}

.tool-meta {
    font-size: 14px;
    color: #999;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.tool-meta p {
    margin-bottom: 5px;
}

/* 关联网站 */
.external-sites h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #2c3e50;
}

.external-site-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.external-site-item {
    display: block;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: 20px;
    color: #333;
    text-decoration: none;
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.external-site-item h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #3498db;
}

.external-site-item p {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

/* 反馈页面 */
.feedback-submit {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: 30px;
    max-width: 600px;
    margin: 0 auto;
}

.feedback-submit h1 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #2c3e50;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #3498db;
}

.form-hint {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.form-actions {
    text-align: right;
    margin-top: 30px;
}

.form-actions button {
    padding: 12px 24px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

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

/* 消息提示 */
.success-message,
.error-message {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 管理员登录 */
.admin-login {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.login-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.login-container h1 {
    font-size: 24px;
    margin-bottom: 30px;
    text-align: center;
    color: #2c3e50;
}

/* 管理员仪表盘 */
.admin-dashboard {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: 30px;
}

.dashboard-header h1 {
    font-size: 28px;
    margin-bottom: 10px;
    color: #2c3e50;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.stat-card {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.stat-number {
    font-size: 36px;
    font-weight: 600;
    color: #3498db;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 16px;
    color: #666;
    margin-bottom: 15px;
}

.stat-link {
    display: inline-block;
    color: #3498db;
    text-decoration: none;
    font-size: 14px;
}

.stat-link:hover {
    text-decoration: underline;
}

.dashboard-actions h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #2c3e50;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.action-btn {
    display: inline-block;
    padding: 12px 20px;
    background-color: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.3s;
}

.action-btn:hover {
    background-color: #2980b9;
}

/* 管理页面通用样式 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.page-header h1 {
    font-size: 24px;
    color: #2c3e50;
}

.btn-primary {
    display: inline-block;
    padding: 8px 16px;
    background-color: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.3s;
}

.btn-primary:hover {
    background-color: #2980b9;
}

/* 表格样式 */
.tool-table-container,
.feedback-table-container,
.site-table-container,
.category-table-container {
    overflow-x: auto;
}

.tool-table,
.feedback-table,
.site-table,
.category-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.tool-table th,
.feedback-table th,
.site-table th,
.category-table th,
.tool-table td,
.feedback-table td,
.site-table td,
.category-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.tool-table th,
.feedback-table th,
.site-table th,
.category-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.tool-table tr:hover,
.feedback-table tr:hover,
.site-table tr:hover,
.category-table tr:hover {
    background-color: #f8f9fa;
}

/* 按钮样式 */
.btn-view,
.btn-edit,
.btn-delete {
    display: inline-block;
    padding: 6px 12px;
    margin-right: 5px;
    border-radius: 4px;
    font-size: 14px;
    text-decoration: none;
    transition: background-color 0.3s;
}

.btn-view {
    background-color: #3498db;
    color: white;
}

.btn-view:hover {
    background-color: #2980b9;
}

.btn-edit {
    background-color: #f39c12;
    color: white;
}

.btn-edit:hover {
    background-color: #e67e22;
}

.btn-delete {
    background-color: #e74c3c;
    color: white;
}

.btn-delete:hover {
    background-color: #c0392b;
}

/* 状态标签 */
.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.pending {
    background-color: #f39c12;
    color: white;
}

.status-badge.replied {
    background-color: #27ae60;
    color: white;
}

/* 空数据提示 */
.no-tools,
.no-data {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-tools p,
.no-data p {
    margin-bottom: 15px;
    font-size: 16px;
}

.no-data a {
    color: #3498db;
    text-decoration: none;
}

.no-data a:hover {
    text-decoration: underline;
}

/* 反馈详情 */
.feedback-info {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.feedback-header {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.feedback-meta p {
    margin-bottom: 10px;
    font-size: 14px;
}

.feedback-meta strong {
    color: #2c3e50;
}

.feedback-content,
.feedback-reply {
    margin-bottom: 20px;
    padding: 15px;
    background-color: white;
    border-radius: 4px;
}

.feedback-content h3,
.feedback-reply h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #2c3e50;
}

.reply-time {
    font-size: 12px;
    color: #999;
    margin-top: 10px;
    text-align: right;
}

.reply-form {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* 过滤器 */
.feedback-filters {
    margin-bottom: 20px;
}

.filter-buttons {
    display: flex;
    gap: 10px;
}

.filter-btn {
    padding: 8px 16px;
    background-color: #f0f0f0;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
}

.filter-btn:hover,
.filter-btn.active {
    background-color: #3498db;
    color: white;
}

/* 底部样式 */
footer {
    background-color: #2c3e50;
    color: white;
    padding: 30px 0;
    margin-top: 50px;
}

footer .container {
    text-align: center;
}

footer p {
    margin: 0;
}

footer a {
    color: #3498db;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    nav ul {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    nav ul li {
        margin: 0 10px;
    }
    
    .tool-grid,
    .external-site-list {
        grid-template-columns: 1fr;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .tool-content iframe {
        min-height: 400px;
    }
    
    .action-buttons {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    main {
        padding: 20px 0;
    }
    
    .search-section,
    .categories,
    .tool-detail,
    .feedback-submit,
    .admin-dashboard {
        padding: 20px;
    }
    
    .search-box form {
        flex-direction: column;
    }
    
    .login-container {
        padding: 30px 20px;
    }
    
    .tool-table th,
    .feedback-table th,
    .site-table th,
    .tool-table td,
    .feedback-table td,
    .site-table td {
        padding: 8px;
        font-size: 14px;
    }
    
    .filter-buttons,
    .action-buttons {
        flex-direction: column;
    }
}