@import url('variables.css');

html {
    background-color: var(--mint-green);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family-base);
    background-color: var(--mint-green);
    color: var(--text-color);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

@media (pointer: coarse) {
    input,
    textarea,
    select {
        font-size: 16px;
    }
}

@supports (-webkit-touch-callout: none) {
    input,
    textarea,
    select {
        font-size: 16px;
    }
}

.container {
    width: 100%;
    max-width: 480px; /* 移动端适配 */
    min-height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Glassmorphism utils */
.glass-container {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

button {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    color: var(--text-color);
    font-weight: bold;
}

button:active {
    transform: scale(0.95);
}

button:focus,
a:focus,
input:focus,
textarea:focus {
    outline: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.62);
    outline-offset: 2px;
}

.topbar {
    width: calc(100% - 40px);
    max-width: 480px;
    height: 60px;
    padding: 0 22px;
    margin: 16px 20px 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.26);
    border: 1px solid rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 10px 34px rgba(31, 38, 135, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.12), 0 0 26px rgba(255, 255, 255, 0.18);
    position: sticky;
    top: 16px;
    z-index: 60;
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
}

.topbar-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 0;
}

.topbar-title {
    font-weight: 800;
    font-size: 15px;
    color: rgba(26, 74, 56, 0.92);
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 10px;
}

.topbar-btn,
.more-btn {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

#back-btn {
    color: rgba(117, 167, 159, 0.92);
}

#back-btn svg {
    width: 22px;
    height: 22px;
    display: block;
}

html[data-theme="night"] .topbar {
    background: rgba(16, 34, 52, 0.24);
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

html[data-theme="night"] .topbar-title {
    color: rgba(236, 244, 240, 0.86);
}

html[data-theme="night"] .topbar-btn,
html[data-theme="night"] .more-btn {
    background: rgba(16, 34, 52, 0.22);
    border-color: rgba(255, 255, 255, 0.16);
    color: rgba(236, 244, 240, 0.88);
}

html[data-theme="night"] #back-btn {
    color: rgba(236, 244, 240, 0.88);
}

html[data-theme="night"] {
    --mint-green: #0e1d2d;
    --text-color: rgba(236, 244, 240, 0.92);
    --text-color-light: rgba(236, 244, 240, 0.6);
    --glass-bg: rgba(16, 34, 52, 0.38);
    --glass-border: rgba(255, 255, 255, 0.16);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.24);
    --transition-liquid: #173450;
    --dance-bg-1: #173450;
    --dance-bg-2: #102234;
    --dance-bg-3: #0e1d2d;
}

html.page-leaving body {
    opacity: 0;
    transition: opacity 180ms ease;
}

@media (prefers-reduced-motion: reduce) {
    html.page-leaving body {
        transition: none;
    }
}
