/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: default;
    user-select: none;
}

/* 输入元素光标 */
input, textarea, select, button, a {
    cursor: pointer;
    user-select: auto;
}

input[type="text"], input[type="password"], input[type="email"], textarea {
    cursor: text;
    user-select: text;
}

/* 文本内容 */
p, h1, h2, h3, h4, h5, h6, span {
    user-select: text;
    cursor: text;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

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

/* 导航栏 */
.nav-header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.nav-logo {
    font-size: 24px;
    font-weight: bold;
    color: #1890ff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: nowrap;
    white-space: nowrap;
}

/* 认证表单 */
.auth-form {
    max-width: 450px;
    margin: 80px auto;
    padding: 40px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    position: relative;
}

.auth-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1890ff, #40a9ff, #69c0ff);
    border-radius: 12px 12px 0 0;
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 24px;
    font-weight: 600;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.1);
}

.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: #fff;
}

.form-group select:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.1);
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    min-width: 100px;
}

.btn-primary {
    background: linear-gradient(90deg, #1890ff, #40a9ff);
    color: #fff;
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.3);
}

/* 表单中的主按钮 */
.form-group .btn-primary {
    width: 100%;
}

.btn-primary:hover {
    background: linear-gradient(90deg, #40a9ff, #69c0ff);
    box-shadow: 0 6px 16px rgba(24, 144, 255, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: #f0f2f5;
    color: #333;
    border: 1px solid #e8e8e8;
}

.btn-secondary:hover {
    background-color: #e6e8eb;
    border-color: #d9d9d9;
    transform: translateY(-1px);
}

.btn-outline {
    background-color: transparent;
    color: #1890ff;
    border: 1px solid #1890ff;
}

.btn-outline:hover {
    background-color: rgba(24, 144, 255, 0.05);
}

/* 表单底部 */
.form-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: #666;
}

.form-footer a {
    color: #1890ff;
    text-decoration: none;
    font-weight: 500;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* 消息提示 */
.message {
    margin-top: 20px;
    padding: 14px 18px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.success {
    background-color: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #52c41a;
}

.message.error {
    background-color: #fff2f0;
    border: 1px solid #ffccc7;
    color: #ff4d4f;
}

/* 仪表盘 */
.dashboard {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    padding: 40px;
    margin-top: 40px;
    position: relative;
    overflow: hidden;
}

.dashboard::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1890ff, #40a9ff, #69c0ff);
    border-radius: 12px 12px 0 0;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid #f0f0f0;
}

.dashboard-header h2 {
    font-size: 28px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 24px;
}

.welcome-message {
    font-size: 16px;
    color: #666;
}

.points-info {
    background: linear-gradient(135deg, #f6ffed, #f0fff4);
    padding: 12px 24px;
    border-radius: 24px;
    border: 1px solid #b7eb8f;
    color: #52c41a;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(82, 196, 26, 0.15);
}

.dashboard-actions {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 32px;
    padding: 24px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.08);
}

.dashboard-actions .btn {
    flex: 1;
    min-width: 120px;
    max-width: 200px;
}

.dashboard-actions .btn-primary {
    background: linear-gradient(90deg, #1890ff, #40a9ff);
    color: #fff;
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.3);
}

.dashboard-actions .btn-secondary {
    background-color: #f0f2f5;
    color: #333;
    border: 1px solid #e8e8e8;
}

.dashboard-actions .btn-outline {
    background-color: transparent;
    color: #1890ff;
    border: 1px solid #1890ff;
}

/* 文档列表 */
.documents-section {
    margin-top: 40px;
}

.documents-section h3 {
    margin-bottom: 24px;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.document-list {
    list-style: none;
    background-color: #fafafa;
    border-radius: 8px;
    overflow: hidden;
}

.document-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    background-color: #fff;
}

.document-item:hover {
    background-color: #f8f9fa;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.document-info h4 {
    margin-bottom: 8px;
    color: #333;
    font-size: 16px;
    font-weight: 500;
}

.document-meta {
    font-size: 14px;
    color: #8c8c8c;
    display: flex;
    gap: 16px;
}

.document-type {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.document-type.html {
    background-color: #fff1f0;
    color: #ff4d4f;
}

.document-type.css {
    background-color: #f0f5ff;
    color: #1890ff;
}

.document-type.js {
    background-color: #f6ffed;
    color: #52c41a;
}

.document-actions {
    display: flex;
    gap: 8px;
}

/* 编辑页面 */
.edit-section {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    padding: 40px;
    margin-top: 40px;
}

.edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid #f0f0f0;
}

.edit-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.edit-form {
    margin-bottom: 40px;
}

.form-group textarea {
    width: 100%;
    padding: 16px;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Courier New', Courier, monospace;
    min-height: 450px;
    resize: vertical;
    transition: all 0.3s ease;
    line-height: 1.5;
}

.form-group textarea:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.1);
}

/* 分享链接 */
.share-section {
    margin-top: 40px;
    padding: 28px;
    background-color: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #f0f0f0;
}

.share-section h4 {
    margin-bottom: 20px;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.share-link {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    align-items: center;
}

.share-link input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    font-size: 14px;
    background-color: #fff;
}

.share-link input:focus {
    outline: none;
    border-color: #1890ff;
}

.share-section p {
    font-size: 14px;
    color: #8c8c8c;
    margin: 0;
}

/* 创建文档页面 */
.create-section {
    max-width: 600px;
    margin: 80px auto;
    padding: 40px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    position: relative;
}

.create-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1890ff, #40a9ff, #69c0ff);
    border-radius: 12px 12px 0 0;
}

.create-section h2 {
    text-align: center;
    margin-bottom: 32px;
    color: #333;
    font-size: 24px;
    font-weight: 600;
}

.create-form .form-group {
    margin-bottom: 28px;
}

.type-options {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.type-option {
    flex: 1;
    padding: 16px;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.type-option:hover {
    border-color: #1890ff;
    background-color: rgba(24, 144, 255, 0.05);
}

.type-option input {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.type-option.selected {
    border-color: #1890ff;
    background-color: rgba(24, 144, 255, 0.1);
    box-shadow: 0 2px 8px rgba(24, 144, 255, 0.2);
}

.type-option .icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.type-option .label {
    font-weight: 500;
    color: #333;
}

/* 返回按钮 */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 24px;
    transition: all 0.3s ease;
}

.back-link:hover {
    color: #1890ff;
    transform: translateX(-4px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    .nav-container {
        padding: 0 16px;
    }
    
    .nav-logo {
        font-size: 20px;
    }
    
    .nav-actions {
        gap: 8px;
    }
    
    .auth-form {
        margin: 40px auto;
        padding: 32px 24px;
    }
    
    .dashboard {
        padding: 24px;
        margin-top: 24px;
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .user-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        width: 100%;
    }
    
    .dashboard-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .dashboard-actions .btn {
        flex: 1;
        min-width: 120px;
    }
    
    .document-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 16px;
    }
    
    .document-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 8px;
    }
    
    .edit-section {
        padding: 24px;
        margin-top: 24px;
    }
    
    .edit-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .share-link {
        flex-direction: column;
        align-items: stretch;
    }
    
    .create-section {
        margin: 40px auto;
        padding: 32px 24px;
    }
    
    .type-options {
        flex-direction: column;
    }
    
    .type-option {
        text-align: left;
        padding: 16px 20px;
    }
    
    .type-option .icon {
        display: inline-block;
        margin-right: 16px;
        margin-bottom: 0;
    }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #8c8c8c;
}

.empty-state .icon {
    font-size: 64px;
    margin-bottom: 24px;
    opacity: 0.5;
}

.empty-state h4 {
    margin-bottom: 12px;
    color: #666;
    font-size: 18px;
}

.empty-state p {
    margin-bottom: 32px;
    font-size: 14px;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #1890ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    opacity: 0.9;
}

.tooltip:hover::before {
    content: '';
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}