/* 活动导航链接样式 */
.nav-menu a.active {
    color: #3498db;
}

.nav-menu a.active::after {
    width: 100%;
}

/* 英雄区域 */
.crypto-hero {
    padding: 120px 0 80px 0;
    background: linear-gradient(135deg, #ffffff 0%, #f1f8ff 100%);
    position: relative;
    overflow: hidden;
}

.crypto-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(90deg, transparent, rgba(52, 152, 219, 0.1), transparent),
        linear-gradient(180deg, transparent, rgba(44, 62, 80, 0.1), transparent);
    animation: scan 10s linear infinite;
}

.crypto-hero .hero-content {
    text-align: center;
    position: relative;
    z-index: 2;
    animation: fadeInUp 1s ease;
}

.crypto-hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    background: linear-gradient(90deg, #2c3e50, #3498db);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.crypto-hero p {
    font-size: 1.2rem;
    color: #555555;
    max-width: 600px;
    margin: 0 auto;
}

/* 工具布局 */
.tools-layout {
    display: flex;
    gap: 30px;
    min-height: 600px;
}

/* 左侧算法选择 */
.algorithm-sidebar {
    width: 280px;
    flex-shrink: 0;
}

.algorithm-sidebar h2 {
    color: #2c3e50;
    font-size: 1.5rem;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
}

.algorithm-sidebar h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, #3498db, #2c3e50);
    border-radius: 1px;
}

.algorithm-tabs {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tab-btn {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    width: 100%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.tab-btn:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.15);
    border-color: #3498db;
}

.tab-btn.active {
    border-color: #3498db;
    box-shadow: 0 5px 20px rgba(52, 152, 219, 0.2);
    transform: translateX(8px);
    background: rgba(52, 152, 219, 0.1);
    position: relative;
}

.tab-btn.active::before {
    content: '';
    position: absolute;
    left: -1px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: linear-gradient(180deg, #3498db, #2c3e50);
    border-radius: 0 2px 2px 0;
}

.tab-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
    color: #3498db;
}

.tab-content h3 {
    color: #2c3e50;
    font-size: 1.1rem;
    margin-bottom: 4px;
    font-weight: 600;
}

.tab-content p {
    color: #555555;
    font-size: 0.85rem;
    line-height: 1.3;
}

/* 右侧工具内容 */
.tools-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

/* 工具区域 */
.crypto-tools-section {
    padding: 80px 0;
    background: linear-gradient(135deg, #ffffff 0%, #f1f8ff 100%);
    min-height: 100vh;
}

.crypto-tool {
    display: none;
}

.crypto-tool.active {
    display: block;
}

/* 工具卡片 */
.tool-card {
    background: #ffffff;
    border-radius: 15px;
    padding: 40px;
    margin-bottom: 30px;
    border: 1px solid #e0e0e0;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.tool-card:hover {
    border-color: #3498db;
    box-shadow: 0 10px 30px rgba(52, 152, 219, 0.1);
}

.tool-header {
    text-align: center;
    margin-bottom: 40px;
}

.tool-header h2 {
    color: #2c3e50;
    font-size: 2rem;
    margin-bottom: 15px;
}

.tool-header p {
    color: #555555;
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 700px;
    margin: 0 auto;
}

/* 算法描述 */
.algorithm-description {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: left;
}

.algorithm-description h3 {
    color: #2c3e50;
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.algorithm-description p {
    color: #555555;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* 算法详细信息 */
.algorithm-details {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    margin-top: 30px;
}

.algorithm-details h3 {
    color: #2c3e50;
    font-size: 1.4rem;
    margin-bottom: 15px;
    text-align: center;
}

.algorithm-details-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.detail-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.detail-card h4 {
    color: #3498db;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.detail-card ul {
    padding-left: 20px;
    margin: 10px 0;
}

.detail-card li {
    color: #555555;
    margin-bottom: 8px;
    line-height: 1.4;
}

.detail-card p {
    color: #555555;
    line-height: 1.5;
}

/* 表单样式 */
.crypto-form {
    max-width: 800px;
    margin: 0 auto;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 1rem;
}

.input-with-btn {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 输入框容器 */
.input-container {
    position: relative;
    display: inline-block;
    width: 100%;
}

/* 输入框内的生成按钮 */
.input-generate-btn {
    position: absolute;
    top: 50%;
    left: 8px;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background: rgba(52, 152, 219, 0.1);
    border: 1px solid rgba(52, 152, 219, 0.3);
    border-radius: 4px;
    color: #3498db;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0.7;
    z-index: 10;
}

.input-generate-btn:hover {
    opacity: 1;
    background: rgba(52, 152, 219, 0.2);
    border-color: rgba(52, 152, 219, 0.5);
    transform: translateY(-50%) scale(1.05);
}

.input-generate-btn:active {
    transform: translateY(-50%) scale(0.95);
}

/* 输入框内的复制按钮 */
.input-copy-btn {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid rgba(46, 204, 113, 0.3);
    border-radius: 4px;
    color: #2ecc71;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0.6;
    z-index: 10;
}

.input-copy-btn:hover {
    opacity: 1;
    background: rgba(46, 204, 113, 0.2);
    border-color: rgba(46, 204, 113, 0.5);
    transform: translateY(-50%) scale(1.05);
}

.input-copy-btn:active {
    transform: translateY(-50%) scale(0.95);
}

/* 当输入框获得焦点时，按钮更明显 */
.input-container:hover .input-copy-btn,
.input-container input:focus+.input-copy-btn {
    opacity: 1;
}

.input-container:hover .input-generate-btn,
.input-container input:focus~.input-generate-btn {
    opacity: 1;
}

/* 复制成功状态 */
.input-copy-btn.copied {
    background: rgba(46, 204, 113, 0.2);
    border-color: rgba(46, 204, 113, 0.5);
    color: #27ae60;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    color: #333333;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
    box-sizing: border-box;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* 有生成和复制按钮的输入框需要左右留空间 */
.input-container input {
    padding-left: 35px;
    padding-right: 35px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* 文本框容器 */
.textarea-container {
    position: relative;
    display: inline-block;
    width: 100%;
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
    font-family: 'Courier New', monospace;
    width: 100%;
    padding-right: 45px;
    /* 为复制按钮留出空间 */
}

/* 文本框内的复制按钮 */
.textarea-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid rgba(46, 204, 113, 0.3);
    border-radius: 6px;
    color: #2ecc71;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0.7;
    z-index: 10;
}

.textarea-copy-btn:hover {
    opacity: 1;
    background: rgba(46, 204, 113, 0.2);
    border-color: rgba(46, 204, 113, 0.5);
    transform: translateY(-1px);
}

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

/* 当文本框获得焦点时，复制按钮更明显 */
.textarea-container:hover .textarea-copy-btn,
.textarea-container textarea:focus+.textarea-copy-btn {
    opacity: 1;
}

/* 复制成功状态 */
.textarea-copy-btn.copied {
    background: rgba(46, 204, 113, 0.2);
    border-color: rgba(46, 204, 113, 0.5);
    color: #27ae60;
}

.form-group small {
    color: #777777;
    font-size: 0.85rem;
    margin-top: 5px;
    display: block;
}

.generate-btn {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid #3498db;
    color: #3498db;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    white-space: nowrap;
    align-self: flex-start;
    max-width: 150px;
}

.generate-btn:hover {
    background: rgba(52, 152, 219, 0.1);
    transform: translateY(-1px);
}

/* 按钮样式 */
.form-actions {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin: 35px 0;
    position: relative;
}

.btn {
    padding: 15px 35px;
    border-radius: 35px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    min-width: 140px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transform: translateY(0);
    letter-spacing: 1px;
}

.btn.primary {
    background: linear-gradient(90deg, #3498db, #2c3e50);
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.btn.secondary {
    background: linear-gradient(90deg, #ffffff, #f8f9fa);
    color: #3498db;
    border: 2px solid #3498db;
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.3);
}

.btn.clear {
    background: linear-gradient(90deg, #ffffff, #f8f9fa);
    color: #e74c3c;
    border: 2px solid #e74c3c;
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.3);
}

.btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(52, 152, 219, 0.5);
}

.btn.secondary:hover {
    background: linear-gradient(90deg, #f8f9fa, #ffffff);
    box-shadow: 0 12px 30px rgba(52, 152, 219, 0.4);
}

.btn.clear:hover {
    background: linear-gradient(90deg, #f8f9fa, #ffffff);
    box-shadow: 0 12px 30px rgba(231, 76, 60, 0.4);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

/* 按钮点击波纹效果 */
.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn.ripple::after {
    width: 300px;
    height: 300px;
}

/* 加密选项区域样式 */
.crypto-options {
    background: rgba(52, 152, 219, 0.05);
    border: 1px solid rgba(52, 152, 219, 0.15);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    backdrop-filter: blur(2px);
}

.crypto-options h3 {
    color: #2c3e50;
    font-size: 1.3rem;
    margin-bottom: 15px;
    text-align: left;
}

.options-grid {
    display: flex;
    gap: 20px;
    align-items: start;
    flex-wrap: wrap;
}

.options-grid .form-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 200px;
}

.options-grid .form-group label {
    display: block;
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 1rem;
}

.options-grid .form-group select {
    width: 100%;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    color: #333333;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
    box-sizing: border-box;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.options-grid .form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* 中等屏幕响应式设计 */
@media (max-width: 1024px) {
    .algorithm-sidebar {
        width: 240px;
    }

    .tab-btn {
        padding: 14px;
        gap: 10px;
    }

    .tab-icon {
        font-size: 1.6rem;
    }

    .tab-content h3 {
        font-size: 1rem;
    }

    .tab-content p {
        font-size: 0.8rem;
    }
}

/* 小屏幕响应式设计 */
@media (max-width: 768px) {
    .crypto-hero h1 {
        font-size: 2.5rem;
    }

    .crypto-hero p {
        font-size: 1.1rem;
    }

    /* 移动端布局调整 */
    .tools-layout {
        flex-direction: column;
        gap: 20px;
    }

    .algorithm-sidebar {
        width: 100%;
    }

    .algorithm-tabs {
        flex-direction: row;
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 10px;
    }

    .tab-btn {
        flex-shrink: 0;
        min-width: 120px;
        padding: 12px;
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }

    .tab-btn:hover,
    .tab-btn.active {
        transform: none;
    }

    .tab-icon {
        font-size: 1.5rem;
    }

    .tab-content h3 {
        font-size: 1rem;
    }

    .tab-content p {
        font-size: 0.75rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .input-with-btn {
        flex-direction: column;
        gap: 8px;
    }

    .generate-btn {
        align-self: flex-start;
        max-width: 120px;
        font-size: 0.8rem;
        padding: 6px 12px;
    }

    .form-actions {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 250px;
    }

    .result-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .tool-card {
        padding: 25px;
    }

    .info-card {
        padding: 20px;
    }

    .crypto-hero,
    .algorithm-selector,
    .crypto-tools-section {
        padding: 60px 0;
    }

    /* 移动端文本框复制按钮调整 */
    .textarea-copy-btn {
        width: 28px;
        height: 28px;
        top: 6px;
        right: 6px;
    }

    .textarea-copy-btn svg {
        width: 14px;
        height: 14px;
    }

    .form-group textarea {
        padding-right: 40px;
    }

    .algo-result {
        padding-right: 40px;
    }

    /* 移动端输入框按钮调整 */
    .input-copy-btn {
        width: 22px;
        height: 22px;
        right: 6px;
    }

    .input-generate-btn {
        width: 22px;
        height: 22px;
        left: 6px;
    }

    .input-copy-btn svg,
    .input-generate-btn svg {
        width: 12px;
        height: 12px;
    }

    .input-container input {
        padding-left: 32px;
        padding-right: 32px;
    }

    /* 移动端连体输入框调整 */
    .key-input-group {
        flex-direction: column;
    }

    .key-length-select {
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        border-radius: 0;
        min-width: auto;
    }

    .key-input-wrapper {
        border-radius: 0;
    }

    /* 移动端选项区域调整 */
    .crypto-options {
        padding: 15px;
        margin: 15px 0;
    }

    .options-grid {
        flex-direction: column;
        gap: 15px;
    }

    .options-grid .form-group small {
        display: block;
        /* 在移动端显示提示文字 */
        font-size: 0.75rem;
        margin-top: 3px;
    }
}

/* 输入框占位符样式 */
::placeholder {
    color: #999999;
}

/* 选择框样式 */
select option {
    background: #ffffff;
    color: #333333;
}

/* 滚动条样式 */
textarea::-webkit-scrollbar,
.algorithm-tabs::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

textarea::-webkit-scrollbar-track,
.algorithm-tabs::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

textarea::-webkit-scrollbar-thumb,
.algorithm-tabs::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 3px;
}

textarea::-webkit-scrollbar-thumb:hover,
.algorithm-tabs::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}

/* 选项区域样式 - 用于加密模式、填充模式和输出格式 */
.options-area {
    background: rgba(52, 152, 219, 0.05);
    border: 1px solid rgba(52, 152, 219, 0.15);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    backdrop-filter: blur(2px);
}

.options-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: start;
}

.options-row .form-group {
    margin-bottom: 0;
}

.options-row .form-group label {
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.options-row .form-group select {
    font-size: 0.9rem;
    padding: 10px 12px;
}

.options-row .form-group small {
    display: none;
    /* 隐藏小提示文字以节省空间 */
}

/* 连体输入框样式 - 用于密钥长度和密钥输入 */
.key-input-group {
    display: flex;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.key-input-group:focus-within {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.key-length-select {
    background: rgba(52, 152, 219, 0.1);
    border: none;
    padding: 12px 16px;
    color: #3498db;
    font-size: 0.9rem;
    font-weight: 600;
    border-right: 1px solid #e0e0e0;
    cursor: pointer;
    min-width: 140px;
    flex-shrink: 0;
}

.key-length-select:focus {
    outline: none;
    background: rgba(52, 152, 219, 0.15);
}

.key-input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.key-input-group .input-generate-btn {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
}

.key-input-group .input-copy-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
}

.key-input-group input {
    border: none;
    background: transparent;
    padding: 12px 35px;
    color: #333333;
    font-size: 1rem;
    width: 100%;
    box-sizing: border-box;
}

.key-input-group input:focus {
    outline: none;
    box-shadow: none;
}

/* 动画效果 */
@keyframes scan {
    0% {
        transform: translateY(-100%);
    }

    100% {
        transform: translateY(100%);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}