* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

html, body {
    height: 100%;
    overflow: hidden;
    background: #ddd;
    color: #333;
}

body {
    min-height: 100vh;
}

.header {
    height: 50px;
    background: #ddd;
    color: #333;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;

    /* 让标题垂直居中，并留出左右内边距 */
    display: flex;
    align-items: center;
    padding: 0 20px;
}

.header .title {
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 1px;
}

/* header 高 50px，底部留 30px（原 footer 位置），两侧各 10px */
.main {
    position: relative;
    margin: 50px 10px 30px 10px;
    height: calc(100% - 80px);
    background: #333;
    border-radius: 20px;
    overflow-y: auto;
    overflow-x: hidden;
}

.box {
    position: relative;
    width: calc(100% - 20px);
    margin: 10px;
    background: #333;
    height: auto;
	padding: 20px;
	
    /* 用 grid 做卡片网格布局 */
    display: grid;
    grid-template-columns: repeat(auto-fill, 80px);
    gap: 20px;
    justify-content: space-between;
    align-content: start;
}
@media (max-width: 768px) {
    .box {
        gap: 10px;
    }
}

.item {
    width: 80px;
    height: 80px;
    background: #2966a0;
    border-radius: 10px;
    color: #ddd;
    font-size: 14px;
    line-height: 1.4;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6px;
    cursor: pointer;
    user-select: none;
    word-break: break-all;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.item:hover {
    background: #3280c9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.item:active {
    transform: translateY(0);
}

/* 空状态：让提示在 box 内水平垂直居中 */
.box.empty-mode {
    min-height: calc(100vh - 140px);
}

.empty-tip {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #888;
    font-size: 14px;
    padding: 20px;
    text-align: center;
    white-space: nowrap;   /* 防止文字一个字一行 */
}



/*  滚动条美化（8px） */
.main::-webkit-scrollbar {
    width: 8px;
}
.main::-webkit-scrollbar-track {
    background: #2a2a2a;
    border-radius: 10px;
    margin: 10px 0;
}
.main::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 10px;
    border: 2px solid #2a2a2a;
}
.main::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* Firefox */
.main {
    scrollbar-width: thin;
    scrollbar-color: #555 #2a2a2a;
}


/*登录模式：让表单居中在 box 内*/
.box.login-mode {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 140px); /* 让 box 撑满 main，表单视觉居中 */
}

/* 登录表单 */
.login-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.login-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.password-input {
    width: 220px;
    height: 40px;
    padding: 0 14px;
    border: none;
    border-radius: 8px;
    background: #444;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: box-shadow 0.2s;
}
.password-input::placeholder {
    color: #999;
}
.password-input:focus {
    box-shadow: 0 0 0 2px #2966a0;
}

.login-btn {
    height: 40px;
    padding: 0 22px;
    border: none;
    border-radius: 8px;
    background: #2966a0;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}
.login-btn:hover  { background: #3280c9; }
.login-btn:active { background: #1e4f7d; transform: translateY(1px); }

.login-error {
    color: #ff6b6b;
    font-size: 13px;
}




/* 登录模式：让表单居中在 box 内*/
.box.login-mode {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 140px);
}

/* 登录表单 */
.login-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.login-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.password-input {
    width: 220px;
    height: 40px;
    padding: 0 14px;
    border: none;
    border-radius: 8px;
    background: #444;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: box-shadow 0.2s;
}
.password-input::placeholder { color: #999; }
.password-input:focus { box-shadow: 0 0 0 2px #2966a0; }

.login-btn {
	display:inline-block;
    height: 40px;
    line-height: 40px;
	width:50px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: #2966a0;
    color: #fff;
    font-size: 14px;
	


    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}
.login-btn:hover  { background: #3280c9; }
.login-btn:active { background: #1e4f7d; transform: translateY(1px); }

.login-error {
    color: #ff6b6b;
    font-size: 13px;
    min-height: 16px;
}

/* 退出按钮*/
.logout-btn {
    display: none;
    margin-left: auto;
    padding: 6px 14px;
    border-radius: 6px;
    background: #2966a0;
    color: #fff;
    font-size: 13px;
    text-decoration: none;
    transition: background 0.2s;
}
.logout-btn.visible { display: inline-block; }
.logout-btn:hover   { background: #3280c9; }















