/**
 * 网盘资源搜索站 - 样式文件
 * 响应式设计，支持移动端和桌面端
 */

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

header h1 {
    font-size: 2.5em;
    color: #2c3e50;
    font-weight: 600;
}

/* 搜索框样式 */
.search-box {
    margin-bottom: 20px;
}

.search-form {
    display: flex;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    flex: 1;
    padding: 12px 20px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 5px;
    outline: none;
    transition: border-color 0.3s;
}

.search-input:focus {
    border-color: #3498db;
}

.search-button {
    padding: 12px 30px;
    font-size: 16px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-button:hover {
    background-color: #2980b9;
}

.clear-search {
    padding: 12px 20px;
    font-size: 16px;
    background-color: #95a5a6;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s;
    display: inline-block;
}

.clear-search:hover {
    background-color: #7f8c8d;
}

/* 搜索信息提示 */
.search-info {
    text-align: center;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #e8f4f8;
    border-radius: 5px;
    color: #2c3e50;
}

/* 表格容器 */
.table-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    margin-bottom: 20px;
}

/* 表格样式 */
.resource-table {
    width: 100%;
    border-collapse: collapse;
}

.resource-table thead {
    background-color: #34495e;
    color: white;
}

.resource-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.resource-table th:first-child {
    width: 80px;
}

.resource-table th:nth-child(2) {
    width: 40%;
}

.resource-table th:nth-child(3) {
    width: 150px;
}

.resource-table tbody tr {
    border-bottom: 1px solid #ecf0f1;
    transition: background-color 0.2s;
}

.resource-table tbody tr:hover {
    background-color: #f8f9fa;
}

.resource-table td {
    padding: 15px;
}

.resource-table td:first-child {
    font-weight: 600;
    color: #7f8c8d;
}

.resource-link {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.resource-link:hover {
    color: #2980b9;
    text-decoration: underline;
}

.no-data {
    text-align: center;
    padding: 40px !important;
    color: #95a5a6;
    font-size: 18px;
}

/* 加载状态样式 */
.loading {
    text-align: center;
    padding: 40px !important;
    color: #3498db;
    font-size: 18px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* 错误状态样式 */
.error {
    text-align: center;
    padding: 40px !important;
    color: #e74c3c;
    font-size: 18px;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.page-link {
    padding: 8px 12px;
    background-color: white;
    color: #3498db;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s;
}

.page-link:hover {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

.page-link.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
    cursor: default;
}

.page-ellipsis {
    padding: 8px 12px;
    color: #95a5a6;
}

/* 页脚样式 */
footer {
    text-align: center;
    padding: 20px 0;
    color: #7f8c8d;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }

    .search-form {
        flex-direction: column;
    }

    .search-button,
    .clear-search {
        width: 100%;
    }

    .resource-table th,
    .resource-table td {
        padding: 10px;
        font-size: 14px;
    }

    .resource-table th:first-child,
    .resource-table td:first-child {
        display: none;
    }

    .pagination {
        font-size: 14px;
    }

    .page-link {
        padding: 6px 10px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    header h1 {
        font-size: 1.5em;
    }

    .resource-table {
        font-size: 12px;
    }

    .resource-table th:nth-child(4),
    .resource-table td:nth-child(4) {
        display: none;
    }
}

/* 后台管理样式 */
.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.admin-header {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.admin-header h1 {
    margin: 0;
    font-size: 1.8em;
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    transition: all 0.3s;
    font-weight: 500;
    text-align: center;
}

.btn-primary {
    background: white;
    color: #4CAF50;
}

.btn-primary:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-success {
    background: #4CAF50;
    color: white;
}

.btn-success:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-danger {
    background: #f44336;
    color: white;
}

.btn-danger:hover {
    background: #da190b;
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: #757575;
    color: white;
}

.btn-secondary:hover {
    background: #616161;
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-warning {
    background: #ff9800;
    color: white;
}

.btn-warning:hover {
    background: #f57c00;
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-info {
    background: #2196F3;
    color: white;
}

.btn-info:hover {
    background: #0b7dda;
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 消息提示样式 */
.message {
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 500;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
}

.message-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* 表单区域样式 */
.form-section {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.form-section h2 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.form-group input[type="file"] {
    padding: 8px;
}

.form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* 重复标题警告样式 */
.duplicate-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 12px 15px;
    border-radius: 4px;
    margin-top: 8px;
    display: none;
    animation: slideDown 0.3s ease-out;
}

.duplicate-warning.show {
    display: block;
}

.duplicate-list {
    margin-top: 10px;
    padding-left: 20px;
    list-style-type: disc;
}

.duplicate-list li {
    margin: 8px 0;
    line-height: 1.6;
}

.duplicate-list a {
    color: #4CAF50;
    text-decoration: none;
    font-weight: 500;
}

.duplicate-list a:hover {
    text-decoration: underline;
}

/* 资源列表样式 */
.resource-list {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.resource-list h2 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* 后台表格样式增强 */
.admin-container .resource-table {
    margin-top: 20px;
}

.admin-container .resource-table th,
.admin-container .resource-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.admin-container .resource-table th {
    background: #f5f5f5;
    font-weight: 600;
    color: #333;
}

.admin-container .resource-table tr:hover {
    background: #f9f9f9;
}

.admin-container .resource-table td.actions {
    white-space: nowrap;
}

.admin-container .resource-table td.actions a,
.admin-container .resource-table td.actions button {
    margin-right: 5px;
    padding: 5px 10px;
    font-size: 12px;
}

/* 登录页面样式 */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.login-box h1 {
    text-align: center;
    color: #4CAF50;
    margin-bottom: 30px;
}

.login-box .form-group {
    margin-bottom: 20px;
}

.login-box .btn {
    width: 100%;
}

/* 统计页面样式 */
.statistics-container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.statistics-group {
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 4px;
    border-left: 4px solid #4CAF50;
}

.statistics-group h3 {
    margin-top: 0;
    color: #333;
}

.statistics-list {
    list-style: none;
    padding: 0;
}

.statistics-list li {
    padding: 10px;
    margin: 5px 0;
    background: white;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.statistics-list li:hover {
    background: #e8f5e9;
}

/* 导入页面样式 */
.import-container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.import-instructions {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    border-left: 4px solid #2196F3;
}

.import-instructions h3 {
    margin-top: 0;
    color: #1976D2;
}

.import-instructions ul {
    margin: 10px 0;
    padding-left: 20px;
}

.import-results {
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
}

.import-results.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.import-results.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* 返回链接样式 */
.back-link {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.back-link a {
    color: #4CAF50;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.back-link a:hover {
    color: #45a049;
    text-decoration: underline;
}

/* 响应式设计 - 后台管理 */
@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .header-actions {
        width: 100%;
        justify-content: center;
    }

    .form-section,
    .resource-list,
    .statistics-container,
    .import-container {
        padding: 20px;
    }

    .admin-container .resource-table {
        font-size: 12px;
    }

    .admin-container .resource-table th,
    .admin-container .resource-table td {
        padding: 8px;
    }

    .admin-container .resource-table td.actions a,
    .admin-container .resource-table td.actions button {
        display: block;
        margin: 5px 0;
        width: 100%;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .admin-container {
        padding: 10px;
    }

    .admin-header h1 {
        font-size: 1.3em;
    }

    .login-container {
        margin: 50px auto;
        padding: 10px;
    }

    .login-box {
        padding: 20px;
    }
}
