/* ====== 激活码方案页面 - 对齐 form.html 样式规范 ====== */

/* 卡片容器（对齐 .form-card） */
.key-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    padding: 20px;
    width: 100%;
}

/* 卡片头部（对齐 .form-card-header） */
.key-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.key-card-header h3 {
    margin: 0;
    font-size: 16px;
}

/* 右侧操作区：进度条 + 新建按钮 */
.key-header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* 激活码总量进度条 */
.key-quota {
    display: flex;
    align-items: center;
    white-space: nowrap;
    gap: 8px;
}

.key-quota-label{
    color: #000;
}

.key-quota-text {
    font-size: 13px;
    color: #999;
}

.key-quota-track {
    width: 200px;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.key-quota-used {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: #409eff;
    border-radius: 4px;
    transition: width 0.3s;
    z-index: 1;
}

.key-quota-danger {
    position: absolute;
    top: 0;
    height: 100%;
    background: #f56c6c;
    border-radius: 0 4px 4px 0;
    z-index: 2;
    transition: left 0.3s, width 0.3s;
}

/* 新建按钮 */
.key-create-btn {
    width: 90px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(268.5deg, rgba(38,111,255,1) 1.98%,rgba(70,179,240,1) 98.71%);
    color: #fff;
    border: none;
    border-radius: 100px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

/* ====== 表格（对齐 .table-container） ====== */
.key-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 14px;
}

/* 表头（对齐 form th） */
.key-table th {
    background: #f5f5f5;
    padding: 12px 0;
    font-weight: 500;
    border: none;
    text-align: center;
}

/* 数据行（对齐 form td） */
.key-table td {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    padding: 15px 0;
    text-align: center;
    border: none;
}

/* 去掉表格线 */
.key-table,
.key-table tr {
    border: none;
}

/* 操作按钮（对齐 .opt-btn） */
.key-action {
    color: #409eff;
    cursor: pointer;
    margin: 0 8px;
    background: none;
    border: none;
    padding: 0;
    font-size: 14px;
}

.key-action:hover {
    color: #66b1ff;
}

/* 空状态（对齐 .empty-tip） */
.key-empty {
    text-align: center;
    padding: 60px 0;
    color: #999;
    font-size: 14px;
}

/* ====== 分页（对齐 .pagination） ====== */
.key-pager {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.key-pager-select {
    padding: 4px 8px;
    border: 1px solid #e4e7ed;
    border-radius: 4px;
    font-size: 13px;
    color: #333;
    outline: none;
    cursor: pointer;
    background: #fff;
}

/* 分页按钮（对齐 .page-btn） */
.key-pager-btn {
    padding: 4px 12px;
    border: 1px solid #e4e7ed;
    background: #fff;
    cursor: pointer;
    border-radius: 4px;
    font-size: 13px;
    color: #333;
}

.key-pager-btn.active {
    background: #409eff;
    color: #fff;
    border-color: #409eff;
}

.key-pager-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 分页信息 */
.key-pager-info {
    font-size: 13px;
    color: #999;
}

/* ====== 弹窗遮罩 ====== */
.key-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.key-overlay.is-show {
    display: flex;
}

/* 弹窗内表单字段 */
.key-field {
    margin-bottom: 0;
}

.key-field-label {
    display: block;
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
}

.key-field-label .req {
    color: #e74c3c;
    margin-right: 2px;
}

.key-field-input {
    width: 100%;
    height: 34px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    padding: 0 12px;
    font-size: 14px;
    color: #333;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.key-field-input:focus {
    border-color: #165dff;
}

.key-field-input::placeholder {
    color: #bbb;
}

/* ====== 生成激活码弹窗（对齐 expire-modal 风格） ====== */
.key-gen-modal-box {
    background: #fff;
    border-radius: 12px;
    width: 620px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.key-gen-modal-header {
    height: 56px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #f0f0f0;
}

.key-gen-modal-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #333;
}

.key-gen-modal-close {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.key-gen-modal-close:hover {
    color: #333;
}

.key-gen-modal-close svg {
    width: 18px;
    height: 18px;
}

.key-gen-modal-body {
    width: 620px;
    min-height: 200px;
    padding: 28px 32px;
}

/* 表单行 */
.key-gen-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.key-gen-row:last-child {
    margin-bottom: 0;
}

.key-gen-row-top {
    align-items: flex-start;
}

.key-gen-label {
    width: 120px;
    font-size: 15px;
    color: #333;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.key-gen-row-top .key-gen-label {
    padding-top: 8px;
}

.key-gen-label .req {
    color: #e74c3c;
    margin-right: 2px;
}

/* 方案名称只读值 */
.key-gen-value {
    font-size: 14px;
    color: #333;
}

/* 步进器 + 单位 */
.key-gen-control {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.key-stepper {
    display: flex;
    align-items: center;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    overflow: hidden;
    height: 34px;
}

.key-stepper-btn {
    width: 34px;
    height: 100%;
    border: none;
    background: #fff;
    color: #666;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    user-select: none;
}

.key-stepper-btn:hover:not(:disabled) {
    background: #f5f7fa;
    color: #165dff;
}

.key-stepper-btn:disabled {
    color: #ccc;
    cursor: not-allowed;
}

.key-stepper-input {
    width: 60px;
    height: 100%;
    border: none;
    border-left: 1px solid #d9d9d9;
    border-right: 1px solid #d9d9d9;
    text-align: center;
    font-size: 14px;
    color: #333;
    outline: none;
    -moz-appearance: textfield;
}

.key-stepper-input::-webkit-outer-spin-button,
.key-stepper-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.key-gen-unit {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
}

/* 备注区域 */
.key-gen-textarea-wrap {
    flex: 1;
}

.key-gen-textarea {
    width: 100%;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    color: #333;
    outline: none;
    box-sizing: border-box;
    resize: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.key-gen-textarea:focus {
    border-color: #165dff;
}

.key-gen-textarea::placeholder {
    color: #bbb;
}

/* 底部 */
.key-gen-modal-footer {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 0 24px;
    border-top: 1px solid #f0f0f0;
}

.key-gen-btn-cancel {
    width: 106px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid currentColor;
    border-radius: 100px;
    background: #fff;
    color: var(--color2);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.key-gen-btn-cancel:hover {
    background: #EBF2FF;
}

.key-gen-btn-confirm {
    width: 106px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 100px;
    background: linear-gradient(268.5deg, rgba(38,111,255,1) 1.98%, rgba(70,179,240,1) 98.71%);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.key-gen-btn-confirm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
