:root {
    --headerTitleColor--: #363636;
    --bookTitleColor--: #535455;
    --linkColor--: #364149;
    --linkHoverColor--: #db4429;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
}

.ew-link {
    text-decoration: none;
    color: var(--linkColor--);
}

.ew-link:hover {
    border-bottom: 1px solid;
    color: var(--linkHoverColor--);
}

.ew-book-title {
    margin: 15px 0;
    text-align: center;
    color: var(--bookTitleColor--);
}

/* 标题区登录/退出/忘记密码等操作链接的间距 */
.ew-auth-area .ew-link {
    margin-left: 12px;
}

/* 登录态：右上角用户信息（头像 + 昵称） */
.ew-user-info {
    display: inline-flex;
    align-items: center;
    margin-left: 12px;
    vertical-align: middle;
}

.ew-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #f0f0f0;
}

.ew-user-nickname {
    margin-left: 6px;
    font-size: 14px;
    font-weight: normal;
    color: var(--linkColor--);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 用户信息区内的退出按钮 */
.ew-logout-btn {
    margin-left: 10px;
    font-size: 14px;
}

/* 未登录：书架暗灰遮罩，强提醒登录（.ew-book 相对定位承载遮罩） */
.ew-login-mask {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    background: rgba(30, 30, 30, 0.62);
    border-radius: 4px;
}

.ew-login-mask-text {
    margin: 0;
    padding: 0 24px;
    color: #fff;
    font-size: 16px;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.ew-login-mask-btn {
    padding: 10px 38px;
    background: var(--linkHoverColor--);
    color: #fff !important;
    font-size: 16px;
    letter-spacing: 2px;
    border-radius: 22px;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    transition: background 0.2s, transform 0.2s;
}

.ew-login-mask-btn:hover {
    background: #c03a20;
    transform: translateY(-2px);
}

.ew-book {
    max-width: 920px;
    /* 保证兼容性 */
    width: calc(100% - 30px);
    width: -webkit-fill-available;
    width: -moz-available;
    width: stretch;
    margin: auto;
    box-sizing: border-box;
    padding-bottom: 2em;
    position: relative;
}

.ew-book-header {
    background: url('../images/bookshelftop.jpg') no-repeat left top / cover;
}

.ew-container {
    display: flex;
    align-items: center;
    padding: 5px 3em;
}

.ew-book-header-title {
    font-size: 18px;
    color: var(--headerTitleColor--);
}

.ew-book-header-link {
    margin-left: 8px;
}

.ew-book-content {
    box-sizing: border-box;
    padding-left: 4em;
    background: url('../images/bookshelfmiddle.jpg') repeat-y;
    background-size: 100% 196px;
    max-width: 920px;
    width: 100%;
}

.ew-book-content-box {
    display: flex;
    flex-wrap: wrap;
}

.ew-book-content-item {
    max-width: 130px;
    width: 33.333333%;
    height: 170px;
    box-sizing: border-box;
    margin-bottom: 26px;
}

.ew-book-content-item-box {
    margin: 18px 14px;
    box-sizing: border-box;
    height: calc(100% - 28px);
    width: calc(100% - 36px);
    position: relative;
}

.ew-book-content-item-box-link,
.ew-book-content-item-box-link-img {
    display: block;
    width: 100%;
    height: 100%;
}

.ew-tooltip:hover::before {
    content: "";
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px;
    border-color: transparent transparent #f5b745 transparent;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, calc(-50% - 8px));
}


.ew-tooltip:hover::after {
    content: attr(data-title);
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, calc(-50% + 18px));
    background-color: #f5b745;
    padding: 10px;
    border-radius: 8px;
    z-index: 999;
    color: #fff;
    white-space: pre;
    word-break: break-all;
    font-size: 14px
}

.ew-book-content-item-box-link:hover {
    border: none;
    box-shadow: 0 0 15px #0a0a0a;
}

@media screen and (max-width: 660px) {
    .ew-book-content {
        padding-left: .4em;
    }
}

.ew-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: url("../images/to-top.svg") no-repeat;
    background-size: contain;
    width: 35px;
    height: 35px;
    cursor: pointer;
    visibility: hidden;
}

.ew-to-top:hover {
    transform: scale(1.2);
}