/* 全局重置与基础样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: #f0f2f5;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    color: #333;
    min-height: 100vh;
    padding: 24px 16px;
}

/* 容器 */
.container {
    max-width: 680px;
    margin: 0 auto;
}

/* 头部 */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 22px;
    font-weight: 600;
    color: #1a1a1a;
}

/* 队列状态 */
.queue-hint {
    font-size: 12px;
    color: #52c41a;
    margin-top: 5px;
}

.queue-status span {
    display: inline-block;
    background-color: #e6f4ff;
    color: #4A90D9;
    border: 1px solid #bae0ff;
    border-radius: 12px;
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 500;
}

/* 卡片 */
.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    padding: 24px;
    margin-bottom: 20px;
}

.card h2 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    padding-bottom: 14px;
    margin-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

/* 提示横幅 */
.notice {
    background-color: #fffbe6;
    border: 1px solid #ffe58f;
    color: #7d5900;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* 表单 */
.form-group {
    margin-bottom: 12px;
}

.form-group input {
    width: 100%;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    color: #333;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    border-color: #4A90D9;
    box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.15);
}

.form-group input::placeholder {
    color: #bfbfbf;
}

/* 2FA 帮助按钮 */
.twofa-help-wrap {
    text-align: center;
    margin-bottom: 14px;
}

.btn-twofa-help {
    display: inline-block;
    background-color: #fff7e6;
    color: #d46b08;
    border: 1px solid #ffd591;
    border-radius: 6px;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s, border-color 0.2s;
}

.btn-twofa-help:hover {
    background-color: #ffe7ba;
    border-color: #ffa940;
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s, opacity 0.2s;
}

.btn-primary {
    background-color: #4A90D9;
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background-color: #3a7bc8;
}

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

/* 消息提示 */
.message {
    margin-top: 12px;
    padding: 0;
    border-radius: 6px;
    font-size: 14px;
    display: none;
}

.message.success {
    display: block;
    background-color: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
    padding: 10px 12px;
}

.message.error {
    display: block;
    background-color: #fff2f0;
    color: #ff4d4f;
    border: 1px solid #ffccc7;
    padding: 10px 12px;
}

/* CDK 剩余次数 */
.remaining-uses {
    font-size: 13px;
    font-weight: 600;
    color: #4A90D9;
    background: #e6f4ff;
    border: 1px solid #bae0ff;
    border-radius: 6px;
    padding: 7px 12px;
    margin-top: 14px;
    margin-bottom: 4px;
    display: inline-block;
}

/* 订单列表 */
.order-list {
    margin-top: 16px;
}

.order-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.order-item:last-child {
    border-bottom: none;
}

.order-info {
    flex: 1;
    min-width: 0;
}

.order-email {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.order-time {
    font-size: 12px;
    color: #8c8c8c;
    margin-top: 4px;
}

.order-status {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: 12px;
}

.status-message {
    font-size: 12px;
    color: #8c8c8c;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 状态徽章 */
.status-badge {
    display: inline-block;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.status-success {
    background-color: #f6ffed;
    color: #52c41a;
}

.status-pending {
    background-color: #fffbe6;
    color: #faad14;
}

.status-running {
    background-color: #e6f4ff;
    color: #1677ff;
}

.status-failed {
    background-color: #fff2f0;
    color: #ff4d4f;
}

/* 取消按钮 */
.cancel-btn {
    background: transparent;
    border: 1px solid #ff4d4f;
    color: #ff4d4f;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    white-space: nowrap;
}

.cancel-btn:hover {
    background-color: #ff4d4f;
    color: #fff;
}

.cancel-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 订单项内联消息 */
.order-inline-msg {
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

.order-inline-msg.success {
    color: #52c41a;
    background-color: #f6ffed;
    display: inline;
    border: none;
}

.order-inline-msg.error {
    color: #ff4d4f;
    background-color: #fff2f0;
    display: inline;
    border: none;
}

/* =====================
   失败自检手册
   ===================== */
.checklist-wrap {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #ffccc7;
    margin-bottom: 20px;
    overflow: hidden;
}

.checklist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.checklist-header:hover {
    background: #fff5f5;
}

.checklist-title {
    font-size: 15px;
    font-weight: 700;
    color: #c0392b;
}

.checklist-toggle-text {
    font-size: 13px;
    font-weight: 600;
    color: #c0392b;
    white-space: nowrap;
}

.checklist-arrow {
    display: inline-block;
    transition: transform 0.2s;
}

.checklist-body {
    display: none;
    padding: 0 20px 20px 20px;
    border-top: 1px solid #ffccc7;
}

.checklist-intro {
    font-size: 13px;
    color: #555;
    margin: 14px 0 16px;
    line-height: 1.6;
}

.checklist-item {
    background: #fff;
    border: 1px solid #ffd6d6;
    border-radius: 8px;
    padding: 16px 18px;
    margin-bottom: 12px;
}

.checklist-item:last-child {
    margin-bottom: 0;
}

.checklist-item-title {
    font-size: 15px;
    font-weight: 700;
    color: #c0392b;
    margin-bottom: 6px;
}

.checklist-item-desc {
    font-size: 13px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 12px;
}

.checklist-link-row {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px dashed #ffb3b3;
    border-radius: 6px;
    padding: 8px 12px;
    background: #fffafa;
}

.checklist-link {
    flex: 1;
    font-size: 12px;
    color: #c0392b;
    text-decoration: none;
    word-break: break-all;
    line-height: 1.5;
}

.checklist-link:hover {
    text-decoration: underline;
}

.copy-btn {
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #c0392b;
    color: #c0392b;
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.copy-btn:hover {
    background: #c0392b;
    color: #fff;
}

.copy-btn.copied {
    background: #52c41a;
    border-color: #52c41a;
    color: #fff;
}

/* =====================
   居中购买卡密按钮
   ===================== */
.buy-center {
    text-align: center;
    margin-bottom: 20px;
}

.btn-buy-center {
    display: inline-block;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    padding: 12px 36px;
    border-radius: 50px;
    box-shadow: 0 4px 14px rgba(108, 92, 231, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    letter-spacing: 0.5px;
}

.btn-buy-center:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.5);
}

/* =====================
   右侧固定按钮组
   ===================== */
.side-buttons {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 1000;
}

.side-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 54px;
    padding: 18px 0;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    border-radius: 8px 0 0 8px;
    text-decoration: none;
    user-select: none;
    position: relative;
    transition: width 0.2s;
}

.side-btn span {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 2px;
}

.side-btn-buy {
    background: linear-gradient(160deg, #6c5ce7, #a29bfe);
    color: #fff;
    box-shadow: -2px 2px 8px rgba(108, 92, 231, 0.35);
}

.side-btn-buy:hover {
    background: linear-gradient(160deg, #5a4bd1, #9088f0);
}

.side-btn-contact {
    background: linear-gradient(160deg, #00b894, #55efc4);
    color: #fff;
    box-shadow: -2px 2px 8px rgba(0, 184, 148, 0.35);
}

.side-btn-contact:hover {
    background: linear-gradient(160deg, #00a381, #44ddb3);
}

/* QR 弹出框 */
.qr-popup {
    display: none;
    position: absolute;
    right: 62px;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.18);
    padding: 12px;
    text-align: center;
    width: 180px;
    z-index: 1001;
}

.qr-popup img {
    width: 156px;
    height: 156px;
    object-fit: contain;
    border-radius: 4px;
    display: block;
}

.qr-popup p {
    font-size: 12px;
    color: #666;
    margin-top: 8px;
}

.qr-popup::after {
    content: '';
    position: absolute;
    right: -7px;
    top: 50%;
    transform: translateY(-50%);
    border: 7px solid transparent;
    border-left-color: #fff;
    border-right: none;
}

.side-btn-contact:hover .qr-popup {
    display: block;
}

/* =====================
   使用说明面板
   ===================== */
.info-panel {
    position: fixed;
    right: 66px;
    bottom: 24px;
    width: 300px;
    background: #fff;
    border-radius: 10px;
    border-left: 4px solid #ff4d4f;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    z-index: 999;
    overflow: hidden;
}

.info-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #fff;
    cursor: default;
}

.info-panel-header span {
    font-size: 14px;
    font-weight: 700;
    color: #e53935;
}

.info-toggle {
    background: none;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    width: 22px;
    height: 22px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s;
}

.info-toggle:hover {
    background: #f5f5f5;
}

.info-panel-body {
    padding: 4px 14px 14px 14px;
    border-top: 1px solid #f5f5f5;
}

.info-panel-body ol {
    padding-left: 18px;
    margin: 0;
}

.info-panel-body li {
    font-size: 13px;
    color: #444;
    line-height: 1.7;
    margin-bottom: 4px;
}

.info-panel-body li strong {
    color: #333;
}

.info-panel-body li.warn-item {
    color: #e53935;
}

.info-panel-body li.warn-item strong {
    color: #e53935;
}

/* =====================
   响应式
   ===================== */
@media (max-width: 480px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .order-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .order-status {
        margin-left: 0;
        flex-wrap: wrap;
    }

    .status-message {
        max-width: 100%;
    }
}
