/**
 * love咪小手机 - 登录/注册/公告 样式
 * 视觉与锁屏保持一致：暮蓝-暖棕渐变 + 半透明玻璃卡片
 */

/* ========== 通用：登录覆盖层 ========== */
.love-mi-login-overlay {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    z-index: 100060; /* 高于锁屏 100050 */
    display: none;
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
    overflow: hidden;
    border-radius: inherit;
    isolation: isolate;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: auto;
    transition: opacity 0.32s ease;
}

.love-mi-login-overlay.is-visible {
    display: flex;
    opacity: 1;
}

.love-mi-login-overlay.is-fading {
    opacity: 0;
    pointer-events: none;
}

.love-mi-login-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(circle at 18% 12%, rgba(255, 248, 236, 0.22) 0%, rgba(255, 248, 236, 0) 38%),
        radial-gradient(circle at 82% 90%, rgba(255, 200, 180, 0.18) 0%, rgba(255, 200, 180, 0) 42%),
        linear-gradient(155deg, #8B9DC5 0%, #7388A3 48%, #5A2A2A 100%);
}

.love-mi-login-scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(
        180deg,
        rgba(255, 250, 240, 0.06) 0%,
        rgba(255, 250, 240, 0) 32%,
        rgba(36, 16, 16, 0.18) 100%
    );
}

.love-mi-login-inner {
    position: relative;
    z-index: 2;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: max(28px, env(safe-area-inset-top, 0px)) 22px max(20px, env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.love-mi-login-inner::-webkit-scrollbar {
    width: 0;
    height: 0;
}

/* ========== 顶部 logo / 品牌 ========== */
.love-mi-login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    margin-bottom: 26px;
    flex-shrink: 0;
}

.love-mi-login-logo {
    width: 76px;
    height: 76px;
    object-fit: contain;
    border-radius: 22px;
    box-shadow: 0 10px 26px rgba(20, 30, 50, 0.32);
    background: rgba(255, 250, 240, 0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.love-mi-login-title {
    font-family: "HuiwenMingChao", "PingFang SC", "Microsoft YaHei", serif;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: #fffaf0;
    text-shadow: 0 4px 14px rgba(20, 30, 50, 0.32);
}

.love-mi-login-subtitle {
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.04em;
    color: rgba(255, 250, 240, 0.78);
    margin-top: -2px;
}

/* ========== 卡片：登录/注册表单 ========== */
.love-mi-login-card {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    box-sizing: border-box;
    border-radius: 22px;
    border: 1px solid rgba(255, 250, 240, 0.42);
    background: linear-gradient(180deg, rgba(255, 250, 240, 0.22) 0%, rgba(255, 250, 240, 0.1) 100%);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 18px 38px rgba(20, 30, 50, 0.28);
    padding: 22px 20px 20px;
    color: rgba(255, 250, 240, 0.96);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.love-mi-login-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.love-mi-login-card-title {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #fffaf0;
}

.love-mi-login-back-btn {
    background: none;
    border: none;
    color: rgba(255, 250, 240, 0.85);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 10px;
    transition: background 0.18s ease;
    font-family: inherit;
}

.love-mi-login-back-btn:hover,
.love-mi-login-back-btn:focus-visible {
    background: rgba(255, 250, 240, 0.12);
    outline: none;
}

/* ========== 输入字段 ========== */
.love-mi-login-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.love-mi-login-field-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: rgba(255, 250, 240, 0.82);
    text-transform: none;
}

.love-mi-login-input {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 250, 240, 0.34);
    background: rgba(20, 24, 40, 0.32);
    color: #fffaf0;
    font-size: 14px;
    font-family: inherit;
    letter-spacing: 0.02em;
    outline: none;
    transition: border 0.18s ease, background 0.18s ease;
    -webkit-appearance: none;
    appearance: none;
}

.love-mi-login-input::placeholder {
    color: rgba(255, 250, 240, 0.5);
}

.love-mi-login-input:focus {
    border-color: rgba(255, 250, 240, 0.78);
    background: rgba(20, 24, 40, 0.46);
}

.love-mi-login-input--code {
    font-family: "SF Mono", "Cascadia Code", "Consolas", "Microsoft YaHei", monospace;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* ========== 错误/提示行 ========== */
.love-mi-login-hint {
    min-height: 16px;
    margin: 4px 0 12px;
    font-size: 12px;
    color: rgba(255, 230, 220, 0.92);
    text-align: left;
    letter-spacing: 0.02em;
}

.love-mi-login-hint--ok {
    color: rgba(220, 255, 230, 0.92);
}

/* ========== 主按钮 ========== */
.love-mi-login-primary-btn {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #f3c1c1 0%, #d49aa8 50%, #a76d80 100%);
    color: #2c1418;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.1em;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(167, 109, 128, 0.36);
    transition: transform 0.16s ease, box-shadow 0.18s ease, opacity 0.18s ease;
    font-family: inherit;
}

.love-mi-login-primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(167, 109, 128, 0.46);
}

.love-mi-login-primary-btn:active {
    transform: translateY(0);
}

.love-mi-login-primary-btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 6px 14px rgba(167, 109, 128, 0.24);
}

/* ========== 切换链接 ========== */
.love-mi-login-switch-row {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    color: rgba(255, 250, 240, 0.7);
}

.love-mi-login-switch-link {
    background: none;
    border: none;
    color: #fffaf0;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-family: inherit;
}

.love-mi-login-switch-link:hover,
.love-mi-login-switch-link:focus-visible {
    background: rgba(255, 250, 240, 0.14);
    outline: none;
}

/* ========== 底部小字 ========== */
.love-mi-login-footer {
    margin-top: auto;
    padding-top: 18px;
    text-align: center;
    font-size: 11px;
    color: rgba(255, 250, 240, 0.55);
    letter-spacing: 0.04em;
}

/* ========== 公告模态框 ========== */
.love-mi-announce-overlay {
    position: absolute;
    inset: 0;
    z-index: 100070;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(12, 16, 28, 0.58);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: inherit;
    overflow: hidden;
    padding: 18px;
    box-sizing: border-box;
}

.love-mi-announce-overlay.is-visible {
    display: flex;
}

.love-mi-announce-card {
    width: 100%;
    max-width: 320px;
    max-height: 88%;
    box-sizing: border-box;
    border-radius: 20px;
    background: linear-gradient(180deg, #fffaf3 0%, #fff3ea 100%);
    color: #3a2a2a;
    box-shadow: 0 22px 48px rgba(20, 30, 50, 0.42);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.love-mi-announce-header {
    flex: 0 0 auto;
    padding: 16px 18px 12px;
    border-bottom: 1px solid rgba(60, 30, 30, 0.08);
    background: linear-gradient(180deg, #fff7ee 0%, #fff0e2 100%);
}

.love-mi-announce-title {
    font-family: "HuiwenMingChao", "PingFang SC", "Microsoft YaHei", serif;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #5a2a2a;
    margin: 0 0 10px;
    text-align: center;
}

.love-mi-announce-tabs {
    display: flex;
    background: rgba(90, 42, 42, 0.08);
    border-radius: 12px;
    padding: 3px;
    gap: 2px;
}

.love-mi-announce-tab {
    flex: 1;
    padding: 7px 10px;
    border: none;
    background: transparent;
    color: rgba(60, 30, 30, 0.7);
    font-size: 12.5px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    letter-spacing: 0.04em;
    transition: background 0.18s ease, color 0.18s ease;
    font-family: inherit;
}

.love-mi-announce-tab.is-active {
    background: #fffaf3;
    color: #5a2a2a;
    box-shadow: 0 2px 8px rgba(90, 42, 42, 0.14);
}

.love-mi-announce-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 14px 18px 8px;
    scrollbar-width: thin;
}

.love-mi-announce-body::-webkit-scrollbar {
    width: 6px;
}

.love-mi-announce-body::-webkit-scrollbar-thumb {
    background: rgba(90, 42, 42, 0.18);
    border-radius: 4px;
}

.love-mi-announce-section {
    display: none;
    line-height: 1.72;
    font-size: 13px;
    color: #3a2a2a;
}

.love-mi-announce-section.is-active {
    display: block;
}

.love-mi-announce-section h4 {
    font-family: "HuiwenMingChao", "PingFang SC", "Microsoft YaHei", serif;
    font-size: 14px;
    font-weight: 700;
    color: #5a2a2a;
    margin: 0 0 8px;
    letter-spacing: 0.04em;
}

.love-mi-announce-section ol {
    margin: 0;
    padding-left: 22px;
}

.love-mi-announce-section ol li {
    margin-bottom: 10px;
    color: #3a2a2a;
}

.love-mi-announce-section ol li:last-child {
    margin-bottom: 0;
}

.love-mi-announce-section .love-mi-announce-section-sub {
    font-size: 12px;
    color: rgba(60, 30, 30, 0.62);
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed rgba(90, 42, 42, 0.18);
}

.love-mi-announce-footer {
    flex: 0 0 auto;
    padding: 12px 18px max(14px, env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(60, 30, 30, 0.08);
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    background: rgba(255, 247, 238, 0.85);
}

.love-mi-announce-confirm-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: #5a2a2a;
    letter-spacing: 0.02em;
    cursor: pointer;
    user-select: none;
}

.love-mi-announce-confirm-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #a76d80;
    cursor: pointer;
}

.love-mi-announce-ok-btn {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 14px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #d49aa8 0%, #a76d80 100%);
    color: #fffaf3;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.1em;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(167, 109, 128, 0.32);
    transition: transform 0.16s ease, opacity 0.18s ease;
    font-family: inherit;
}

.love-mi-announce-ok-btn:hover {
    transform: translateY(-1px);
}

.love-mi-announce-ok-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ========== 暗色主题适配 ========== */
html[data-appearance="dark"] .love-mi-announce-card {
    background: linear-gradient(180deg, #2a1f24 0%, #221a1f 100%);
    color: #f3e6df;
}

html[data-appearance="dark"] .love-mi-announce-header {
    background: linear-gradient(180deg, #2f2329 0%, #261b21 100%);
    border-bottom-color: rgba(255, 250, 240, 0.08);
}

html[data-appearance="dark"] .love-mi-announce-title {
    color: #f8d6c8;
}

html[data-appearance="dark"] .love-mi-announce-tab {
    color: rgba(243, 230, 223, 0.7);
}

html[data-appearance="dark"] .love-mi-announce-tab.is-active {
    background: #3a2a30;
    color: #ffd6c5;
}

html[data-appearance="dark"] .love-mi-announce-section {
    color: #f3e6df;
}

html[data-appearance="dark"] .love-mi-announce-section h4 {
    color: #ffd6c5;
}

html[data-appearance="dark"] .love-mi-announce-section ol li {
    color: #f3e6df;
}

html[data-appearance="dark"] .love-mi-announce-section .love-mi-announce-section-sub {
    color: rgba(243, 230, 223, 0.62);
    border-top-color: rgba(255, 250, 240, 0.18);
}

html[data-appearance="dark"] .love-mi-announce-footer {
    background: rgba(34, 26, 31, 0.9);
    border-top-color: rgba(255, 250, 240, 0.08);
}

html[data-appearance="dark"] .love-mi-announce-confirm-row {
    color: #f3e6df;
}

/* ========== 容器查询适配（与锁屏一致） ========== */
@supports (width: 1cqw) {
    .love-mi-login-inner {
        padding-left: clamp(14px, 5cqw, 26px);
        padding-right: clamp(14px, 5cqw, 26px);
    }

    .love-mi-login-title {
        font-size: clamp(18px, 5.4cqw, 24px);
    }

    .love-mi-login-card {
        padding: clamp(16px, 5cqw, 24px) clamp(14px, 5cqw, 22px) clamp(14px, 5cqw, 20px);
    }
}
