*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: linear-gradient(145deg, #1a1f36 0%, #252b48 45%, #1e3a5f 100%);
    min-height: 100vh;
    color: #e8ecf4;
    line-height: 1.5;
}

.page {
    max-width: 560px;
    margin: 0 auto;
    padding: 24px 16px 40px;
}

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

.back-link {
    display: inline-block;
    color: #8ba3c7;
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 16px;
}

.back-link:hover {
    color: #b8cce8;
}

.header h1 {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.subtitle {
    margin: 0;
    color: #9aa8be;
    font-size: 14px;
}

.card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    backdrop-filter: blur(12px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
}

.result-box {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.password-output {
    flex: 1;
    min-width: 0;
    padding: 14px 16px;
    font-size: 18px;
    font-family: "SF Mono", "Consolas", "Monaco", monospace;
    letter-spacing: 0.04em;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    outline: none;
}

.password-output:focus {
    border-color: #5b9fd4;
}

.result-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.btn {
    border: none;
    cursor: pointer;
    font-size: 14px;
    border-radius: 10px;
    transition: background 0.15s, transform 0.1s;
}

.btn:active {
    transform: scale(0.98);
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-icon {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    color: #dce4f0;
    white-space: nowrap;
}

.btn-icon:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.18);
}

.btn-primary {
    width: 100%;
    margin-top: 20px;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(135deg, #3d8bfd, #2a6fd6);
    color: #fff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4d97ff, #3578e0);
}

.strength-bar {
    height: 4px;
    margin-top: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: width 0.3s, background 0.3s;
}

.strength-text {
    margin: 6px 0 0;
    font-size: 12px;
    color: #9aa8be;
}

.strength-weak .strength-fill { background: #e74c3c; width: 25%; }
.strength-fair .strength-fill { background: #f39c12; width: 50%; }
.strength-good .strength-fill { background: #3498db; width: 75%; }
.strength-strong .strength-fill { background: #2ecc71; width: 100%; }

.options {
    margin-top: 24px;
}

.option-row {
    margin-bottom: 18px;
}

.option-row label:first-child {
    display: block;
    font-size: 13px;
    color: #9aa8be;
    margin-bottom: 8px;
}

.length-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.length-control input[type="range"] {
    flex: 1;
    accent-color: #3d8bfd;
}

.length-input {
    width: 56px;
    padding: 8px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
    font-size: 15px;
}

.checks {
    display: grid;
    gap: 10px;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #dce4f0;
}

.check-item input {
    width: 18px;
    height: 18px;
    accent-color: #3d8bfd;
}

select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    font-size: 14px;
}

.password-list {
    list-style: none;
    margin: 16px 0 0;
    padding: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.password-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-family: "SF Mono", "Consolas", monospace;
    font-size: 14px;
}

.password-list .copy-one {
    flex-shrink: 0;
    padding: 4px 10px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: #b8cce8;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.password-list .copy-one:hover {
    background: rgba(255, 255, 255, 0.18);
}

.footer {
    text-align: center;
    margin-top: 28px;
    font-size: 12px;
    color: #7a8ba8;
}

.footer a {
    color: #8ba3c7;
}

.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    padding: 10px 20px;
    background: rgba(30, 40, 60, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    font-size: 14px;
    opacity: 0;
    transition: transform 0.25s, opacity 0.25s;
    pointer-events: none;
    z-index: 100;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

@media (max-width: 480px) {
    .result-box {
        flex-direction: column;
    }

    .result-actions {
        flex-direction: row;
    }

    .btn-icon {
        flex: 1;
    }
}
