/* =============================================
   全局样式
   ============================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    background: #f0f2f5;
    padding: 12px;
}

.container { max-width: 800px; margin: 0 auto; }

/* =============================================
   头部
   ============================================= */
.header {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
    text-align: center;
}
.header h1 { color: #fff; font-size: 22px; }
.header h1 span { color: #f39c12; }
.header .sub { color: #888; font-size: 12px; margin-top: 4px; }

/* =============================================
   用户栏
   ============================================= */
.user-bar {
    background: white;
    border-radius: 10px;
    padding: 10px 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    font-size: 14px;
}
.user-bar .user-info { color: #333; }
.user-bar .user-info strong { color: #f39c12; }
.user-bar .user-info .badge { background: #28a745; color: #fff; padding: 1px 10px; border-radius: 12px; font-size: 11px; margin-left: 6px; }
.user-bar .user-info .badge-expired { background: #dc3545; color: #fff; padding: 1px 10px; border-radius: 12px; font-size: 11px; margin-left: 6px; }
.user-bar .user-info .badge-expire-soon { background: #ffc107; color: #333; padding: 1px 10px; border-radius: 12px; font-size: 11px; margin-left: 6px; }
.user-bar .user-info .expire-time { color: #888; font-size: 12px; margin-left: 6px; }

.user-bar .btn-group { display: flex; gap: 8px; flex-wrap: wrap; }
.user-bar .btn-group .btn {
    padding: 6px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: opacity 0.2s;
    color: #fff;
    text-decoration: none;
    display: inline-block;
}
.user-bar .btn-group .btn-login { background: linear-gradient(135deg, #667eea, #764ba2); }
.user-bar .btn-group .btn-logout { background: linear-gradient(135deg, #dc3545, #e74c3c); }
.user-bar .btn-group .btn-register { background: linear-gradient(135deg, #28a745, #20c997); }

/* =============================================
   提示消息
   ============================================= */
.login-msg {
    padding: 10px 16px;
    border-radius: 10px;
    margin-bottom: 12px;
    text-align: center;
    font-size: 14px;
}
.login-msg.success { background: #d4edda; color: #155724; }
.login-msg.error { background: #f8d7da; color: #721c24; }

/* =============================================
   信息栏
   ============================================= */
.info-bar {
    background: white;
    border-radius: 10px;
    padding: 10px 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #888;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    flex-wrap: wrap;
    gap: 6px;
}
.info-bar .count { color: #f39c12; font-weight: bold; }

/* =============================================
   卡片（话题列表）
   ============================================= */
.card {
    background: white;
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.card .time {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
}
.card .time .tag {
    background: #f39c12;
    color: #fff;
    padding: 1px 10px;
    border-radius: 10px;
    font-size: 10px;
    margin-right: 8px;
}
.card .content {
    font-size: 15px;
    line-height: 1.8;
    color: #333;
    white-space: pre-wrap;
    word-break: break-all;
}
.card .content .empty { color: #aaa; font-style: italic; }
.card .images {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}
.card .images .img-wrap {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #2d2d2d;
    cursor: pointer;
    padding-bottom: 75%;
}
.card .images .img-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.img-lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-size: 14px;
    border-radius: 8px;
    z-index: 2;
}
.img-wrap.locked { cursor: default; }
.img-wrap.locked .img-lock-overlay { display: flex; }
.img-wrap:not(.locked) .img-lock-overlay { display: none; }

.card .meta {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f2f5;
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #999;
}

/* =============================================
   空状态
   ============================================= */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }

/* =============================================
   分页
   ============================================= */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 12px 0 20px;
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s;
}
.pagination a {
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
}
.pagination a:hover {
    background: #f39c12;
    color: #fff;
    border-color: #f39c12;
}
.pagination .active {
    background: #f39c12;
    color: #fff;
    border: 1px solid #f39c12;
}
.pagination .disabled {
    color: #ccc;
    cursor: not-allowed;
    background: #f5f5f5;
    border: 1px solid #eee;
}
.pagination .page-info {
    color: #888;
    font-size: 13px;
    padding: 6px 10px;
}
.pagination .view-limit-tip {
    color: #dc3545;
    font-size: 13px;
    padding: 6px 12px;
    background: rgba(220,53,69,0.1);
    border-radius: 6px;
    border: 1px solid rgba(220,53,69,0.2);
    width: 100%;
    text-align: center;
}
.pagination .view-limit-tip a {
    color: #f39c12;
    text-decoration: none;
    font-weight: 600;
}
.pagination .view-limit-tip a:hover { text-decoration: underline; }

/* =============================================
   续费横幅
   ============================================= */
.renew-banner {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 12px;
    padding: 12px 18px;
    margin-bottom: 12px;
    border: 2px solid #f39c12;
    display: none;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.renew-banner.visible { display: flex; }
.renew-banner .text { color: #fff; font-size: 14px; }
.renew-banner .text strong { color: #f39c12; }
.renew-banner .btn-pay {
    padding: 6px 20px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.renew-banner .btn-pay:hover { opacity: 0.9; }
.renew-banner .btn-pay.expired {
    background: linear-gradient(135deg, #dc3545, #c82333);
    animation: pulse-red 1.5s infinite;
}
@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220,53,69,0.4); }
    50% { box-shadow: 0 0 0 10px rgba(220,53,69,0); }
}

/* =============================================
   弹窗通用
   ============================================= */
.pay-overlay, .auth-overlay, .publish-overlay, .daily-tip-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.pay-overlay.active, .auth-overlay.active, .publish-overlay.active, .daily-tip-overlay.active {
    display: flex;
}
.pay-overlay { background: rgba(0,0,0,0.7); }
.auth-overlay { background: rgba(0,0,0,0.6); }
.publish-overlay { background: rgba(0,0,0,0.7); }
.daily-tip-overlay { background: rgba(0,0,0,0.7); }

/* =============================================
   支付弹窗
   ============================================= */
.pay-modal {
    background: #1a1a2e;
    border-radius: 16px;
    padding: 30px;
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(102,126,234,0.2);
    position: relative;
}
.pay-modal .close-btn {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    color: #888;
    font-size: 28px;
    cursor: pointer;
}
.pay-modal .close-btn:hover { color: #fff; }
.pay-modal h2 { color: #fff; font-size: 20px; margin-bottom: 16px; }
.pay-modal h2 span { color: #f39c12; }
.pay-modal .user-info {
    color: #888;
    font-size: 13px;
    margin-bottom: 16px;
    padding: 12px;
    background: #0f0f1a;
    border-radius: 8px;
    line-height: 1.8;
}
.pay-modal .user-info strong { color: #f39c12; }

.plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.plan-grid .plan-item {
    border: 2px solid #333;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}
.plan-grid .plan-item:hover { border-color: #667eea; }
.plan-grid .plan-item.selected {
    border-color: #f39c12;
    background: rgba(243,156,18,0.1);
}
.plan-grid .plan-item .name { font-size: 16px; font-weight: 700; color: #fff; }
.plan-grid .plan-item .price { font-size: 22px; font-weight: 700; color: #f39c12; margin: 6px 0; }
.plan-grid .plan-item .days { font-size: 13px; color: #888; }

.pay-result {
    margin-top: 12px;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
}
.pay-result.success { background: rgba(40,167,69,0.2); color: #28a745; }
.pay-result.error { background: rgba(220,53,69,0.2); color: #dc3545; }
.pay-result.loading { background: rgba(102,126,234,0.2); color: #667eea; }

.pay-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #1677ff, #0a58ca);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 12px;
}
.pay-btn:hover { opacity: 0.9; }
.pay-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.pay-btn.pay-btn-success { background: linear-gradient(135deg, #28a745, #20c997); }

.pay-redirect-tip {
    background: rgba(243,156,18,0.15);
    border: 1px solid #f39c12;
    border-radius: 10px;
    padding: 16px;
    margin-top: 12px;
    text-align: center;
    color: #f39c12;
    font-size: 14px;
}
.pay-redirect-tip .big-icon { font-size: 48px; display: block; margin-bottom: 8px; }
.pay-redirect-tip .sub-tip { color: #888; font-size: 13px; margin-top: 4px; }

/* =============================================
   登录/注册弹窗
   ============================================= */
.auth-modal {
    background: #1a1a2e;
    border-radius: 16px;
    padding: 30px;
    max-width: 440px;
    width: 100%;
    border: 1px solid rgba(102,126,234,0.2);
    position: relative;
}
.auth-modal .close-btn {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    color: #888;
    font-size: 28px;
    cursor: pointer;
}
.auth-modal .close-btn:hover { color: #fff; }
.auth-modal h2 { color: #fff; font-size: 20px; margin-bottom: 20px; text-align: center; }
.auth-modal h2 span { color: #f39c12; }
.auth-modal .form-group { margin-bottom: 14px; }
.auth-modal .form-group label { display: block; color: #ccc; font-size: 13px; margin-bottom: 4px; }
.auth-modal .form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #333;
    border-radius: 8px;
    background: #0f0f1a;
    color: #fff;
    font-size: 14px;
}
.auth-modal .form-group input:focus { outline: none; border-color: #f39c12; }
.auth-modal .submit-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}
.auth-modal .submit-btn:hover { opacity: 0.9; }
.auth-modal .submit-btn.register-btn { background: linear-gradient(135deg, #28a745, #20c997); }
.auth-modal .switch-link {
    color: #888;
    font-size: 13px;
    text-align: center;
    margin-top: 12px;
}
.auth-modal .switch-link a {
    color: #f39c12;
    cursor: pointer;
    text-decoration: none;
}
.auth-modal .switch-link a:hover { text-decoration: underline; }

.auth-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.auth-tabs .tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: #888;
    font-size: 15px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}
.auth-tabs .tab-btn.active {
    color: #f39c12;
    border-bottom-color: #f39c12;
}
.auth-tabs .tab-btn:hover { color: #fff; }
.auth-form { display: none; }
.auth-form.active { display: block; }

/* =============================================
   每日提示弹窗
   ============================================= */
.daily-tip-modal {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 16px;
    padding: 30px;
    max-width: 480px;
    width: 100%;
    border: 2px solid #f39c12;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    animation: slideUp 0.4s ease;
}
.daily-tip-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.daily-tip-icon { font-size: 28px; }
.daily-tip-title { color: #f39c12; font-size: 18px; font-weight: 700; flex: 1; }
.daily-tip-close {
    background: none;
    border: none;
    color: #888;
    font-size: 28px;
    cursor: pointer;
    padding: 0 8px;
}
.daily-tip-close:hover { color: #fff; }
.daily-tip-body {
    color: #ccc;
    font-size: 15px;
    line-height: 1.8;
    padding: 12px 0;
    min-height: 60px;
}
.daily-tip-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 12px;
}
.daily-tip-btn:hover { opacity: 0.9; }

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* =============================================
   发布弹窗
   ============================================= */
.publish-modal {
    background: #1a1a2e;
    border-radius: 16px;
    padding: 30px;
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(102,126,234,0.2);
    position: relative;
}
.publish-modal .publish-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    color: #888;
    font-size: 28px;
    cursor: pointer;
}
.publish-modal .publish-close:hover { color: #fff; }
.publish-modal h2 { color: #fff; font-size: 20px; margin-bottom: 16px; }
.publish-modal .form-group { margin-bottom: 14px; }
.publish-modal .form-group label { display: block; color: #ccc; font-size: 13px; margin-bottom: 4px; }
.publish-modal .form-group textarea,
.publish-modal .form-group select,
.publish-modal .form-group input[type="text"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #333;
    border-radius: 8px;
    background: #0f0f1a;
    color: #fff;
    font-size: 14px;
}
.publish-modal .form-group textarea:focus,
.publish-modal .form-group select:focus,
.publish-modal .form-group input[type="text"]:focus { outline: none; border-color: #f39c12; }

.upload-area {
    border: 2px dashed #333;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    margin-bottom: 10px;
}
.upload-area:hover { border-color: #f39c12; background: rgba(243,156,18,0.05); }
.upload-area.dragover { border-color: #f39c12; background: rgba(243,156,18,0.1); }
.upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}
.upload-placeholder .upload-icon { font-size: 32px; display: block; margin-bottom: 8px; }
.upload-placeholder span { display: block; color: #888; font-size: 14px; }
.upload-placeholder .small { font-size: 11px; color: #666; }

.url-input-group {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.url-input-group input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #333;
    border-radius: 6px;
    background: #0f0f1a;
    color: #fff;
    font-size: 13px;
    min-width: 150px;
}
.url-input-group input:focus { outline: none; border-color: #f39c12; }
.url-input-group .btn-add {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: #f39c12;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    font-weight: 600;
}
.url-input-group .btn-add:hover { opacity: 0.85; }
.url-input-group textarea {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid #333;
    border-radius: 6px;
    background: #0f0f1a;
    color: #fff;
    font-size: 13px;
    resize: vertical;
    font-family: monospace;
}

.preview-area {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.preview-area .preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #333;
}
.preview-area .preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.preview-area .preview-item .remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(220,53,69,0.8);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.preview-area .preview-item .remove-btn:hover { background: #dc3545; }

.publish-submit-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
}
.publish-submit-btn:hover { opacity: 0.9; }
.publish-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* =============================================
   发布悬浮按钮
   ============================================= */
.publish-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: #fff;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(243,156,18,0.4);
    z-index: 99998;
    transition: all 0.3s ease;
    user-select: none;
}
.publish-fab.visible { display: flex; }
.publish-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(243,156,18,0.6);
}
.publish-fab .fab-icon { font-size: 22px; line-height: 1; }
.publish-fab .fab-text { font-size: 10px; margin-top: 2px; font-weight: 600; }

/* =============================================
   图片预览弹窗
   ============================================= */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    padding: 20px;
}
.modal.active { display: flex; }
.modal img { max-width: 95%; max-height: 90%; border-radius: 8px; }
.modal .hint {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.3);
    font-size: 13px;
}

/* =============================================
   Toast提示
   ============================================= */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    z-index: 9999999;
    animation: toastIn 0.3s ease;
    max-width: 300px;
}
.toast.success { background: #28a745; }
.toast.error { background: #dc3545; }
.toast.info { background: #667eea; }
@keyframes toastIn {
    from { transform: translateX(100px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* =============================================
   Spinner
   ============================================= */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.2);
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =============================================
   页脚
   ============================================= */
.footer {
    text-align: center;
    color: #aaa;
    font-size: 12px;
    padding: 16px 0;
}

/* =============================================
   响应式
   ============================================= */
@media (max-width: 480px) {
    body { padding: 8px; }
    .header h1 { font-size: 18px; }
    .card { padding: 12px 14px; }
    .card .content { font-size: 14px; }
    .card .images { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
    .renew-banner { font-size: 13px; padding: 10px 14px; }
    .pay-modal { padding: 20px; }
    .plan-grid { grid-template-columns: repeat(2, 1fr); }
    .pagination a, .pagination span { padding: 4px 10px; font-size: 12px; }
    .publish-fab { bottom: 20px; right: 20px; width: 56px; height: 56px; }
    .publish-fab .fab-icon { font-size: 18px; }
    .publish-fab .fab-text { font-size: 9px; }
    .publish-modal { padding: 20px; }
    .auth-modal { padding: 20px; }
    .url-input-group { flex-wrap: wrap; }
    .url-input-group input { min-width: 100%; }
    .url-input-group textarea { min-width: 100%; }
}