/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* 基础样式 */
html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Noto Sans Lao', 'Noto Sans SC', 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 10px;
    line-height: 1.6;
    color: #333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 容器 */
.container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
    position: relative;
}

/* 头部 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 20px;
    text-align: center;
    position: relative;
}

.header-top {
    position: absolute;
    top: 15px;
    right: 20px;
    z-index: 10;
}

.header h1 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    font-weight: 600;
}

/* 导航链接 */
.nav-links {
    margin-bottom: 15px;
}

.nav-link {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.3);
}

.nav-link:hover {
    background: #e9ecef;
    color: #333;
}

.nav-link:active {
    transform: scale(0.95);
}

/* 语言切换器 */
.language-switcher {
    display: flex;
    justify-content: flex-end;
}

.lang-select {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    font-weight: 500;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23ffffff'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2 2 2 0 012 2v2.945M8 3.935V5.5A2.5 2.5 0 0010.5 8h.5a2 2 0 012 2 2 2 0 104 0 2 2 0 012-2h1.064M15 20.488V18a2 2 0 012-2h3.064M21 12a9 9 0 11-18 0 9 9 0 0118 0z'/%3e%3c/svg%3e"), url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: left 8px center, right 8px center;
    background-repeat: no-repeat;
    background-size: 16px, 12px;
    padding-left: 32px;
    padding-right: 28px;
    min-width: 100px;
    text-align: center;
}

.lang-select:focus {
    outline: none;
    border-color: rgba(255,255,255,0.5);
    box-shadow: 0 0 0 2px rgba(255,255,255,0.2);
}

.lang-select option {
    background: #667eea;
    color: white;
    padding: 8px;
}

/* 保留原来的按钮样式作为备用 */
.lang-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    font-weight: 500;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.lang-btn:active {
    transform: scale(0.95);
}

.lang-btn.active {
    background: white;
    color: #667eea;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 表单容器 */
.form-container {
    padding: 25px 20px;
}

/* 表单组 */
.form-group {
    margin-bottom: 20px;
}

.form-group > label {
    display: inline-block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

.photo-hint {
    display: inline-block;
    margin-left: 10px;
    font-size: 0.9em;
    font-weight: 400;
    color: var(--text-light-color);
}

/* 表单控件 */
.form-control {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
    font-family: inherit;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control:invalid {
    border-color: #e74c3c;
}

/* Select 样式 */
select.form-control {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

/* 表单行 */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-row .form-group {
    margin-bottom: 0;
}

/* 文件上传 */
.file-upload {
    position: relative;
    display: inline-block;
    width: 100%;
}

.file-upload input[type=file] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 1;
}

.file-upload-label {
    display: block;
    padding: 15px;
    border: 2px dashed #667eea;
    border-radius: 12px;
    text-align: center;
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
    font-weight: 500;
}

.file-upload-label:active {
    background: #e8f0fe;
    border-color: #5a6fd8;
    transform: scale(0.98);
}

/* 提交按钮 */
.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 18px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 25px;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.submit-btn:active {
    transform: translateY(1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

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

/* 字符计数 */
.char-count {
    color: #666;
    text-align: right;
    display: block;
    margin-top: 8px;
    font-size: 0.875rem;
}

.char-count.warning {
    color: #f39c12;
}

.char-count.error {
    color: #e74c3c;
}

/* 图片预览 */
.preview-images {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.preview-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 10px;
    margin-top: 10px;
}

.time-picker-trigger {
    cursor: pointer;
    display: flex;
    align-items: center;
    padding-left: 15px;
    color: #ccc;
}

.time-picker-trigger.selected {
    color: var(--text-color);
}

.time-picker-panel {
    display: none;
    position: absolute;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    width: 200px;
    height: 250px;
    overflow-y: auto;
    z-index: 1001;
    color: var(--dark-bg);
}

.time-picker-panel::-webkit-scrollbar {
    width: 6px;
}

.time-picker-panel::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.time-picker-option {
    padding: 10px 15px;
    cursor: pointer;
    font-size: 0.95rem;
}

.time-picker-option:hover {
    background: var(--primary-color-light);
}

/* 必填项标记 */
.required {
    color: #e74c3c;
}

/* 加载状态 */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* 成功状态 */
.success {
    border-color: #27ae60 !important;
    background-color: #d5f4e6 !important;
}

/* 错误状态 */
.error {
    border-color: #e74c3c !important;
    background-color: inherit !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 5px;
    }
    .container {
        border-radius: 15px;
        margin: 0;
    }
    .header {
        padding: 20px 15px;
    }
    .header h1 {
        font-size: 1.3rem;
    }
    .form-container {
        padding: 20px 15px;
    }
    .form-control {
        padding: 14px;
        font-size: 16px; /* 防止iOS缩放 */
    }
    .submit-btn {
        padding: 16px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .language-switcher {
        gap: 8px;
    }
    
    .lang-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .preview-image {
        width: 70px;
        height: 70px;
    }
}

/* 触摸优化 */
@media (hover: none) and (pointer: coarse) {
    .form-control {
        min-height: 44px; /* iOS推荐的最小触摸目标 */
    }
    
    .lang-btn {
        min-height: 36px;
    }
    
    .submit-btn {
        min-height: 48px;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    }
    
    .container {
        background: #2c3e50;
        color: #ecf0f1;
    }
    
    .form-group label {
        color: #ecf0f1;
    }
    
    .form-control {
        background: #34495e;
        border-color: #4a5f7a;
        color: #ecf0f1;
    }
    
    .form-control:focus {
        background: #2c3e50;
    }
    
    .file-upload-label {
        background: #34495e;
        border-color: #667eea;
        color: #667eea;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-group {
    animation: fadeIn 0.3s ease-out;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5a6fd8;
}

.form-row-prefix {
    display: flex;
    align-items: stretch; /* 让子元素高度一致 */
    border: 1px solid #ced4da;
    border-radius: 8px;
    overflow: hidden; /* 确保圆角生效 */
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.form-row-prefix:focus-within {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, .25);
}

.prefix-label {
    display: flex;
    align-items: center;
    padding: 0 15px;
    font-size: 16px;
    font-weight: 400;
    color: #495057;
    background-color: #e9ecef;
    border-right: 1px solid #ced4da;
}

.form-row-prefix .form-control {
    border: none;
    box-shadow: none;
    border-radius: 0;
    flex: 1;
    min-width: 0; /* 解决flex item内部input宽度溢出问题 */
}

.recruitment-code-notice {
    color: #d9534f; /* 红色文字 */
    text-align: center;
    font-size: 14px; /* 调小字体 */
    margin-top: 10px; /* 与上方按钮的间距 */
    padding: 0 15px;
    line-height: 1.4;
    font-weight: 500;
}

/* 弹窗样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none; /* 默认隐藏 */
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.visible {
    display: flex;
}

.modal-content {
    background: white;
    padding: 25px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 18px;
    color: #333;
}

.modal-content .form-control {
    margin-bottom: 10px;
    text-align: center;
    font-size: 16px;
    /* 确保弹窗内的输入框在白色背景下可见 */
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.modal-notice {
    font-size: 13px;
    color: #666;
    margin-bottom: 25px;
}

.modal-actions {
    display: flex;
    gap: 15px;
}

.modal-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cancel-btn {
    background: #e9ecef;
    color: #555;
}

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

.confirm-btn {
    background: #007bff;
    color: white;
}

.confirm-btn:hover {
    background: #0056b3;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 新的四宫格照片上传样式 */
.photo-grid-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.photo-slot {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 aspect ratio */
    border: 2px dashed #d0d5dd;
    border-radius: 8px;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
}

.photo-slot:hover {
    border-color: #007bff;
    background-color: #f1f5f9;
}

.photo-slot .plus-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: #d0d5dd;
    font-weight: 300;
    pointer-events: none;
}

.photo-slot .preview-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-slot .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    line-height: 22px;
    text-align: center;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s;
}

.photo-slot:hover .remove-btn {
    opacity: 1;
}

#workPhotos {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    white-space: nowrap;
}

.file-upload-label {
    display: block;
    padding: 15px;
    border: 2px dashed #667eea;
    border-radius: 12px;
    text-align: center;
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
    font-weight: 500;
}

.file-upload-label:active {
    background: #e8f0fe;
    border-color: #5a6fd8;
    transform: scale(0.98);
}

/* 吐司提示样式 */
.success-message, .error-message {
    position: fixed; 
    top: 20px; 
    left: 50%; 
    transform: translateX(-50%);
    color: white; 
    padding: 15px 25px; 
    border-radius: 8px; 
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15); 
    animation: slideDown 0.3s ease;
    font-weight: 500; 
    font-size: 0.9rem;
    max-width: 90%;
    text-align: center;
}

.success-message { 
    background: #27ae60; 
}

.error-message { 
    background: #e74c3c; 
}

@keyframes slideDown {
    from { 
        opacity: 0; 
        transform: translateX(-50%) translateY(-20px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(-50%) translateY(0); 
    }
} 