/* Tools.css - 工具下载页面样式 */
:root {
    --primary: #2c7be5;
    --primary-dark: #1a68d1;
    --secondary: #6c757d;
    --light: #f8f9fa;
    --dark: #343a40;
    --success: #00d97e;
    --danger: #e63757;
    --warning: #f6c343;
    --border: #e9ecef;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html, body {
    height: 100%;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    background-color: #f5f7fa;
    color: var(--dark);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: var(--primary);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline:hover {
    background-color: var(--primary);
    color: white;
}

.btn-success {
    background-color: var(--success);
    color: white;
}

.btn-success:hover {
    background-color: #00c571;
}

/* 导航栏样式 */
header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.logo i {
    margin-right: 10px;
    font-size: 28px;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 25px;
}

.nav-links a {
    color: var(--dark);
    font-weight: 500;
    transition: color 0.3s;
    padding: 5px 0;
    position: relative;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a.active {
    color: var(--primary);
    font-weight: 600;
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary);
}

.user-menu {
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 10px;
}

.login-actions {
    display: flex;
    gap: 10px;
}

.user-info-display {
    display: flex;
    align-items: center;
    gap: 12px;
}

#navUsername {
    font-weight: 500;
    color: var(--dark);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: transparent;
    color: var(--secondary);
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.logout-btn:hover {
    background-color: #f8f9fa;
    border-color: var(--secondary);
    color: var(--dark);
}

/* 页面标题区域 */
.page-header {
    background: linear-gradient(135deg, #2c7be5 0%, #1a68d1 100%);
    color: white;
    padding: 60px 0;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.page-header p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
}

/* 工具内容区域 */
.section {
    padding: 60px 0;
}

.tools-content {
    display: flex;
    gap: 30px;
    padding: 20px 0;
}

/* 筛选侧边栏 */
.filters-sidebar {
    flex: 0 0 280px;
    background-color: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    height: fit-content;
}

.filter-section {
    margin-bottom: 25px;
}

.filter-section h3 {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    font-size: 1.1rem;
}

.filter-options {
    list-style: none;
}

.filter-options li {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.filter-options input[type="radio"] {
    margin-right: 10px;
}

.filter-options label {
    cursor: pointer;
    display: flex;
    align-items: center;
    width: 100%;
}

.filter-count {
    margin-left: auto;
    color: var(--secondary);
    font-size: 0.9rem;
}

/* 工具列表主区域 */
.tools-main {
    flex: 1;
}

.search-sort-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.search-box {
    flex: 1;
    max-width: 400px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
}

.search-box button {
    position: absolute;
    right: 5px;
    top: 5px;
    padding: 7px 15px;
    border-radius: 4px;
    background-color: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
}

.clear-search {
    position: absolute;
    right: 50px;
    top: 5px;
    padding: 7px 10px;
    border-radius: 4px;
    background-color: transparent;
    color: var(--secondary);
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
}

.clear-search:hover {
    color: var(--danger);
}

/* 搜索操作按钮样式 */
.search-actions {
    margin: 0 15px;
}

.search-actions .btn {
    padding: 10px 15px;
    font-size: 0.9rem;
}

.sort-options select {
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background-color: white;
    font-size: 0.9rem;
}

/* 工具网格 */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.tool-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.tool-image {
    height: 160px;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--primary);
}

.tool-content {
    padding: 25px;
}

.tool-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 5px;
}

.tool-tag {
    display: inline-block;
    background-color: #e6f2ff;
    color: var(--primary);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.tool-card h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.tool-card p {
    color: var(--secondary);
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tool-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    font-size: 0.9rem;
    color: var(--secondary);
    flex-wrap: wrap;
    gap: 8px;
}

.tool-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.tool-actions .btn {
    flex: 1;
    text-align: center;
    padding: 8px 0;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.pagination-list {
    display: flex;
    list-style: none;
}

.pagination-item {
    margin: 0 5px;
}

.pagination-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 4px;
    background-color: white;
    color: var(--dark);
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

.pagination-link:hover, .pagination-link.active {
    background-color: var(--primary);
    color: white;
}

.pagination-link.disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination-link.disabled:hover {
    background-color: #f8f9fa;
    color: #6c757d;
}

/* 热门工具 */
.featured-tools {
    margin-top: 60px;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
}

.section-title h2 {
    font-size: 2rem;
    color: var(--dark);
    margin-bottom: 15px;
}

.section-title p {
    color: var(--secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    padding: 30px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--secondary);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

.form-but {
    text-align: center;
}

.form-but .btn {
    margin: 0 10px;
}

.form-switch {
    text-align: center;
    margin-top: 15px;
}

.form-switch a {
    color: var(--primary);
    cursor: pointer;
}

.form-switch a:hover {
    text-decoration: underline;
}

/* 页脚样式 */
footer {
    background-color: var(--dark);
    color: white;
    padding: 60px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-column h3 {
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #adb5bd;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: white;
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #495057;
    color: #adb5bd;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        padding: 15px 0;
    }

    .nav-links {
        margin-top: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-links li {
        margin: 0 10px;
    }

    .tools-content {
        flex-direction: column;
    }

    .search-sort-bar {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .search-actions {
        margin: 0;
        text-align: center;
    }

    .search-box {
        max-width: 100%;
    }

    .user-info-display {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .logout-btn {
        margin-top: 5px;
    }
}

.open-source-info {
    background-color: white;
    border-radius: 8px;
    padding: 40px;
    margin-top: 40px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.open-source-info h2 {
    margin-bottom: 20px;
    color: var(--primary);
}

.open-source-info p {
    margin-bottom: 20px;
    color: var(--secondary);
}

/* 贡献工具模态框样式 */
.contribute-modal .modal-content {
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

textarea.form-control {
    min-height: 80px;
    resize: vertical;
}

.required::after {
    content: " *";
    color: var(--danger);
}

.form-hint {
    font-size: 0.85rem;
    color: var(--secondary);
    margin-top: 5px;
}

/* 共享指南样式 */
.guide-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.guide-section:last-child {
    border-bottom: none;
}

.guide-section h4 {
    color: var(--primary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.guide-section h4 i {
    width: 20px;
    text-align: center;
}

.guide-section h5 {
    color: var(--dark);
    margin: 15px 0 10px 0;
    font-size: 1rem;
}

.guide-section h6 {
    color: var(--dark);
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.guide-section ul, .guide-section ol {
    padding-left: 20px;
    margin-bottom: 10px;
}

.guide-section li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.sub-section {
    margin-bottom: 15px;
}

.sub-section:last-child {
    margin-bottom: 0;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.info-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid var(--primary);
}

.info-item h6 {
    color: var(--primary);
    margin-bottom: 8px;
}

.info-item p {
    font-size: 0.9rem;
    color: var(--secondary);
    margin: 0;
}

.quality-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 0.9rem;
}

.quality-table th,
.quality-table td {
    padding: 12px;
    text-align: left;
    border: 1px solid #e9ecef;
}

.quality-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: var(--dark);
}

.quality-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.benefits {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.benefit-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.benefit-item i {
    color: var(--primary);
    font-size: 1.2rem;
    margin-top: 2px;
}

.benefit-item h5 {
    margin: 0 0 5px 0;
    color: var(--dark);
}

.benefit-item p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--secondary);
}

.guide-section.warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 20px;
    margin-top: 20px;
}

.guide-section.warning h4 {
    color: #e6a700;
}

.guide-section.warning ul {
    color: #856404;
}

.guide-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    margin-top: 20px;
}

.guide-footer p {
    margin-bottom: 10px;
    color: var(--secondary);
}

.guide-footer a {
    color: var(--primary);
}

/* 修复共享指南模态框滚动问题 */
#guideModal .modal-content {
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 0; /* 移除内边距，让内部元素控制 */
}

#guideModal .modal-header {
    padding: 20px 20px 0 20px;
    margin-bottom: 0;
}

#guideModal .modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    max-height: calc(90vh - 140px); /* 减去头部和底部的高度 */
}

#guideModal .modal-footer {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 15px 20px;
    text-align: center;
    margin-top: 0;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .info-grid {
        grid-template-columns: 1fr;
    }

    .benefits {
        grid-template-columns: 1fr;
    }
    
    .quality-table {
        font-size: 0.8rem;
    }
    
    .quality-table th,
    .quality-table td {
        padding: 8px;
    }
    
    #guideModal .modal-content {
        max-height: 95vh;
        margin: 20px;
    }
    
    #guideModal .modal-body {
        max-height: calc(95vh - 140px);
    }
}