/* ==================== 基础与布局 ==================== */
* {
    box-sizing: border-box;
}

body {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

#app {
    width: 100%;
}

.container {
    width: 100%;
    max-width: 1100px;
    padding: 0 20px;
    margin: 0 auto;
}

[v-cloak] {
    display: none !important;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-block: 20px;
}

.nav-links {
    display: flex;
    gap: 15px;
}

.nav-links a {
    cursor: pointer;
    text-decoration: underline;
}

.nav-links a.active {
    font-weight: bold;
    color: #165dff;
    text-decoration: none;
}

main {
    min-height: calc(100vh - 200px);
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card {
    border: 1px solid #e5e6eb;
    padding: 20px;
    border-radius: 8px;
    margin-top: 15px;
    background: #fff;
}

.table-empty {
    text-align: center;
    color: #86909c;
    padding: 20px;
}

footer {
    width: 100%;
    text-align: center;
    margin-top: 40px;
    padding-block: 20px;
    color: #86909c;
    font-size: 14px;
}

/* ==================== 表格与表单 ==================== */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

th,
td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid #f2f3f5;
}

th {
    background-color: #f7f8fa;
    color: #4e5969;
    font-weight: 600;
}

.filter-bar {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
    padding: 15px 20px;
    margin: 20px 0;
    background-color: #f7f8fa;
    border: 1px solid #e5e6eb;
    border-radius: 6px;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #4e5969;
}

.filter-item select {
    padding: 6px 12px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    outline: none;
    min-width: 130px;
    cursor: pointer;
    background: #fff;
}

.form-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
}

.form-group-row {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.form-label {
    font-size: 14px;
    font-weight: 500;
    color: #4e5969;
    margin-bottom: 8px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    font-size: 14px;
    color: #1d2129;
    background-color: #f2f3f5;
    border: 1px solid transparent;
    border-radius: 6px;
    outline: none;
    transition: all 0.2s ease;
}

.form-input,
.form-select {
    height: 38px;
    padding: 0 12px;
}

.form-textarea {
    padding: 12px;
    resize: vertical;
}

.form-select {
    padding-right: 30px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%234e5969'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 18px;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    background-color: #ffffff;
    border-color: #165dff;
    box-shadow: 0 0 0 2px rgba(22, 93, 255, 0.15);
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    margin-top: 10px font-size: 14px;
    color: #4e5969;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"],
.checkbox-label input[type="radio"] {
    margin-right: 6px;
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #165dff;
}

/* ==================== 按钮样式 ==================== */
button {
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    border: none;
    border-radius: 6px;
    outline: none;
}

.btn {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.btn-group {
    display: flex;
    gap: 6px;
}

/* 合并冗余的 btn-default 与 btn-cancel */
.btn-default,
.btn-cancel {
    background-color: #f2f3f5;
    color: #4e5969;
}

.btn-default:hover,
.btn-cancel:hover {
    background-color: #e5e6eb;
    color: #1d2129;
}

.btn-submit {
    background-color: #165dff;
    color: #ffffff;
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 6px;
}

.btn-submit:hover {
    background-color: #0e42d2;
}

.btn-submit:disabled {
    background-color: #94bfff;
    cursor: not-allowed;
}

.btn-danger {
    background-color: #ffece8;
    color: #f53f3f;
}

.btn-danger:hover {
    background-color: #fde2e2;
    color: #e51616;
}

.btn-green {
    background-color: #e8ffea;
    color: #00b42a;
}

.btn-green:hover {
    background-color: #aff0b5;
}

.btn-reset {
    background: #fff;
    border: 1px solid #e5e6eb;
    color: #4e5969;
    padding: 6px 12px;
}

.btn-reset:hover {
    background: #f2f3f5;
}

/* ==================== 模态框与动画 ==================== */
/* 修复：display 不参与 transition，改用 visibility + opacity 实现真正的淡入动画 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(29, 33, 41, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal-container {
    background-color: #ffffff;
    width: 480px;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(29, 33, 41, 0.12);
    padding: 24px;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal-container {
    transform: scale(1);
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #1d2129;
    margin: 0 0 16px 0;
}

.modal-message {
    color: #4e5969;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ==================== 分页组件 ==================== */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    font-size: 14px;
    color: #4e5969;
}

.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination li {
    margin: 0 4px;
}

.pagination button {
    padding: 6px 12px;
    border: 1px solid #e5e6eb;
    background-color: #fff;
    cursor: pointer;
    border-radius: 4px;
    color: #1d2129;
    transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
    border-color: #165dff;
    color: #fff;
}

.pagination li.active button {
    background-color: #165dff;
    color: #fff;
    border-color: #165dff;
}

.pagination li.disabled button {
    color: #c9cdd4;
    cursor: not-allowed;
    background-color: #f7f8fa;
    border-color: #e5e6eb;
}

/* ==================== 登录组件 ==================== */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: calc(100vh - 100px);
}

.login-container .view-card {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
    width: 410px;
    border: 1px solid #f2f3f5;
}

.login-container h2 {
    margin-bottom: 24px;
    color: #1d2129;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
}

.login-container input[type="text"],
.login-container input[type="email"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #e5e6eb;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    background: #f7f8fa;
    transition: all 0.2s;
}

.login-container input:focus {
    border-color: #165dff;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(22, 93, 255, 0.15);
}

.login-container button {
    width: 100%;
    margin-top: 10px;
}

.login-container .message {
    margin-top: 15px;
    text-align: center;
    font-size: 14px;
    min-height: 20px;
}

.login-container .success {
    color: #00b42a;
}

.login-container .error {
    color: #f53f3f;
}

/* ==================== 加载状态指示器 ==================== */
@keyframes rotation {
    0% {
        transform: rotate(0deg)
    }

    100% {
        transform: rotate(360deg)
    }
}

@keyframes prixClipFix {
    0% {
        clip-path: polygon(50% 50%, 0 0, 0 0, 0 0, 0 0, 0 0)
    }

    25% {
        clip-path: polygon(50% 50%, 0 0, 100% 0, 100% 0, 100% 0, 100% 0)
    }

    50% {
        clip-path: polygon(50% 50%, 0 0, 100% 0, 100% 100%, 100% 100%, 100% 100%)
    }

    75% {
        clip-path: polygon(50% 50%, 0 0, 100% 0, 100% 100%, 0 100%, 0 100%)
    }

    100% {
        clip-path: polygon(50% 50%, 0 0, 100% 0, 100% 100%, 0 100%, 0 0)
    }
}

.loader {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    position: relative;
    animation: rotation 1s linear infinite;
    margin: 40px auto;
}

.loader::before,
.loader::after {
    content: "";
    box-sizing: border-box;
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 4px solid #e5e6eb;
    animation: prixClipFix 2s linear infinite;
}

.loader::after {
    border-color: #165dff;
    animation: prixClipFix 2s linear infinite, rotation 0.5s linear infinite reverse;
    inset: 4px;
}

.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.loading::after {
    content: "";
    position: absolute;
    top: calc(50% - 9px);
    left: calc(50% - 9px);
    display: inline-block;
    box-sizing: border-box;
    width: 18px;
    height: 18px;
    border: 2px solid #FFF;
    border-bottom-color: transparent;
    border-radius: 50%;
    animation: rotation 0.8s linear infinite;
}

.btn-default.loading::after,
.btn-danger.loading::after,
.btn-green.loading::after {
    border-color: #165dff;
    border-bottom-color: transparent;
}

/* 其它 */
.logout {
    padding: 4px 10px;
    margin-left: 10px;
}

.hr {
    border: none;
    border-top: 1px solid #f2f3f5;
    margin-bottom: 20px;
}

.btn-confirm {
    color: #fff;
    background-color: #f53f3f
}

.discount-format {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-active {
    color: #00b42a;
    font-weight: bold;
}

.status-inactive {
    color: #ff7d00;
    font-weight: bold;
}

.td-num {
    font-family: monospace;
    font-size: 12px;
}

.info-box {
    display: flex;
    align-items: center;
    background-color: #eef6ff;
    border: 1px solid #cce3ff;
    color: #0056b3;
    padding: 10px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

.info-box .icon {
    margin-right: 8px;
    font-size: 16px;
}

.info-box .tip-text {
    margin: 0;
    line-height: 1.5;
}