/* ==================== 卡密购买页面样式（全新） ==================== */

#licensePageContent {
    position: relative;
    padding: 12px;
}

.lic-loading {
    text-align: center;
    padding: 40px;
    color: var(--color-text-muted);
}

.lic-shell {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.lic-hero {
    padding: 22px 24px;
    border-radius: 24px;
    background:
        radial-gradient(circle at top left, rgba(255, 214, 153, 0.92), transparent 36%),
        radial-gradient(circle at 85% 18%, rgba(255, 255, 255, 0.35), transparent 22%),
        linear-gradient(135deg, #171b25 0%, #232a39 52%, #3a2d1f 100%);
    color: #fffaf3;
    box-shadow: 0 30px 70px rgba(17, 21, 30, 0.24);
}

.lic-hero-copy h2 {
    margin: 8px 0 10px;
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 2.4vw, 2.2rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
}

.lic-hero-copy-plain h2 {
    margin-top: 0;
}

.lic-hero-copy p {
    margin: 0;
    max-width: 620px;
    color: rgba(255, 250, 243, 0.82);
    font-size: 0.86rem;
    line-height: 1.62;
}

.lic-kicker {
    display: inline-flex;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    font-size: 0.64rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 700;
}

.lic-kicker-muted {
    background: rgba(255, 140, 0, 0.08);
    border-color: rgba(255, 140, 0, 0.12);
    color: var(--color-primary-dark);
}

.lic-section {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(216, 190, 150, 0.45);
    box-shadow: 0 22px 50px rgba(49, 38, 24, 0.08);
    border-radius: 24px;
    padding: 24px;
}

.lic-section-head {
    margin-bottom: 20px;
}

.lic-section-head h3 {
    margin: 8px 0 0;
    font-family: var(--font-display);
    font-size: 1.2rem;
    letter-spacing: -0.02em;
    color: #202534;
}

.lic-section-head-plain h3 {
    margin-top: 0;
}

.lic-section-head p {
    margin: 8px 0 0;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
}

.lic-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.lic-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 22px;
    border: 1px solid rgba(216, 190, 150, 0.45);
    background: rgba(255, 255, 255, 0.9);
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.lic-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(49, 38, 24, 0.12);
}

.lic-tag {
    position: absolute;
    top: 14px;
    right: 14px;
    padding: 4px 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    z-index: 1;
}

.lic-tag-hot {
    background: linear-gradient(135deg, #ffb24c, #ef7b00);
}

.lic-card-header {
    padding: 16px 14px 12px;
    background: linear-gradient(135deg, var(--card-accent, #ff8c00), color-mix(in srgb, var(--card-accent, #ff8c00) 80%, #000));
    color: #fff;
    text-align: center;
}

.lic-card-header h3 {
    margin: 0 0 6px;
    font-size: 1rem;
    font-weight: 700;
}

.lic-card-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 2px;
}

.lic-price-sym { font-size: 0.85rem; }
.lic-price-num {
    font-family: var(--font-display);
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}
.lic-price-unit { font-size: 0.75rem; opacity: 0.85; }

.lic-card-subtitle {
    display: block;
    margin-top: 4px;
    font-size: 0.72rem;
    opacity: 0.8;
}

.lic-card-body {
    flex: 1;
    padding: 14px 16px;
}

.lic-features {
    list-style: none;
    margin: 0;
    padding: 0;
}

.lic-features li {
    position: relative;
    padding: 6px 0 6px 22px;
    color: #3a4050;
    font-size: 0.88rem;
    line-height: 1.6;
}

.lic-features li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255, 140, 0, 0.12);
    border: 2px solid rgba(255, 140, 0, 0.45);
}

.lic-buy-btn {
    display: block;
    width: calc(100% - 24px);
    margin: 0 12px 12px;
    padding: 10px 14px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff9e2c, #ef7b00);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(239, 123, 0, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lic-buy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 32px rgba(239, 123, 0, 0.32);
}

/* ==================== 结算弹窗 ==================== */

.lic-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(14, 18, 28, 0.55);
    backdrop-filter: blur(6px);
    animation: licFadeIn 0.2s ease;
}

@keyframes licFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lic-modal {
    position: relative;
    width: 460px;
    max-width: 94vw;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(216, 190, 150, 0.5);
    box-shadow: 0 40px 80px rgba(17, 21, 30, 0.3);
    animation: licSlideUp 0.3s ease;
}

@keyframes licSlideUp {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.lic-modal-close {
    position: absolute;
    top: 16px;
    right: 18px;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    color: #666;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 1;
}

.lic-modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

.lic-modal-header {
    padding: 24px 24px 0;
}

.lic-modal-header h3 {
    margin: 10px 0 0;
    font-family: var(--font-display);
    font-size: 1.3rem;
    letter-spacing: -0.02em;
    color: #202534;
}

.lic-modal-header-plain h3 {
    margin-top: 0;
}

.lic-modal-body {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.lic-checkout-pkg {
    padding: 16px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255, 245, 227, 0.94), rgba(255, 255, 255, 0.96));
    border: 1px solid rgba(228, 196, 148, 0.5);
}

.lic-checkout-pkg-name {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: #202534;
}

.lic-checkout-pkg-desc {
    margin-top: 6px;
    font-size: 0.84rem;
    color: var(--color-text-secondary);
}

.lic-checkout-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lic-checkout-row > label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #685942;
    letter-spacing: 0.02em;
}

.lic-qty-ctrl {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lic-qty-btn {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(201, 176, 136, 0.45);
    border-radius: 12px;
    background: rgba(255, 250, 244, 0.9);
    font-size: 1.2rem;
    cursor: pointer;
    color: #4a3c2a;
    transition: background 0.2s;
}

.lic-qty-btn:hover {
    background: rgba(255, 240, 220, 0.95);
}

.lic-qty-input {
    width: 72px;
    text-align: center;
    padding: 10px;
    border: 1px solid rgba(201, 176, 136, 0.45);
    border-radius: 14px;
    background: rgba(255, 250, 244, 0.9);
    font-size: 1rem;
    font-weight: 700;
    color: #2a3140;
    outline: none;
}

.lic-qty-input:focus {
    border-color: rgba(255, 140, 0, 0.65);
    box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.1);
}

.lic-promo-input-wrap {
    display: flex;
    gap: 10px;
}

.lic-promo-input {
    flex: 1;
    padding: 12px 14px;
    border: 1px solid rgba(201, 176, 136, 0.45);
    border-radius: 16px;
    background: rgba(255, 250, 244, 0.9);
    font-size: 0.9rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #2a3140;
    outline: none;
}

.lic-promo-input:focus {
    border-color: rgba(255, 140, 0, 0.65);
    box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.1);
}

.lic-promo-apply-btn {
    padding: 12px 18px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #fff2da, #ffd89b);
    color: #4c3420;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.2s;
}

.lic-promo-apply-btn:hover {
    transform: translateY(-1px);
}

.lic-promo-hint {
    min-height: 20px;
    font-size: 0.78rem;
}

.lic-promo-ok { color: var(--color-success); font-weight: 600; }
.lic-promo-err { color: var(--color-error); font-weight: 600; }
.lic-promo-auto { color: var(--color-primary-dark); font-weight: 500; }

.lic-checkout-loading {
    text-align: center;
    padding: 20px;
    color: var(--color-text-muted);
}

.lic-checkout-error {
    text-align: center;
    padding: 16px;
    color: var(--color-error);
    border-radius: 14px;
    background: rgba(239, 68, 68, 0.06);
}

.lic-checkout-block {
    padding: 16px;
    border-radius: 16px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.22);
    text-align: center;
}

.lic-checkout-block strong {
    display: block;
    margin-bottom: 8px;
    color: #92400e;
}

.lic-checkout-block p {
    margin: 0;
    color: #78350f;
    font-size: 0.88rem;
    line-height: 1.6;
}

.lic-checkout-summary {
    border-radius: 20px;
    border: 1px solid rgba(228, 196, 148, 0.45);
    background: rgba(255, 248, 238, 0.7);
    padding: 18px;
}

.lic-summary-lines {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(228, 196, 148, 0.4);
}

.lic-summary-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
    color: #3a4050;
}

.lic-summary-discount {
    color: var(--color-success);
    font-weight: 600;
}

.lic-line-through {
    text-decoration: line-through;
    color: var(--color-text-muted);
}

.lic-summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lic-summary-total span {
    font-size: 0.9rem;
    color: #3a4050;
}

.lic-summary-total strong {
    font-family: var(--font-display);
    font-size: 1.6rem;
    letter-spacing: -0.04em;
    color: #202534;
}

.lic-modal-footer {
    padding: 0 24px 24px;
}

.lic-pay-btn {
    display: block;
    width: 100%;
    padding: 15px 20px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff9e2c, #ef7b00);
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 18px 34px rgba(239, 123, 0, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.lic-pay-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 22px 40px rgba(239, 123, 0, 0.36);
}

.lic-pay-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

@media (max-width: 768px) {
    .lic-hero { padding: 22px 18px; border-radius: 22px; }
    .lic-section { padding: 18px; border-radius: 20px; }
    .lic-cards-grid { grid-template-columns: 1fr; }
    .lic-modal { border-radius: 22px; }
    .lic-promo-input-wrap { flex-direction: column; }
}

/* 授权状态兼容视图 */
.license-active, .license-inactive, .license-error, .license-loading {
    padding: 20px;
    border-radius: 8px;
}

.license-active {
    background: #f0f9ff;
    border: 1px solid #bfdbfe;
}

.license-inactive {
    background: #fef3c7;
    border: 1px solid #fde68a;
    text-align: center;
}

.license-error {
    background: #fee;
    border: 1px solid #fcc;
    text-align: center;
}

.status-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
}

.status-header .icon {
    font-size: 24px;
}

.status-body {
    display: grid;
    gap: 15px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e5e7eb;
}

.status-item label {
    color: #6b7280;
    font-weight: 500;
}

.status-item span {
    color: #111827;
    font-weight: 600;
}

.status-item span.active {
    color: #10b981;
}

.status-item span.expired {
    color: #ef4444;
}

.status-item span.warning {
    color: #f59e0b;
}

.license-code {
    font-family: 'Courier New', monospace;
    background: #f3f4f6;
    padding: 4px 8px;
    border-radius: 4px;
}

/* 设备列表 */
.device-list {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e5e7eb;
}

.device-list h4 {
    margin-bottom: 15px;
    color: #374151;
}

.device-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
}

.device-item.current {
    border-color: #3b82f6;
    background: #eff6ff;
}

.device-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.device-fingerprint {
    font-family: 'Courier New', monospace;
    color: #6b7280;
    font-size: 13px;
}

.current-tag {
    background: #3b82f6;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.device-time {
    display: flex;
    gap: 20px;
}

.device-time small {
    color: #9ca3af;
    font-size: 12px;
}

/* 无授权状态 */
.inactive-message {
    color: #78350f;
    margin: 15px 0;
}

.activate-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    padding: 10px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.activate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* 激活卡密表单 */
.activate-form {
    display: flex;
    gap: 15px;
    max-width: 600px;
}

.license-input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Courier New', monospace;
    transition: all 0.3s ease;
}

.license-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-activate {
    padding: 12px 40px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-activate:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}
