/* ========== 全局样式 ========== */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

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

body {
    font-family: 'Noto Sans SC', system-ui, -apple-system, sans-serif;
    background: radial-gradient(circle at 20% 30%, #0a0a0f, #030305);
    color: #eef2ff;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
}

/* ========== 滚动条 ========== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #1e1e2a;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #22d3ee, #8b5cf6);
    border-radius: 10px;
}

/* ========== 头部 ========== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 40px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #22d3ee, #8b5cf6);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    box-shadow: 0 8px 32px rgba(34, 211, 238, 0.3);
}

.header-logo h1 {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #22d3ee, #a855f7);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.header-logo p {
    font-size: 14px;
    color: #94a3b8;
    margin-top: 4px;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.btn-api, .btn-reset {
    padding: 10px 20px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-api {
    background: rgba(139, 92, 246, 0.2);
    color: #c084fc;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.btn-api:hover {
    background: rgba(139, 92, 246, 0.4);
    transform: translateY(-2px);
}

.btn-reset {
    background: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-reset:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* ========== 标签页 ========== */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 4px;
}

.tab {
    padding: 12px 28px;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 40px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
}

.tab.active {
    background: rgba(34, 211, 238, 0.15);
    color: #22d3ee;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ========== 卡片 ========== */
.card {
    background: rgba(18, 18, 24, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(34, 211, 238, 0.15);
    border-radius: 28px;
    padding: 24px;
    transition: all 0.3s;
}

.card:hover {
    border-color: rgba(34, 211, 238, 0.4);
}

.card-full {
    background: rgba(18, 18, 24, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(34, 211, 238, 0.15);
    border-radius: 28px;
    padding: 28px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.card-header h2 {
    font-size: 22px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header h2 i {
    color: #22d3ee;
}

/* ========== 三列网格 ========== */
.grid-3col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

@media (max-width: 1200px) {
    .grid-3col {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* ========== 上传区域 ========== */
.upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 32px;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 20px;
}

.upload-area:hover {
    border-color: #22d3ee;
    background: rgba(34, 211, 238, 0.05);
}

.upload-area i {
    font-size: 48px;
    color: #64748b;
}

.upload-area p {
    font-size: 14px;
    font-weight: 500;
}

.upload-area small {
    font-size: 11px;
    color: #64748b;
}

/* ========== 代码区域 ========== */
.code-area {
    width: 100%;
    height: 320px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 16px;
    color: #e2e8f0;
    resize: vertical;
}

.code-area:focus {
    outline: none;
    border-color: #22d3ee;
}

.code-area.output {
    height: 280px;
    margin-bottom: 16px;
}

/* ========== 操作按钮 ========== */
.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.action-buttons button {
    flex: 1;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 40px;
    color: #94a3b8;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.action-buttons button:hover {
    background: rgba(34, 211, 238, 0.2);
    color: #22d3ee;
}

/* ========== 算法列表 ========== */
.search-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.search-wrapper i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 14px;
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 42px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 40px;
    color: white;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.search-input:focus {
    border-color: #22d3ee;
}

.methods-list {
    max-height: 320px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.method-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.method-item:hover {
    background: rgba(34, 211, 238, 0.1);
    transform: translateX(4px);
}

.method-item.selected {
    border-left-color: #22d3ee;
    background: rgba(34, 211, 238, 0.15);
}

.method-item input {
    width: 18px;
    height: 18px;
    accent-color: #22d3ee;
    cursor: pointer;
}

.method-item i {
    font-size: 18px;
    color: #a855f7;
}

.method-item .method-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.method-item .strength-badge {
    padding: 4px 10px;
    border-radius: 40px;
    font-size: 10px;
    font-weight: bold;
    color: white;
}

.strength-weak { background: #f43f5e; }
.strength-medium { background: #f59e0b; }
.strength-strong { background: #10b981; }

/* ========== 密码区域 ========== */
.password-area {
    margin: 16px 0;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.password-area input {
    width: 100%;
    padding: 14px 18px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #f59e0b;
    border-radius: 40px;
    color: white;
    font-size: 14px;
    outline: none;
}

.password-area input:focus {
    border-color: #22d3ee;
}

/* ========== 模式按钮 ========== */
.mode-buttons {
    display: flex;
    gap: 12px;
    margin: 20px 0 16px;
}

.btn-encrypt, .btn-decrypt {
    flex: 1;
    padding: 14px;
    border-radius: 40px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-encrypt {
    background: linear-gradient(135deg, #06b6d4, #14b8a6);
    color: white;
}

.btn-decrypt {
    background: rgba(255, 255, 255, 0.1);
    color: #94a3b8;
}

.btn-process {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #8b5cf6, #06b6d4);
    border: none;
    border-radius: 40px;
    font-size: 18px;
    font-weight: bold;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-process:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(34, 211, 238, 0.4);
}

.btn-clear {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 12px;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-clear:hover {
    color: #22d3ee;
}

/* ========== 输出区域 ========== */
.output-actions {
    display: flex;
    gap: 12px;
}

.output-actions button {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 40px;
    color: #94a3b8;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.output-actions button:hover {
    background: rgba(34, 211, 238, 0.2);
    color: #22d3ee;
}

/* ========== 预览区域 ========== */
.preview-section {
    margin-top: 16px;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.preview-header span {
    font-size: 13px;
    color: #f59e0b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.preview-header button {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 40px;
    color: #94a3b8;
    font-size: 11px;
    cursor: pointer;
}

.preview-container {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 20px;
    min-height: 280px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.preview-container iframe {
    width: 100%;
    height: 280px;
    border: none;
    background: white;
}

/* ========== 外部API区域 ========== */
.api-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

@media (max-width: 900px) {
    .api-grid {
        grid-template-columns: 1fr;
    }
}

.api-grid label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    color: #94a3b8;
}

.api-grid input, .api-grid select, .api-grid textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: white;
    font-size: 13px;
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 16px;
    outline: none;
}

.api-grid input:focus, .api-grid select:focus, .api-grid textarea:focus {
    border-color: #22d3ee;
}

.api-buttons {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.btn-api-call {
    flex: 1;
    padding: 12px;
    background: rgba(34, 211, 238, 0.2);
    border: 1px solid rgba(34, 211, 238, 0.3);
    border-radius: 40px;
    color: #22d3ee;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-api-call:hover {
    background: rgba(34, 211, 238, 0.4);
    transform: translateY(-2px);
}

.api-result {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 20px;
    padding: 16px;
    min-height: 300px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    overflow: auto;
    color: #a5f3fc;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ========== API卡片网格 ========== */
.api-grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.api-card {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(34, 211, 238, 0.1);
}

.api-card:hover {
    background: rgba(34, 211, 238, 0.1);
    transform: translateX(4px);
    border-color: #22d3ee;
}

.api-card i {
    font-size: 20px;
    color: #22d3ee;
    margin-right: 10px;
}

.api-card .api-name {
    font-weight: 600;
    font-size: 15px;
}

.api-card .api-url {
    font-size: 11px;
    color: #64748b;
    margin-top: 6px;
    word-break: break-all;
}

/* ========== 底部 ========== */
.footer {
    margin-top: 48px;
    padding: 24px;
    text-align: center;
    font-size: 12px;
    color: #475569;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    line-height: 1.6;
}

/* ========== 状态徽章 ========== */
.status-badge {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 8px 20px;
    border-radius: 40px;
    font-size: 12px;
    font-weight: 500;
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-online {
    background: rgba(16, 185, 129, 0.9);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

.status-offline {
    background: rgba(239, 68, 68, 0.9);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
}

/* ========== 类型徽章 ========== */
.badge-type {
    padding: 6px 16px;
    border-radius: 40px;
    font-size: 11px;
    font-weight: bold;
}

.badge-type.html {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.badge-type.php {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.badge-type.unknown {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* ========== 动画 ========== */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.processing {
    animation: pulse 0.8s infinite;
}

.hidden {
    display: none;
}