body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    -webkit-app-region: drag;
    user-select: none;
}

body :not(.username-input):not(.custom-dropdown):not(.dropdown-item):not(.custom-input):not(.dropdown-arrow) {
    -webkit-app-region: drag;
    user-select: none;
}

*:focus {
    outline: none;
}

body {
    background: none; 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: fixed;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* 背景容器 */
.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* 置于内容下方 */
    pointer-events: none; /* 不干扰交互 */
}

/* 顶部背景 */
.bg-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 150px; /* 根据实际图片高度调整 */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* 中间背景 */
.bg-mid {
    position: absolute;
    top: 150px; /* 与顶部图片高度一致 */
    left: 0;
    width: 100%;
    height: calc(100% - 150px - 200px); /* 减去顶部和底部高度 */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* 底部背景 */
.bg-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px; /* 根据实际图片高度调整 */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* 内容容器 */
.content-container {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 1;
}


.container {
    position: relative;
    width: 100%;
    height: 100%;
}

/* 窗口控制按钮 */
.window-controls {
    position: absolute;
    top: 6px;
    right: 19px;
    display: flex;
    gap: 31px;
}

.window-btn {
    display: block;
}

.window-btn input {
    -webkit-app-region: no-drag;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
}

.minimize-btn {
    position: relative;
    right: 31px;
}

/* 快速链接 */
.quick-links {
    position: absolute;
    bottom: 150px;
    left: 0;
    width: 100%;
}

.quick-link-item {
    display: block;
    position: absolute;
    bottom: 0;
}

.quick-link-item input {
    -webkit-app-region: no-drag;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
}

.link-1 {
    left: 0px;
}

.link-2 {
    left: 133px;
}

.link-3 {
    left: 266px;
}

.link-4 {
    left: 399px;
}

.link-5 {
    left: 532px;
}

.link-6 {
    left: 665px;
}

/* 推广链接 */
.promo-link {
    position: absolute;
    bottom: 270px;
    right: 80px;
}

.promo-link input {
    -webkit-app-region: no-drag;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
}

/* 登录表单 */
.login-form {

    position: absolute;
    bottom: 30px;
    right: 47px;
}

.username-input {
    display: block;
    position: absolute;
    bottom: 89px;
    right: 278px;
}

.password-input {
    display: block;
    position: absolute;
    bottom: 34px;
    right: 278px;
    -webkit-app-region: no-drag;
}

.remember-checkbox {
    display: block;
    position: absolute;
    bottom: 30px;
    right: 247px;
}

.remember-checkbox label {
    -webkit-app-region: no-drag;
}

.login-btn {
    border: solid 1px red;
    display: block;
    position: absolute;
    bottom: 82px;
    right: 0;
}

.register-btn {
    display: block;
    position: absolute;
    bottom: 30px;
    right: 0;
}

.login-btn input,
.register-btn input {
    -webkit-app-region: no-drag;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
}

/* 输入框样式 */
.custom-input {
    width: 144px;
    height: 26px;
    border: 2px solid #2196F3;
    border-radius: 4px;
    outline: none;
    background-color: #dbf3ff;
    transition: 
        border-color 0.3s ease,
        box-shadow 0.3s ease;
    padding: 0 5px;
    font-size: 14px;
}

.custom-input:focus {
    border-color: #ccc;
    box-shadow: 0 0 4px rgba(33, 150, 243, 0.3);
}

.custom-input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* 复选框样式 */
.custom-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}


.custom-checkbox,
.custom-checkbox *,
#inputremember,
.checkmark {
    -webkit-app-region: no-drag !important;
    user-select: auto !important;
    cursor: pointer !important;
    pointer-events: auto !important;
}

.sr-only {
    -webkit-app-region: drag;
    position: absolute;
    width: 18px;  /* 与 checkmark 相同大小 */
    height: 18px;
    opacity: 0;   /* 完全透明但可点击 */
    cursor: pointer;
    z-index: 1;   /* 确保在 checkmark 上方 */
    margin: 0;
    padding: 0;
}

.checkmark {
    --size: 18px;
    position: relative;
    width: var(--size);
    height: var(--size);
    border: 2px solid #95a5a6;
    border-radius: 4px;
    transition: 
        border-color 0.2s,
        background-color 0.2s;
}

input:checked ~ .checkmark {
    border-color: #3498db;
    background-color: #3498db;
}

.checkmark::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.2s;
}

input:checked ~ .checkmark::after {
    opacity: 1;
}

input:focus ~ .checkmark {
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

input:disabled ~ .checkmark {
    opacity: 0.6;
    background-color: #ecf0f1;
}

input:disabled ~ .label-text {
    color: #95a5a6;
}

/* 注册页面 */
.register-page {
    display: none;
    position: absolute;
    bottom: 0px;
    left: 0px;
    width: 100%;
    height: 151px;
    background: url('regpage.png');
}

.register-form {
    position: relative;
    width: 100%;
    height: 100%;
}

.reg-name-input {
    display: block;
    position: absolute;
    bottom: 103px;
    left: 122px;
}

.reg-pass-input {
    display: block;
    position: absolute;
    bottom: 59px;
    left: 122px;
}

.reg-pass-confirm-input {
    display: block;
    position: absolute;
    bottom: 15px;
    left: 122px;
}

.reg-phone-input {
    display: block;
    position: absolute;
    bottom: 59px;
    left: 444px;
    -webkit-app-region: no-drag;
}

.reg-code-input {
    display: block;
    position: absolute;
    bottom: 15px;
    left: 444px;
    -webkit-app-region: no-drag;
}

.reg-sex-radio {
    display: block;
    position: absolute;
    bottom: 105px;
    left: 462px;
    -webkit-app-region: no-drag;
}

.reg-confirm-btn {
    display: block;
    position: absolute;
    bottom: 82px;
    right: 47px;
}

.reg-cancel-btn {
    display: block;
    position: absolute;
    bottom: 30px;
    right: 47px;
}

.reg-name-input input,
.reg-pass-input input,
.reg-pass-confirm-input input,
.reg-phone-input input,
.reg-code-input input,
.reg-confirm-btn input,
.reg-cancel-btn input {
    -webkit-app-region: no-drag;
    border: none;
    background: transparent;
}

/* 注册页面特殊输入框 */
.phone-input {
    width: 166px;
}

.code-input {
    width: 80px;
}

/* 单选按钮样式 */
.custom-radio input[type="radio"] {
    opacity: 0;
    position: absolute;
    -webkit-app-region: no-drag;
}

.custom-radio .radio-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 0px solid #666;
    border-radius: 50%;
    position: relative;
    vertical-align: middle;
    margin-right: 50px;
    transition: all 0.3s;
}

.custom-radio input:checked + .radio-icon {
    border-color: #2196F3;
    background: #e3f2fd;
}

.custom-radio input:checked + .radio-icon::after {
    content: "";
    position: absolute;
    width: 12px;
    height: 12px;
    background: #2196F3;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: radio-check 0.3s ease-out;
}

.custom-radio input:disabled + .radio-icon {
    opacity: 0.6;
    background: #eee;
}

/* 验证码按钮 */
.get-code-btn {
    background: #0ba217;
    color: white;
    border: 2px solid #2196F3;
    padding: 6px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.3s;
    white-space: nowrap;
    width: 80px;
    font-size: 14px;
}

.get-code-btn:disabled {
    background: #bd3232;
    cursor: not-allowed;
}

/* 对话框 */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    display: none;
    z-index: 1000;
}

.dialog-box {
    background: url('tips.png');
    width: 500px;
    height: 250px;
    border-radius: 1px;
    display: block;
    position: relative;
    pointer-events: auto;

}

.dialog-content {
    margin-top: 80px;
    margin-left: 100px;
}

.dialog-text {
    width: 360px;
    height: 100px;
    user-select: none;
    margin: 0;
    padding: 0;
    font-size: 16px;
    color: #333;
}

.dialog-close-btn {
    margin-left: 370px;
    margin-top: -8px;
}

.dialog-close-btn img  {
    user-select: auto;
    cursor: pointer;
    display: block;
    width: auto;
    height: auto;
}


/* 动画 */
@keyframes radio-check {
    0% {
        transform: translate(-50%, -50%) scale(0);
    }
    70% {
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

/* 进度条相关（虽然未使用但保留） */
.progress-bar {
    background-color: #f1f1f1;
}

.progress {
    width: 0;
    height: 30px;
    background-color: #4CAF50;
    transition: width 2s;
}

.progress-bar-text {
    text-align: center;
    line-height: 30px;
    color: rgb(0, 0, 0);
    position: absolute;
    width: 100%;
}

.loading-container {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px; /* 图片和转圈之间的间距 */
    top: 50%;
    left: 56%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.spinner-svg {
    animation: rotate 2s linear infinite;
}

.spinner-circle {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: 0;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
    100% { transform: rotate(360deg); }
}

@keyframes dash {
    0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
    50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
    100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}
/* 自定义下拉列表 - 从上方弹出 */
.custom-dropdown {
    position: absolute;
    bottom: 100%; /* 改为从底部向上弹出 */
    left: 0;
    width: 154px;
    max-height: 200px;
    overflow-y: auto;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1); /* 阴影方向调整 */
    display: none;
    z-index: 1000;
    margin-bottom: 5px; /* 与输入框的间距 */
}

.custom-dropdown.show {
    display: block;
}

.dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    color: #333;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: #f5f5f5;
}

.dropdown-item:first-child {
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.dropdown-item:last-child {
    border-bottom: none;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
}

/* 下拉箭头 */
.dropdown-arrow {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #2196F3;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    user-select: none;
    pointer-events: auto; /* 确保可以点击 */
}

.dropdown-arrow:hover {
    color: #1976D2;
}


/* 明确设置需要交互的元素 */
.username-input,
.custom-dropdown,
.dropdown-item,
.custom-input {
    -webkit-app-region: no-drag;
    user-select: auto;
}

/* 确保所有交互元素可点击 */
.custom-checkbox,
.custom-checkbox *,
#inputremember,
.checkmark,
.custom-radio,
.custom-radio *,
.custom-radio input[type="radio"],
.radio-icon,
.get-code-btn,
.window-btn,
.quick-link-item,
.promo-link,
.login-btn,
.register-btn,
.reg-confirm-btn,
.reg-cancel-btn,
.dialog-overlay {
    -webkit-app-region: no-drag !important;
    user-select: auto !important;
    cursor: pointer !important;
    pointer-events: auto !important;
}