/* 通用样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 500px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
}

.header {
    background: #1976d2;
    color: white;
    padding: 20px;
    text-align: center;
    font-size: 20px;
    font-weight: bold;
}

.section-subtitle {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #333;
}

.required {
    color: #f44336;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    background: #fafafa;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #1976d2;
    background: white;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.1);
}

.form-input::placeholder {
    color: #999;
}

.select-group {
    margin-bottom: 15px;
}

.select-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.3s ease;
}

.select-header:hover {
    background: #f0f0f0;
}

.select-header.active {
    border-color: #1976d2;
    background: white;
}

.select-text {
    font-size: 16px;
    color: #333;
}

.select-placeholder {
    color: #999;
}

.select-arrow {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.select-arrow.rotated {
    transform: rotate(180deg);
}

.select-options {
    display: none;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    background: white;
    max-height: 200px;
    overflow-y: auto;
}

.select-options.show {
    display: block;
}

.select-option {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.select-option:hover {
    background: #f5f5f5;
}

.select-option:last-child {
    border-bottom: none;
}

.radio-group {
    margin-bottom: 20px;
}

.radio-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
}

.radio-option {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
}

.radio-input {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
    /* 移动端增大触摸区域 */
    min-width: 18px;
    min-height: 18px;
}

.radio-label {
    font-size: 16px;
    color: #333;
    cursor: pointer;
    line-height: 1.4;
}

/* 单选框选中时的高亮效果 */
.radio-option:has(.radio-input:checked) {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    border: 2px solid #4caf50;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
    transform: scale(1.02);
}

.radio-option:has(.radio-input:checked) .radio-label {
    color: #2e7d32;
    font-weight: 600;
}

/* 兼容不支持:has选择器的浏览器 */
.radio-option.selected {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    border: 2px solid #4caf50;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
    transform: scale(1.02);
}

.radio-option.selected .radio-label {
    color: #2e7d32;
    font-weight: 600;
}

/* 单选框悬停效果 */
.radio-option:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
    transform: translateX(2px);
}

.radio-option:has(.radio-input:checked):hover,
.radio-option.selected:hover {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    border-color: #4caf50;
    transform: scale(1.02) translateX(2px);
}

.textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    background: #fafafa;
    resize: vertical;
    font-family: inherit;
}

.textarea:focus {
    outline: none;
    border-color: #1976d2;
    background: white;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.1);
}

.hint-text {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

/* 实时校验样式 */
.validation-message {
    font-size: 12px;
    margin-top: 5px;
    padding: 5px 8px;
    border-radius: 4px;
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.validation-message.show {
    display: block;
}

.validation-message.error {
    background-color: #ffeaea;
    color: #d63031;
    border: 1px solid #fab1a0;
}

.validation-message.success {
    background-color: #d1f2eb;
    color: #00b894;
    border: 1px solid #55efc4;
}

.validation-message.warning {
    background-color: #fff3cd;
    color: #e17055;
    border: 1px solid #fdcb6e;
}

/* 输入框状态样式 */
.form-input.valid {
    border-color: #00b894;
    box-shadow: 0 0 0 2px rgba(0, 184, 148, 0.1);
}

.form-input.invalid {
    border-color: #d63031;
    box-shadow: 0 0 0 2px rgba(214, 48, 49, 0.1);
}

.form-input.warning {
    border-color: #e17055;
    box-shadow: 0 0 0 2px rgba(225, 112, 85, 0.1);
}

/* 单选按钮组校验状态 */
.radio-group.invalid .form-label {
    color: #d63031;
}

.radio-group.valid .form-label {
    color: #00b894;
}

/* NFC选择区域校验状态 */
.nfc-section.invalid .form-label {
    color: #d63031;
}

.nfc-section.valid .form-label {
    color: #00b894;
}

/* 下拉选择校验状态 */
.select-group.invalid .select-header {
    border-color: #d63031;
    box-shadow: 0 0 0 2px rgba(214, 48, 49, 0.1);
}

.select-group.valid .select-header {
    border-color: #00b894;
    box-shadow: 0 0 0 2px rgba(0, 184, 148, 0.1);
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

.nfc-section {
    margin-bottom: 20px;
}

.nfc-hint {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
}

.nfc-button {
    width: 100%;
    padding: 15px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    background: #fafafa;
    font-size: 16px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.nfc-button:hover {
    border-color: #1976d2;
    color: #1976d2;
    background: #f5f7fa;
}

.nfc-button.active {
    border-color: #4caf50;
    color: #4caf50;
    background: #f1f8e9;
}

.submit-button {
    width: 100%;
    padding: 15px;
    background: #1976d2;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.submit-button:hover {
    background: #1565c0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
}

.footer-text {
    text-align: center;
    font-size: 12px;
    color: #999;
    padding: 20px;
    line-height: 1.5;
}

.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.alert-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

/* ================================== */
/* 成功状态覆盖层样式 */
/* ================================== */

.success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    animation: successOverlayFadeIn 0.8s ease-out;
}

@keyframes successOverlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.success-overlay-content {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 20px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    padding: 40px 30px;
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: successContentSlideUp 0.8s ease-out 0.2s both;
    overflow: hidden;
}

@keyframes successContentSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 背景装饰 */
.success-bg-decoration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.success-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.1);
    animation: successFloat 6s ease-in-out infinite;
}

.success-circle-1 {
    width: 60px;
    height: 60px;
    top: 10%;
    right: 10%;
    animation-delay: 0s;
}

.success-circle-2 {
    width: 40px;
    height: 40px;
    bottom: 20%;
    left: 15%;
    animation-delay: 2s;
}

.success-circle-3 {
    width: 80px;
    height: 80px;
    top: 60%;
    right: 20%;
    animation-delay: 4s;
}

@keyframes successFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-15px) rotate(120deg); }
    66% { transform: translateY(8px) rotate(240deg); }
}

/* 成功主内容 */
.success-main-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

/* 成功图标 */
.success-icon-container {
    margin-bottom: 25px;
}

.success-checkmark-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00c851 0%, #00a641 100%);
    position: relative;
    margin: 0 auto;
    animation: successIconScale 0.6s ease-out 0.5s both;
}

.success-checkmark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
}

.success-checkmark::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    height: 3px;
    width: 12px;
    background: white;
    border-radius: 2px;
    transform: rotate(45deg);
    transform-origin: left bottom;
    animation: successCheck1 0.3s ease-out 1.1s both;
}

.success-checkmark::after {
    content: '';
    position: absolute;
    left: 8px;
    top: 50%;
    height: 3px;
    width: 20px;
    background: white;
    border-radius: 2px;
    transform: rotate(-45deg);
    transform-origin: left bottom;
    animation: successCheck2 0.3s ease-out 1.3s both;
}

@keyframes successIconScale {
    from {
        opacity: 0;
        transform: scale(0.3);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes successCheck1 {
    from { width: 0; }
    to { width: 12px; }
}

@keyframes successCheck2 {
    from { width: 0; }
    to { width: 20px; }
}

/* 成功文本内容 */
.success-text-content {
    animation: successTextFadeIn 0.6s ease-out 0.7s both;
}

.success-main-title {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 10px 0;
    line-height: 1.2;
}

.success-main-subtitle {
    font-size: 16px;
    color: #7f8c8d;
    margin: 0 0 25px 0;
    line-height: 1.4;
}

@keyframes successTextFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 成功信息卡片 */
.success-info-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    animation: successCardSlide 0.6s ease-out 0.9s both;
}

.success-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 8px 0;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.success-info-item:last-child {
    border-bottom: none;
}

.success-info-label {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.success-info-value {
    font-weight: 700;
    color: #2c3e50;
    font-size: 14px;
    font-family: 'Courier New', monospace;
}

@keyframes successCardSlide {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 下一步说明 */
.success-next-steps {
    text-align: left;
    margin: 25px 0;
    animation: successStepsSlide 0.6s ease-out 1.1s both;
}

.success-next-steps h3 {
    color: #2c3e50;
    font-size: 18px;
    margin-bottom: 15px;
    text-align: center;
}

.success-steps-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.success-step-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 10px;
    border-left: 4px solid #667eea;
    transition: transform 0.2s ease;
}

.success-step-card:hover {
    transform: translateX(5px);
}

.success-step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.success-step-info h4 {
    margin: 0 0 5px 0;
    color: #2c3e50;
    font-size: 15px;
}

.success-step-info p {
    margin: 0;
    color: #6c757d;
    font-size: 13px;
    line-height: 1.4;
}

@keyframes successStepsSlide {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 温馨提示 */
.success-tips-card {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-radius: 12px;
    padding: 18px;
    margin: 20px 0;
    text-align: left;
    animation: successTipsSlide 0.6s ease-out 1.3s both;
}

.success-tips-card h4 {
    color: #856404;
    margin: 0 0 12px 0;
    font-size: 15px;
    text-align: center;
}

.success-tips-list {
    margin: 0;
    padding-left: 18px;
    color: #6c5317;
}

.success-tips-list li {
    margin: 6px 0;
    font-size: 13px;
    line-height: 1.5;
}

.success-tips-list a {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
}

.success-tips-list a:hover {
    text-decoration: underline;
}

@keyframes successTipsSlide {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 成功操作按钮 */
.success-action-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 25px 0 10px 0;
    animation: successButtonsSlide 0.6s ease-out 1.5s both;
}

.success-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    min-width: 110px;
    justify-content: center;
}

.success-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.success-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.success-btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
}

.success-btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

.success-btn-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
}

.success-btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(23, 162, 184, 0.4);
}

@keyframes successButtonsSlide {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 移动端成功页面适配 */
@media (max-width: 768px) {
    .success-overlay-content {
        margin: 10px;
        padding: 30px 20px;
        border-radius: 15px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .success-main-title {
        font-size: 24px;
    }
    
    .success-action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .success-btn {
        width: 100%;
        max-width: 280px;
    }
    
    .success-steps-grid {
        gap: 10px;
    }
    
    .success-step-card {
        padding: 12px;
    }
    
    .success-info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .success-checkmark-circle {
        width: 60px;
        height: 60px;
    }
    
    .success-checkmark {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 480px) {
    .success-overlay-content {
        margin: 5px;
        padding: 25px 15px;
    }
    
    .success-main-title {
        font-size: 20px;
    }
    
    .success-main-subtitle {
        font-size: 14px;
    }
}

/* 响应式设计 */
@media (max-width: 600px) {
    .container {
        max-width: 100%;
    }
}
