.home-auth-overlay {
 position: fixed;
 inset: 0;
 z-index: 10000;
 background: rgba(30, 28, 24, 0.45);
 backdrop-filter: blur(6px);
 -webkit-backdrop-filter: blur(6px);
 display: flex;
 align-items: center;
 justify-content: center;
 padding: 1rem;
 animation: homeAuthFade 0.25s ease;
}

.home-auth-overlay[hidden] { display: none !important; }

@keyframes homeAuthFade {
 from { opacity: 0; }
 to { opacity: 1; }
}

.home-auth-modal {
 position: relative;
 width: 100%;
 max-width: 380px;
 padding: 1.8rem 1.6rem 1.6rem;
 background: #f6f1e7;
 border: 1px solid rgba(108, 120, 98, 0.18);
 border-radius: 14px;
 box-shadow: 0 12px 40px rgba(40, 38, 34, 0.18);
 animation: homeAuthPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes homeAuthPop {
 from { opacity: 0; transform: translateY(12px) scale(0.96); }
 to { opacity: 1; transform: translateY(0) scale(1); }
}

.home-auth-close {
 position: absolute;
 top: 0.7rem;
 right: 0.9rem;
 width: 1.8rem;
 height: 1.8rem;
 font-size: 1.3rem;
 line-height: 1;
 color: #8a7e72;
 background: transparent;
 border: none;
 border-radius: 50%;
 cursor: pointer;
 transition: color 0.2s ease, background-color 0.2s ease;
}

.home-auth-close:hover {
 color: #3d3530;
 background: rgba(108, 120, 98, 0.1);
}

.home-auth-title {
 margin: 0 0 0.3rem;
 font-family: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "Georgia", serif;
 font-size: 1.15rem;
 font-weight: 600;
 color: #3d3530;
 letter-spacing: 0.04em;
}

.home-auth-sub {
 margin: 0 0 1.1rem;
 font-size: 0.78rem;
 color: #8a7e72;
 line-height: 1.55;
}

.home-auth-tabs {
 display: flex;
 gap: 0.5rem;
 margin-bottom: 1rem;
 border-bottom: 1px solid rgba(108, 120, 98, 0.18);
}

.home-auth-tab {
 padding: 0.45rem 0.9rem;
 font-size: 0.85rem;
 font-family: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "Georgia", serif;
 color: #8a7e72;
 background: transparent;
 border: none;
 border-bottom: 2px solid transparent;
 cursor: pointer;
 transition: color 0.2s ease, border-color 0.2s ease;
 margin-bottom: -1px;
}

.home-auth-tab.active {
 color: #6b9080;
 border-bottom-color: #6b9080;
}

.home-auth-form {
 display: flex;
 flex-direction: column;
 gap: 0.7rem;
}

.home-auth-form[hidden] { display: none; }

.home-auth-field {
 display: flex;
 flex-direction: column;
 gap: 0.25rem;
}

.home-auth-field > span {
 font-size: 0.75rem;
 color: #8a7e72;
}

.home-auth-field input {
 padding: 0.5rem 0.7rem;
 font-size: 0.85rem;
 font-family: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "Georgia", serif;
 color: #3d3530;
 background: rgba(255, 253, 247, 0.7);
 border: 1px solid rgba(108, 120, 98, 0.22);
 border-radius: 6px;
 outline: none;
 transition: border-color 0.25s ease;
}

.home-auth-field input:focus-visible {
 border-color: #6b9080;
}

.home-auth-captcha {
 display: flex;
 gap: 0.5rem;
 align-items: flex-end;
}

.home-auth-captcha .home-auth-field {
 flex: 1;
}

.home-auth-captcha img {
 height: 38px;
 width: 110px;
 border-radius: 6px;
 cursor: pointer;
 border: 1px solid rgba(108, 120, 98, 0.22);
}

.home-auth-code-row {
 display: flex;
 gap: 0.5rem;
}

.home-auth-code-row input {
 flex: 1;
}

.home-auth-code-btn {
 flex-shrink: 0;
 padding: 0 0.8rem;
 font-size: 0.78rem;
 font-family: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "Georgia", serif;
 color: #6b9080;
 background: transparent;
 border: 1px solid rgba(107, 144, 128, 0.3);
 border-radius: 6px;
 cursor: pointer;
 transition: border-color 0.2s ease;
 white-space: nowrap;
}

.home-auth-code-btn:hover:not(:disabled) {
 border-color: rgba(107, 144, 128, 0.55);
}

.home-auth-code-btn:disabled {
 color: #b3a89c;
 border-color: rgba(108, 120, 98, 0.18);
 cursor: not-allowed;
}

.home-auth-error {
 margin: 0;
 min-height: 1rem;
 font-size: 0.78rem;
 color: #b07a6a;
 line-height: 1.4;
}

.home-auth-submit {
 margin-top: 0.3rem;
 padding: 0.6rem 1rem;
 font-size: 0.88rem;
 font-family: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "Georgia", serif;
 color: #f6f1e7;
 background: #6b9080;
 border: none;
 border-radius: 8px;
 cursor: pointer;
 transition: background-color 0.25s ease;
}

.home-auth-submit:hover {
 background: #5a7a6c;
}

.home-auth-link-btn {
 display: block;
 width: 100%;
 margin-top: 0.6rem;
 padding: 0.3rem 0;
 font-size: 0.8rem;
 font-family: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "Georgia", serif;
 color: #8b7355;
 background: transparent;
 border: none;
 cursor: pointer;
 transition: color 0.25s ease;
}
.home-auth-link-btn:hover {
 color: #6b9080;
}

.dark-mode .home-auth-modal {
 background: #1f1d19;
 border-color: rgba(218, 211, 190, 0.13);
 box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}
.dark-mode .home-auth-title { color: #e0ddd5; }
.dark-mode .home-auth-close:hover { background: rgba(218, 211, 190, 0.1); color: #e0ddd5; }
.dark-mode .home-auth-field input {
 background: rgba(40, 38, 34, 0.5);
 color: #e0ddd5;
 border-color: rgba(218, 211, 190, 0.18);
}
.dark-mode .home-auth-tabs { border-bottom-color: rgba(218, 211, 190, 0.13); }
.dark-mode .home-auth-captcha img { border-color: rgba(218, 211, 190, 0.18); background: #2a2823; }

.account-modal {
 max-width: 420px;
 max-height: 90vh;
 overflow-y: auto;
}

.account-hero {
 display: flex;
 align-items: center;
 gap: 0.9rem;
 padding: 0.8rem 0 1.1rem;
 border-bottom: 1px dashed rgba(108, 120, 98, 0.2);
 margin-bottom: 1rem;
}
.account-avatar-wrap {
 position: relative;
 width: 56px;
 height: 56px;
 flex-shrink: 0;
}
.account-avatar-wrap img {
 width: 100%;
 height: 100%;
 border-radius: 50%;
 object-fit: cover;
 border: 2px solid rgba(108, 120, 98, 0.15);
}
.account-avatar-placeholder {
 width: 100%;
 height: 100%;
 border-radius: 50%;
 background: linear-gradient(135deg, #6b9080, #7a9bb5);
 color: #f6f1e7;
 display: flex;
 align-items: center;
 justify-content: center;
 font-size: 1.4rem;
 font-weight: 600;
 font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
}
.account-avatar-edit {
 position: absolute;
 bottom: -2px;
 right: -2px;
 width: 22px;
 height: 22px;
 border-radius: 50%;
 background: #6b9080;
 color: #f6f1e7;
 border: 2px solid #f6f1e7;
 display: flex;
 align-items: center;
 justify-content: center;
 cursor: pointer;
 transition: transform 0.2s ease, background 0.2s ease;
}
.account-avatar-edit:hover {
 transform: scale(1.1);
 background: #5a7a6c;
}
.account-avatar-edit:disabled {
 opacity: 0.5;
 cursor: not-allowed;
}
.account-hero-info {
 min-width: 0;
 flex: 1;
}
.account-hero-name {
 font-size: 1rem;
 font-weight: 600;
 color: #3d3530;
 letter-spacing: 0.3px;
 margin-bottom: 0.2rem;
}
.account-hero-email {
 font-size: 0.78rem;
 color: #8a7e72;
}

.home-auth-field textarea {
 width: 100%;
 padding: 0.55rem 0.7rem;
 font-size: 0.85rem;
 font-family: inherit;
 color: #3d3530;
 background: rgba(255, 255, 255, 0.5);
 border: 1px solid rgba(108, 120, 98, 0.22);
 border-radius: 8px;
 resize: vertical;
 line-height: 1.5;
 transition: border-color 0.2s ease, box-shadow 0.2s ease;
 box-sizing: border-box;
}
.home-auth-field textarea:focus {
 outline: none;
 border-color: #6b9080;
 box-shadow: 0 0 0 3px rgba(107, 144, 128, 0.1);
}
.home-auth-field textarea:disabled {
 background: rgba(108, 120, 98, 0.08);
 color: #8a7e72;
 cursor: not-allowed;
}

.account-tabs .home-auth-tab {
 flex: 1;
 text-align: center;
 padding: 0.45rem 0.4rem;
}

.account-notify-hint {
 margin: 0 0 0.8rem;
 font-size: 0.8rem;
 color: #8a7e72;
 line-height: 1.5;
}
.account-notify-row {
 display: flex;
 align-items: center;
 justify-content: space-between;
 padding: 0.7rem 0.8rem;
 background: rgba(108, 120, 98, 0.05);
 border: 1px solid rgba(108, 120, 98, 0.1);
 border-radius: 10px;
 cursor: pointer;
 margin-bottom: 0.6rem;
 transition: background 0.2s ease;
}
.account-notify-row:hover {
 background: rgba(108, 120, 98, 0.08);
}
.account-notify-info {
 display: flex;
 flex-direction: column;
 gap: 0.15rem;
}
.account-notify-title {
 font-size: 0.86rem;
 font-weight: 500;
 color: #3d3530;
}
.account-notify-desc {
 font-size: 0.74rem;
 color: #8a7e72;
}

.account-toggle {
 position: relative;
 display: inline-block;
 width: 40px;
 height: 22px;
 flex-shrink: 0;
}
.account-toggle input {
 opacity: 0;
 width: 0;
 height: 0;
}
.account-toggle-slider {
 position: absolute;
 cursor: pointer;
 inset: 0;
 background: rgba(108, 120, 98, 0.3);
 border-radius: 22px;
 transition: background 0.3s ease;
}
.account-toggle-slider::before {
 content: "";
 position: absolute;
 width: 16px;
 height: 16px;
 left: 3px;
 bottom: 3px;
 background: #f6f1e7;
 border-radius: 50%;
 transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
 box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.account-toggle input:checked + .account-toggle-slider {
 background: #6b9080;
}
.account-toggle input:checked + .account-toggle-slider::before {
 transform: translateX(18px);
}

.account-logout-btn {
 display: block;
 width: 100%;
 margin-top: 1.2rem;
 padding: 0.6rem;
 font-size: 0.84rem;
 letter-spacing: 1px;
 color: #c75450;
 background: rgba(199, 84, 80, 0.06);
 border: 1px solid rgba(199, 84, 80, 0.18);
 border-radius: 8px;
 cursor: pointer;
 transition: all 0.25s ease;
}
.account-logout-btn:hover {
 background: rgba(199, 84, 80, 0.12);
 border-color: #c75450;
}

.dark-mode .account-hero { border-bottom-color: rgba(218, 211, 190, 0.13); }
.dark-mode .account-avatar-wrap img { border-color: rgba(218, 211, 190, 0.15); }
.dark-mode .account-avatar-edit { border-color: #2a2823; }
.dark-mode .account-hero-name { color: #e0ddd5; }
.dark-mode .account-hero-email { color: #a89e92; }
.dark-mode .home-auth-field textarea {
 background: rgba(40, 38, 34, 0.5);
 color: #e0ddd5;
 border-color: rgba(218, 211, 190, 0.18);
}
.dark-mode .home-auth-field textarea:disabled {
 background: rgba(108, 120, 98, 0.12);
 color: #a89e92;
}
.dark-mode .account-notify-row {
 background: rgba(218, 211, 190, 0.04);
 border-color: rgba(218, 211, 190, 0.1);
}
.dark-mode .account-notify-row:hover { background: rgba(218, 211, 190, 0.07); }
.dark-mode .account-notify-title { color: #e0ddd5; }
.dark-mode .account-notify-desc { color: #a89e92; }
.dark-mode .account-toggle-slider { background: rgba(218, 211, 190, 0.2); }
.dark-mode .account-toggle-slider::before { background: #2a2823; }
.dark-mode .account-logout-btn {
 color: #e0807c;
 background: rgba(199, 84, 80, 0.1);
 border-color: rgba(199, 84, 80, 0.25);
}
.dark-mode .account-logout-btn:hover {
 background: rgba(199, 84, 80, 0.18);
 border-color: #e0807c;
}

@media (max-width: 480px) {
 .account-modal { max-width: 100%; padding: 1.4rem 1.2rem 1.2rem; }
 .account-hero { gap: 0.7rem; padding: 0.6rem 0 0.9rem; }
 .account-avatar-wrap { width: 48px; height: 48px; }
 .account-tabs .home-auth-tab { font-size: 0.8rem; padding: 0.4rem 0.2rem; }
}