/* ============================================
   卡密助手 - 全局样式
   蓝白简约风 阿里云/腾讯云风格
   ============================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC',
                 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif;
    font-size: 14px;
    color: #303133;
    line-height: 1.6;
    background: #f5f6fa;
    -webkit-tap-highlight-color: transparent;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

.container {
    max-width: 750px;
    margin: 0 auto;
    padding: 12px;
    padding-bottom: 40px;
}

/* ===== 顶部栏 ===== */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px 16px;
}
.topbar-title {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
}
.topbar-admin {
    font-size: 20px;
    color: #6b7280;
    padding: 4px 10px;
    border-radius: 50%;
}
.topbar-admin:hover { background: #eef0f4; }

/* ===== 首页卡片列表 ===== */
.card-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 4px;
}

.func-card {
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
    transition: transform .15s, background .15s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}
.func-card:hover { background: #fafbfc; transform: translateY(-1px); }
.func-card:active { transform: scale(0.98); }

.card-icon {
    width: 56px; height: 56px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    margin-right: 14px;
}
.icon-text { font-size: 22px; font-weight: 600; color: #1677ff; }

.card-body { flex: 1; min-width: 0; }

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
    display: flex;
    align-items: baseline;
}
.title-tag {
    font-size: 13px;
    color: #1677ff;
    font-weight: 500;
    margin-left: 2px;
}

.card-desc {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.card-arrow {
    flex-shrink: 0;
    margin-left: 8px;
    font-size: 22px;
    color: #c0c4cc;
    font-weight: 300;
}

/* ===== 详情页 ===== */
.detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px 16px;
}
.back-btn {
    font-size: 14px;
    color: #374151;
    padding: 4px 10px;
    border-radius: 6px;
}
.back-btn:hover { background: #eef0f4; }
.header-title { font-size: 15px; font-weight: 600; color: #1f2937; }
.header-right { width: 52px; }

.main-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 18px rgba(0,0,0,.06);
}

.card-icon-wrap {
    width: 80px; height: 80px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 18px;
}
.box-icon { font-size: 42px; }

.card-title-wrap {
    display: flex;
    align-items: baseline;
    margin-bottom: 18px;
}
.main-title { font-size: 18px; font-weight: 700; color: #1f2937; }
.main-tag { font-size: 14px; color: #1677ff; font-weight: 500; margin-left: 3px; }

.card-desc-box {
    width: 100%;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 22px;
}
.desc-text { font-size: 13px; color: #6b7280; line-height: 1.6; text-align: center; display: block; }

.extract-btn {
    width: 100%;
    height: 48px;
    background: linear-gradient(135deg, #1677ff 0%, #4096ff 100%);
    border-radius: 24px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 6px 16px rgba(22,119,255,.3);
    transition: all .2s;
    letter-spacing: 1px;
}
.extract-btn:hover { box-shadow: 0 8px 22px rgba(22,119,255,.35); transform: translateY(-1px); }
.extract-btn:active { transform: scale(.97); box-shadow: 0 4px 10px rgba(22,119,255,.25); }
.extract-btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-icon { font-size: 16px; }

/* ===== 结果弹窗 ===== */
.result-mask {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 999;
}
.result-box {
    width: 310px;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    animation: pop .2s ease;
}
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.result-header { padding: 18px; text-align: center; border-bottom: 1px solid #f0f0f0; }
.result-title { font-size: 16px; font-weight: 600; color: #1f2937; }
.result-body { padding: 24px 18px; text-align: center; }
.result-code {
    font-size: 20px;
    font-weight: 700;
    color: #1677ff;
    letter-spacing: 3px;
    display: block;
    margin-bottom: 8px;
    font-family: 'Courier New', monospace;
}
.result-tip { font-size: 12px; color: #9ca3af; }
.result-footer { display: flex; border-top: 1px solid #f0f0f0; }
.result-btn {
    flex: 1;
    height: 48px;
    font-size: 15px;
    transition: background .15s;
}
.copy-btn { color: #1677ff; font-weight: 600; border-right: 1px solid #f0f0f0; }
.copy-btn:hover { background: #f0f7ff; }
.close-btn { color: #6b7280; }
.close-btn:hover { background: #f9fafb; }

/* ===== 广告占位 ===== */
.ad-section {
    margin-top: 20px;
    background: #fff;
    border-radius: 10px;
    padding: 14px;
    position: relative;
    box-shadow: 0 2px 6px rgba(0,0,0,.03);
}
.ad-badge {
    position: absolute; top: 6px; left: 6px;
    font-size: 10px; color: #999;
    padding: 1px 6px; background: rgba(0,0,0,.04); border-radius: 3px;
}
.ad-content { display: flex; align-items: center; justify-content: space-between; }
.ad-text { flex: 1; }
.ad-title { font-size: 14px; font-weight: 500; color: #1f2937; margin-bottom: 4px; }
.ad-brand { font-size: 12px; color: #9ca3af; }
.ad-thumb {
    width: 52px; height: 42px;
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
    margin-left: 10px;
}
.ad-inner { display: flex; gap: 8px; }
.ad-card {
    flex: 1;
    height: 80px;
    border-radius: 6px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    position: relative;
}
.ad-left { background: linear-gradient(135deg, #fff7ed, #fed7aa); }
.ad-left .ad-img-icon { font-size: 28px; }
.ad-left .ad-name { font-size: 11px; color: #9a3412; margin-top: 2px; font-weight: 500; }
.ad-right { background: linear-gradient(135deg, #fee2e2, #fecaca); }
.ad-right .ad-tag { font-size: 13px; font-weight: 700; color: #b91c1c; margin-bottom: 2px; }
.ad-right .star { font-size: 11px; color: #7f1d1d; }
.ad-right .ad-enter {
    position: absolute; right: 8px; bottom: 8px;
    font-size: 11px; color: #fff; background: #1677ff;
    padding: 2px 10px; border-radius: 10px;
}
