/* 随机口袋：幸运数字 · 随便逛逛 · 一句古诗 */

.rand-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
    max-width: 940px;
    margin: 0 auto 20px;
    font-size: 20px;
    color: #5b6478;
}
.rand-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    border-radius: 999px;
    cursor: pointer;
    user-select: none;
    transition: background .2s ease, transform .12s ease, box-shadow .2s ease;
    outline: none;
}
.rand-item:hover { background: rgba(255,255,255,.6); }
.rand-item:active { transform: scale(.96); }
.rand-item:focus-visible { box-shadow: 0 0 0 3px rgba(75,123,236,.25); }

.rand-sep { color: #c2c9d6; font-size: 18px; padding: 0 2px; }

/* 线性图标 */
.rand-icon {
    width: 28px;
    height: 28px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.55;
    stroke-linecap: round;
    stroke-linejoin: round;
    color: #7c879b;
    transition: color .2s ease, transform .3s ease;
}
.rand-item:hover .rand-icon { color: #4b7bec; }

.rand-refresh {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: #98a3b5;
    border-radius: 50%;
    transition: color .2s, background .2s, transform .3s;
}
.rand-refresh svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.rand-refresh:hover { color: #4b7bec; background: rgba(75,123,236,.12); transform: rotate(180deg); }

.rand-val {
    font-weight: 600;
    color: #2b3446;
    font-variant-numeric: tabular-nums;
    max-width: 230px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: bottom;
    transition: opacity .16s ease, transform .16s ease, filter .16s ease;
}
.rand-val.out { opacity: 0; transform: translateY(-5px); filter: blur(2px); }
.rand-val.in { animation: randIn .26s ease; }
@keyframes randIn {
    from { opacity: 0; transform: translateY(6px); filter: blur(2px); }
    to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

a.rand-val { text-decoration: none; }
a.rand-val:hover { color: #4b7bec; }

.rand-author { color: #98a1b3; font-size: 12px; }



.rand-item.pop { animation: randPop .28s ease; }
@keyframes randPop {
    0% { transform: scale(1); }
    45% { transform: scale(1.06); }
    100% { transform: scale(1); }
}

@media (max-width: 600px) {
    .rand-bar { font-size: 13px; margin-bottom: 14px; }
    .rand-val { max-width: 150px; }
    .rand-author { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .rand-val, .rand-val.in, .rand-item.pop { animation: none !important; transition: none !important; }
}

/* 诗句比较长，单独放宽，避免被截断 */
#randPoemVal { max-width: 460px; }

@media (max-width: 600px) {
    #randPoemVal { max-width: 210px; }
}

/* 时间 / 地区 */
#clockNow { font-variant-numeric: tabular-nums; }
#geoText { max-width: 180px; }
#clockBox, #geoBox { cursor: default; }