/**
 * 淘贴插件样式
 *
 * ⚠️ 只用既有 --mn-* / --c-* 主题变量，全部带 fallback（规范 §11.7）：
 *    硬编码 #fff / #333 在暗夜主题下会直接失效。
 * ⚠️ 提权：核心 .mn-input 与 .tt-field 同为 (0,1,0)，靠 .tt-form .mn-input 提到 (0,2,0)，
 *    否则核心 width:100% 会静默压掉插件尺寸控制（reply_reward 同款踩过）。
 * ⚠️ 零内联：显隐统一走 [hidden] / .is-hidden，不写 style=""（规范 §7.3）。
 *
 * @file plugins/taotie/assets/style.css
 * @package Plugin\Taotie
 * @version 1.0.0
 */

/* ===== 页面头 ===== */

.tt-page-head {
    align-items: flex-start;
    gap: 12px;
}

.tt-subtitle {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--mn-text-muted, #888);
}

.tt-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* ===== 工具栏（排序 + 搜索） ===== */

.tt-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 20px;
    border-bottom: 1px solid var(--mn-border-light, #eee);
}

.tt-sort {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tt-sort-item {
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 13px;
    color: var(--mn-text-secondary, #666);
    text-decoration: none;
    transition: background .15s, color .15s;
}

.tt-sort-item:hover {
    background: var(--mn-bg-row-hover, #f5f5f5);
    color: var(--mn-text, #333);
}

.tt-sort-item.active {
    background: var(--mn-primary-subtle, #eaf3ff);
    color: var(--mn-primary, #0066cc);
    font-weight: 600;
}

.tt-search {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tt-search .tt-search-input {
    width: 180px;
    height: 30px;
    padding: 0 10px;
    font-size: 13px;
}

/* ===== 专辑卡片网格 ===== */

.tt-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    padding: 16px 20px;
}

.tt-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--mn-border, #e5e7eb);
    border-radius: 10px;
    background: var(--mn-bg-card, #fff);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}

.tt-card:hover {
    border-color: var(--mn-primary, #0066cc);
    box-shadow: var(--mn-shadow-sm, 0 2px 8px rgba(0, 0, 0, .06));
    transform: translateY(-1px);
}

/* 封面：有 cover 出图，没有回落首字色块（P2 起自动提取） */
.tt-card-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 84px;
    font-size: 30px;
    font-weight: 700;
    color: var(--mn-primary, #0066cc);
    background: var(--mn-primary-subtle, #eaf3ff);
    overflow: hidden;
}

.tt-card-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tt-card-body {
    padding: 10px 12px 12px;
}

.tt-card-name {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--mn-text, #333);
    line-height: 1.4;
    word-break: break-word;
}

.tt-card-desc {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--mn-text-muted, #888);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tt-card-meta {
    margin-top: 8px;
    font-size: 12px;
    color: var(--mn-text-secondary, #666);
}

.tt-dot {
    margin: 0 4px;
    color: var(--mn-text-muted, #888);
}

/* ===== 徽章 ===== */

.tt-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--mn-text-secondary, #666);
    background: var(--mn-tag-bg, #f0f0f0);
}

.tt-badge-warn {
    color: var(--mn-warning, #b45309);
    background: var(--mn-tag-warning-bg, #fef3c7);
}

/* ===== 详情页头部 ===== */

.tt-detail-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px 14px;
}

.tt-detail-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: 10px;
    font-size: 26px;
    font-weight: 700;
    color: var(--mn-primary, #0066cc);
    background: var(--mn-primary-subtle, #eaf3ff);
    overflow: hidden;
}

.tt-detail-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tt-detail-info {
    flex: 1;
    min-width: 0;
}

.tt-detail-name {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--mn-text, #333);
    word-break: break-word;
}

.tt-detail-desc {
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--mn-text-secondary, #666);
    word-break: break-word;
}

.tt-detail-meta {
    margin-top: 8px;
    font-size: 12px;
    color: var(--mn-text-muted, #888);
}

.tt-detail-meta a {
    color: var(--mn-text-secondary, #666);
    text-decoration: none;
}

.tt-detail-meta a:hover {
    color: var(--mn-primary, #0066cc);
}

.tt-detail-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* ===== 提示条 ===== */

.tt-notice {
    margin: 0 20px 14px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--mn-text-secondary, #666);
    background: var(--mn-bg-row-hover, #f5f5f5);
    border-left: 3px solid var(--mn-primary, #0066cc);
}

.tt-notice-warn {
    color: var(--mn-warning, #b45309);
    background: var(--mn-tag-warning-bg, #fef3c7);
    border-left-color: var(--mn-warning, #b45309);
}

/* ===== 我的淘贴 ===== */

.tt-mine-row {
    align-items: center;
}

.tt-mine-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.tt-inline {
    display: inline-flex;
    margin: 0;
}

/* ===== 表单 ===== */

.tt-form-section {
    max-width: 640px;
}

.tt-form {
    padding: 4px 20px 20px;
}

.tt-field {
    margin-bottom: 16px;
}

.tt-field-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--mn-text, #333);
}

.tt-field-control {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* 提权到 (0,2,0)，压过核心 .mn-input 的 width:100% */
.tt-form .mn-input {
    width: 100%;
    box-sizing: border-box;
}

.tt-form .tt-textarea {
    resize: vertical;
    min-height: 72px;
    line-height: 1.6;
}

.tt-field-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--mn-text-muted, #888);
}

.tt-radio-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

.tt-radio,
.tt-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--mn-text-secondary, #666);
    cursor: pointer;
}

.tt-form-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 0;
    padding: 0 20px 20px;
}

.tt-form .tt-form-actions {
    padding-left: 0;
    padding-right: 0;
}

/* ===== 淘贴弹层 ===== */

.tt-modal {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tt-modal[hidden] {
    display: none;
}

.tt-modal-mask {
    position: absolute;
    inset: 0;
    background: var(--mn-comp-overlay-bg, rgba(0, 0, 0, .45));
}

.tt-modal-box {
    position: relative;
    z-index: 1;
    width: 92%;
    max-width: 420px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    background: var(--mn-bg-card, #fff);
    box-shadow: var(--mn-shadow-dropdown, 0 12px 32px rgba(0, 0, 0, .18));
    overflow: hidden;
}

.tt-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--mn-border-light, #eee);
}

.tt-modal-head h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--mn-text, #333);
}

.tt-modal-x {
    width: 26px;
    height: 26px;
    padding: 0;
    border: none;
    border-radius: 6px;
    font-size: 18px;
    line-height: 1;
    color: var(--mn-text-muted, #888);
    background: transparent;
    cursor: pointer;
}

.tt-modal-x:hover {
    background: var(--mn-bg-row-hover, #f5f5f5);
    color: var(--mn-text, #333);
}

.tt-modal-body {
    padding: 12px 16px;
    overflow-y: auto;
}

.tt-modal-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--mn-border-light, #eee);
}

.tt-album-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tt-album-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 6px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--mn-text, #333);
    cursor: pointer;
}

.tt-album-item:hover {
    background: var(--mn-bg-row-hover, #f5f5f5);
}

.tt-album-item input {
    flex-shrink: 0;
}

.tt-album-item-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tt-modal-empty {
    padding: 10px 4px;
    font-size: 13px;
    color: var(--mn-text-muted, #888);
    text-align: center;
}

.tt-new-wrap {
    margin-top: 10px;
}

.tt-new-wrap[hidden] {
    display: none;
}

.tt-new-input {
    width: 100%;
    box-sizing: border-box;
}

.tt-new-toggle {
    margin: 10px 0 0;
}

.tt-modal-msg {
    margin: 10px 0 0;
    font-size: 12px;
    line-height: 1.5;
    color: var(--mn-error, #dc2626);
}

.tt-modal-msg[hidden] {
    display: none;
}

/* ===== 后台 ===== */

.tt-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
}

.tt-table-wrap {
    overflow-x: auto;
}

.tt-state {
    font-size: 12px;
    color: var(--c-text-light, #888);
}

.tt-state-ok {
    color: var(--c-success, #16a34a);
}

.tt-state-warn {
    color: var(--c-danger, #dc2626);
}

.tt-row-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tt-danger {
    color: var(--c-danger, #dc2626);
}

.tt-empty {
    padding: 20px;
    font-size: 13px;
    color: var(--c-text-light, #888);
    text-align: center;
}

.tt-pager {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}

.tt-pager-info {
    font-size: 13px;
    color: var(--c-text-light, #888);
}

/* ===== 用户主页横排入口（profile_user_card_after） =====
   该钩子输出落在 user_profile 的 `.up-user-info-top`（flex + wrap）里，
   与用户名、关注按钮同一行 → 必须是行内横排，不能占满整行。 */

.tt-up-strip {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.tt-up-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 150px;
    padding: 2px 8px;
    border: 1px solid var(--mn-border, #e5e7eb);
    border-radius: 999px;
    background: var(--mn-bg-card, #fff);
    font-size: 12px;
    line-height: 18px;
    color: var(--mn-text-secondary, #666);
    text-decoration: none;
    transition: border-color .15s, color .15s;
}

.tt-up-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tt-up-chip:hover {
    border-color: var(--mn-primary, #0066cc);
    color: var(--mn-primary, #0066cc);
}

.tt-up-more {
    font-size: 12px;
    color: var(--mn-text-muted, #999);
    text-decoration: none;
    white-space: nowrap;
}

.tt-up-more:hover {
    color: var(--mn-primary, #0066cc);
}

/* ===== 响应式 ===== */

@media (max-width: 900px) {
    .tt-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .tt-grid {
        grid-template-columns: minmax(0, 1fr);
        padding: 12px 16px;
    }

    .tt-page-head {
        flex-direction: column;
        align-items: stretch;
    }

    .tt-head-actions {
        justify-content: flex-start;
    }

    .tt-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .tt-search .tt-search-input {
        flex: 1;
        width: auto;
    }

    .tt-detail-head {
        flex-wrap: wrap;
    }

    .tt-detail-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .tt-mine-row {
        flex-wrap: wrap;
    }

    .tt-mine-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 6px;
    }
}
