* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.main-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* 头部样式 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 1px solid #e5e7eb;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 24px;
    flex: 1;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.folder-icon {
    font-size: 24px;
}

.header-title h1 {
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.header-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #6b7280;
    font-size: 14px;
    padding-right: 24px;
    border-right: 1px solid #e5e7eb;
}

.header-user span {
    font-weight: 500;
    white-space: nowrap;
}

.btn-logout {
    padding: 6px 16px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-logout:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-logout:active {
    transform: translateY(0);
}

.btn-add {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.btn-secondary:hover {
    background: #e5e7eb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.icon-plus {
    font-size: 20px;
    font-weight: bold;
}

/* 控制栏样式 */
.control-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    border-bottom: 1px solid #e5e7eb;
}

.view-toggle {
    display: flex;
    gap: 8px;
}

.view-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s;
}

.view-btn:hover {
    background: #f3f4f6;
}

.view-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.search-box {
    display: flex;
    gap: 8px;
    align-items: center;
}

.search-box input {
    padding: 10px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    width: 300px;
    outline: none;
}

.search-box input:focus {
    border-color: #667eea;
}

.search-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.search-btn:hover {
    background: #f3f4f6;
}

/* 面包屑导航 */
.breadcrumb {
    padding: 12px 32px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
    align-items: center;
}

.breadcrumb-item {
    color: #6b7280;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.breadcrumb-item:hover {
    background: #f3f4f6;
}

.breadcrumb-item.active {
    color: #667eea;
    font-weight: 500;
}

.breadcrumb-separator {
    color: #9ca3af;
}

/* 内容区域 */
.content-area {
    padding: 32px;
    min-height: 400px;
}

/* 网格视图 */
.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 24px;
}

.file-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.file-item:hover {
    background: #f9fafb;
    transform: translateY(-2px);
}

.file-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

.file-name {
    font-size: 14px;
    color: #1f2937;
    text-align: center;
    word-break: break-all;
    max-width: 100%;
}

/* 列表视图 */
.file-table {
    width: 100%;
    border-collapse: collapse;
}

.file-table thead {
    background: #f9fafb;
}

.file-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

.file-table td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    color: #1f2937;
}

.file-table tbody tr {
    cursor: pointer;
    transition: background 0.2s;
}

.file-table tbody tr:hover {
    background: #f9fafb;
}

.table-file-icon {
    font-size: 24px;
    margin-right: 8px;
    vertical-align: middle;
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: #9ca3af;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 16px;
}

/* 右键菜单 */
.context-menu {
    position: fixed;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: none;
    z-index: 1000;
    min-width: 150px;
    overflow: hidden;
}

.context-menu.show {
    display: block;
}

.menu-item {
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
    color: #1f2937;
}

.menu-item:hover {
    background: #f3f4f6;
}

.menu-item:not(:last-child) {
    border-bottom: 1px solid #e5e7eb;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
}

.close {
    font-size: 28px;
    font-weight: bold;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.close:hover {
    color: #1f2937;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
}

.btn-cancel,
.btn-confirm {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-cancel {
    background: #f3f4f6;
    color: #374151;
}

.btn-cancel:hover {
    background: #e5e7eb;
}

.btn-confirm {
    background: #667eea;
    color: white;
}

.btn-confirm:hover {
    background: #5568d3;
}

/* 上传相关样式 */
.upload-path {
    margin-bottom: 20px;
}

.upload-path label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
}

.upload-path select {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    line-height: 1.6;
}

.upload-path select option {
    padding: 6px 8px;
    white-space: pre;
}

.file-input-wrapper {
    margin-bottom: 20px;
}

.file-input-wrapper input[type="file"] {
    display: none;
}

.file-input-label {
    display: inline-block;
    padding: 12px 24px;
    background: #f3f4f6;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    width: 100%;
}

.file-input-label:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

#fileList {
    margin-top: 16px;
}

.file-list-item {
    padding: 8px;
    background: #f9fafb;
    border-radius: 4px;
    margin-bottom: 8px;
    font-size: 14px;
    color: #374151;
}

/* 文件夹树 */
.folder-tree {
    max-height: 300px;
    overflow-y: auto;
}

.folder-tree-item {
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
    font-size: 14px;
    color: #374151;
}

.folder-tree-item:hover {
    background: #f3f4f6;
}

.folder-tree-item.selected {
    background: #667eea;
    color: white;
}

.folder-tree-item .tree-icon {
    margin-right: 8px;
}

/* 属性内容 */
.properties-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.property-item {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    background: #f9fafb;
    border-radius: 6px;
}

.property-label {
    font-weight: 500;
    color: #6b7280;
}

.property-value {
    color: #1f2937;
}
