:root {
    --primary-color: #3498db;
    --primary-light: #ebf5fb;
    --secondary-color: #f8f9fa;
    --border-color: #e0e0e0;
    --text-color: #333;
    --text-light: #666;
    --success-color: #2ecc71;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: 250px;
    background-color: white;
    box-shadow: var(--shadow);
    padding: 20px 0;
    z-index: 10;
}

.logo {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.logo h1 {
    color: var(--primary-color);
    font-size: 24px;
    font-weight: 600;
}

.nav-menu {
    list-style: none;
}

.nav-item {
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
}

.nav-item:hover {
    background-color: var(--primary-light);
}

.nav-item.active {
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
}

.nav-item i {
    margin-right: 10px;
    font-size: 18px;
}

/* 主内容区样式 */
.main-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

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

.breadcrumb {
    display: flex;
    align-items: center;
}

.breadcrumb a {
    color: var(--text-light);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

.breadcrumb span {
    margin: 0 8px;
    color: var(--text-light);
}

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

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

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

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--text-color);
}

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

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

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

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

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

/* 文件操作栏样式 */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.toolbar-left {
    display: flex;
    gap: 10px;
}

.toolbar-right {
    display: flex;
    gap: 10px;
}

.search-box {
    position: relative;
}

.search-box input {
    padding: 8px 12px 8px 35px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    width: 250px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

/* 文件列表样式 */
.file-list-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: auto;
}

.file-list-header {
    display: grid;
    grid-template-columns: 40px minmax(200px, 0.8fr) 120px 200px 100px;
    padding: 12px 15px;
    background-color: var(--secondary-color);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
}

.file-list {
    list-style: none;
}

.file-item {
    display: grid;
    grid-template-columns: 40px minmax(200px, 0.8fr) 120px 200px 100px;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .file-list-header, .file-item {
        grid-template-columns: 40px minmax(150px, 0.8fr) 100px 150px 80px;
    }
}

@media (max-width: 992px) {
    .file-list-header, .file-item {
        grid-template-columns: 40px minmax(120px, 0.8fr) 80px 120px 70px;
    }
}

@media (max-width: 768px) {
    .file-list-header, .file-item {
        grid-template-columns: 30px 0.8fr 80px 60px;
    }

    .file-modified {
        display: none;
    }
}

@media (max-width: 576px) {
    .file-list-header, .file-item {
        grid-template-columns: 25px 0.8fr 60px;
        padding: 8px 10px;
    }

    .file-modified, .file-size {
        display: none;
    }

    .file-actions {
        gap: 4px;
    }

    .action-btn {
        padding: 2px;
    }
}


.file-item:hover {
    background-color: var(--primary-light);
}

.file-item.selected {
    background-color: var(--primary-light);
}

.file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: var(--primary-color);
}

.file-name {
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-size, .file-modified, .file-actions {
    display: flex;
    align-items: center;
}

.file-actions {
    gap: 8px;
    opacity: 1; /* 始终显示操作按钮 */
}

.action-btn {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px;
    border-radius: 3px;
}

.action-btn:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

/* 右键菜单样式 */
.context-menu {
    position: fixed;
    background-color: white;
    box-shadow: var(--shadow);
    border-radius: 4px;
    padding: 8px 0;
    z-index: 1000;
    min-width: 180px;
    display: none;
}

.context-menu-item {
    padding: 8px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.context-menu-item:hover {
    background-color: var(--primary-light);
}

/* 上传区域样式 */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    margin-bottom: 20px;
    transition: all 0.3s;
    background-color: white;
}

.upload-area.active {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
}

.upload-area i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.upload-area p {
    margin-bottom: 15px;
    color: var(--text-light);
}

/* 模态框样式 */
.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;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    width: 500px;
    max-width: 90%;
    box-shadow: var(--shadow);
}

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

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.form-container {
    background-color: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 30px;
    width: 100%;
    max-width: 500px;
}

.form-title {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-option {
    position: relative;
    padding: 16px 20px 16px 50px;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #f8fafc;
}

.radio-option:hover {
    border-color: #3498db;
    background-color: #f0f7ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.1);
}

.radio-option.selected {
    border-color: #3498db;
    background-color: #e1f0fa;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
}

.radio-option input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.custom-radio {
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    height: 22px;
    width: 22px;
    background-color: #fff;
    border-radius: 50%;
    border: 2px solid #bdc3c7;
    transition: all 0.3s ease;
}

.radio-option:hover .custom-radio {
    border-color: #3498db;
}

.radio-option.selected .custom-radio {
    border-color: #3498db;
    background-color: #3498db;
}

.custom-radio::after {
    content: "";
    position: absolute;
    display: none;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: white;
}

.radio-option.selected .custom-radio::after {
    display: block;
}

.radio-label {
    font-size: 1rem;
    color: #2c3e50;
    font-weight: 500;
}

.radio-description {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-top: 5px;
    line-height: 1.4;
}


.close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-light);
}

/* 预览模态框样式 */
.preview-content {
    max-height: 70vh;
    overflow: auto;
}

.preview-image {
    max-width: 100%;
    display: block;
    margin: 0 auto;
}

.preview-text {
    white-space: pre-wrap;
    font-family: monospace;
    background-color: var(--secondary-color);
    padding: 15px;
    border-radius: 4px;
}

/* 确认对话框样式 */
.confirm-dialog {
    text-align: center;
    padding: 10px 0;
}

.confirm-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.confirm-message {
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 1.5;
}

/* 同名文件处理对话框 */
.duplicate-files-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 15px;
    background-color: var(--secondary-color);
}

.duplicate-file-item {
    padding: 5px 0;
    border-bottom: 1px solid var(--border-color);
}

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

/* 消息提示 */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 4px;
    color: white;
    z-index: 1100;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    transform: translateX(150%);
}

.message.success {
    background-color: var(--success-color);
}

.message.error {
    background-color: var(--danger-color);
}

.message.warning {
    background-color: var(--warning-color);
}

.message.show {
    transform: translateX(0);
}

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

    .sidebar {
        width: 100%;
        height: auto;
    }

    .file-list-header, .file-item {
        grid-template-columns: 30px 0.8fr 80px 100px 60px;
    }

    .file-modified {
        display: none;
    }
}

/* 上传进度条样式 */
.upload-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: var(--border-color);
    z-index: 1200;
    display: none;
}

.upload-progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

.upload-progress-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1100;
    display: none;
    align-items: center;
    justify-content: center;
}

.upload-progress-content {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    width: 400px;
    max-width: 90%;
    text-align: center;
    box-shadow: var(--shadow);
}

.upload-progress-info {
    margin: 15px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.upload-progress-text {
    font-size: 14px;
    color: var(--text-light);
}

.upload-progress-percent {
    font-weight: 600;
    color: var(--primary-color);
}

.upload-progress-bar-container {
    height: 8px;
    background-color: var(--secondary-color);
    border-radius: 4px;
    overflow: hidden;
    margin: 10px 0;
}

.upload-progress-bar-inner {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

.upload-progress-files {
    margin-top: 15px;
    max-height: 150px;
    overflow-y: auto;
    text-align: left;
}

.upload-progress-file {
    padding: 5px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

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

/* 公告模态框样式 */
.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-light);
    margin-right: auto;
}

.checkbox-container input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 3px;
    margin-right: 8px;
    position: relative;
    transition: all 0.3s;
}

.checkbox-container input:checked + .checkmark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-container input:checked + .checkmark::after {
    content: "✓";
    position: absolute;
    color: white;
    font-size: 12px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* 公告内容样式 */
#announcementContent h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

#announcementContent hr {
    display: block;
    height: 1px;
    border: 0;
    border-top: 1px solid var(--border-color);
    width: 100%;
}

.announcement-history {
    display: block;
    width: 450px;
    height: 200px;
    border: 0;
    overflow: auto; /* 当内容溢出时显示滚动条 */
    padding: 5px;
    margin: 5px;
}

#announcementContent ul {
    margin: 15px 0;
    padding-left: 20px;
}

#announcementContent li {
    margin-bottom: 8px;
    line-height: 1.5;
}

#announcementContent p {
    margin-top: 15px;
    color: var(--text-light);
}

/* 排序按钮样式 */
.sort-buttons {
    display: flex;
    align-items: center;
    gap: 5px;
}

.sort-btn {
    position: relative;
    padding: 6px 12px;
    font-size: 14px;
}

.sort-btn.active {
    background-color: var(--primary-light);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.sort-indicator {
    font-size: 12px;
    font-weight: bold;
    color: var(--primary-color);
}

/* 文件列表标题排序指示器 */
.file-list-header {
    display: grid;
    grid-template-columns: 40px 0.8fr 120px 200px 100px;
    padding: 12px 15px;
    background-color: var(--secondary-color);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    user-select: none;
}

.file-list-header > div {
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    padding: 4px 8px;
    border-radius: 4px;
}

.file-list-header > div:hover {
    background-color: var(--border-color);
}

.file-list-header > div:first-child {
    cursor: default;
}

.file-list-header > div:first-child:hover {
    background-color: transparent;
}

.header-sort-indicator {
    margin-left: 4px;
    font-size: 12px;
    opacity: 0.7;
}