/**
 * 小红袍 v2.7 共建者中心 + 前台发布表单样式
 *
 * @package XHP
 */

/* ============================================================
 * 1. 共建者中心主页
 * ============================================================ */
.xhp-dashboard-hero {
    padding: 24px 0;
}
.xhp-dashboard-hero-inner {
    display: flex;
    gap: 24px;
    align-items: center;
    background: var(--xhp-card);
    border: 1px solid var(--xhp-border);
    border-radius: var(--xhp-radius-lg);
    padding: 28px;
    flex-wrap: wrap;
    box-shadow: var(--xhp-shadow-sm);
}
.xhp-avatar-lg {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid var(--xhp-primary);
}
.xhp-dashboard-info {
    flex: 1;
    min-width: 240px;
}
.xhp-dashboard-info .xhp-hero-title {
    font-size: 24px;
    margin: 8px 0 4px;
}
.xhp-dashboard-stats {
    display: flex;
    gap: 24px;
}
.xhp-dash-stat {
    text-align: center;
}
.xhp-dash-stat-num {
    font-size: 22px;
    font-weight: 800;
    color: var(--xhp-primary);
}
.xhp-dash-stat-label {
    font-size: 11px;
    color: var(--xhp-muted-foreground);
    margin-top: 2px;
}

/* 快捷操作卡片 */
.xhp-dash-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}
.xhp-dash-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 28px 20px;
    background: var(--xhp-card);
    border: 1px solid var(--xhp-border);
    border-radius: var(--xhp-radius-lg);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}
.xhp-dash-action-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--xhp-shadow-md);
    border-color: oklch(0.52 0.19 27 / 0.3);
}
.xhp-dash-action-icon {
    font-size: 40px;
    margin-bottom: 12px;
}
.xhp-dash-action-card h3 {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 8px;
}
.xhp-dash-action-card p {
    font-size: 13px;
    color: var(--xhp-muted-foreground);
    margin: 0 0 16px;
    line-height: 1.5;
    flex-grow: 1;
}

/* ============================================================
 * 2. 前台发布表单
 * ============================================================ */
.xhp-submit-form-wrap {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px 0;
}
.xhp-submit-form {
    background: var(--xhp-card);
    border: 1px solid var(--xhp-border);
    border-radius: var(--xhp-radius-lg);
    padding: 32px;
    box-shadow: var(--xhp-shadow-sm);
}

/* 表单分区 */
.xhp-form-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--xhp-border);
}
.xhp-form-section:last-of-type {
    border-bottom: none;
}
.xhp-form-section-title {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 20px;
    padding-left: 12px;
    border-left: 3px solid var(--xhp-primary);
    color: var(--xhp-foreground);
}

/* 输入框统一样式 */
.xhp-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--xhp-border-strong);
    border-radius: var(--xhp-radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: var(--xhp-card);
    color: var(--xhp-foreground);
    transition: all 0.2s;
    box-sizing: border-box;
}
.xhp-input:focus {
    outline: none;
    border-color: var(--xhp-primary);
    box-shadow: 0 0 0 3px oklch(0.52 0.19 27 / 0.1);
}
textarea.xhp-input {
    resize: vertical;
    min-height: 80px;
}

/* 表单行 */
.xhp-form-row {
    margin-bottom: 16px;
}
.xhp-form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--xhp-foreground);
}
.xhp-required {
    color: var(--xhp-primary);
}
.xhp-form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.xhp-form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* 可重复字段 */
.xhp-repeat-item {
    border: 1px solid var(--xhp-border);
    border-radius: var(--xhp-radius);
    padding: 14px;
    margin-bottom: 12px;
    background: var(--xhp-muted);
}
.xhp-repeat-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.xhp-repeat-head .xhp-input {
    flex: 1;
}
.xhp-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--xhp-primary);
    color: var(--xhp-primary-foreground);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}
.xhp-lock-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    white-space: nowrap;
    padding: 6px 10px;
    border: 1px solid var(--xhp-border-strong);
    border-radius: var(--xhp-radius-sm);
    background: var(--xhp-card);
}
.xhp-remove-item {
    flex-shrink: 0;
    color: var(--xhp-muted-foreground) !important;
}
.xhp-remove-item:hover {
    color: oklch(0.58 0.22 25) !important;
}

/* 提交区 */
.xhp-form-submit {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}
.xhp-form-tip {
    font-size: 12px;
    color: var(--xhp-muted-foreground);
    margin-top: 12px;
    text-align: center;
}
.xhp-form-msg {
    margin-top: 16px;
}
.xhp-form-msg.is-success {
    background: var(--xhp-emerald-light);
    color: var(--xhp-emerald);
    padding: 12px 16px;
    border-radius: var(--xhp-radius-sm);
    font-size: 14px;
}
.xhp-form-msg.is-error {
    background: oklch(0.93 0.05 25);
    color: oklch(0.5 0.2 25);
    padding: 12px 16px;
    border-radius: var(--xhp-radius-sm);
    font-size: 14px;
}

/* ============================================================
 * 3. 我的内容列表
 * ============================================================ */
.xhp-my-content-section {
    margin-bottom: 32px;
}
.xhp-my-content-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.xhp-my-content-head h3 {
    font-size: 17px;
    font-weight: 700;
    margin: 0;
}
.xhp-my-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: var(--xhp-card);
    border: 1px solid var(--xhp-border);
    border-radius: var(--xhp-radius);
    overflow: hidden;
}
.xhp-my-table th {
    text-align: left;
    padding: 12px 14px;
    background: var(--xhp-muted);
    color: var(--xhp-muted-foreground);
    font-weight: 600;
    font-size: 12px;
}
.xhp-my-table td {
    padding: 12px 14px;
    border-top: 1px solid var(--xhp-border);
}
.xhp-my-table tr:hover td {
    background: var(--xhp-muted);
}

/* ============================================================
 * 4. 响应式
 * ============================================================ */
@media (max-width: 768px) {
    .xhp-dashboard-hero-inner,
    .xhp-dash-actions {
        flex-direction: column;
    }
    .xhp-dashboard-stats {
        width: 100%;
        justify-content: space-around;
    }
    .xhp-form-grid-2,
    .xhp-form-grid-3 {
        grid-template-columns: 1fr;
    }
    .xhp-submit-form {
        padding: 20px;
    }
    .xhp-form-submit {
        flex-direction: column;
    }
    .xhp-my-table {
        font-size: 12px;
    }
    .xhp-my-table th,
    .xhp-my-table td {
        padding: 8px;
    }
}

/* ============================================================
 * 5. 共建者中心入口卡片（首页 Hero 下方）
 * ============================================================ */
.xhp-dash-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 28px;
    border-radius: var(--xhp-radius-lg);
    flex-wrap: wrap;
}
.xhp-dash-entry-logged {
    background: linear-gradient(135deg, oklch(0.52 0.19 27 / 0.06), oklch(0.72 0.16 65 / 0.06));
    border: 1px solid oklch(0.52 0.19 27 / 0.2);
}
.xhp-dash-entry-guest {
    background: linear-gradient(135deg, oklch(0.6 0.14 145 / 0.06), oklch(0.6 0.16 200 / 0.06));
    border: 1px solid oklch(0.6 0.14 145 / 0.2);
}
.xhp-dash-entry-info {
    flex: 1;
    min-width: 240px;
}
.xhp-dash-entry-info .xhp-section-title {
    font-size: 22px;
    margin: 8px 0 4px;
}
.xhp-dash-entry-info .xhp-section-desc {
    font-size: 13px;
    margin: 0;
}
.xhp-dash-entry-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* ============================================================
 * 6. 导航栏登录/注册/共建者中心按钮样式
 * ============================================================ */
.xhp-nav-dashboard a {
    background: var(--xhp-gradient-hong);
    color: var(--xhp-primary-foreground) !important;
    border-radius: 999px;
    padding: 6px 16px !important;
    font-weight: 700;
    margin-left: 8px;
}
.xhp-nav-dashboard a:hover {
    opacity: 0.9;
    color: var(--xhp-primary-foreground) !important;
}
.xhp-nav-dashboard a::after {
    display: none !important;
}
.xhp-nav-login a,
.xhp-nav-register a {
    color: var(--xhp-primary) !important;
    font-weight: 600;
}
.xhp-nav-register a {
    background: oklch(0.52 0.19 27 / 0.08);
    border-radius: 999px;
    padding: 6px 16px !important;
}
.xhp-nav-login a::after,
.xhp-nav-register a::after {
    display: none !important;
}

/* ============================================================
 * 7. 响应式
 * ============================================================ */
@media (max-width: 768px) {
    .xhp-dash-entry {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    .xhp-dash-entry-actions {
        justify-content: center;
    }
}
