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

body {
    font-family: 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
    background-color: #f8f8f8;
    line-height: 1.6;
    color: #333;
}

/* 用户统计条 */
.user-stats-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #2c3e50;
    color: white;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stats-container {
    padding: 10px 20px;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    font-size: 14px;
}

/* 管理后台链接 */
.admin-link {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    background: #ecf0f1;
    border-radius: 8px;
}

.admin-link a {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.admin-link a:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* 页面头部 */
.header {
    margin-bottom: 40px;
    padding: 30px 0;
    border-bottom: 2px solid #e0e0e0;
}

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

.header-text {
    text-align: center;
    flex: 1;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* Gopeed测试结果 */
.test-result {
    margin: 15px 0;
    padding: 12px;
    border-radius: 6px;
    font-size: 0.9em;
}

.test-loading {
    background: #e3f2fd;
    color: #1976d2;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
}

.test-success {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 10px;
    border-radius: 4px;
    border-left: 4px solid #4caf50;
}

.test-error {
    background: #ffebee;
    color: #c62828;
    padding: 10px;
    border-radius: 4px;
    border-left: 4px solid #f44336;
}

/* 移动端响应式 */
@media (max-width: 768px) {
    .title {
        font-size: 2em;
    }
    
    .subtitle {
        font-size: 0.9em;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-actions button {
        width: 100%;
    }
    
    .link-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .link-actions {
        width: 100%;
        margin-top: 10px;
    }
    
    .link-actions button {
        flex: 1;
    }
}

/* 设置图标按钮 */
.settings-icon-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    padding: 0;
}

.settings-icon-btn:hover {
    transform: rotate(90deg);
    opacity: 0.7;
}

/* 公告区域 */
.announcement-section {
    background: linear-gradient(135deg, #f8f8f8, #f0f0f0);
    border: 2px solid var(--ink-light);
    border-radius: 8px;
    margin-bottom: 30px;
    padding: 20px;
    position: relative;
}

.announcement-section::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border: 1px solid var(--ink-black);
    border-radius: 8px;
    pointer-events: none;
}

.announcement-content h3 {
    color: var(--ink-black);
    margin-bottom: 15px;
    font-size: 1.2em;
    font-family: 'KaiTi', '楷体', serif;
    font-weight: bold;
}

#announcementText {
    color: var(--ink-gray);
    line-height: 1.8;
    font-size: 0.95em;
    font-family: '宋体', 'SimSun', serif;
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border: 2px solid var(--ink-light);
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--ink-light);
}

.modal-header h3 {
    font-family: '黑体', 'SimHei', sans-serif;
    color: var(--ink-black);
    margin: 0;
}

.modal-close {
    font-size: 28px;
    cursor: pointer;
    color: var(--ink-gray);
    background: none;
    border: none;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--ink-black);
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.title {
    font-size: 2.5em;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1em;
    color: #7f8c8d;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #2c3e50;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 10px;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

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

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

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-success:hover {
    background-color: #229954;
}

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

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

/* 区域样式 */
.input-section,
.file-section,
.download-section,
.settings-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

/* 解析按钮居中 */
.input-section #parseBtn {
    display: block;
    margin: 0 auto;
}

/* 文件列表样式 */
.file-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin: 20px 0;
}

.file-item {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.file-item:hover {
    background-color: #f8f9fa;
}

.file-item:last-child {
    border-bottom: none;
}

.file-checkbox {
    margin-right: 15px;
}

.file-icon {
    margin-right: 15px;
    font-size: 20px;
    width: 30px;
    text-align: center;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.file-name.file-oversize {
    color: #999;
    text-decoration: line-through;
}

/* 过滤文件样式 */
.file-filtered {
    opacity: 0.5;
}

.filtered-tag {
    display: inline-block;
    background: #e74c3c;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    margin-left: 8px;
    font-weight: normal;
}


.file-size {
    color: #7f8c8d;
    font-size: 0.9em;
}

.file-date {
    color: #95a5a6;
    font-size: 0.8em;
}

/* 面包屑导航 */
.breadcrumb {
    margin-bottom: 20px;
    color: #7f8c8d;
}

/* 下载链接样式 */
.link-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.link-info {
    flex: 1;
    min-width: 0;
}

.link-name {
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 1em;
}

.link-url {
    color: #3498db;
    font-size: 0.85em;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.link-size {
    color: #666;
    font-size: 0.9em;
}

.link-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.link-btn {
    padding: 8px 16px;
    font-size: 14px;
    white-space: nowrap;
}

/* 设置网格 */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* 操作按钮区域 */
.action-buttons {
    margin-top: 20px;
    text-align: center;
}

/* 状态提示 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #2c3e50;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.toast.success {
    background: #27ae60;
}

.toast.error {
    background: #e74c3c;
}

.toast.warning {
    background: #f39c12;
}

/* 加载遮罩 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: white;
    font-size: 16px;
}

/* 管理入口链接 */
.admin-link {
    position: fixed;
    bottom: 20px;
    right: 20px;
}

.admin-link a {
    background: #34495e;
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.admin-link a:hover {
    background: #2c3e50;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .title {
        font-size: 2em;
    }

    .input-section,
    .file-section,
    .download-section,
    .settings-section {
        padding: 20px;
    }

    .btn {
        width: 100%;
        margin-bottom: 10px;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        text-align: left;
    }

    .admin-link {
        bottom: 10px;
        right: 10px;
    }

    /* 移动端下载链接样式 */
    .download-link {
        flex-direction: column;
        align-items: flex-start;
    }

    .link-info {
        width: 100%;
        min-width: 0;
        margin-bottom: 10px;
    }

    .link-url {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .link-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .link-btn {
        flex: 1;
        min-width: 0;
    }
}