/**
 * 密码生成器样式
 */

/* 布局 */
.password-layout {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

/* 设置区域 */
.password-settings {
    width: 300px;
    flex-shrink: 0;
    background: var(--color-bg-secondary);
    border-radius: 16px;
    padding: 20px;
}

/* 设置区块 */
.setting-section {
    margin-bottom: 20px;
}

.setting-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 10px;
}

.length-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    font-weight: 700;
    color: var(--color-primary);
}

/* 长度滑块 */
.length-slider {
    margin-bottom: 4px;
}

.length-slider input[type="range"] {
    width: 100%;
    height: 6px;
    background: var(--color-bg);
    border-radius: 3px;
    appearance: none;
    cursor: pointer;
}

.length-slider input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--color-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.length-marks {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--color-text-light);
    margin-top: 4px;
}

/* 字符类型选项 */
.char-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.char-option {
    cursor: pointer;
}

.char-option input {
    display: none;
}

.char-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    border-radius: 8px;
    transition: all 0.15s;
}

.char-option input:checked + .char-box {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.char-title {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 4px;
}

.char-sample {
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--color-text-secondary);
}

/* 高级选项 */
.advanced-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--color-bg);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--color-text-secondary);
    transition: all 0.15s;
}

.checkbox-option:hover {
    background: var(--color-bg-tertiary);
}

.checkbox-option input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* 自定义输入 */
.custom-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 13px;
    font-family: 'JetBrains Mono', monospace;
    background: var(--color-bg);
    color: var(--color-text);
}

.custom-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* 数量选项 */
.count-options {
    display: flex;
    gap: 6px;
}

.count-btn {
    flex: 1;
    padding: 8px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 12px;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.count-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.count-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

/* 生成按钮 */
.btn-generate {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    justify-content: center;
    gap: 8px;
}

/* 结果区域 */
.password-result {
    flex: 1;
    background: var(--color-bg-secondary);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 单个结果 */
.single-result {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.password-display {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--color-bg);
    border-radius: 12px;
}

.password-text {
    flex: 1;
    font-family: 'JetBrains Mono', monospace;
    font-size: 20px;
    font-weight: 500;
    color: var(--color-text);
    word-break: break-all;
    letter-spacing: 2px;
}

.btn-refresh {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--color-bg-secondary);
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-refresh:hover {
    background: var(--color-primary);
    transform: rotate(180deg);
}

/* 强度条 */
.strength-bar {
    height: 6px;
    background: var(--color-bg);
    border-radius: 3px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    transition: all 0.3s;
}

.strength-fill.weak { background: #ef4444; }
.strength-fill.medium { background: #f59e0b; }
.strength-fill.strong { background: #22c55e; }
.strength-fill.very-strong { background: #3b82f6; }

.strength-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}

.strength-label {
    font-weight: 600;
}

.strength-label.weak { color: #ef4444; }
.strength-label.medium { color: #f59e0b; }
.strength-label.strong { color: #22c55e; }
.strength-label.very-strong { color: #3b82f6; }

.entropy-label {
    color: var(--color-text-secondary);
}

/* 结果操作 */
.result-actions {
    display: flex;
    gap: 8px;
}

.result-actions .btn {
    flex: 1;
    justify-content: center;
}

/* 批量结果 */
.batch-result {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.batch-result.hidden {
    display: none;
}

.batch-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.batch-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
}

.password-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.password-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--color-bg);
    border-radius: 8px;
}

.password-item-text {
    flex: 1;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--color-text);
    word-break: break-all;
}

.password-item-copy {
    padding: 4px 10px;
    border: none;
    background: var(--color-primary);
    color: white;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.15s;
}

.password-item:hover .password-item-copy {
    opacity: 1;
}

/* 历史记录 */
.history-section {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.history-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 150px;
    overflow-y: auto;
}

.history-empty {
    font-size: 12px;
    color: var(--color-text-light);
    text-align: center;
    padding: 20px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--color-bg);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.history-item:hover {
    background: var(--color-bg-tertiary);
}

.history-item-text {
    flex: 1;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--color-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item-time {
    font-size: 10px;
    color: var(--color-text-light);
}

/* 响应式 */
@media (max-width: 800px) {
    .password-layout {
        flex-direction: column;
    }

    .password-settings {
        width: 100%;
    }

    .char-options {
        grid-template-columns: repeat(2, 1fr);
    }
}
