:root {
    /* 现代色彩系统 (Zinc/Slate & Vibrant Blue) */
    --bg-app: #09090b;
    /* 极深背景 */
    --bg-surface: #18181b;
    /* 卡片/侧边栏背景 */
    --bg-surface-hover: #27272a;

    --border-subtle: #27272a;
    --border-default: #3f3f46;

    --primary: #3b82f6;
    /* 核心蓝 */
    --primary-hover: #2563eb;
    --primary-foreground: #ffffff;

    --text-main: #f4f4f5;
    /* 主要文字 */
    --text-muted: #a1a1aa;
    /* 次要文字 */

    --danger: #ef4444;
    --success: #10b981;

    /* 布局与间距 */
    --container-width: 1200px;
    --header-height: 64px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;

    --space-2: 0.5rem;
    /* 8px */
    --space-3: 0.75rem;
    /* 12px */
    --space-4: 1rem;
    /* 16px */
    --space-6: 1.5rem;
    /* 24px */
    --space-8: 2rem;
    /* 32px */
}

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

button {
    font-family: inherit;
}

/* 导航栏 */
.navbar {
    background-color: rgba(9, 9, 11, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
}

.nav-container {
    max-width: var(--container-width);
    margin: 0 auto;
    width: 100%;
    padding: 0 var(--space-6);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: -0.025em;
}

.logo-icon {
    font-size: 1.5rem;
}

.nav-actions,
.nav-user {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.user-name {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-right: var(--space-2);
}

/* 主布局 */
.container {
    max-width: var(--container-width);
    margin: var(--space-8) auto;
    padding: 0 var(--space-6);
    display: grid;
    grid-template-columns: 240px 1fr;
    /* 侧边栏固定宽度 */
    gap: var(--space-8);
    min-height: calc(100vh - var(--header-height) - var(--space-8));
}

/* 侧边栏 */
.sidebar {
    position: sticky;
    top: calc(var(--header-height) + var(--space-8));
    height: fit-content;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.menu-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.925rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.menu-item:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-main);
}

.menu-item.active {
    background-color: var(--bg-surface-hover);
    color: var(--primary);
}

.menu-divider {
    height: 1px;
    background-color: var(--border-subtle);
    margin: var(--space-3) 0;
}

.menu-icon {
    font-size: 1.1rem;
    opacity: 0.8;
}

/* 主内容区 */
.main-content {
    width: 100%;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
}

.content-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-main);
}

/* 搜索框 */
.search-box input {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    width: 280px;
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* 卡片网格 */
.shares-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-4);
}

.share-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.share-card:hover {
    border-color: var(--border-default);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.share-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-3);
}

.share-type {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.share-type.text {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

.share-type.file {
    background-color: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.share-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.share-content {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: var(--space-4);
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

.share-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-3);
    border-top: 1px solid var(--border-subtle);
    font-size: 0.75rem;
    color: #71717a;
    /* Zinc-500 */
}

/* 按钮系统 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    line-height: 1;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--primary-foreground);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: transparent;
    border-color: var(--border-default);
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: var(--bg-surface-hover);
    border-color: var(--text-muted);
}

.btn-block {
    width: 100%;
    padding: 0.75rem;
}

/* 模态框 */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background-color: #18181b;
    /* Zinc-900 */
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 480px;
    z-index: 1001;
    position: relative;
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    animation: zoomIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-large {
    max-width: 700px;
}

.modal-header {
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-main);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    border-radius: 4px;
}

.modal-close:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-main);
}

.modal-body {
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.modal-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--border-subtle);
    background-color: rgba(24, 24, 27, 0.5);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* 表单元素 */
.input,
.textarea {
    width: 100%;
    background-color: #09090b;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    color: var(--text-main);
    font-size: 0.925rem;
    transition: 0.2s;
    font-family: inherit;
}

.textarea {
    min-height: 120px;
    resize: vertical;
}

.input:focus,
.textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
    user-select: none;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* 文件上传 */
.file-upload {
    position: relative;
    width: 100%;
    margin-bottom: var(--space-4);
}

.file-upload input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--border-default);
    border-radius: var(--radius-lg);
    background-color: rgba(255, 255, 255, 0.02);
    padding: var(--space-8);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 160px;
    width: 100%;
}

.file-upload-label:hover {
    border-color: var(--primary);
    background-color: rgba(59, 130, 246, 0.05);
}

.file-upload input[type="file"]:focus+.file-upload-label {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.upload-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-3);
    color: var(--text-muted);
    transition: transform 0.2s ease, color 0.2s ease;
}

.file-upload-label:hover .upload-icon {
    transform: translateY(-4px);
    color: var(--primary);
}

.upload-text {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.file-name {
    margin-top: var(--space-3);
    font-size: 0.875rem;
    color: var(--text-main);
    text-align: center;
    min-height: 24px;
}

.file-name:not(:empty) {
    padding: var(--space-2) var(--space-3);
    background: rgba(59, 130, 246, 0.1);
    border-radius: var(--radius-md);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
}


/* 状态组件 (Toast & Empty) */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    background-color: #18181b;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-main);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    z-index: 2000;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast.success {
    border-left: 3px solid var(--success);
}

.toast.error {
    border-left: 3px solid var(--danger);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
    color: var(--text-muted);
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius-lg);
}

.empty-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-2);
    opacity: 0.3;
}

.hidden {
    display: none !important;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        padding: 0 var(--space-4);
        margin: var(--space-4) auto;
        gap: var(--space-6);
    }

    .sidebar {
        position: static;
        margin-bottom: var(--space-4);
    }

    .shares-grid {
        grid-template-columns: 1fr;
    }

    .search-box input {
        width: 100%;
    }

    .nav-container {
        padding: 0 var(--space-4);
    }
}