/* 全局样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #f5f7fa;
    color: #333;
    font-size: 14px;
    line-height: 1.6;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* 登录注册页 */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}
.auth-box {
    background: #fff;
    border-radius: 12px;
    padding: 40px 35px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.auth-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 24px;
}
.auth-box .form-group { margin-bottom: 18px; }
.auth-box label {
    display: block;
    margin-bottom: 6px;
    color: #666;
    font-size: 13px;
}
.auth-box input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}
.auth-box input:focus {
    outline: none;
    border-color: #667eea;
}
.auth-box .btn {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
    transition: opacity 0.3s;
}
.auth-box .btn:hover { opacity: 0.9; }
.auth-box .auth-link {
    text-align: center;
    margin-top: 20px;
    color: #999;
    font-size: 13px;
}
.auth-box .auth-link a { color: #667eea; }
.auth-box .error-msg {
    background: #fee;
    color: #c33;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 13px;
}
.auth-box .success-msg {
    background: #efe;
    color: #3c3;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 13px;
}

/* 会员前台顶部导航 */
.user-header {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}
.user-nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 0 20px;
    height: 60px;
}
.user-nav .logo {
    font-size: 18px;
    font-weight: bold;
    color: #667eea;
    margin-right: 40px;
}
.user-nav .nav-links {
    display: flex;
    gap: 30px;
    flex: 1;
}
.user-nav .nav-links a {
    color: #666;
    font-size: 15px;
    padding: 8px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}
.user-nav .nav-links a:hover,
.user-nav .nav-links a.active {
    color: #667eea;
    border-bottom-color: #667eea;
}
.user-nav .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.user-nav .user-info img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}
.user-nav .user-info span { color: #666; font-size: 14px; }
.user-nav .logout-btn {
    color: #999;
    font-size: 13px;
    margin-left: 10px;
}
.user-nav .logout-btn:hover { color: #c33; }

/* 过期提示 */
.expire-notice {
    background: #fff3cd;
    color: #856404;
    padding: 10px 20px;
    text-align: center;
    font-size: 14px;
    border-bottom: 1px solid #ffeaa7;
}
.expired-notice {
    background: #f8d7da;
    color: #721c24;
    padding: 10px 20px;
    text-align: center;
    font-size: 14px;
    border-bottom: 1px solid #f5c6cb;
}

/* 主内容区 */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 25px 20px;
}






/* 产品分类区 */
.product-section {
    margin-bottom: 35px;
}
.product-section .section-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    padding-left: 12px;
    border-left: 4px solid #667eea;
}
.product-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}
.product-card {
    background: #fff;
    border-radius: 10px;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    padding:6px;
    box-sizing: border-box;
}
.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}
.product-card .product-logo {
    width: 38px;
    height: 38px;
    border-radius: 6px;
    object-fit: contain;
    margin: 0 auto 6px;
    background: #f0f0f0;
    flex-shrink:0;
}
.product-card .product-name {
    font-size: 10px;
    color: #333;
    font-weight: 500;
    overflow:hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width:100%;
}
.empty-tip {
    text-align: center;
    color: #999;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
}






/* 二维码页面 */
.qrcode-page {
    max-width: 450px;
    margin: 30px auto;
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}
.qrcode-page h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #333;
}
.qrcode-page .qr-image {
    width: 300px;
    height: 300px;
    margin: 0 auto 15px;
    border: 1px solid #eee;
    border-radius: 8px;
}
.qrcode-page .expire-time {
    color: #dc3545;
    font-size: 15px;
    margin-bottom: 20px;
}
.qrcode-page .share-image {
    max-width: 100%;
    margin: 0 auto 20px;
    border-radius: 8px;
}
.qrcode-page .btn-group {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.qrcode-page .btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: opacity 0.3s;
}
.qrcode-page .btn-primary {
    background: #667eea;
    color: #fff;
}
.qrcode-page .btn-secondary {
    background: #f0f0f0;
    color: #666;
}
.qrcode-page .btn:hover { opacity: 0.85; }
.qrcode-page .tip {
    color: #999;
    font-size: 13px;
    margin-top: 15px;
}

/* 资讯列表 */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.news-card {
    background: #fff;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    gap: 15px;
    cursor: pointer;
    transition: box-shadow 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.news-card:hover { box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.news-card.locked { opacity: 0.6; cursor: not-allowed; }
.news-card .news-cover {
    width: 140px;
    height: 90px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f0f0f0;
}
.news-card .news-info { flex: 1; }
.news-card .news-title {
    font-size: 16px;
    color: #333;
    margin-bottom: 8px;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.news-card .news-time {
    color: #999;
    font-size: 13px;
}
.news-card .lock-tip {
    color: #f39c12;
    font-size: 13px;
    margin-top: 5px;
}

/* 资讯详情 */
.news-detail {
    background: #fff;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.news-detail h1 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #333;
}
.news-detail .news-meta {
    color: #999;
    font-size: 13px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}
.news-detail .news-content {
    font-size: 15px;
    line-height: 1.8;
    color: #444;
}
.news-detail .news-content img {
    max-width: 100%;
    border-radius: 6px;
    margin: 15px 0;
}
.news-detail .back-btn {
    display: inline-block;
    margin-top: 30px;
    padding: 10px 25px;
    background: #f0f0f0;
    color: #666;
    border-radius: 6px;
    font-size: 14px;
}

/* 客户列表 */
.table-container {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th {
    background: #f8f9fa;
    padding: 14px 12px;
    text-align: left;
    font-weight: 600;
    color: #555;
    font-size: 13px;
    border-bottom: 2px solid #eee;
}
.data-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #f0f0f0;
    color: #444;
    font-size: 14px;
}
.data-table tr:hover { background: #fafbfc; }
.data-table .progress-badge {
    display: inline-block;
    padding: 3px 10px;
    background: #e8f4fd;
    color: #2196f3;
    border-radius: 12px;
    font-size: 12px;
    cursor: pointer;
}
.filter-bar {
    background: #fff;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.filter-bar select,
.filter-bar input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
}
.filter-bar .btn {
    padding: 8px 20px;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

/* 个人信息 */
.profile-card {
    background: #fff;
    border-radius: 12px;
    padding: 35px;
    max-width: 500px;
    margin: 0 auto;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}
.profile-card .avatar-section {
    text-align: center;
    margin-bottom: 30px;
}
.profile-card .avatar-section img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 15px;
    border: 3px solid #667eea;
}
.profile-card .avatar-section .name {
    font-size: 20px;
    font-weight: bold;
    color: #333;
}
.profile-card .info-row {
    display: flex;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid #f0f0f0;
}
.profile-card .info-row .label { color: #999; }
.profile-card .info-row .value { color: #333; font-weight: 500; }
.profile-card .member-badge {
    display: inline-block;
    padding: 3px 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border-radius: 12px;
    font-size: 12px;
}
.profile-card .action-btns {
    display: flex;
    gap: 12px;
    margin-top: 25px;
}
.profile-card .action-btns .btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}
.profile-card .btn-primary { background: #667eea; color: #fff; }
.profile-card .btn-danger { background: #f5f5f5; color: #999; }

/* 管理员后台 */
.admin-layout {
    display: flex;
    min-height: 100vh;
}
.admin-sidebar {
    width: 220px;
    background: #2c3e50;
    color: #fff;
    flex-shrink: 0;
}
.admin-sidebar .sidebar-header {
    padding: 20px;
    font-size: 16px;
    font-weight: bold;
    border-bottom: 1px solid #34495e;
    text-align: center;
}
.admin-sidebar .sidebar-menu {
    list-style: none;
    padding: 10px 0;
}
.admin-sidebar .sidebar-menu li a {
    display: block;
    padding: 12px 25px;
    color: #bdc3c7;
    font-size: 14px;
    transition: all 0.3s;
}
.admin-sidebar .sidebar-menu li a:hover,
.admin-sidebar .sidebar-menu li a.active {
    background: #34495e;
    color: #fff;
    border-left: 3px solid #667eea;
}
.admin-main {
    flex: 1;
    background: #f5f7fa;
}
.admin-topbar {
    background: #fff;
    padding: 0 25px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.admin-topbar .page-title {
    font-size: 17px;
    font-weight: 600;
    color: #333;
}
.admin-topbar .topbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}
.admin-topbar .topbar-right a {
    color: #666;
    font-size: 14px;
}
.admin-content {
    padding: 25px;
}

/* 管理员卡片 */
.admin-card {
    background: #fff;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.admin-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.admin-card .card-header h3 {
    font-size: 17px;
    color: #333;
}
.admin-card .btn-add {
    padding: 8px 18px;
    background: #667eea;
    color: #fff;
    border-radius: 6px;
    font-size: 13px;
    border: none;
    cursor: pointer;
}
.admin-card .btn-edit {
    color: #2196f3;
    margin-right: 10px;
    font-size: 13px;
}
.admin-card .btn-delete {
    color: #f44336;
    font-size: 13px;
    background: none;
    border: none;
    cursor: pointer;
}

/* 表单样式 */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #555;
    font-size: 14px;
    font-weight: 500;
}
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group input[type="url"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}
.form-group .checkbox-group {
    display: flex;
    gap: 20px;
}
.form-group .checkbox-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: normal;
    margin-bottom: 0;
}
.form-group .image-preview {
    width: 100px;
    height: 100px;
    border: 1px dashed #ddd;
    border-radius: 6px;
    margin-top: 8px;
    object-fit: cover;
    background: #fafafa;
}
.form-actions {
    margin-top: 25px;
    display: flex;
    gap: 12px;
}
.form-actions .btn {
    padding: 10px 30px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}
.form-actions .btn-primary { background: #667eea; color: #fff; }
.form-actions .btn-default { background: #f0f0f0; color: #666; }

/* 富文本编辑器（简化） */
.rich-editor {
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}
.rich-editor .editor-toolbar {
    background: #f8f9fa;
    padding: 8px;
    border-bottom: 1px solid #ddd;
    display: flex;
    gap: 8px;
}
.rich-editor .editor-toolbar button {
    padding: 5px 10px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}
.rich-editor textarea {
    width: 100%;
    min-height: 300px;
    border: none;
    padding: 15px;
    font-size: 14px;
    resize: vertical;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 25px;
}
.pagination a,
.pagination span {
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    color: #666;
    font-size: 13px;
}
.pagination .current {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

/* 注册码展示 */
.code-box {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 13px;
    word-break: break-all;
    color: #333;
}
.code-copy-btn {
    padding: 4px 10px;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    margin-left: 8px;
}

/* 终端表单页 */
.form-page {
    min-height: 100vh;
    background: #f5f7fa;
    padding: 30px 15px;
}
.form-page .form-container {
    max-width: 420px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    padding: 30px 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}
.form-page .form-container h2 {
    text-align: center;
    font-size: 20px;
    margin-bottom: 25px;
    color: #333;
}
.form-page .form-group input {
    padding: 14px 15px;
    font-size: 15px;
}
.form-page .submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
}
.form-page .error-page {
    text-align: center;
    padding: 40px 20px;
}
.form-page .error-page .icon {
    font-size: 60px;
    margin-bottom: 20px;
}
.form-page .error-page h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 10px;
}
.form-page .error-page p {
    color: #999;
    font-size: 14px;
}
.form-page .success-page {
    text-align: center;
    padding: 40px 20px;
}
.form-page .success-page .icon {
    width: 80px;
    height: 80px;
    background: #4caf50;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 40px;
}
.form-page .success-page h3 {
    font-size: 20px;
    color: #333;
    margin-bottom: 10px;
}
.form-page .success-page p {
    color: #999;
    font-size: 14px;
}

/* 弹窗 */
.modal-mask {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-box {
    background: #fff;
    border-radius: 10px;
    padding: 25px;
    width: 90%;
    max-width: 400px;
}
.modal-box h3 {
    margin-bottom: 15px;
    font-size: 17px;
}
.modal-box .modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}
.modal-box .modal-actions button {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

/* 响应式 */
@media (max-width: 768px) {
    .user-nav { padding: 0 15px; }
    .user-nav .logo { margin-right: 20px; font-size: 16px; }
    .user-nav .nav-links { gap: 15px; }
    .user-nav .nav-links a { font-size: 14px; }
    .user-nav .user-info span { display: none; }
    .main-content { padding: 15px; }
    .product-grid { grid-template-columns: repeat(6, 1fr); gap: 8px; }
    .product-card { padding: 18px 10px; }
    .product-card .product-logo { width: 55px; height: 55px; }
    .admin-layout { flex-direction: column; }
    .admin-sidebar { width: 100%; }
    .admin-sidebar .sidebar-menu { display: flex; overflow-x: auto; padding: 5px; }
    .admin-sidebar .sidebar-menu li a { white-space: nowrap; padding: 10px 15px; }
    .admin-content { padding: 15px; }
    .news-card { flex-direction: column; }
    .news-card .news-cover { width: 100%; height: 160px; }
    .data-table { font-size: 12px; }
    .data-table th, .data-table td { padding: 10px 8px; }
}









/*底部导航完整修复，安卓+苹果iPhone微信兼容 */
.user-header {
    position: fixed !important;
    bottom: 0 !important;
    left:0;
    right:0;
    background:#ffffff;
    z-index:999;
    /* 安全区写在最外层容器，兼容新旧iOS，constant写env前面 */
    padding-bottom: constant(safe-area-inset-bottom);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.user-header .nav-links {
    display:flex;
    height:56px; /* 可视区域导航高度，不含小黑条安全区 */
}
.user-header .nav-links a {
    flex: 1;
    display:flex !important;
    justify-content:center !important;
    align-items:center !important;
    text-decoration:none;
    font-size:14px;
    color:#666;
    padding:0 !important;
}
.user-header .nav-links a.active {
    color:#2563eb;
    font-weight:bold;
}
/* 清空子容器多余安全区设置，避免冲突 */
.user-nav {
    padding-bottom:0 !important;
}







