/* 图库：沿用论坛卡片、按钮和配色 */
.tuku-app [hidden] { display: none !important; }
.tuku-head { margin-bottom: 18px; }
.tuku-subtitle { margin: 4px 0 0; font-size: 12px; }

/* 列表/详情页头：左返回、中标题、右操作 */
.tuku-page-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
}
.tuku-page-head-aside { display: flex; align-items: center; gap: 8px; }
.tuku-page-head-aside .btn { font-size: 14px; }
.tuku-page-head-left { justify-self: start; }
.tuku-page-head-right { justify-self: end; }
.tuku-page-head-main { min-width: 0; text-align: center; }
.tuku-page-head-main h2 { justify-content: center; }

/* 列表标题右侧：彩色 / 黑白切换 */
.tuku-color-switch {
    display: inline-flex;
    align-items: center;
    padding: 2px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f8fafc;
}
.tuku-color-switch button {
    padding: 3px 10px;
    border: 0;
    border-radius: 999px;
    background: none;
    color: #4b5563;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}
.tuku-color-switch button.active { background: var(--primary); color: #fff; }
/* 图库类型导航：复用版块导航条样式，按钮化 */
.tuku-type-nav .forum-nav-link {
    border: 0;
    background: transparent;
    font-family: inherit;
    cursor: pointer;
}
.tuku-type-nav .forum-nav-link:hover { background: #f3f4f9; }
.tuku-type-nav .forum-nav-link.active { background: var(--primary-soft); }
.tuku-search { display: grid; grid-template-columns: 100px minmax(0, 1fr) auto; gap: 10px; }
.tuku-search input,
.tuku-search select {
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    background: #fbfdff;
    outline: none;
}
.tuku-search input:focus,
.tuku-search select:focus {
    border-color: #a5b4fc;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
    background: #fff;
}
.tuku-period { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.tuku-period strong { color: var(--text); font-size: 16px; }
.tuku-balls { display: flex; align-items: flex-start; justify-content: center; gap: 12px; flex-wrap: wrap; min-height: 72px; }
.tuku-number { display: flex; flex-direction: column; align-items: center; gap: 5px; width: 48px; }
.tuku-ball {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    box-shadow: inset 0 -4px 8px rgba(0, 0, 0, 0.12), 0 3px 8px rgba(30, 41, 59, 0.12);
}
.tuku-ball-red { background: linear-gradient(145deg, #fb7185, #dc2626); }
.tuku-ball-blue { background: linear-gradient(145deg, #60a5fa, #2563eb); }
.tuku-ball-green { background: linear-gradient(145deg, #34d399, #059669); }
.tuku-ball-plain { background: linear-gradient(145deg, #818cf8, #4f46e5); }
.tuku-number small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.tuku-plus { align-self: center; color: #94a3b8; font-size: 25px; font-weight: 600; }
.tuku-years { display: flex; gap: 9px; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; scroll-behavior: smooth; }
.tuku-year { flex: 0 0 auto; white-space: nowrap; border: 1px solid #c7d2fe; background: var(--primary-soft); color: var(--primary); }
.tuku-year:hover { border-color: #a5b4fc; color: var(--primary-dark); }
.tuku-year-bw { border-color: #e2e8f0; background: #f8fafc; color: #64748b; }
.tuku-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 16px; }
.tuku-thumb {
    display: block;
    width: 100%;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    text-align: left;
    transition: transform 0.16s, border-color 0.16s, box-shadow 0.16s;
}
.tuku-thumb:hover { transform: translateY(-2px); border-color: #c7d2fe; box-shadow: var(--shadow); }
.tuku-thumb img { display: block; width: 100%; height: auto; min-height: 90px; background: #f1f5f9; }
.tuku-thumb span { display: block; padding: 9px 10px 10px; text-align: center; font-size: 13px; font-weight: 600; }
.tuku-load-sentinel { width: 100%; height: 1px; }
.tuku-status { margin-top: 5px; text-align: center; font-size: 13px; }
.tuku-list-layout { display: grid; grid-template-columns: minmax(0, 1fr) 38px; gap: 16px; align-items: start; }
.tuku-results { grid-column: 1; grid-row: 1; min-width: 0; }
.tuku-letter-nav { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; position: sticky; top: 86px; max-height: calc(100vh - 110px); overflow-y: auto; }
.tuku-letter-nav button {
    width: 32px;
    height: 27px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    cursor: pointer;
}
.tuku-letter-nav button:hover { background: var(--primary-soft); color: var(--primary); }
.tuku-result-group { scroll-margin-top: 90px; }
.tuku-result-group h3 { margin: 12px 0 5px; color: var(--primary); font-size: 17px; }
.tuku-result-group:first-child h3 { margin-top: 0; }
.tuku-result-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    padding: 11px 8px;
    border: 0;
    border-bottom: 1px solid #f1f5f9;
    background: transparent;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}
.tuku-result-row:hover { background: #f8fafc; color: var(--primary); }
.tuku-result-row span:first-child { min-width: 0; overflow-wrap: anywhere; }
.tuku-result-row small { flex-shrink: 0; color: var(--muted); }
.tuku-periods { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
.tuku-period-button { padding: 7px 4px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tuku-period-button.active { border-color: #c7d2fe; background: var(--primary-soft); color: var(--primary); }
.tuku-period-toggle { padding: 7px 4px; font-size: 12px; }
.tuku-period-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    max-height: 410px;
    overflow-y: auto;
    padding: 10px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
}
.tuku-period-panel .tuku-period-button { width: 100%; }
.tuku-detail-image { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafc; text-align: center; }
.tuku-detail-stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 240px; }
.tuku-detail-status {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    text-align: center;
    font-size: 13px;
}
.tuku-detail-status:empty { display: none; }
.tuku-detail-image button { position: relative; z-index: 1; display: inline-block; max-width: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.tuku-detail-image button:disabled { cursor: default; }
.tuku-detail-image img { display: block; max-width: 100%; height: auto; margin: 0 auto; border-radius: 8px; transition: opacity 0.26s ease, transform 0.26s ease; }
.tuku-detail-image img:not([src]) { display: none; }
.tuku-detail-image img.tuku-image-fading { opacity: 0; transform: scale(0.985); }

@media (max-width: 640px) {
    .tuku-head { margin-bottom: 10px; }
    .tuku-page-head { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr); gap: 8px; align-items: baseline; }
    .tuku-page-head-main h2 { font-size: 15px; }
    .tuku-page-head .tuku-subtitle { font-size: 11px; }
    .tuku-page-head .btn { padding: 5px 9px; }
    .tuku-color-switch button { padding: 3px 6px; }
    .tuku-detail-hint { display: none; }
    .tuku-periods { margin-bottom: 10px; }
    .tuku-search { grid-template-columns: 90px minmax(0, 1fr); }
    .tuku-search .btn { grid-column: 1 / -1; }
    .tuku-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .tuku-thumb span { padding: 8px 6px; font-size: 12px; }
    .tuku-balls { gap: 7px; }
    .tuku-number { width: 39px; }
    .tuku-ball { width: 38px; height: 38px; font-size: 15px; }
    .tuku-number small { font-size: 10px; }
    .tuku-plus { font-size: 20px; }
    .tuku-list-layout { grid-template-columns: minmax(0, 1fr) 30px; gap: 8px; }
    .tuku-letter-nav button { width: 28px; height: 26px; font-size: 11px; }
    .tuku-detail-image { padding: 8px; }
    .tuku-detail-stage { min-height: 180px; }
}
