/* 人事管理系统 H5 样式 - 参考京东家政风格 */

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

:root {
    --primary: #e1251b;
    --success: #52c41a;
    --warning: #faad14;
    --danger: #ff4d4f;
    --text: #333;
    --text-secondary: #666;
    --text-light: #999;
    --border: #eee;
    --bg: #f5f5f5;
    --white: #fff;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
}

/* 通用样式 */
.page {
    min-height: 100vh;
    padding-bottom: 20px;
}

.page-header {
    background: var(--white);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-header h2 {
    font-size: 17px;
    font-weight: 600;
}

.btn-back {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text);
    padding: 0;
    position: absolute;
    left: 16px;
}

/* 登录页 - 京东家政风格 */
#page-login {
    background: linear-gradient(135deg, #e1251b 0%, #c91a13 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 30px;
}

.login-brand {
    text-align: center;
    margin-bottom: 40px;
}

.brand-icon {
    font-size: 64px;
    margin-bottom: 12px;
}

.brand-title {
    font-size: 26px;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 8px;
}

.brand-sub {
    font-size: 14px;
    color: rgba(255,255,255,0.8);
}

.login-form-simple {
    background: var(--white);
    border-radius: 12px;
    padding: 30px 24px;
}

.login-input-group {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding: 14px 0;
    margin-bottom: 0;
}

.login-input-group .input-icon {
    font-size: 20px;
    margin-right: 12px;
    width: 24px;
    text-align: center;
}

.login-input-group input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    background: transparent;
}

.login-input-group input::placeholder {
    color: #bbb;
}

.btn-code {
    background: #f5f5f5;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--primary);
    white-space: nowrap;
}

.form-tip-center {
    font-size: 12px;
    color: var(--text-light);
    text-align: center;
    margin: 12px 0 20px;
}

.btn-login-submit {
    width: 100%;
    height: 48px;
    background: linear-gradient(135deg, #ff6b9d 0%, #e8658c 100%);
    border: none;
    border-radius: 24px;
    color: var(--white);
    font-size: 16px;
    font-weight: 500;
}

.login-link {
    text-align: center;
    font-size: 13px;
    color: var(--text-light);
    margin-top: 16px;
}

.login-link span {
    color: var(--primary);
}
}

.form-item input:focus {
    border-color: var(--primary);
}

.form-item.verify-code {
    display: flex;
    gap: 12px;
}

.form-item.verify-code input {
    flex: 1;
}

.form-item.verify-code button {
    width: 110px;
    height: 48px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    color: var(--primary);
}

.form-tip {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 20px;
    text-align: center;
}

.btn-primary {
    width: 100%;
    height: 48px;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    color: var(--white);
    font-size: 16px;
    font-weight: 500;
}

.btn-primary:active {
    background: #b01a16;
}

.btn-primary:disabled {
    background: #ccc;
}

.btn-secondary {
    background: var(--white);
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
}

/* 渠道首页 - 京东风格 */
.channel-header {
    background: linear-gradient(135deg, #e8658c 0%, #e1251b 100%);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--white);
}

.channel-title {
    font-size: 18px;
    font-weight: 600;
}

.channel-header .btn-logout {
    background: rgba(255,255,255,0.25);
    border: none;
    color: var(--white);
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 13px;
}

.channel-content {
    background: #f7f7f7;
    min-height: calc(100vh - 60px);
    padding: 16px;
}

.channel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.channel-card {
    background: var(--white);
    border-radius: 12px;
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.channel-card:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.channel-card .card-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.channel-card .card-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 10px;
}

.channel-card .card-btn {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b9d 0%, #e8658c 100%);
    color: var(--white);
    padding: 6px 16px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 500;
}

.channel-stats {
    background: var(--white);
    border-radius: 12px;
    padding: 20px 16px;
}

.stats-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
}

.stats-row {
    display: flex;
    justify-content: space-around;
}

.stats-item {
    text-align: center;
}

.stats-item .stats-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

.stats-item .stats-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.menu-list {
    background: var(--white);
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

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

.menu-item:active {
    background: var(--bg);
}

.menu-item .icon {
    width: 44px;
    height: 44px;
    background: var(--bg);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-right: 12px;
}

.menu-item .text {
    flex: 1;
}

.menu-item .text .title {
    font-size: 15px;
    font-weight: 500;
}

.menu-item .text .desc {
    font-size: 12px;
    color: var(--text-secondary);
}

.menu-item .arrow {
    font-size: 24px;
    color: #ccc;
}

/* 推荐表单 - 京东风格 */
.recommend-form-content {
    padding: 16px;
    background: var(--white);
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 14px;
    color: var(--text);
    margin-bottom: 8px;
}

.required {
    color: var(--primary);
    margin-right: 4px;
}

.form-input {
    width: 100%;
    height: 44px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 0 12px;
    font-size: 14px;
    outline: none;
    background: #fafafa;
}

.form-input:focus {
    border-color: var(--primary);
    background: var(--white);
}

.form-input::placeholder {
    color: #bbb;
}

.form-select {
    width: 100%;
    height: 44px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 0 12px;
    font-size: 14px;
    outline: none;
    background: #fafafa url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 12px center;
    appearance: none;
    -webkit-appearance: none;
    color: #333;
}

.form-select:focus {
    border-color: var(--primary);
    background-color: var(--white);
}

.btn-submit-form {
    width: 100%;
    height: 48px;
    background: var(--primary);
    border: none;
    border-radius: 4px;
    color: var(--white);
    font-size: 16px;
    font-weight: 500;
    margin-top: 24px;
}

/* 导入页 - 京东风格 */
.import-content {
    padding: 20px 16px;
}

.template-download {
    background: var(--white);
    padding: 20px;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 12px;
}

.template-download p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.upload-area {
    background: var(--white);
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    margin-bottom: 12px;
}

.upload-area:active {
    border-color: var(--primary);
    background: #fff5f5;
}

.upload-area .upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.upload-area p {
    color: var(--text);
}

.upload-area .tip {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 8px;
}

.upload-info {
    background: var(--white);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.upload-info p {
    color: var(--danger);
    font-size: 13px;
}

/* 批量创建页面 */
.import-tabs {
    display: flex;
    background: var(--white);
    border-bottom: 1px solid var(--border);
}

.import-tab {
    flex: 1;
    padding: 14px 0;
    text-align: center;
    font-size: 15px;
    color: var(--text-secondary);
    position: relative;
}

.import-tab.active {
    color: var(--primary);
    font-weight: 500;
}

.import-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}

.import-content-batch {
    padding: 20px 16px;
}

.upload-zone {
    background: #f8f9fa;
    border: 2px dashed #e5e5e5;
    border-radius: 12px;
    padding: 50px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-zone:active {
    border-color: var(--primary);
    background: #fff5f5;
}

.upload-icon-big {
    font-size: 64px;
    margin-bottom: 12px;
}

.upload-text {
    font-size: 16px;
    color: var(--text);
    font-weight: 500;
}

.upload-notice {
    background: var(--white);
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
}

.notice-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

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

.template-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--white);
    border-radius: 8px;
    padding: 16px;
    margin-top: 12px;
}

.template-text {
    font-size: 14px;
    color: var(--text-secondary);
}

.btn-download-template {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
}

.selected-file {
    display: flex;
    align-items: center;
    background: var(--white);
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 12px;
}

.file-icon {
    font-size: 32px;
    margin-right: 12px;
}

.file-info {
    flex: 1;
}

.file-name {
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
}

.file-size {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
}

.btn-remove-file {
    background: #f5f5f5;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 18px;
    color: #999;
}

.btn-upload-submit {
    width: 100%;
    height: 48px;
    background: var(--primary);
    border: none;
    border-radius: 24px;
    color: var(--white);
    font-size: 16px;
    font-weight: 500;
    margin-top: 24px;
}

/* 二维码页 */
.qrcode-content {
    padding: 20px 16px;
}

.qrcode-box {
    background: var(--white);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    margin-bottom: 12px;
}

.qrcode-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 20px;
}

.qrcode-image {
    width: 200px;
    height: 200px;
    margin: 0 auto 16px;
    background: var(--white);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qrcode-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.qrcode-tip {
    font-size: 12px;
    color: var(--text-light);
}

.promo-code {
    background: var(--white);
    padding: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.promo-code span {
    color: var(--text-secondary);
}

.promo-code strong {
    flex: 1;
    font-size: 16px;
    letter-spacing: 2px;
}

.btn-copy {
    background: var(--primary);
    border: none;
    color: var(--white);
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 13px;
}

/* ============================================ */
/* 推广页 - 京东风格 */
/* ============================================ */

.promo-page {
    background: linear-gradient(180deg, #e1251b 0%, #c91a13 50%, #f5f5f5 50%);
    min-height: calc(100vh - 50px);
}

.promo-banner {
    text-align: center;
    padding: 30px 20px 20px;
    color: #fff;
}

.banner-text {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 8px;
}

.banner-sub {
    font-size: 16px;
}

.banner-sub .highlight {
    font-size: 28px;
    font-weight: 700;
}

.qrcode-box-promotion {
    margin: 0 16px;
}

.qrcode-frame {
    background: #fff;
    border-radius: 16px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.qrcode-title-promotion {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 20px;
}

.qrcode-image-promotion {
    width: 180px;
    height: 180px;
    margin: 0 auto 16px;
    background: #fff;
    border: 2px dashed #e1251b;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qrcode-image-promotion img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.promo-highlights {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
    padding: 16px;
    background: #fff5f5;
    border-radius: 8px;
}

.highlight-item {
    font-size: 14px;
    color: var(--primary);
}

.highlight-divider {
    color: #ddd;
}

.promo-code-box {
    margin: 16px;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.promo-code-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.promo-code-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 4px;
    margin-bottom: 16px;
}

.btn-copy-promotion {
    background: var(--primary);
    border: none;
    color: #fff;
    padding: 12px 40px;
    border-radius: 24px;
    font-size: 15px;
}

/* ============================================ */
/* 推荐记录页 - 参考京东样式 */
/* ============================================ */

.record-stats {
    display: flex;
    background: var(--white);
    padding: 16px;
    margin-top: 12px;
    justify-content: center;
    align-items: center;
}

.record-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 30px;
}

.record-stat-item .stat-num {
    font-size: 22px;
    font-weight: 600;
    color: var(--primary);
}

.record-stat-item .stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.record-stat-divider {
    width: 1px;
    height: 30px;
    background: var(--border);
}

.record-toolbar {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
}

.search-box {
    flex: 1;
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: 4px;
    padding: 8px 12px;
}

.search-box .search-icon {
    font-size: 16px;
    margin-right: 8px;
}

.search-box input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    outline: none;
}

.filter-btn {
    padding: 8px 20px;
    background: var(--white);
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: var(--text);
}

/* 筛选弹窗 - 京东风格 */
.filter-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

.filter-modal.show {
    display: block;
}

.filter-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-radius: 16px 16px 0 0;
    max-height: 70%;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 16px;
    font-weight: 500;
}

.filter-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #ccc;
    padding: 0;
    line-height: 1;
}

.filter-body {
    padding: 20px;
    max-height: 50vh;
    overflow-y: auto;
}

.filter-section {
    margin-bottom: 20px;
}

.filter-section:last-child {
    margin-bottom: 0;
}

.filter-title {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-option {
    padding: 10px 20px;
    background: #f5f5f5;
    border-radius: 4px;
    font-size: 14px;
    color: var(--text);
    border: 1px solid #e5e5e5;
    min-width: 80px;
    text-align: center;
}

.filter-option.active {
    background: #fff5f5;
    border-color: var(--primary);
    color: var(--primary);
}

.filter-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    background: var(--white);
}

.filter-footer button {
    flex: 1;
    height: 44px;
    border-radius: 22px;
    font-size: 15px;
    border: none;
}

.btn-reset {
    background: #f5f5f5;
    color: var(--text);
}

.btn-confirm {
    background: var(--primary);
    color: var(--white);
}

/* 记录列表 - 京东风格 */
.records-list {
    padding: 12px 16px;
}

.record-item {
    background: var(--white);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 12px;
}

.record-item-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.record-name {
    font-size: 15px;
    font-weight: 500;
}

.record-status {
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
}

.record-status.pending {
    background: #fff7e6;
    color: #fa8c16;
}

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

.record-status.offline {
    background: #f5f5f5;
    color: #999;
}

.record-item-bottom {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.record-item-bottom span {
    display: flex;
    align-items: center;
}

.loading, .empty {
    text-align: center;
    padding: 60px 40px;
    color: var(--text-light);
}

/* Toast */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.75);
    color: var(--white);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
}
