/* zh 首页 — Mac mini 布局的业务组件样式 */

:root {
    --ink: #0f172a;
    --muted: #64748b;
    --line: #d7dee8;
    --accent: #2563eb;
    --surface: #ffffff;
}

#toast-container {
    position: fixed;
    top: 5.75rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}
.toast {
    background: var(--ink);
    color: #fff;
    padding: 0.8rem 1.25rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
    animation: home-toast-in 0.3s ease;
}
@keyframes home-toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

#mobile-menu { display: none; }
#mobile-menu.is-open { display: flex; }

.nav-auth-btn {
    height: 2.5rem;
    padding: 0 1.1rem;
    background: #0f172a;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s;
}
.nav-auth-btn:hover { background: #1e293b; }

.nav-user-menu { position: relative; }
.nav-user-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: 2.5rem;
    padding: 0 1rem;
    border-radius: 9999px;
    background: #0f172a;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
}
.nav-user-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    min-width: 13rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 0.9rem;
    padding: 0.45rem;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.1);
    z-index: 60;
}
.nav-user-menu.is-open .nav-user-dropdown { display: block; }
.nav-user-dropdown a,
.nav-user-dropdown button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.65rem 0.8rem;
    border: none;
    background: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: var(--ink);
    text-decoration: none;
    cursor: pointer;
}
.nav-user-dropdown a:hover,
.nav-user-dropdown button:hover { background: #f1f5f9; }
.nav-user-email {
    padding: 0.5rem 0.8rem;
    font-size: 0.75rem;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
    margin-bottom: 0.2rem;
    word-break: break-all;
}
.nav-user-logout { color: #ef4444 !important; }

.lang-switcher { position: relative; }
.lang-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.35rem 0.5rem;
}
.lang-trigger:hover { color: var(--ink); }
.lang-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    min-width: 11rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 0.9rem;
    padding: 0.45rem;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.1);
    z-index: 60;
}
.lang-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.55rem 0.8rem;
    border: none;
    background: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ink);
    cursor: pointer;
    text-align: left;
}
.lang-item:hover { background: #f1f5f9; }
.lang-item.is-active { font-weight: 700; }

.period-tabs {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem;
    background: var(--surface);
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
}
.period-tabs button {
    padding: 0.45rem 0.95rem;
    border: none;
    border-radius: 9999px;
    background: transparent;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    font-family: inherit;
}
.period-tabs button:hover { color: var(--ink); }
.period-tabs button.is-active {
    background: #0f172a;
    color: #fff;
    font-weight: 600;
}

.dc-card-clickable {
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}
.dc-card-clickable:hover {
    transform: translateY(-2px);
}

html.site-auth-logged-in .hide-when-authed { display: none !important; }
html:not(.site-auth-logged-in) .hide-when-guest { display: none !important; }
