/* SSL证书解析工具样式 */

/* 快捷键提示 */
.shortcut-tips {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    font-size: 14px;
    position: relative;
    overflow: hidden;
    animation: slideIn 0.5s ease;
}

.shortcut-tips::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 3s infinite;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.tips-icon {
    font-size: 18px;
}

.tips-text {
    font-weight: 600;
}

.shortcut-tips kbd {
    background: rgba(255, 255, 255, 0.2);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Tab按钮 */
.tab-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
}

.tab-button {
    flex: 1;
    padding: 14px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #64748b;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-button:hover {
    background: #f1f5f9;
    color: #3b82f6;
}

.tab-button.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
    background: linear-gradient(to bottom, rgba(59, 130, 246, 0.05), transparent);
}

.tab-icon {
    font-size: 18px;
}

/* Tab内容 */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 表单标签 */
.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
    font-size: 15px;
}

.label-icon {
    font-size: 18px;
}

/* 输入框样式 */
.query-input,
.query-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: all 0.3s ease;
    box-sizing: border-box;
    position: relative;
}

.query-input:focus,
.query-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

.query-input:hover,
.query-textarea:hover {
    border-color: #94a3b8;
}

.query-textarea {
    font-family: 'Courier New', monospace;
    resize: vertical;
    min-height: 200px;
    line-height: 1.6;
}

/* 输入提示 */
.input-hint {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 8px;
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
}

.hint-icon {
    font-size: 14px;
    margin-top: 2px;
}

/* 欢迎提示 */
.welcome-tip {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-color: #7dd3fc;
    animation: fadeIn 0.5s ease;
}

.welcome-tip .result-title {
    color: #0369a1;
    border-bottom-color: #7dd3fc;
}

.welcome-content {
    padding: 8px 0;
}

.welcome-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    margin-bottom: 10px;
    background: white;
    border-radius: 8px;
    border-left: 3px solid #0ea5e9;
    transition: all 0.3s ease;
}

.welcome-item:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.2);
}

.welcome-item:last-child {
    margin-bottom: 0;
}

.welcome-icon {
    font-size: 24px;
    min-width: 24px;
}

.welcome-text {
    flex: 1;
    font-size: 14px;
    line-height: 1.6;
    color: #334155;
}

.welcome-text strong {
    color: #0369a1;
    font-weight: 600;
}
.button-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* 按钮样式 */
.button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.button:hover::before {
    width: 300px;
    height: 300px;
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.button:active {
    transform: translateY(0);
}

.button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.button-icon {
    font-size: 16px;
    position: relative;
    z-index: 1;
}

.button-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.button-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.button-ai {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
}

.button-ai:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
}

.button-secondary {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: white;
}

.button-secondary:hover {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
}

.button-copy {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.button-copy:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

/* 结果区域 */
.query-result {
    margin-top: 30px;
    padding: 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.result-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
}

.title-icon {
    font-size: 22px;
}

/* 错误提示 */
.error-result {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-color: #fca5a5;
}

.error-result .result-title {
    color: #dc2626;
    border-bottom-color: #fca5a5;
}

.error-message {
    color: #991b1b;
    margin: 0;
    padding: 12px;
    background: white;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.6;
}

/* 证书状态 */
.cert-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 24px;
    font-size: 15px;
    font-weight: 600;
    animation: pulse 0.5s ease;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

.cert-status.valid {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 2px solid #6ee7b7;
    box-shadow: 0 4px 12px rgba(110, 231, 183, 0.3);
}

.cert-status.warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 2px solid #fcd34d;
    box-shadow: 0 4px 12px rgba(252, 211, 77, 0.3);
}

.cert-status.expired {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border: 2px solid #fca5a5;
    box-shadow: 0 4px 12px rgba(252, 165, 165, 0.3);
}

.status-icon {
    font-size: 20px;
}

.days-remaining {
    font-weight: normal;
    font-size: 14px;
}

/* 证书区块 */
.cert-section {
    margin-bottom: 24px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease;
}

.cert-section:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: #334155;
    margin: 0 0 16px 0;
}

.section-icon {
    font-size: 18px;
}

/* 证书表格 */
.cert-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 6px;
    overflow: hidden;
}

.cert-table tr {
    border-bottom: 1px solid #e2e8f0;
    transition: background 0.2s ease;
}

.cert-table tr:hover {
    background: #f8fafc;
}

.cert-table tr:last-child {
    border-bottom: none;
}

.cert-table td {
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.6;
    position: relative;
}

.label-col {
    width: 180px;
    font-weight: 600;
    color: #475569;
    background: #f8fafc;
}

.value-col {
    color: #334155;
    word-break: break-all;
    cursor: text;
    user-select: text;
}

.value-col:hover::after {
    content: '📋';
    position: absolute;
    right: 10px;
    opacity: 0.5;
    font-size: 14px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.value-col:hover::after:hover {
    opacity: 1;
}

/* 序列号样式 */
.serial-number {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #7c3aed;
}

/* 指纹样式 */
.fingerprint {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #059669;
    line-height: 1.8;
}

/* DN完整信息 */
.dn-full {
    padding: 12px;
    background: white;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #475569;
    margin-bottom: 12px;
    word-break: break-all;
    line-height: 1.6;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    cursor: text;
}

.dn-full:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* SAN列表 */
.san-list {
    padding: 12px;
    background: white;
    border-radius: 6px;
    font-size: 14px;
    color: #334155;
    line-height: 1.8;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    cursor: text;
}

.san-list:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* 操作按钮区域 */
.action-buttons {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: center;
    animation: fadeInUp 0.5s ease 0.3s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* AI结果 */
.ai-result-wrapper {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    border-color: #c4b5fd;
    animation: slideInRight 0.5s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.ai-result-wrapper .result-title {
    color: #5b21b6;
    border-bottom-color: #c4b5fd;
}

.ai-result {
    padding: 16px;
    background: white;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.8;
    color: #334155;
    white-space: pre-wrap;
    border: 1px solid #e9d5ff;
    animation: fadeIn 0.5s ease 0.2s both;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .tab-buttons {
        flex-direction: column;
    }
    
    .tab-button {
        border-bottom: none;
        border-left: 3px solid transparent;
    }
    
    .tab-button.active {
        border-bottom: none;
        border-left-color: #3b82f6;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .button {
        width: 100%;
        justify-content: center;
    }
    
    .label-col {
        width: 100px;
        font-size: 13px;
    }
    
    .value-col {
        font-size: 13px;
    }
    
    .shortcut-tips {
        flex-wrap: wrap;
        font-size: 13px;
    }
    
    /* 移动端证书区块优化 */
    .cert-section {
        padding: 12px;
    }
    
    .cert-table {
        font-size: 13px;
    }
    
    .cert-table td {
        padding: 10px 12px;
    }
    
    /* 移动端欢迎提示 */
    .welcome-item {
        padding: 10px;
        gap: 10px;
    }
    
    .welcome-icon {
        font-size: 20px;
    }
    
    .welcome-text {
        font-size: 13px;
    }
    
    /* 移动端加载蒙版 */
    .loading-content {
        padding: 25px 30px;
    }
    
    /* 移动端输入框 */
    .query-input,
    .query-textarea {
        font-size: 16px; /* 防止iOS自动缩放 */
    }
    
    .query-textarea {
        min-height: 150px;
    }
}

/* 滚动条样式 */
.query-textarea::-webkit-scrollbar {
    width: 8px;
}

.query-textarea::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.query-textarea::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.query-textarea::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 加载动画 */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading {
    animation: spin 1s linear infinite;
    display: inline-block;
}

/* 加载蒙版 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.loading-content {
    background: white;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    font-size: 14px;
    color: #475569;
    font-weight: 500;
}

/* Toast提示样式 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 14px 20px;
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    max-width: 400px;
    border-left: 4px solid #3b82f6;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-icon {
    font-size: 22px;
    animation: bounceIn 0.5s ease;
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.toast-message {
    flex: 1;
    font-size: 14px;
    color: #334155;
    font-weight: 500;
}

.toast-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    line-height: 1;
}

.toast-close:hover {
    background: #f1f5f9;
    color: #475569;
}

.toast-success {
    border-left-color: #10b981;
}

.toast-error {
    border-left-color: #ef4444;
}

.toast-warning {
    border-left-color: #f59e0b;
}

.toast-info {
    border-left-color: #3b82f6;
}

/* Toast响应式设计 */
@media (max-width: 768px) {
    .toast {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}
