/* ==========================================================
   WC License Manager — Frontend Styles
   CSS 变量由 PHP 动态注入（基于配色方案设置）
   ========================================================== */

:root {
    --wclm-primary:        #96588a;
    --wclm-primary-hover:  #7a4570;
    --wclm-primary-light:  #96588a22;
    --wclm-primary-border: #96588a66;
}

/* ── 我的订单授权码列 ─────────────────────────────────────── */
.wclm-col-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
}

/* ── 授权码展示 ───────────────────────────────────────────── */
.wclm-frontend-license {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.wclm-license-code {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 12px;
    background: #f6f7f7;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 3px 8px;
    word-break: break-all;
    color: #1d2327;
}

/* ── 复制按钮 ─────────────────────────────────────────────── */
.wclm-copy-btn {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: var(--wclm-primary);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
    transition: background .15s, opacity .15s;
}
.wclm-copy-btn:hover  { background: var(--wclm-primary-hover); }
.wclm-copy-btn.copied { opacity: .85; }
.wclm-copy-btn:disabled { cursor: default; }

/* ── 绑定授权按钮 ─────────────────────────────────────────── */
.wclm-frontend-bind-btn {
    display: inline-block;
    padding: 5px 14px;
    background: var(--wclm-primary);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
    transition: background .15s;
}
.wclm-frontend-bind-btn:hover { background: var(--wclm-primary-hover); }

/* ── 查看授权码按钮 ───────────────────────────────────────── */
.wclm-frontend-view-btn {
    display: inline-block;
    padding: 5px 14px;
    background: #fff;
    color: var(--wclm-primary);
    border: 1.5px solid var(--wclm-primary);
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
    transition: background .15s, color .15s;
}
.wclm-frontend-view-btn:hover {
    background: var(--wclm-primary);
    color: #fff;
}

/* ── 超限徽章 ─────────────────────────────────────────────── */
.wclm-status-over-limit {
    display: inline-block;
    padding: 3px 10px;
    background: #f3e8ff;
    color: #6b21a8;
    border-radius: 12px;
    font-size: 12px;
    cursor: default;
}

/* ── 订单详情页 ───────────────────────────────────────────── */
.wclm-order-details-section { margin-top: 32px; }
.wclm-order-details-section h2 { font-size: 18px; margin-bottom: 12px; }
.wclm-details-table { width: 100%; border-collapse: collapse; }
.wclm-details-table th,
.wclm-details-table td {
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    font-size: 14px;
    vertical-align: middle;
}
.wclm-details-table th {
    background: #f9fafb;
    font-weight: 600;
    width: 120px;
    color: #374151;
}

/* ==========================================================
   弹框公共样式
   ========================================================== */

.wclm-fe-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}
.wclm-fe-overlay[style*="display: block"],
.wclm-fe-overlay[style*="display:block"] { display: flex !important; }

.wclm-fe-modal {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 16px 48px rgba(0,0,0,.22);
    width: 440px;
    max-width: 94vw;
    overflow: hidden;
    animation: wclmFeIn .2s ease;
}
.wclm-fe-modal--wide { width: 680px; }

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

.wclm-fe-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid #f0f0f0;
}
.wclm-fe-header h2 { margin: 0; font-size: 16px; }
.wclm-fe-close {
    background: none; border: none; font-size: 20px;
    cursor: pointer; color: #999; line-height: 1; padding: 0;
    transition: color .15s;
}
.wclm-fe-close:hover { color: #c00; }

.wclm-fe-body { padding: 20px 20px 8px; }

/* ── 表单字段 ─────────────────────────────────────────────── */
.wclm-fe-field { margin-bottom: 16px; }
.wclm-fe-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.wclm-fe-req { color: #c00; }
.wclm-fe-field input {
    width: 100%; padding: 8px 11px;
    border: 1.5px solid #ddd; border-radius: 4px;
    font-size: 14px; box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s;
}
.wclm-fe-field input:focus {
    outline: none;
    border-color: var(--wclm-primary);
    box-shadow: 0 0 0 3px var(--wclm-primary-light);
}
.wclm-fe-err-input { border-color: #c00 !important; }

/* ── 加载 ─────────────────────────────────────────────────── */
.wclm-fe-loading { text-align: center; padding: 36px 20px; }
.wclm-fe-spinner {
    width: 38px; height: 38px;
    border: 3px solid #f0f0f0;
    border-top-color: var(--wclm-primary);
    border-radius: 50%;
    animation: wclmFeSpin .7s linear infinite;
    margin: 0 auto 14px;
}
@keyframes wclmFeSpin { to { transform: rotate(360deg); } }
.wclm-fe-loading p { color: #666; font-size: 14px; margin: 0; }

/* ── 结果区 ───────────────────────────────────────────────── */
.wclm-fe-success, .wclm-fe-error { text-align: center; padding: 24px 20px 10px; }
.wclm-fe-icon {
    width: 48px; height: 48px; border-radius: 50%;
    font-size: 22px; line-height: 48px; margin: 0 auto 12px;
}
.wclm-fe-icon--ok  { background: #d1fae5; color: #065f46; }
.wclm-fe-icon--err { background: #fee2e2; color: #991b1b; }
.wclm-fe-success h3, .wclm-fe-error h3 { margin: 0 0 14px; font-size: 15px; }
.wclm-fe-errmsg { color: #c00; font-size: 14px; margin: 0; }

.wclm-fe-license-box {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    background: #f9f9f9; border: 1px solid #e0e0e0;
    border-radius: 5px; padding: 9px 12px; text-align: left;
}
.wclm-fe-license-key {
    flex: 1; font-family: monospace; font-size: 13px;
    word-break: break-all; color: #333;
}
.wclm-fe-copy-btn {
    background: var(--wclm-primary);
    color: #fff; border: none;
    border-radius: 4px; padding: 5px 12px; cursor: pointer;
    font-size: 12px; white-space: nowrap; transition: background .15s;
}
.wclm-fe-copy-btn:hover { background: var(--wclm-primary-hover); }

/* ── Footer ──────────────────────────────────────────────── */
.wclm-fe-footer {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 12px 20px 18px; border-top: 1px solid #f0f0f0; margin-top: 10px;
}
.wclm-fe-footer button {
    padding: 7px 18px; border-radius: 4px; cursor: pointer;
    font-size: 13px; border: 1px solid #ddd; background: #f9f9f9;
    transition: background .15s;
}
.wclm-fe-submit {
    background: var(--wclm-primary) !important;
    color: #fff !important;
    border-color: var(--wclm-primary) !important;
}
.wclm-fe-submit:hover { background: var(--wclm-primary-hover) !important; }
.wclm-fe-retry {
    background: #2271b1 !important;
    color: #fff !important;
    border-color: #2271b1 !important;
}
.wclm-fe-cancel { color: #555; }

/* ── 查看授权码表格 ───────────────────────────────────────── */
.wclm-view-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.wclm-view-table th,
.wclm-view-table td {
    padding: 9px 12px;
    border-bottom: 1px solid #f0f0f0;
    text-align: left;
    vertical-align: middle;
}
.wclm-view-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #444;
    white-space: nowrap;
    border-bottom: 2px solid var(--wclm-primary-border);
}
.wclm-view-table tr:last-child td { border-bottom: none; }
.wclm-view-table .wclm-license-code {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 11px;
    background: #f6f7f7;
    border: 1px solid #e5e7eb;
    border-radius: 3px;
    padding: 2px 6px;
    word-break: break-all;
}

/* ── 图标复制按钮（查看授权列表内） ──────────────────────── */
.wclm-lic-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.wclm-copy-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    color: var(--wclm-primary);
    border: 1.5px solid var(--wclm-primary-border);
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s, color .15s, border-color .15s;
}
.wclm-copy-icon-btn:hover {
    background: var(--wclm-primary);
    color: #fff;
    border-color: var(--wclm-primary);
}
.wclm-copy-icon-btn.copied {
    background: #d1fae5;
    color: #065f46;
    border-color: #6ee7b7;
}
.wclm-copy-icon-btn svg { pointer-events: none; }

/* loading 区只显示 spinner，不显示文字 */
.wclm-view-loading { text-align: center; padding: 32px 20px; }
.wclm-view-loading p { display: none; }

/* ── 解除授权按钮 ─────────────────────────────────────────── */
.wclm-unbind-btn {
    display: inline-block;
    padding: 4px 10px;
    background: #fff;
    color: #dc2626;
    border: 1.5px solid #fca5a5;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
    transition: background .15s, color .15s, border-color .15s;
}
.wclm-unbind-btn:hover {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}
.wclm-unbind-btn:disabled {
    opacity: .6;
    cursor: default;
}
.wclm-col-action { width: 90px; text-align: center; }
