* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #f8fafc;
    color: #334155;
    line-height: 1.6;
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
.header {
    background: white;
    padding: 2rem 0;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
}

.header h1 {
    font-size: 2rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.header p {
    color: #64748b;
    font-size: 1rem;
}

/* 主体布局 */
.main {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* 表单容器 */
.form-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    height: fit-content;
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
}

.form-group input {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background: #fafafa;
}

.form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 头像选项 */
.avatar-options {
    position: relative;
}

.avatar-tabs {
    display: flex;
    margin-bottom: 0.75rem;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #d1d5db;
}

.avatar-tab {
    flex: 1;
    padding: 0.5rem 1rem;
    background: #f9fafb;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    color: #6b7280;
    transition: all 0.2s ease;
}

.avatar-tab.active {
    background: #3b82f6;
    color: white;
}

.avatar-tab:hover:not(.active) {
    background: #f3f4f6;
}

.avatar-upload, .avatar-url {
    display: none;
}

.avatar-upload.active, .avatar-url.active {
    display: block;
}

.upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fafafa;
}

.upload-area:hover {
    border-color: #3b82f6;
    background: #f0f9ff;
}

.upload-area span {
    color: #6b7280;
    font-size: 0.875rem;
}

.avatar-url input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background: #fafafa;
}

.avatar-url input:focus {
    outline: none;
    border-color: #3b82f6;
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 按钮样式 */
.action-buttons {
    margin-top: 1rem;
    display: flex;
    gap: 0.75rem;
}

.btn-primary, .btn-secondary {
    flex: 1;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

.btn-primary:active, .btn-secondary:active {
    transform: translateY(0);
}

/* 自定义信息项样式 */
.custom-items-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header label {
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
}

.add-btn {
    padding: 0.5rem 0.75rem;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-btn:hover {
    background: #059669;
    transform: translateY(-1px);
}

.custom-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.custom-item {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.custom-item input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background: #fafafa;
}

.custom-item input:focus {
    outline: none;
    border-color: #3b82f6;
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.remove-btn {
    padding: 0.75rem;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.75rem;
    min-width: 2.5rem;
}

.remove-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.custom-item-preview {
    font-size: 0.875rem;
    line-height: 1.5;
    color: #374151;
    padding: 0.25rem 0;
}

/* 预览容器 */
.preview-container {
    position: sticky;
    top: 2rem;
    height: fit-content;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* 标签页样式 */
.preview-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
}

.tab-btn {
    flex: 1;
    padding: 1rem;
    background: #f9fafb;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.2s ease;
}

.tab-btn.active {
    background: white;
    color: #1f2937;
    border-bottom: 2px solid #3b82f6;
}

.tab-btn:hover:not(.active) {
    background: #f3f4f6;
    color: #374151;
}

/* 标签内容 */
.tab-content {
    display: none;
    padding: 1.5rem;
}

.tab-content.active {
    display: block;
}

/* 代码容器样式 */
.code-container {
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
}

.code-header span {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.copy-btn {
    padding: 0.375rem 0.75rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.copy-btn:hover {
    background: #2563eb;
}

.code-container pre {
    margin: 0;
    padding: 1rem;
    overflow-x: auto;
    background: #f8fafc;
}

.code-container code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.75rem;
    line-height: 1.5;
    color: #374151;
    white-space: pre-wrap;
    word-break: break-all;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #f1f5f9;
    width: 100%;
    max-width: 400px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.avatar-container {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #f1f5f9;
    background: #f8fafc;
}

.avatar-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.social-icons {
    display: flex;
    gap: 0.5rem;
    opacity: 0.6;
}

.social-icons span {
    font-size: 1.25rem;
}

.card-content {
    text-align: left;
}

.name {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.profession {
    color: #64748b;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.info-item {
    font-size: 0.875rem;
    line-height: 1.5;
    color: #374151;
    padding: 0.25rem 0;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .main {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.5rem;
    }
    
    .preview-container {
        position: static;
        order: -1; /* 预览区域在移动端显示在表单上方 */
    }
    
    .card {
        margin: 0 auto;
        max-width: 100%;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .main {
        padding: 1rem;
        gap: 1rem;
    }
    
    .form-container {
        padding: 1rem;
        border-radius: 8px;
    }
    
    .form-section {
        gap: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .header {
        padding: 1rem;
    }
    
    .header h1 {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }
    
    .header p {
        font-size: 0.875rem;
    }
    
    .card {
        padding: 1.5rem;
        border-radius: 12px;
    }
    
    .card-header {
        margin-bottom: 1rem;
    }
    
    .avatar-container {
        width: 60px;
        height: 60px;
    }
    
    .name {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }
    
    .profession {
        font-size: 0.8rem;
        margin-bottom: 1rem;
    }
    
    .info-list {
        gap: 0.5rem;
    }
    
    .info-item {
        font-size: 0.8rem;
        padding: 0.125rem 0;
    }
    
    /* 表单元素移动端优化 */
    .form-group input {
        padding: 0.875rem;
        font-size: 16px; /* 防止iOS缩放 */
        border-radius: 6px;
    }
    
    .avatar-tab {
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
    }
    
    .upload-area {
        padding: 1rem;
    }
    
    .upload-area span {
        font-size: 0.8rem;
    }
    
    /* 按钮移动端优化 */
    .action-buttons {
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 1.5rem;
    }
    
    .btn-primary, .btn-secondary {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        border-radius: 6px;
    }
    
    /* 标签页移动端优化 */
    .tab-btn {
        padding: 0.875rem;
        font-size: 0.8rem;
    }
    
    .tab-content {
        padding: 1rem;
    }
    
    /* 代码区域移动端优化 */
    .code-container code {
        font-size: 0.7rem;
        line-height: 1.4;
    }
    
    .code-header {
        padding: 0.5rem 0.75rem;
    }
    
    .copy-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.7rem;
    }
    
    /* 自定义项目移动端优化 */
    .custom-item {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .custom-item input {
        font-size: 16px; /* 防止iOS缩放 */
        padding: 0.875rem;
    }
    
    .remove-btn {
        align-self: flex-end;
        min-width: auto;
        padding: 0.5rem 1rem;
    }
    
    .add-btn {
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .main {
        padding: 0.75rem;
    }
    
    .header {
        padding: 0.75rem;
    }
    
    .header h1 {
        font-size: 1.25rem;
    }
    
    .form-container {
        padding: 0.75rem;
        margin: 0;
    }
    
    .card {
        padding: 1rem;
        border-radius: 8px;
    }
    
    .avatar-container {
        width: 50px;
        height: 50px;
    }
    
    .name {
        font-size: 1.25rem;
    }
    
    .profession {
        font-size: 0.75rem;
    }
    
    .info-item {
        font-size: 0.75rem;
    }
    
    .social-icons span {
        font-size: 1rem;
    }
    
    /* 通知在小屏幕上的优化 */
    .notification {
        top: 0.5rem;
        right: 0.5rem;
        left: 0.5rem;
        transform: translateY(-100%);
        font-size: 0.8rem;
    }
    
    .notification.show {
        transform: translateY(0);
    }
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    font-size: 0.875rem;
}

.notification.success {
    background: #10b981;
}

.notification.error {
    background: #ef4444;
}

.notification.show {
    transform: translateX(0);
}

/* 底部样式 */
.footer {
    background: white;
    border-top: 1px solid #e2e8f0;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
}

.footer-section {
    display: flex;
    justify-content: center;
}

.copyright {
    color: #64748b;
    font-size: 0.875rem;
    margin: 0;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s ease;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: #f8fafc;
}

.footer-link:hover {
    color: #3b82f6;
    background: #f0f9ff;
}

.footer-link .icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

/* 响应式底部 */
@media (max-width: 768px) {
    .footer {
        padding: 1.5rem 0;
        margin-top: 2rem;
    }
    
    .footer-content {
        padding: 0 1rem;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .footer-link {
        justify-content: center;
        width: 100%;
        max-width: 280px;
    }
    
    .copyright {
        font-size: 0.75rem;
        line-height: 1.4;
    }
}
