/* 统一签名页面增强样式 */

/* 添加现代化的渐变背景 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 10% 20%, rgba(67, 97, 238, 0.05) 0%, rgba(248, 249, 250, 0.8) 90%);
    pointer-events: none;
    z-index: -1;
}

/* 增强应用图标样式 */
.app-icon {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    border-radius: 32px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 48px;
    box-shadow: 0 15px 30px rgba(67, 97, 238, 0.3);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.app-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 70%);
    transform: rotate(30deg);
}

.app-icon:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 20px 40px rgba(67, 97, 238, 0.4);
}

/* 增强标题样式 */
.app-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0 0 10px 0;
    color: #212529;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 增强描述样式 */
.app-description {
    font-size: 1.1rem;
    color: #6c757d;
    max-width: 600px;
    margin: 0 auto 20px;
}

/* 签名标签样式 */
.signing-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.signing-tab {
    padding: 12px 24px;
    background: #f8f9fa;
    color: #495057;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.signing-tab:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-2px);
}

.signing-tab.active {
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    color: white;
    border-color: #4361ee;
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.3);
}

/* 签名方式选择区域 */
.signing-method-section {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid #e9ecef;
}

.signing-method-section h3 {
    margin-top: 0;
    color: #212529;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
}

/* 单选按钮样式 */
.radio-item {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding: 12px 15px;
    border-radius: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.radio-item:hover {
    background: #e9ecef;
}

.radio-item input[type="radio"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.radio-item label {
    margin-bottom: 0;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    flex: 1;
}

/* 上传区域增强样式 */
.upload-area {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.upload-item {
    text-align: center;
    padding: 30px 20px;
    border: 2px dashed #dee2e6;
    border-radius: 16px;
    background: #ffffff;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.upload-item:hover {
    border-color: #4361ee;
    background: #edf2ff;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(67, 97, 238, 0.15);
}

.upload-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #4361ee 0%, #5856d6 100%);
    border-radius: 20px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 30px;
    box-shadow: 0 8px 20px rgba(67, 97, 238, 0.3);
    transition: all 0.3s ease;
    position: relative;
}

.upload-item:hover .upload-icon {
    transform: translateY(-3px) rotate(5deg);
    box-shadow: 0 12px 25px rgba(67, 97, 238, 0.4);
}

.upload-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 8px;
}

.upload-subtitle {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 15px;
}

.mobile-hint {
    font-size: 0.85rem;
    color: #4361ee;
    font-weight: 600;
    animation: pulse 2s infinite;
    display: none;
}

@keyframes pulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* 文件选中状态 */
.file-selected {
    border-color: #4cc9f0 !important;
    background: linear-gradient(135deg, rgba(76, 201, 240, 0.1) 0%, rgba(76, 201, 240, 0.05) 100%) !important;
    box-shadow: 0 10px 25px rgba(76, 201, 240, 0.2) !important;
}

.file-selected .upload-icon {
    background: linear-gradient(135deg, #4cc9f0 0%, #4895ef 100%);
    animation: successPulse 2s ease-in-out infinite;
}

@keyframes successPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.file-info-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #4cc9f0 0%, #4895ef 100%);
    color: white;
    border-radius: 15px;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(76, 201, 240, 0.3);
    max-width: calc(100% - 24px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 服务器文件选择器 */
.server-file-selector {
    margin: 25px 0;
    padding: 25px;
    border: 2px dashed #dee2e6;
    border-radius: 16px;
    background: #f8f9fa;
}

.server-file-selector h4 {
    margin-top: 0;
    color: #212529;
    text-align: center;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.file-list {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 20px;
}

.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-item:hover {
    background: #f8f9fa;
    border-color: #4361ee;
    transform: translateY(-2px);
}

.file-item.selected {
    background: rgba(67, 97, 238, 0.1);
    border-color: #4361ee;
}

.file-icon {
    margin-right: 12px;
    font-size: 1.2rem;
    color: #4361ee;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-item-info {
    flex: 1;
    min-width: 0;
}

.file-item-name {
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #212529;
    font-size: 0.95rem;
}

.file-item-meta {
    display: flex;
    gap: 10px;
    font-size: 0.8rem;
    color: #6c757d;
}

.file-item-check {
    margin-left: 10px;
    flex-shrink: 0;
}

/* 密码输入框 */
.password-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.password-input:focus {
    outline: none;
    border-color: #4361ee;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
    background: white;
}

/* 高级设置 */
.advanced-settings-header {
    border-bottom: 1px solid #e9ecef;
    padding: 15px 0;
    margin-bottom: 20px;
    cursor: pointer;
}

.advanced-settings-header h3 {
    margin: 0;
    color: #212529;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.advanced-settings-content {
    padding: 10px 0;
}

/* 高级选项样式 */
.advanced-options-header {
    cursor: pointer;
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.advanced-options-header:hover {
    background: #e9ecef;
    border-color: #007AFF;
}

.advanced-options-header label {
    margin-bottom: 0;
    font-weight: 600;
    color: #495057;
}

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

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

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #4361ee;
    box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
}

/* 复选框样式 */
.checkbox-item {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding: 10px 15px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.checkbox-item:hover {
    background: #f8f9fa;
}

.checkbox-item input[type="checkbox"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
}

.checkbox-item label {
    margin-bottom: 0;
    font-weight: normal;
    color: #495057;
    flex: 1;
}

small {
    display: block;
    color: #6c757d;
    font-size: 0.85rem;
    margin-top: 5px;
}

/* 签名按钮 */
.sign-button {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 10px 30px rgba(67, 97, 238, 0.4);
    position: relative;
    overflow: hidden;
    margin-top: 10px;
}

.sign-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(67, 97, 238, 0.5);
}

.sign-button:active {
    transform: translateY(-1px);
}

.sign-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* 进度条 */
.progress-container {
    margin: 25px 0;
    display: none;
}

.progress-container.show {
    display: block;
}

.progress {
    width: 100%;
    height: 12px;
    background: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    margin: 15px 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4361ee, #5856d6);
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: progressShine 1.5s ease-in-out infinite;
}

@keyframes progressShine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.progress-text {
    text-align: center;
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 10px;
}

/* 结果显示区域 */
.result-section {
    margin-top: 30px;
    padding: 25px;
    border-radius: 16px;
    background: #f8f9fa;
    display: none;
}

.result-section.show {
    display: block;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-title {
    font-size: 1.25rem;
    margin-top: 0;
    margin-bottom: 20px;
    color: #212529;
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-content {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.result-item:last-child {
    border-bottom: none;
}

.result-label {
    color: #6c757d;
}

.result-value {
    color: #212529;
    font-weight: 500;
    text-align: right;
    word-break: break-all;
}

.download-btn {
    display: block;
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #4cc9f0 0%, #2db441 100%);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    margin-top: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(50, 215, 75, 0.3);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(50, 215, 75, 0.4);
}

.download-btn:active {
    transform: translateY(0);
}

.install-btn {
    display: block;
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #4895ef 0%, #42b4e6 100%);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    margin-top: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(90, 200, 250, 0.3);
}

.install-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(90, 200, 250, 0.4);
}

.install-btn:active {
    transform: translateY(0);
}

/* 警告信息 */
.alert {
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.hidden {
    display: none !important;
}

/* 拖拽悬停效果 */
.drag-hover {
    border-color: #4361ee !important;
    background: linear-gradient(135deg, 
        rgba(67, 97, 238, 0.12) 0%, 
        rgba(67, 97, 238, 0.06) 100%) !important;
    transform: scale(1.02) !important;
    box-shadow: 
        0 25px 50px rgba(67, 97, 238, 0.2),
        0 0 0 2px #4361ee !important;
}

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

.modal-content {
    background: #fff;
    padding: 25px;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.modal-title {
    margin: 0;
    font-size: 1.25rem;
    color: #212529;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close {
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    color: #999;
    background: none;
    border: none;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close:hover {
    background: #f8f9fa;
    color: #333;
}

.modal-body {
    margin-bottom: 20px;
}

.signing-status {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.status-icon {
    font-size: 2rem;
    margin-right: 15px;
}

.status-text {
    flex: 1;
}

.status-title {
    font-weight: 600;
    margin-bottom: 5px;
    color: #212529;
}

.status-message {
    color: #6c757d;
}

.signing-log {
    height: 200px;
    overflow-y: auto;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    font-family: monospace;
    font-size: 0.9rem;
}

.log-entry {
    margin-bottom: 8px;
}

.log-time {
    color: #4361ee;
    font-weight: 600;
}

.log-message {
    color: #212529;
}

.log-warning {
    color: #ff9f0a;
}

.log-error {
    color: #ff3b30;
}

.log-info {
    color: #4895ef;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.3);
}

/* UDID签名区域 */
#udid-signing-section {
    display: none;
    margin-top: 20px;
}

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

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

.udid-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.udid-input:focus {
    outline: none;
    border-color: #4361ee;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
    background: white;
}

.udid-info {
    background: rgba(67, 97, 238, 0.05);
    border: 1px solid rgba(67, 97, 238, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

.udid-info h3 {
    margin-top: 0;
    color: #212529;
    display: flex;
    align-items: center;
    gap: 10px;
}

.udid-info-item {
    display: flex;
    margin-bottom: 10px;
}

.udid-info-label {
    font-weight: 500;
    width: 150px;
    color: #212529;
}

.udid-info-value {
    flex: 1;
    color: #6c757d;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .app-icon {
        width: 100px;
        height: 100px;
        font-size: 40px;
        border-radius: 24px;
    }
    
    .app-title {
        font-size: 2rem;
    }
    
    .upload-area {
        grid-template-columns: 1fr;
    }
    
    .file-grid {
        grid-template-columns: 1fr;
    }
    
    .sign-button {
        padding: 16px;
        font-size: 1rem;
    }
    
    .modal-content {
        width: 95%;
        padding: 20px;
    }
    
    .signing-log {
        height: 150px;
        font-size: 0.8rem;
    }
    
    .udid-info-label {
        width: 100px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .app-icon {
        width: 80px;
        height: 80px;
        font-size: 32px;
    }
    
    .app-title {
        font-size: 1.75rem;
    }
    
    .signing-tabs {
        flex-direction: column;
        align-items: center;
    }
    
    .signing-tab {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    .password-input,
    .udid-input {
        padding: 14px 18px;
        font-size: 1rem;
    }
}
