* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    background: #f5f1e8;
    color: #2b2118;
}

.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2b2118 0%, #4a3826 100%);
}

.login-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 16px;
    text-align: center;
    font-size: 12px;
}

.login-footer a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
}

.login-footer a:hover {
    color: #d4af37;
}

.login-card {
    width: 360px;
    background: #fff;
    border-radius: 12px;
    padding: 40px 32px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.login-title {
    margin: 0;
    text-align: center;
    color: #b8860b;
    font-size: 28px;
    letter-spacing: 4px;
}

.login-subtitle {
    margin: 4px 0 24px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
}

.form-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
}

.form-input {
    height: 42px;
    padding: 0 12px;
    margin-bottom: 18px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
}

.form-input:focus {
    outline: none;
    border-color: #b8860b;
}

.login-btn {
    height: 44px;
    border: none;
    border-radius: 6px;
    background: #b8860b;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}

.login-btn:hover {
    background: #9c7209;
}

.alert {
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 16px;
}

.alert-error {
    background: #fdecea;
    color: #c0392b;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff8e6;
    color: #966600;
    border: 1px solid #ffe6a1;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #2b2118;
    color: #fff;
    padding: 16px 24px;
}

.admin-header-title {
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 1px;
}

.admin-header-user {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
}

.logout-link {
    color: #ffd479;
    text-decoration: none;
}

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

.admin-main {
    padding: 32px;
}

.welcome-card {
    background: #fff;
    border-radius: 10px;
    padding: 28px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    max-width: 560px;
}

.welcome-card h2 {
    margin-top: 0;
    color: #2b2118;
}

.welcome-card .hint {
    color: #999;
    font-size: 13px;
}

.admin-nav {
    display: flex;
    gap: 4px;
    background: #3a2e20;
    padding: 0 24px;
}

.admin-nav a {
    display: inline-block;
    padding: 12px 18px;
    color: #d9c9a8;
    text-decoration: none;
    font-size: 14px;
    border-bottom: 3px solid transparent;
}

.admin-nav a:hover {
    color: #fff;
}

.admin-nav a.active {
    color: #fff;
    border-bottom-color: #b8860b;
    font-weight: bold;
}

.page-card {
    background: #fff;
    border-radius: 10px;
    padding: 24px 28px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    max-width: 960px;
    margin: 0 auto 24px;
}

.page-title {
    margin: 0 0 18px;
    font-size: 18px;
    color: #2b2118;
}

.search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.search-input {
    flex: 1;
    margin-bottom: 0;
}

.btn {
    height: 42px;
    padding: 0 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

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

.btn-primary:hover {
    background: #9c7209;
}

.btn-primary:disabled {
    background: #d8c48f;
    cursor: not-allowed;
}

.btn-small {
    height: 30px;
    padding: 0 12px;
    font-size: 12px;
    background: #b8860b;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-small:hover {
    background: #9c7209;
}

.member-info-card {
    background: #fff8e6;
    border: 1px solid #ffe6a1;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 18px;
    font-size: 14px;
    color: #6b5327;
}

.admin-form .form-row {
    margin-bottom: 18px;
}

.form-textarea {
    height: 80px;
    padding: 10px 12px;
    resize: vertical;
}

.field-error {
    color: #e64340;
    font-size: 12px;
    margin-top: 4px;
    min-height: 16px;
}

.field-hint {
    color: #999;
    font-size: 12px;
    margin-top: 4px;
}

.alert-success {
    background: #e9f9ee;
    color: #1e7e34;
    border: 1px solid #b7ebc6;
}

.summary-line {
    font-size: 14px;
    color: #444;
    margin-bottom: 16px;
}

.summary-amount {
    font-size: 20px;
    font-weight: bold;
    color: #b8860b;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th,
.data-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background: #f7f2e7;
    color: #6b5327;
    font-weight: bold;
}

.search-result .empty-tip,
#historyEmpty {
    color: #999;
    font-size: 13px;
    padding: 16px 0;
    text-align: center;
}

.empty-tip {
    color: #999;
    font-size: 13px;
    padding: 16px 0;
    text-align: center;
}

.badge-today {
    display: inline-block;
    background: #e64340;
    color: #fff;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 6px;
}

.badge-soon {
    display: inline-block;
    background: #f0d9a0;
    color: #6b5327;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 6px;
}

.upload-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.image-preview {
    width: 96px;
    height: 96px;
    border-radius: 8px;
    border: 1px dashed #ddd;
    object-fit: cover;
    background: #f7f2e7;
}

.image-preview-empty {
    width: 96px;
    height: 96px;
    border-radius: 8px;
    border: 1px dashed #ddd;
    background: #f7f2e7;
    color: #bbb;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.table-thumb {
    width: 56px;
    height: 56px;
    border-radius: 6px;
    object-fit: cover;
    background: #f7f2e7;
    vertical-align: middle;
}

.status-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
}

.status-tag-on {
    background: #e9f9ee;
    color: #1e7e34;
}

.status-tag-off {
    background: #f2f2f2;
    color: #999;
}

.status-tag-expired {
    background: #fdecea;
    color: #c0392b;
}

.status-tag-none {
    background: #fff8e6;
    color: #966600;
}

.membership-status-line {
    margin-top: 8px;
    font-size: 13px;
}

.membership-staff-notice {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
}

/* ---------- 核销台 ---------- */
.desk-input-wrap {
    max-width: 640px;
    margin: 24px auto 8px;
    text-align: center;
}

.desk-code-input {
    width: 100%;
    font-size: 32px;
    letter-spacing: 4px;
    text-align: center;
    padding: 16px 12px;
    border: 2px solid #c9a227;
    border-radius: 10px;
    outline: none;
    font-family: "SF Mono", Menlo, Consolas, monospace;
}

.desk-code-input:focus {
    border-color: #a07d10;
    box-shadow: 0 0 0 4px rgba(201, 162, 39, 0.2);
}

.desk-input-hint {
    margin-top: 8px;
    color: #8a7a62;
    font-size: 13px;
}

.desk-actions {
    margin-top: 14px;
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-large {
    font-size: 18px;
    padding: 12px 36px;
}

.desk-result {
    max-width: 640px;
    margin: 16px auto 0;
    border-radius: 10px;
    padding: 18px 20px;
    font-size: 16px;
}

.desk-result-success {
    background: #e9f9ee;
    border: 2px solid #34a853;
    color: #1e7e34;
    font-size: 26px;
    font-weight: bold;
    text-align: center;
}

.desk-result-error {
    background: #fdecea;
    border: 2px solid #e57373;
    color: #c0392b;
    font-size: 20px;
    font-weight: bold;
    text-align: center;
}

.desk-result-confirm {
    background: #fffaf0;
    border: 2px solid #c9a227;
    color: #2b2118;
}

.desk-info-row {
    display: flex;
    padding: 6px 0;
    border-bottom: 1px dashed #eadfc4;
}

.desk-info-row:last-child {
    border-bottom: none;
}

.desk-info-label {
    width: 110px;
    color: #8a7a62;
    flex-shrink: 0;
}

.desk-info-value {
    font-weight: bold;
    word-break: break-all;
}

.desk-info-item {
    font-size: 22px;
    color: #a07d10;
}

.desk-today-title {
    margin-top: 32px;
}

.password-field {
    position: relative;
}
.password-field .form-input {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 0;
    padding-right: 64px;
}
.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #b8860b;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
}
.caps-hint {
    margin: 6px 0 0;
    font-size: 12px;
    color: #d9534f;
}
.login-tip {
    margin: 6px 0 18px;
    font-size: 12px;
    color: #999;
}

/* 活动预告管理 */
.activity-cover-preview {
    width: 240px;
    height: 135px;
    border-radius: 8px;
    border: 1px dashed #ddd;
    object-fit: cover;
    background: #f7f2e7;
}

.activity-cover-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    font-size: 13px;
}

.activity-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.activity-gallery-empty {
    color: #bbb;
    font-size: 13px;
    padding: 12px 0;
}

.activity-gallery-item {
    position: relative;
    width: 110px;
    border: 1px solid #eadfc8;
    border-radius: 8px;
    background: #fff;
    cursor: move;
    overflow: hidden;
}

.activity-gallery-item.dragging {
    opacity: 0.4;
}

.activity-gallery-item.drag-over {
    border-color: #b8860b;
    box-shadow: 0 0 0 2px rgba(184, 134, 11, 0.3);
}

.activity-gallery-item img {
    display: block;
    width: 110px;
    height: 110px;
    object-fit: cover;
    pointer-events: none;
}

.activity-gallery-no {
    position: absolute;
    top: 4px;
    left: 4px;
    min-width: 20px;
    height: 20px;
    line-height: 20px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 12px;
    text-align: center;
}

.activity-gallery-actions {
    display: flex;
    justify-content: space-between;
    padding: 4px;
}

.activity-gallery-actions button {
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    font-size: 12px;
    padding: 2px 6px;
    cursor: pointer;
}

.activity-gallery-actions button:disabled {
    color: #ccc;
    cursor: not-allowed;
}

.activity-table-cover {
    width: 96px;
    height: 54px;
    border-radius: 6px;
    object-fit: cover;
    background: #f7f2e7;
    vertical-align: middle;
}

.activity-form .form-label {
    display: block;
}

.activity-form .form-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 0;
}

.activity-form .form-textarea {
    min-height: 140px;
}

/* 积分兑换页顶部大图预览（与小程序 750 宽横幅比例接近） */
.redemption-banner-preview {
    width: 100%;
    max-width: 480px;
    aspect-ratio: 750 / 360;
    border-radius: 8px;
    border: 1px dashed #ddd;
    background: #f7f2e7;
    color: #bbb;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

.redemption-banner-preview.has-image {
    border-style: solid;
    border-color: #e8dcc0;
}

.redemption-banner-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 客服设置：门店微信二维码预览 */
.cs-qrcode-preview {
    width: 200px;
    height: 200px;
    border-radius: 8px;
    border: 1px dashed #ddd;
    background: #f7f2e7;
    color: #bbb;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px;
    box-sizing: border-box;
    overflow: hidden;
}

.cs-qrcode-preview.has-image {
    border-style: solid;
    border-color: #e8dcc0;
    background: #fff;
    padding: 0;
}

.cs-qrcode-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
