/* ============================================================
   二维码活码管理系统 - 前台样式
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
    font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
    font-size: 14px;
    color: #333;
    background: #f5f7fa;
    line-height: 1.6;
}
a { color: #1f7aff; text-decoration: none; }
a:hover { color: #4d9bff; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.text-muted { color: #8a94a6; font-size: 13px; }
.mono { font-family: Consolas, Menlo, monospace; word-break: break-all; }

/* ---------- 顶部导航 ---------- */
.site-header {
    background: #fff;
    border-bottom: 1px solid #e8ecf2;
    position: sticky; top: 0; z-index: 100;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: #1f2d3d; }
.brand img { height: 34px; }
.brand-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 9px;
    background: linear-gradient(135deg, #1f7aff, #12c2a0);
    color: #fff; font-weight: 700; font-size: 15px;
}
.brand-name { font-size: 17px; font-weight: 600; }
.site-nav { display: flex; align-items: center; gap: 18px; }
.site-nav a { color: #4a5768; font-size: 14px; }
.site-nav a:hover { color: #1f7aff; }
.site-nav .nav-btn {
    background: #1f7aff; color: #fff !important;
    padding: 7px 18px; border-radius: 20px;
}
.site-nav .nav-btn:hover { background: #4d9bff; }

.page-body { padding: 28px 16px 60px; }

/* ---------- 首页 ---------- */
.hero { text-align: center; padding: 46px 0 30px; }
.hero h1 { font-size: 32px; color: #1f2d3d; letter-spacing: 1px; }
.hero-sub { color: #7a8699; margin-top: 10px; font-size: 16px; }

.entry-cards { display: flex; gap: 20px; margin: 20px 0 28px; }
.entry-card {
    flex: 1; background: #fff; border-radius: 14px; padding: 30px 26px;
    border: 1px solid #e8ecf2; color: #333;
    box-shadow: 0 2px 10px rgba(31, 60, 100, 0.04);
    transition: all .2s ease; position: relative;
}
.entry-card:hover { transform: translateY(-4px); box-shadow: 0 10px 26px rgba(31, 60, 100, 0.1); color: #333; }
.entry-card.hot { border-color: #b7d4ff; background: linear-gradient(180deg, #f2f8ff, #ffffff); }
.entry-icon {
    width: 52px; height: 52px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; margin-bottom: 16px;
}
.entry-icon.static { background: #eef4ff; color: #1f7aff; }
.entry-icon.dynamic { background: #e6faf3; color: #00a870; }
.entry-card h2 { font-size: 19px; margin-bottom: 8px; }
.entry-tag {
    background: #00a870; color: #fff; font-size: 12px;
    padding: 2px 8px; border-radius: 10px; vertical-align: 4px; margin-left: 6px;
}
.entry-feats { list-style: none; margin: 14px 0; }
.entry-feats li { color: #6c7a89; font-size: 13px; padding: 3px 0; }
.entry-feats li::before { content: "✓"; color: #00a870; margin-right: 8px; }
.entry-go { color: #1f7aff; font-weight: 600; }

.card { background: #fff; border-radius: 12px; border: 1px solid #e8ecf2; padding: 22px; margin-bottom: 22px; }
.card h3 { font-size: 17px; margin-bottom: 14px; color: #1f2d3d; }

.dash-grid { display: flex; gap: 20px; flex-wrap: wrap; }
.dash-item { display: flex; flex-direction: column; gap: 4px; }
.dash-num { font-size: 20px; font-weight: 700; color: #1f2d3d; }
.dash-label { color: #8a94a6; font-size: 13px; }
.dash-item .btn { align-self: flex-start; }

.reg-banner { text-align: center; padding: 30px; }
.reg-banner h3 { margin-bottom: 8px; }
.reg-banner p { color: #6c7a89; margin-bottom: 10px; }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; background: #fff; }
.table th, .table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid #eef1f6; font-size: 14px; }
.table th { color: #5b687a; font-weight: 600; background: #f8fafc; white-space: nowrap; }
.table.plain th, .table.plain td { border: none; background: none; padding: 8px 6px; }
.table.plain td:first-child { color: #8a94a6; }
.table-wrap { padding: 0; overflow-x: auto; }
.table-wrap .table th:first-child, .table-wrap .table td:first-child { padding-left: 22px; }
.table-wrap .table th:last-child, .table-wrap .table td:last-child { padding-right: 22px; }
.td-ellipsis { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-nowrap { white-space: nowrap; }
.td-actions { white-space: nowrap; }
.mini-qr { width: 48px; height: 48px; border: 1px solid #eef1f6; border-radius: 6px; background: #fff; }
.table td.empty-tip, .empty-tip { text-align: center; color: #8a94a6; padding: 48px 0 !important; }

/* ---------- 徽标 / 状态 ---------- */
.badge { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 12px; white-space: nowrap; }
.badge-green { background: #e6f9f1; color: #00895d; }
.badge-gray { background: #f0f1f3; color: #8a94a6; }
.badge-blue { background: #e8f2ff; color: #1f7aff; }
.badge-gold { background: #fff4e2; color: #c78300; }
.badge-red { background: #fdecec; color: #e04b4b; }

/* ---------- 按钮 / 表单 ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 18px; border-radius: 8px; border: 1px solid transparent;
    cursor: pointer; font-size: 14px; transition: all .15s; user-select: none;
    background: #fff; color: #4a5768;
}
.btn-primary { background: #1f7aff; color: #fff; }
.btn-primary:hover { background: #4d9bff; color: #fff; }
.btn-outline { border-color: #d6dfeb; color: #1f7aff; }
.btn-outline:hover { border-color: #1f7aff; }
.btn-danger { background: #fdecec; color: #e04b4b; }
.btn-danger:hover { background: #f8d5d5; }
.btn-sm { padding: 4px 10px; font-size: 13px; border-radius: 6px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-link { color: #1f7aff; background: none; border: none; }

.form-item { margin-bottom: 16px; }
.form-item label { display: block; margin-bottom: 6px; color: #5b687a; font-weight: 500; }
.form-item .req { color: #e04b4b; }
.form-item input[type=text], .form-item input[type=password], .form-item select,
.form-item input[type=number], .form-item input[type=tel] {
    width: 100%; padding: 10px 12px; border: 1px solid #d6dfeb; border-radius: 8px;
    font-size: 14px; outline: none; transition: border .15s; background: #fff;
}
.form-item input:focus, .form-item select:focus { border-color: #1f7aff; }
.form-item input[type=color] { width: 100%; height: 40px; border: 1px solid #d6dfeb; border-radius: 8px; background: #fff; padding: 4px; cursor: pointer; }
.form-item input[type=range] { width: calc(100% - 60px); vertical-align: middle; }
.form-item output { margin-left: 10px; color: #1f7aff; font-weight: 600; }
.form-inline { display: flex; gap: 18px; }
.form-inline > div { flex: 1; }
.input-group { display: flex; gap: 10px; }
.input-group input { flex: 1; padding: 10px 12px; border: 1px solid #d6dfeb; border-radius: 8px; outline: none; }
.field-tip { color: #98a3b3; font-size: 12px; margin-top: 5px; }
.form-actions { margin-top: 8px; }
.form-links { display: flex; justify-content: space-between; margin-top: 14px; font-size: 13px; }

/* ---------- 页签 ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid #e8ecf2; margin-bottom: 18px; align-items: center; }
.tabs .tab { padding: 10px 20px; color: #5b687a; border-radius: 8px 8px 0 0; margin-bottom: -2px; border-bottom: 2px solid transparent; }
.tabs .tab.active { color: #1f7aff; border-bottom-color: #1f7aff; font-weight: 600; }
.tabs.big { border-bottom: 2px solid #e8ecf2; }
.tab-right { margin-left: auto; padding-bottom: 8px; }

.list-toolbar { padding: 14px 22px; display: flex; justify-content: space-between; }
.search-form { display: flex; gap: 10px; }
.search-form input { padding: 9px 14px; border: 1px solid #d6dfeb; border-radius: 8px; outline: none; width: 260px; }

/* ---------- 生成页 ---------- */
.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: 24px; color: #1f2d3d; }
.page-head p { color: #7a8699; margin-top: 6px; }
.quota-warn {
    margin-top: 10px; background: #fff4e2; color: #c78300;
    border: 1px solid #ffe3b3; border-radius: 8px; padding: 8px 14px;
}
.gen-layout { display: flex; gap: 20px; align-items: flex-start; }
.gen-form { flex: 1.35; min-width: 0; }
.gen-preview { flex: 1; text-align: center; position: sticky; top: 90px; }
.preview-box { display: flex; align-items: center; justify-content: center; min-height: 320px; padding: 14px; }
.preview-box img { max-width: 100%; max-height: 420px; }
.preview-placeholder {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 100%; color: #b1b9c6; gap: 10px;
}
.preview-placeholder .placeholder-icon {
    width: 88px; height: 88px; border-radius: 16px;
    border: 2px dashed #d7dce3; background: #f8fafc;
    display: flex; align-items: center; justify-content: center;
    font-size: 42px; color: #ccd4dd;
}
.preview-placeholder p { font-size: 13px; }
.preview-tip { color: #98a3b3; font-size: 13px; margin-top: 8px; }
.style-toggle { border-top: 1px dashed #e2e8f0; margin: 6px 0 16px; padding-top: 6px; }
.style-toggle .caret { float: right; color: #98a3b3; }
.style-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; }
.style-fields .form-item:first-child, .style-fields .form-item:nth-child(2) { grid-column: 1 / -1; }
.style-fields .form-item:nth-child(4) { grid-column: 1 / -1; }

/* ---------- 详情页 ---------- */
.detail-layout { display: flex; gap: 20px; align-items: flex-start; }
.detail-preview { flex: 1; text-align: center; }
.preview-box.big img { width: 100%; max-width: 380px; }
.detail-info { flex: 1.2; min-width: 0; }
.info-block { margin-bottom: 20px; }
.info-block h4 { font-size: 15px; color: #1f2d3d; margin-bottom: 10px; }
.copy-line { display: flex; gap: 10px; }
.copy-line input { flex: 1; padding: 9px 12px; border: 1px solid #d6dfeb; border-radius: 8px; color: #5b687a; font-size: 13px; }
.stat-grid { display: flex; gap: 30px; margin-bottom: 12px; }
.stat-item { display: flex; flex-direction: column; }
.stat-num { font-size: 26px; font-weight: 700; color: #1f7aff; }
.stat-label { color: #8a94a6; font-size: 13px; }
.week-chart { display: flex; gap: 8px; align-items: flex-end; height: 110px; padding-top: 6px; }
.week-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.week-num { font-size: 12px; color: #5b687a; }
.week-bar { width: 100%; background: #eef1f6; border-radius: 4px 4px 0 0; height: 64px; display: flex; align-items: flex-end; }
.week-bar i { display: block; width: 100%; background: linear-gradient(180deg, #4d9bff, #1f7aff); border-radius: 4px 4px 0 0; min-height: 2px; }
.week-date { font-size: 11px; color: #98a3b3; }
.detail-ops { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; justify-content: center; }

/* ---------- 个人中心 ---------- */
.account-layout { display: flex; gap: 20px; align-items: flex-start; }
.account-card { flex: 1; min-width: 0; }
.quota-item { margin-bottom: 18px; }
.quota-head { display: flex; justify-content: space-between; color: #5b687a; margin-bottom: 8px; }
.quota-bar { height: 8px; background: #eef1f6; border-radius: 4px; overflow: hidden; }
.quota-bar i { display: block; height: 100%; background: #1f7aff; border-radius: 4px; }
.quota-bar i.full { background: #e04b4b; }

/* ---------- 认证页 ---------- */
.auth-wrap { max-width: 460px; margin: 0 auto; padding: 30px; }
.auth-wrap h2 { font-size: 21px; margin-bottom: 6px; }
.auth-sub { color: #8a94a6; margin-bottom: 20px; }
.form-tip { margin-top: 16px; text-align: center; color: #98a3b3; font-size: 12px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- 提示 / 限额页 ---------- */
.message-box { max-width: 520px; margin: 60px auto; background: #fff; border-radius: 14px; padding: 40px; text-align: center; border: 1px solid #e8ecf2; }
.message-box h1 { font-size: 20px; margin-bottom: 12px; }
.message-box p { color: #5b687a; margin-bottom: 10px; }
.message-url { margin-top: 14px; }
.limit-page { max-width: 560px; margin: 60px auto; text-align: center; padding: 44px 30px; }
.limit-page h1 { color: #e04b4b; margin-bottom: 12px; }
.limit-icon { font-size: 42px; color: #ffb03a; margin: 8px 0; }
.limit-ops { margin-top: 20px; }

/* ---------- 分页 ---------- */
.pager { padding: 16px 22px; }
.pager ul { display: flex; list-style: none; gap: 6px; flex-wrap: wrap; }
.pager li a, .pager li span, .pager li.disabled span {
    display: inline-block; min-width: 32px; padding: 6px 10px; text-align: center;
    border: 1px solid #d6dfeb; border-radius: 6px; color: #5b687a; font-size: 13px; background: #fff;
}
.pager li.active span { background: #1f7aff; color: #fff; border-color: #1f7aff; }
.pager li a:hover { border-color: #1f7aff; color: #1f7aff; }

/* ---------- 弹层提示 ---------- */
.toast {
    position: fixed; top: 84px; left: 50%; transform: translateX(-50%);
    background: rgba(31, 45, 61, .92); color: #fff; padding: 10px 24px;
    border-radius: 8px; z-index: 9999; font-size: 14px; max-width: 80vw;
    animation: toast-in .2s ease; box-shadow: 0 6px 20px rgba(0,0,0,.18);
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- 页脚 ---------- */
.site-footer { background: #fff; border-top: 1px solid #e8ecf2; padding: 22px 0; text-align: center; color: #8a94a6; font-size: 13px; }
.footer-sub { font-size: 12px; color: #b1b9c6; margin-top: 4px; }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
    .entry-cards, .gen-layout, .detail-layout, .account-layout { flex-direction: column; }
    .gen-preview { position: static; }
    .header-inner { flex-direction: column; height: auto; padding: 10px 0; gap: 8px; }
    .site-nav { flex-wrap: wrap; justify-content: center; gap: 12px; }
    .style-fields { grid-template-columns: 1fr; }
    .style-fields .form-item { grid-column: auto !important; }
}
