:root {
    --text: #fffaf3;
    --muted: rgba(255, 250, 243, 0.76);
    --glass: rgba(13, 18, 24, 0.30);
    --glass-strong: rgba(13, 18, 24, 0.48);
    --line: rgba(255, 255, 255, 0.16);
    --blue: #7bd7ff;
    --gold: #ffe08a;
    --pink: #ff9fc6;
    --shadow: 0 26px 90px rgba(0, 0, 0, 0.36);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    background:
        url("https://imgapi.cn/api.php?zd=zsyi&fl=meizi&gs=images") center / cover fixed no-repeat,
        url("./12.png") center / cover fixed no-repeat,
        #111821;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(circle at 18% 18%, rgba(123, 215, 255, 0.16), transparent 32%),
        radial-gradient(circle at 82% 76%, rgba(255, 159, 198, 0.14), transparent 30%),
        linear-gradient(120deg, rgba(4, 8, 14, 0.52), rgba(4, 8, 14, 0.18) 48%, rgba(4, 8, 14, 0.58));
}

.background-dim {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    backdrop-filter: blur(0.4px);
    background-image: linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 42px 42px;
    opacity: 0.58;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.20));
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    color: inherit;
    font: inherit;
}

.floating-tools {
    position: fixed;
    top: 22px;
    right: 22px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 999px;
}

.floating-tools:not(.open) {
    padding: 6px;
}

.floating-tools button,
.tool-toggle {
    min-height: 36px;
    border: 0;
    border-radius: 999px;
    padding: 0 14px;
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
    font-size: 14px;
    font-weight: 800;
    transition: transform 0.2s ease, background 0.2s ease;
}

.floating-tools button:hover,
.tool-toggle:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.20);
}

.tool-menu {
    display: grid;
    grid-template-columns: 0fr;
    gap: 0;
    overflow: hidden;
    transition: grid-template-columns 0.24s ease, gap 0.24s ease;
}

.tool-menu button {
    min-width: 0;
    padding-inline: 0;
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
    transition: opacity 0.18s ease, padding 0.24s ease, background 0.2s ease;
}

.floating-tools.open .tool-menu {
    grid-template-columns: 1fr;
    display: flex;
    gap: 8px;
}

.floating-tools.open .tool-menu button {
    padding-inline: 14px;
    opacity: 1;
    pointer-events: auto;
}

.floating-tools.bg-mode [data-page-tool] {
    display: none;
}

.page {
    width: min(1120px, calc(100% - 40px));
    min-height: 100vh;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) 380px;
    gap: 22px;
    align-items: start;
    padding: 34px 0;
    padding-top: clamp(24px, 9vh, 86px);
}

.glass {
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--glass);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px) saturate(125%);
}

body.background-only::before,
body.background-only .background-dim,
body.background-only .page {
    opacity: 0;
    pointer-events: none;
}

body.background-only .floating-tools {
    background: rgba(0, 0, 0, 0.22);
}

body.background-only .tool-toggle {
    display: none;
}

.hero-card {
    min-height: 560px;
    padding: clamp(24px, 4.4vw, 46px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin-top: clamp(0px, 4vh, 28px);
}

.topline,
.card-head,
.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 800;
}

.brand img {
    width: 42px;
    height: 42px;
    padding: 9px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.22));
}

.greeting {
    max-width: 220px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    padding: 8px 12px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.10);
    text-align: right;
}

.ghost-button,
.secondary-button,
.close-button {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.ghost-button {
    min-height: 40px;
    border-radius: 999px;
    padding: 0 16px;
}

.ghost-button:hover,
.secondary-button:hover,
.close-button:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.20);
    border-color: rgba(255, 255, 255, 0.34);
}

.time-block {
    margin: 34px 0 24px;
}

.time {
    font-size: clamp(64px, 11vw, 124px);
    line-height: 0.92;
    font-weight: 800;
    letter-spacing: 0;
    text-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
    font-variant-numeric: tabular-nums;
}

.date-line {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.date-line span {
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    padding: 8px 12px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.10);
}

h1,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 16px;
    font-size: clamp(40px, 6vw, 76px);
    line-height: 1.02;
    letter-spacing: 0;
    text-shadow: 0 16px 40px rgba(0, 0, 0, 0.34);
}

.intro {
    max-width: 640px;
    margin-bottom: 22px;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.85;
}

.intro a {
    color: var(--gold);
    font-weight: 800;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.primary-button,
.secondary-button {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0 22px;
    font-weight: 800;
}

.primary-button {
    border: 0;
    color: #17202a;
    background: linear-gradient(135deg, var(--gold), #fff8d6 54%, var(--blue));
    box-shadow: 0 16px 36px rgba(123, 215, 255, 0.22);
    transition: transform 0.2s ease, filter 0.2s ease;
}

.primary-button:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
}

.side-grid {
    display: grid;
    gap: 18px;
    margin-top: 0;
}

.weather-card,
.poem-card,
.status-card,
.template-card {
    padding: 22px;
}

.card-head {
    margin-bottom: 18px;
}

.card-head span {
    font-weight: 800;
}

.card-head small {
    color: var(--muted);
}

.weather-main {
    display: flex;
    align-items: center;
    gap: 16px;
}

.weather-main img {
    width: 70px;
    height: 70px;
    flex: 0 0 auto;
    object-fit: contain;
}

.weather-main img[src=""] {
    display: none;
}

.weather-main strong {
    display: block;
    margin-bottom: 6px;
    font-size: 28px;
}

.weather-main p {
    margin: 0;
    color: var(--muted);
}

.weather-meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 20px 0;
}

.weather-meta span {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    padding: 8px;
    text-align: center;
    background: rgba(255, 255, 255, 0.08);
    font-weight: 700;
}

.life-advice {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.status-list {
    display: grid;
    gap: 10px;
}

.status-list a,
.status-list button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 52px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    padding: 0 14px;
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    text-align: left;
    transition: transform 0.2s ease, background 0.2s ease;
}

.status-list a:hover,
.status-list button:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.15);
}

.status-list b,
.status-list span {
    display: block;
}

.status-list span {
    color: var(--muted);
    font-size: 13px;
}

.template-card p {
    margin-bottom: 18px;
    color: var(--muted);
    line-height: 1.75;
}

.mini-button {
    min-height: 42px;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
    font-weight: 800;
}

blockquote {
    margin: 0;
}

blockquote p {
    margin-bottom: 16px;
    font-size: 20px;
    line-height: 1.8;
}

cite {
    color: var(--gold);
    font-style: normal;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    z-index: 20;
    transform: translate(-50%, 14px);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 10px 16px;
    color: var(--text);
    background: var(--glass-strong);
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(12px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
    transform: translate(-50%, 0);
    opacity: 1;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.56);
}

.modal-overlay.open {
    display: flex;
}

.modal {
    width: min(680px, 100%);
    max-height: min(760px, calc(100vh - 40px));
    overflow: auto;
    padding: 22px;
    background: var(--glass-strong);
}

.modal-head {
    margin-bottom: 18px;
}

.modal h2 {
    margin: 0;
}

.close-button {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
}

.modal-content {
    color: var(--muted);
    line-height: 1.8;
}

.modal-content h1,
.modal-content h2,
.modal-content h3 {
    color: var(--text);
}

.modal-content a {
    color: var(--gold);
    font-weight: 800;
}

.modal-ok {
    width: 100%;
    margin-top: 18px;
}

@media (max-width: 960px) {
    .page {
        grid-template-columns: 1fr;
        align-items: start;
        padding: 20px 0 90px;
    }

    .hero-card {
        min-height: auto;
    }

    .side-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    body {
        background-attachment: scroll;
    }

    .page {
        width: calc(100% - 28px);
        gap: 14px;
    }

    .glass {
        border-radius: 18px;
    }

    .hero-card,
    .weather-card,
    .poem-card,
    .status-card,
    .template-card {
        padding: 18px;
    }

    .topline {
        align-items: flex-start;
    }

    .floating-tools {
        left: 14px;
        right: 14px;
        top: auto;
        bottom: 16px;
        display: flex;
        width: auto;
        gap: 6px;
        padding: 6px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .floating-tools::-webkit-scrollbar {
        display: none;
    }

    .floating-tools button,
    .tool-toggle {
        flex: 0 0 auto;
        min-height: 34px;
        min-width: 68px;
        padding: 0 10px;
        font-size: 12px;
    }

    .tool-menu {
        flex: 0 0 auto;
    }

    .floating-tools.open .tool-menu {
        gap: 6px;
    }

    .floating-tools.open .tool-menu button {
        padding-inline: 10px;
    }

    .greeting {
        display: none;
    }

    .time-block {
        margin: 36px 0 28px;
    }

    .time {
        font-size: 56px;
    }

    h1 {
        font-size: 40px;
    }

    .intro {
        font-size: 16px;
        line-height: 1.75;
    }

    .actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .side-grid,
    .weather-meta {
        grid-template-columns: 1fr;
    }

    .weather-meta span {
        justify-content: flex-start;
        min-height: 46px;
    }
}
