/**
 * 标签广场（Tag Hall）—— 版式复刻 lightsns.com/tags
 * 所有类名统一 muooy-th- 前缀，不使用主题/WordPress 语义类名。
 */

.muooy-th-bleed {
    background: #f2f4f8;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    overflow-x: clip;
}

.muooy-th-hall {
    color: #1a1a2e;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    padding: 40px 0 80px;
    box-sizing: border-box;
}
.muooy-th-hall *,
.muooy-th-hall *::before,
.muooy-th-hall *::after { box-sizing: border-box; }

.muooy-th-container {
    max-width: var(--muooy-th-width, 1200px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 24px;
    padding: 0 24px;
    align-items: start;
}
.muooy-th-container.is-single {
    grid-template-columns: minmax(0, 1fr);
}

.muooy-th-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ---------- 卡片基底 ---------- */
.muooy-th-hero,
.muooy-th-followed-box,
.muooy-th-group-card,
.muooy-th-group-large,
.muooy-th-empty-box {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .03);
    border: 1px solid rgba(0, 0, 0, .02);
    transition: transform .3s cubic-bezier(.175, .885, .32, 1.275), box-shadow .3s ease;
    overflow: hidden;
    position: relative;
}
.muooy-th-hero:hover,
.muooy-th-followed-box:hover,
.muooy-th-group-card:hover,
.muooy-th-group-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, .06);
}

/* ---------- 页头 + 搜索 ---------- */
.muooy-th-hero {
    padding: 36px 40px;
    text-align: center;
    border-radius: 20px;
    border: 1px solid rgba(0, 0, 0, .04);
}
.muooy-th-hero-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
    margin: 0 auto;
}
.muooy-th-hero-title {
    font-size: 28px;
    font-weight: 800;
    color: #2d3436;
    margin: 0 0 8px;
    letter-spacing: -.5px;
    line-height: 1.3;
}
.muooy-th-hero-sub {
    font-size: 14px;
    color: #a4b0be;
    margin: 0 0 24px;
    line-height: 1.5;
}
.muooy-th-hero-sub strong {
    color: var(--muooy-th-accent, #3b82f6);
    font-size: 16px;
    font-weight: 700;
    padding: 0 4px;
}

.muooy-th-search-bar {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 4px 8px 4px 20px;
    border: 1px solid transparent;
    transition: all .3s cubic-bezier(.2, .8, .2, 1);
}
.muooy-th-search-bar:focus-within {
    background: #fff;
    border-color: rgba(59, 130, 246, .2);
    box-shadow: 0 8px 25px rgba(59, 130, 246, .08);
    transform: translateY(-1px);
}
.muooy-th-ico-search {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    flex: 0 0 auto;
    background: currentColor;
    color: #b2bec3;
    -webkit-mask: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") center / 20px no-repeat;
    mask: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") center / 20px no-repeat;
    transition: color .3s;
}
.muooy-th-search-bar:focus-within .muooy-th-ico-search { color: var(--muooy-th-accent, #3b82f6); }

#muooy_th_search_input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 0;
    font-size: 15px;
    color: #2d3436;
    outline: none;
    box-shadow: none;
    min-width: 0;
}
#muooy_th_search_input::placeholder { color: #b2bec3; font-weight: 400; }

.muooy-th-search-clear {
    display: none;
    align-items: center;
    justify-content: center;
    color: #ff7675;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    margin-right: 4px;
    opacity: .55;
    transition: all .2s;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    flex: 0 0 auto;
}
.muooy-th-search-clear.is-show { display: flex; }
.muooy-th-search-clear:hover { opacity: 1; background: rgba(255, 118, 117, .1); }

/* ---------- 分组 ---------- */
.muooy-th-groups {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
@media (min-width: 1024px) {
    .muooy-th-group-large { background: linear-gradient(to right bottom, #fff, #f8f9fa); }
}
.muooy-th-followed-box { margin-bottom: 24px; }

.muooy-th-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px dashed #f1f2f6;
    padding-bottom: 12px;
    gap: 12px;
}
.muooy-th-group-title {
    font-size: 18px;
    font-weight: 800;
    color: #2d3436;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.4;
}
.muooy-th-heart { color: #ff6b6b; font-size: 16px; }
.muooy-th-group-count {
    font-size: 12px;
    background: rgba(59, 130, 246, .1);
    color: var(--muooy-th-accent, #3b82f6);
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    white-space: nowrap;
}

/* ---------- 标签胶囊 ---------- */
.muooy-th-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.muooy-th-chip {
    display: inline-flex;
    align-items: stretch;
    background: #fff;
    border: 1px solid #dfe6e9;
    border-radius: 12px;
    transition: all .2s;
    overflow: hidden;
    max-width: 100%;
}
.muooy-th-chip:hover {
    background: var(--muooy-th-accent, #3b82f6);
    border-color: var(--muooy-th-accent, #3b82f6);
    transform: scale(1.03);
}
.muooy-th-chip-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    font-size: 14px;
    color: #2d3436;
    text-decoration: none;
    font-weight: 500;
    min-width: 0;
}
.muooy-th-chip:hover .muooy-th-chip-link { color: #fff; }
.muooy-th-chip-link:hover { text-decoration: none; }
.muooy-th-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    flex: 0 0 auto;
    transition: background-color .2s;
}
.muooy-th-chip:hover .muooy-th-dot { background-color: #fff !important; }
.muooy-th-chip-name {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.muooy-th-chip-count { margin-left: 6px; opacity: .6; font-size: 12px; }
.muooy-th-chip-follow {
    margin-left: 8px;
    font-size: 11px;
    opacity: .7;
    padding-left: 8px;
    border-left: 1px solid rgba(0, 0, 0, .08);
    white-space: nowrap;
}
.muooy-th-chip:hover .muooy-th-chip-follow { border-left-color: rgba(255, 255, 255, .35); }

.muooy-th-follow {
    border: 0;
    border-left: 1px solid #eef1f4;
    background: #fbfcfd;
    color: var(--muooy-th-accent, #3b82f6);
    font-size: 12px;
    font-weight: 600;
    padding: 0 10px;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
    line-height: 1;
}
.muooy-th-follow:hover { background: rgba(59, 130, 246, .08); }
.muooy-th-follow.is-on { color: #10b981; }
.muooy-th-chip:hover .muooy-th-follow { background: rgba(255, 255, 255, .16); color: #fff; border-left-color: rgba(255, 255, 255, .3); }

/* ---------- 搜索结果 ---------- */
#muooy_th_search_view { display: none; }
.muooy-th-search-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}
.muooy-th-search-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px 20px;
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(0, 0, 0, .04);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .02);
    transition: all .3s cubic-bezier(.2, .8, .2, 1);
    position: relative;
    overflow: hidden;
}
.muooy-th-search-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--muooy-th-accent, #3b82f6);
    opacity: 0;
    transform: scaleY(0);
    transition: opacity .3s, transform .3s;
}
.muooy-th-search-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .05);
    border-color: rgba(59, 130, 246, .3);
}
.muooy-th-search-card:hover::before { opacity: 1; transform: scaleY(1); }
.muooy-th-search-card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.muooy-th-search-card-name {
    font-size: 16px;
    font-weight: 700;
    color: #2d3436;
    margin: 0 0 4px;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color .3s;
}
.muooy-th-search-card:hover .muooy-th-search-card-name { color: var(--muooy-th-accent, #3b82f6); }
.muooy-th-search-card-meta {
    font-size: 13px;
    color: #a4b0be;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.muooy-th-search-card-meta span { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- 空态 ---------- */
.muooy-th-empty-box {
    text-align: center;
    padding: 60px 20px;
}
.muooy-th-empty-icon { font-size: 56px; margin-bottom: 16px; opacity: .75; }
.muooy-th-empty-box h3 { margin: 0 0 8px; color: #2d3436; font-size: 18px; }
.muooy-th-empty-box p { margin: 0; color: #636e72; font-size: 14px; }
.muooy-th-empty-search {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
    color: #9ca3af;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .03);
}
.muooy-th-empty-search b { font-size: 28px; opacity: .35; margin-bottom: 12px; font-weight: 400; }
.muooy-th-empty-search p { margin: 0; font-size: 13px; }

/* ---------- 右侧栏 ---------- */
.muooy-th-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: sticky;
    top: 90px;
}
.muooy-th-widget {
    background: #fff;
    border-radius: 16px;
    padding: 22px 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .03);
    border: 1px solid rgba(0, 0, 0, .02);
}
.muooy-th-widget-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f2f6;
}
.muooy-th-widget-head h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    color: #2d3436;
}
.muooy-th-widget-head span {
    font-size: 10px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #b2bec3;
    font-weight: 700;
}
.muooy-th-chip-mini-list { display: flex; flex-direction: column; gap: 2px; }
.muooy-th-chip-mini {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 8px;
    text-decoration: none;
    color: #2d3436;
    font-size: 13px;
    transition: background .2s, color .2s;
}
.muooy-th-chip-mini:hover { background: rgba(59, 130, 246, .07); color: var(--muooy-th-accent, #3b82f6); }
.muooy-th-chip-mini em {
    font-style: normal;
    width: 18px;
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 700;
    color: #b2bec3;
}
.muooy-th-chip-mini:nth-child(-n+3) em { color: var(--muooy-th-accent, #3b82f6); }
.muooy-th-chip-mini-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.muooy-th-chip-mini b { font-size: 11px; color: #b2bec3; font-weight: 600; }

.muooy-th-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.muooy-th-stats b {
    display: block;
    font-size: 18px;
    font-weight: 800;
    color: var(--muooy-th-accent, #3b82f6);
    line-height: 1.4;
}
.muooy-th-stats span { font-size: 11px; color: #a4b0be; }
.muooy-th-widget-tip p { margin: 0; font-size: 12.5px; color: #636e72; line-height: 1.8; }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
    .muooy-th-container { grid-template-columns: minmax(0, 1fr); }
    .muooy-th-sidebar { position: static; }
    .muooy-th-search-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .muooy-th-hall { padding: 24px 0 48px; }
    .muooy-th-container { padding: 0 14px; gap: 16px; }
    .muooy-th-hero { padding: 26px 20px; border-radius: 16px; }
    .muooy-th-hero-title { font-size: 22px; }
    .muooy-th-group-card,
    .muooy-th-group-large,
    .muooy-th-followed-box { padding: 18px; }
    .muooy-th-search-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .muooy-th-chip-name { max-width: 120px; }
    .muooy-th-chips { gap: 8px; }
}

/* ---------- 轻提示（自有类名，避开 WP 的 .notice） ---------- */
.muooy-th-toast {
    position: fixed;
    left: 50%;
    bottom: 40px;
    transform: translateX(-50%);
    background: #1f2937;
    color: #fff;
    font-size: 13px;
    line-height: 1.5;
    padding: 10px 18px;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(2, 6, 23, .25);
    z-index: 100000;
    max-width: min(420px, calc(100vw - 40px));
    opacity: 1;
    transition: opacity .3s ease, transform .3s ease;
    animation: muooy-th-toast-in .25s ease both;
}
.muooy-th-toast.is-out { opacity: 0; transform: translateX(-50%) translateY(8px); }
@keyframes muooy-th-toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
