/* 加解密工具样式 */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #e0e7ff 0%, #f5f7fa 100%);
}

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.container {
    width: 100%;
    max-width: 420px;
    margin: 24px auto;
    background: #fff;
    padding: 14px 18px 18px 18px;
    border-radius: 18px;
    box-shadow: 0 4px 24px 0 rgba(60, 72, 88, 0.12);
}

h2 {
    text-align: center;
    font-size: 1.7rem;
    margin-bottom: 16px;
    color: #2d3a4b;
    letter-spacing: 1px;
}

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

label {
    display: block;
    margin-bottom: 10px;
    font-size: 1.08rem;
    color: #3a4a5d;
}

input[type="file"] {
    width: 100%;
    font-size: 1.08rem;
    padding: 12px 10px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    background: #f9fafb;
    box-sizing: border-box;
}

.actions {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 12px;
}

button {
    flex: 1 1 0;
    padding: 14px 0;
    font-size: 1.15rem;
    border: none;
    border-radius: 7px;
    background: linear-gradient(90deg, #4f8cff 0%, #1e40af 100%);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px 0 rgba(79, 140, 255, 0.08);
}

button:hover, button:focus {
    background: linear-gradient(90deg, #2563eb 0%, #1e3a8a 100%);
    outline: none;
}

button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.tip {
    color: #6b7280;
    font-size: 0.98rem;
    margin-top: 18px;
    text-align: center;
    line-height: 1.7;
}

.custom-file-label {
    display: inline-block;
    width: 100%;
    padding: 14px 0;
    background: linear-gradient(90deg, #f1f5f9 0%, #e0e7ef 100%);
    color: #1e293b;
    border: 2px dashed #60a5fa;
    border-radius: 7px;
    text-align: center;
    font-size: 1.08rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    margin-bottom: 8px;
}

.custom-file-label:hover, .custom-file-label:focus {
    background: #e0e7ef;
    border-color: #2563eb;
}

.file-name {
    color: #2563eb;
    font-size: 0.98rem;
    text-align: center;
    min-height: 1.2em;
}

.version-switch {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 4px;
}

.version-switch input[type="radio"] {
    display: none;
}

.switch-bg {
    position: relative;
    display: flex;
    width: 100%;
    max-width: 320px;
    background: #f1f5f9;
    border-radius: 32px;
    box-shadow: 0 1px 4px 0 rgba(60, 72, 88, 0.06);
    overflow: hidden;
    height: 48px;
}

.switch-btn {
    flex: 1 1 0;
    text-align: center;
    z-index: 2;
    font-size: 1.18rem;
    font-weight: 600;
    line-height: 48px;
    cursor: pointer;
    color: #374151;
    transition: color 0.2s;
    user-select: none;
    position: relative;
}

.switch-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 33.33%;
    height: 100%;
    background: linear-gradient(90deg, #a78bfa 0%, #7c3aed 100%);
    border-radius: 32px;
    box-shadow: 0 2px 8px 0 rgba(167, 139, 250, 0.10);
    transition: transform 0.3s cubic-bezier(.4,1.6,.6,1);
    z-index: 1;
}

.version-switch input#ver75:checked ~ .switch-bg .switch-slider {
    transform: translateX(0);
}

.version-switch input#ver85:checked ~ .switch-bg .switch-slider {
    transform: translateX(100%);
}

.version-switch input#vercustom:checked ~ .switch-bg .switch-slider {
    transform: translateX(200%);
}

.version-switch input#ver75:checked ~ .switch-bg label[for="ver75"] {
    color: #fff;
}

.version-switch input#ver85:checked ~ .switch-bg label[for="ver85"] {
    color: #fff;
}

.version-switch input#vercustom:checked ~ .switch-bg label[for="vercustom"] {
    color: #fff;
}

.actions button[name="action"][value="decrypt"] {
    background: linear-gradient(90deg, #34d399 0%, #059669 100%);
    color: #fff;
}

.actions button[name="action"][value="decrypt"]:hover, .actions button[name="action"][value="decrypt"]:focus {
    background: linear-gradient(90deg, #059669 0%, #047857 100%);
}

.actions button[name="action"][value="encrypt"] {
    background: linear-gradient(90deg, #2563eb 0%, #1e40af 100%);
    color: #fff;
}

.actions button[name="action"][value="encrypt"]:hover, .actions button[name="action"][value="encrypt"]:focus {
    background: linear-gradient(90deg, #1e40af 0%, #1e3a8a 100%);
}

.actions button.active {
    box-shadow: 0 0 0 3px #a5b4fc;
    outline: none;
}

.file-type-tip {
    text-align: center;
    font-size: 1.05rem;
    margin-top: 10px;
    font-weight: 600;
}

.file-type-tip.encrypt {
    color: #2563eb;
}

.file-type-tip.decrypt {
    color: #059669;
}

.actions button {
    display: inline-block;
}

.actions button.hide {
    display: none !important;
}

input[type="text"] {
    width: 100%;
    font-size: 1.08rem;
    padding: 12px 10px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    background: #f9fafb;
    box-sizing: border-box;
    margin-bottom: 4px;
}

input[type="text"]:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

/* 弹窗样式 */
#popup-mask {
    position: fixed;
    left: 0; top: 0; right: 0; bottom: 0;
    background: rgba(30,41,59,0.18);
    z-index: 99998;
    animation: popupMaskFadeIn 0.3s;
    transition: opacity 0.25s;
}

#popup-mask.show {
    opacity: 1;
    display: block;
}

#popup-mask.hide {
    opacity: 0;
    transition: opacity 0.18s;
    display: none;
}

#popup-message {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.85);
    min-width: 260px;
    max-width: 90vw;
    background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 100%);
    color: #1e293b;
    border-radius: 18px;
    box-shadow: 0 8px 32px 0 rgba(60,72,88,0.18), 0 2px 8px 0 rgba(79,140,255,0.08);
    padding: 36px 32px 22px 32px;
    font-size: 1.18rem;
    text-align: center;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s cubic-bezier(.4,1.6,.6,1), transform 0.28s cubic-bezier(.4,1.6,.6,1);
    display: none;
}

#popup-message .popup-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: block;
    color: #4f8cff;
    text-shadow: 0 2px 8px #a5b4fc44;
}

#popup-message .popup-text {
    margin-bottom: 18px;
    font-size: 1.18rem;
    color: #1e293b;
    font-weight: 500;
    letter-spacing: 0.5px;
}

#popup-message.show {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
    animation: popupShow 0.32s cubic-bezier(.4,1.6,.6,1);
    display: block;
}

#popup-message.hide {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.85);
    transition: opacity 0.18s, transform 0.18s;
    display: block;
}

#popup-message .popup-btn {
    margin-top: 8px;
    padding: 10px 38px;
    background: linear-gradient(90deg, #4f8cff 0%, #1e40af 100%);
    color: #fff;
    border: none;
    border-radius: 24px;
    font-size: 1.13rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px 0 rgba(79,140,255,0.10);
    transition: background 0.2s, box-shadow 0.2s;
}

#popup-message .popup-btn:hover {
    background: linear-gradient(90deg, #2563eb 0%, #1e3a8a 100%);
    box-shadow: 0 4px 16px 0 rgba(79,140,255,0.18);
}

@keyframes popupShow {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.85); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes popupMaskFadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* 拖拽高亮样式 */
.custom-file-label.dragover {
    border-color: #34d399;
    background: #e0f7ef;
    color: #059669;
}

/* QQ群样式 */
.qq-group {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

.qq-group-link {
    display: inline-flex;
    align-items: center;
    background: #4f8cff;
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
    padding: 7px 18px;
    border-radius: 22px;
    text-decoration: none;
    box-shadow: 0 1px 4px 0 rgba(79, 140, 255, 0.08);
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.qq-group-link:hover, .qq-group-link:focus {
    background: #2563eb;
    color: #fff;
    box-shadow: 0 2px 8px 0 rgba(79, 140, 255, 0.13);
}

.qq-icon {
    font-size: 1.1em;
    margin-right: 7px;
}

/* 移动端适配 */
@media (max-width: 600px) {
    body {
        display: block;
        min-height: auto;
        align-items: initial;
        justify-content: initial;
    }
    .container {
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        box-sizing: border-box;
        padding: 12px;
        border-radius: 0;
        box-shadow: none;
        background: none;
    }
    h2 {
        font-size: 1.25rem;
        margin-bottom: 14px;
    }
    .form-group {
        margin-bottom: 10px;
    }
    .custom-file-label {
        font-size: 1rem;
        padding: 12px 0;
    }
    .switch-btn {
        font-size: 1rem;
    }
    button {
        font-size: 1rem;
        padding: 12px 0;
    }
    input[type="text"] {
        font-size: 1rem;
        padding: 10px 8px;
    }
    .tip {
        font-size: 0.94rem;
        margin-top: 14px;
    }
    #popup-message {
        min-width: 220px;
        max-width: 85vw;
        padding: 28px 24px 18px 24px;
        font-size: 1.1rem;
    }
}

/* 工具导航样式 */
.tools-nav {
    margin: 16px 0;
}

.tools-nav-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4);
}

.tools-nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.6);
}

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

.tools-nav-icon {
    font-size: 20px;
}

.tools-nav-text {
    font-size: 16px;
}

.tools-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.tools-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.tools-modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    animation: slideUp 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.tools-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.tools-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.tools-modal-close {
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.tools-modal-close:hover {
    opacity: 1;
}

.tools-modal-body {
    padding: 16px;
    overflow-y: auto;
    max-height: calc(80vh - 70px);
}

.tools-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.tools-item:last-child {
    margin-bottom: 0;
}

.tools-item:hover {
    background: #f1f5f9;
    border-color: #667eea;
    transform: translateX(4px);
}

.tools-item-icon {
    font-size: 32px;
    margin-right: 16px;
    flex-shrink: 0;
}

.tools-item-info {
    flex: 1;
}

.tools-item-title {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.tools-item-desc {
    font-size: 13px;
    color: #64748b;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@media (max-width: 480px) {
    .tools-modal-content {
        width: 95%;
        max-height: 85vh;
    }

    .tools-item {
        padding: 12px;
    }

    .tools-item-icon {
        font-size: 28px;
        margin-right: 12px;
    }

    .tools-item-title {
        font-size: 14px;
    }

    .tools-item-desc {
        font-size: 12px;
    }
}
