* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #f7f7f8;
    --bg-secondary: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #6b6b6b;
    --border-color: rgba(0, 0, 0, 0.1);
    --accent-color: #10a37f;
    --accent-hover: #0d8a6a;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

/* 弹窗打开时锁定body滚动 */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

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

.header {
    text-align: center;
    padding: 40px 20px;
}

.header h1 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
    max-width: 1000px;
    margin: 0 auto;
}

/* 玻璃卡片效果 */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

/* 表单样式 */
.form-section {
    padding: 30px;
}

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

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.required {
    color: #ef4444;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.9375rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.1);
}

.form-group textarea {
    resize: none;
    min-height: 100px;
}

/* 照片上传 */
.photo-upload {
    position: relative;
    width: 100%;
    height: 200px;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
}

.photo-upload:hover {
    border-color: var(--accent-color);
    background: rgba(16, 163, 127, 0.02);
}

.photo-upload.dragover {
    border-color: var(--accent-color);
    background: rgba(16, 163, 127, 0.05);
}

.upload-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--text-secondary);
}

.upload-placeholder svg {
    margin-bottom: 12px;
    opacity: 0.5;
}

.upload-placeholder span {
    display: block;
    font-size: 0.875rem;
}

.photo-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.photo-preview.show {
    display: block;
}

/* 预览区域 */
.preview-section {
    position: sticky;
    top: 20px;
}

.section-title {
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.preview-card {
    padding: 24px;
    margin-bottom: 20px;
}

.card-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 20px;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--glass-border);
}

.card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.card-photo img.show {
    display: block;
}

.card-photo img.show + .photo-placeholder {
    display: none;
}

.photo-placeholder {
    color: var(--text-secondary);
    opacity: 0.4;
}

.card-info {
    text-align: center;
}

.card-name {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.card-affiliation {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.card-info p {
    font-size: 0.875rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.card-info p strong {
    color: var(--text-secondary);
    font-weight: 500;
}

.card-info a {
    color: var(--accent-color);
    text-decoration: none;
}

.card-info a:hover {
    text-decoration: underline;
}

.card-intro {
    text-align: left;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

/* 按钮样式 */
.glass-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.submit-btn {
    width: 100%;
    background: var(--accent-color);
    color: white;
}

.submit-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 163, 127, 0.3);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 弹窗样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 30px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
}

.modal-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* 双卡片布局 */
.dual-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

/* 翻转卡片 */
.flip-card {
    perspective: 1000px;
    height: 450px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 16px;
    padding: 20px;
    overflow-y: auto;
}

.flip-card-front {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.flip-card-back {
    transform: rotateY(180deg);
}

/* 加载动画 - 玻璃反光效果 */
.loading-shimmer {
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 12px;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* 加载占位符 */
.loading-placeholder {
    padding: 20px 0;
}

.loading-shimmer-box {
    height: 20px;
    background: linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.06) 0%,
        rgba(0, 0, 0, 0.1) 50%,
        rgba(0, 0, 0, 0.06) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
    margin-bottom: 12px;
}

.loading-shimmer-box.short {
    width: 60%;
    margin-left: auto;
    margin-right: auto;
}

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

.lang-badge {
    background: var(--accent-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.edit-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.edit-btn:hover {
    background: var(--bg-primary);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.editable-card .card-photo {
    width: 80px;
    height: 80px;
    margin-bottom: 12px;
}

.editable-card .card-name {
    font-size: 1.125rem;
}

.editable-card p {
    font-size: 0.8125rem;
    margin-bottom: 6px;
}

.editable-card input,
.editable-card textarea {
    width: 100%;
    padding: 8px 10px;
    font-size: 0.8125rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-top: 4px;
    font-family: inherit;
}

.editable-card textarea {
    min-height: 60px;
    resize: none;
}

/* 隐藏所有滚动条 */
* {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

*::-webkit-scrollbar {
    display: none;
}

/* 弹窗按钮 */
.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.cancel-btn {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.cancel-btn:hover {
    background: #e5e5e5;
}

.confirm-btn {
    background: var(--accent-color);
    color: white;
    min-width: 140px;
}

.confirm-btn:hover {
    background: var(--accent-hover);
}

/* 成功弹窗 */
.success-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.success-modal.show {
    display: flex;
}

.success-content {
    text-align: center;
    padding: 40px 60px;
    background: white;
}

.success-content h3 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: var(--accent-color);
}

.success-content p {
    color: var(--text-secondary);
}

/* 打勾动画 */
.checkmark-circle {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
}

.checkmark {
    width: 100%;
    height: 100%;
}

.checkmark-circle-bg {
    stroke: var(--accent-color);
    stroke-width: 2;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
    stroke: var(--accent-color);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.4s forwards;
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .preview-section {
        position: static;
    }

    .dual-cards {
        grid-template-columns: 1fr;
    }

    .flip-card {
        height: 400px;
    }

    .modal-content {
        padding: 20px;
        max-height: 95vh;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .form-section {
        padding: 20px;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 12px;
    }

    .header {
        padding: 24px 12px;
    }

    .card-photo {
        width: 100px;
        height: 100px;
    }

    .photo-upload {
        height: 160px;
    }
}
