/*
 * 文件名称：password.css
 * 作者：wangkai（2026-11-24）
 * 创作时间：2026-11-24 10:00:00（北京时间）
 * 文件说明：随机密码生成工具页面样式，包含参数设置区、密码列表与复制反馈效果
 */

/* 页面整体容器 */
.pg-page {
    max-width: 1290px;
    margin: 24px auto 40px;
    padding: 0 12px;
}

/* 主卡片 */
.pg-card {
    padding: 24px;
    background: #ffffff;
    border: 1px solid #e5e9f2;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(15, 35, 95, 0.05);
}

/* 标题与说明 */
.pg-title {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 600;
    color: #1f2d3d;
}

.pg-sub {
    margin: 0 0 20px;
    font-size: 13px;
    color: #8a94a6;
}

/* 参数设置区 */
.pg-form {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.pg-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 160px;
}

.pg-field--full {
    flex: 1 1 100%;
}

.pg-field > label {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #45526b;
}

/* 数字输入框与下拉框 */
.pg-input {
    width: 100%;
    height: 38px;
    padding: 6px 10px;
    border: 1px solid #d5dbe8;
    border-radius: 6px;
    background: #ffffff;
    font-size: 14px;
    color: #1f2d3d;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

select.pg-input {
    cursor: pointer;
}

.pg-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* 字符组合复选框 */
.pg-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
}

.pg-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    color: #45526b;
    cursor: pointer;
}

.pg-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #2563eb;
    cursor: pointer;
}

/* 操作按钮区 */
.pg-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 22px 0 16px;
    padding-top: 18px;
    border-top: 1px dashed #e5e9f2;
}

.pg-btn {
    height: 40px;
    padding: 0 22px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s;
}

.pg-btn--primary {
    background: #2563eb;
    color: #ffffff;
}

.pg-btn--primary:hover {
    background: #1d4fd7;
}

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

/* 提示文字 */
.pg-tip {
    font-size: 13px;
    color: #8a94a6;
}

.pg-tip.is-error {
    color: #e5484d;
}

.pg-tip.is-success {
    color: #12a150;
}

/* 密码列表：自适应多列，依次排列 */
.pg-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
}

/* 单条密码（整条可点击复制） */
.pg-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: #f7f9fc;
    border: 1px solid #e5e9f2;
    border-radius: 8px;
    font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
    font-size: var(--pg-item-font, 14px);
    color: #1f2d3d;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, transform 0.1s;
}

.pg-item:hover {
    background: #eef4ff;
    border-color: #b9cdfb;
}

.pg-item:active {
    transform: scale(0.99);
}

/* 序号 */
.pg-item__index {
    flex: 0 0 26px;
    padding-top: 1px;
    color: #a3adc2;
    font-size: 12px;
    text-align: right;
}

/* 密码文本：完整展示不隐藏，超长自动换行；balance 避免末尾只剩一个字符 */
.pg-item__text {
    flex: 1 1 auto;
    min-width: 0;
    font-size: inherit;
    white-space: normal;
    word-break: break-all;
    overflow-wrap: anywhere;
    text-wrap: balance;
    line-height: 1.5;
}

/* 复制状态标签 */
.pg-item__copy {
    flex: 0 0 auto;
    padding-top: 1px;
    font-family: inherit;
    font-size: 12px;
    color: #2563eb;
}

.pg-item.is-copied {
    background: #eafaf0;
    border-color: #9fdcb5;
}

.pg-item.is-copied .pg-item__copy {
    color: #12a150;
}

/* 空状态 */
.pg-empty {
    grid-column: 1 / -1;
    padding: 24px;
    text-align: center;
    font-size: 14px;
    color: #a3adc2;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .pg-card {
        padding: 16px;
    }

    .pg-field {
        flex: 1 1 100%;
    }

    .pg-list {
        grid-template-columns: 1fr;
    }
}
