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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 0;
    color: #333;
}

/* 导航栏样式 */
.nav-bar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 600;
    color: #667eea;
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-link {
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: #64748b;
    border-radius: 0.375rem;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    background: #667eea;
    color: white;
}

.login-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 80px);
    justify-content: center;
}

.login-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.login-header h2 {
    font-size: 28px;
    margin-bottom: 10px;
    font-weight: 600;
}

.login-header p {
    font-size: 16px;
    opacity: 0.9;
    line-height: 1.5;
}

.login-content {
    padding: 30px;
}

.error-message {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.cert-selection {
    margin-bottom: 30px;
}

.cert-status {
    display: flex;
    align-items: center;
    padding: 16px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.cert-status.detected {
    background: #ecfdf5;
    border-color: #10b981;
}

.cert-status.error {
    background: #fef2f2;
    border-color: #ef4444;
}

.status-icon {
    font-size: 24px;
    margin-right: 12px;
}

#statusText {
    font-size: 16px;
    font-weight: 500;
}

.cert-detect-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.cert-detect-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

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

.cert-list {
    margin-top: 20px;
}

.cert-list h4 {
    color: #374151;
    margin-bottom: 15px;
    font-size: 16px;
}

.cert-option {
    padding: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}

.cert-option:hover {
    border-color: #3b82f6;
    background: #eff6ff;
    transform: translateY(-1px);
}

.cert-option.selected {
    border-color: #10b981;
    background: #ecfdf5;
}

.cert-option .cert-name {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 5px;
}

.cert-option .cert-details {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
}

.login-actions {
    margin-top: 30px;
}

.login-btn {
    width: 100%;
    padding: 16px 20px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
}

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

.btn-icon {
    margin-right: 8px;
    font-size: 18px;
}

.help-info {
    margin-top: 30px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 10px;
    border-left: 4px solid #3b82f6;
}

.help-info h4 {
    color: #374151;
    margin-bottom: 15px;
    font-size: 16px;
}

.help-info ol {
    margin-left: 20px;
}

.help-info li {
    color: #6b7280;
    margin-bottom: 8px;
    line-height: 1.5;
}

.help-info ul {
    margin-left: 20px;
    margin-bottom: 20px;
}

.help-info ul li {
    list-style-type: none;
    padding-left: 5px;
}

.browser-notice {
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    font-size: 14px;
}

.browser-notice strong {
    color: #1e40af;
}

.browser-notice ul {
    margin-top: 10px;
    margin-left: 15px;
}

.browser-notice li {
    margin-bottom: 5px;
    color: #1e3a8a;
}

/* 手动选择相关样式 */
.manual-cert-selection {
    margin-top: 20px;
    padding: 20px;
    background: #fef3c7;
    border: 2px solid #fbbf24;
    border-radius: 10px;
}

.manual-cert-selection h4 {
    color: #92400e;
    margin-bottom: 15px;
}

.manual-cert-selection p {
    color: #78350f;
    margin-bottom: 15px;
}

.manual-option {
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #e5e7eb !important;
    margin-bottom: 10px;
}

.manual-option:hover {
    border-color: #f59e0b !important;
    background: #fef3c7 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.manual-option .cert-name {
    font-weight: 700;
    color: #92400e;
    font-size: 16px;
}

.manual-option .cert-details {
    color: #78350f;
    font-size: 13px;
}

/* 证书类型图标样式 */
.cert-option[data-type="webauthn"] .cert-name::before {
    content: "🔐 ";
}

.cert-option[data-type="file"] .cert-name::before {
    content: "📁 ";
}

.cert-option[data-type="usb"] .cert-name::before {
    content: "🔌 ";
}

.cert-option[data-type="browser"] .cert-name::before {
    content: "🌐 ";
}

.cert-option[data-type="windows"] .cert-name::before {
    content: "🪟 ";
}

.cert-option[data-type="macos"] .cert-name::before {
    content: "🍎 ";
}

.cert-option[data-type="linux"] .cert-name::before {
    content: "🐧 ";
}

/* IP地址访问警告样式 */
.ip-access-warning {
    margin: 15px 0;
    padding: 15px;
    background: linear-gradient(135deg, #fff3cd 0%, #fef3c7 100%);
    border: 2px solid #fbbf24;
    border-radius: 10px;
    border-left: 5px solid #f59e0b;
}

.ip-access-warning h5 {
    color: #92400e;
    margin-bottom: 10px;
    font-size: 16px;
}

.ip-access-warning p {
    color: #78350f;
    margin-bottom: 10px;
    line-height: 1.5;
}

.ip-access-warning ul {
    margin: 10px 0 10px 20px;
    padding: 0;
}

.ip-access-warning li {
    color: #78350f;
    margin-bottom: 5px;
    line-height: 1.4;
}

.ip-access-warning code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    color: #1f2937;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .login-container {
        padding: 10px;
    }
    
    .login-header {
        padding: 20px;
    }
    
    .login-header h2 {
        font-size: 24px;
    }
    
    .login-content {
        padding: 20px;
    }
}

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

.cert-list {
    animation: fadeIn 0.5s ease;
}

#loginForm {
    animation: fadeIn 0.5s ease;
}
