/* ==========================================================================
   精简样式表 - 内部管理系统
   移除Bootstrap依赖，使用纯CSS实现
   ========================================================================== */

/* CSS Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 全局样式 */
body {
    padding: 20px;
    background: #f0f2f5;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

/* 移除按钮聚焦外框 */
button:focus,
button:active,
input:focus,
textarea:focus {
    outline: none !important;
}

/* 加载画面 */
#pageLoader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f7fafc;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

#pageLoader.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e9ecef;
    border-top: 4px solid #add8e6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loader-text {
    margin-top: 20px;
    color: #8898aa;
    font-size: 14px;
    font-weight: 500;
}

/* 按钮内联spinner */
.btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 4px;
}

/* Toast容器 - 固定定位 */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

/* 容器 */
.container {
    max-width: 500px;
    margin: 50px auto;
    padding: 0 15px;
}

/* 标题 */
.system-title {
    text-align: center;
    font-size: 28px;
    font-weight: bold;
    color: #333;
    margin-bottom: 30px;
    margin-top: 20px;
}

/* Toast 提示框 */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    width: 90%;
    max-width: 400px;
}

.toast-message {
    padding: 16px 24px;
    margin-bottom: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: none;
    animation: slideDown 0.3s ease;
    font-size: 14px;
    color: #fff;
    font-weight: 500;
}

.toast-success {
    background: #52c41a;
    color: #fff;
}

.toast-error {
    background: #ff4d4f;
    color: #fff;
}

.toast-warning {
    background: #faad14;
    color: #fff;
}

.toast-info {
    background: #1890ff;
    color: #fff;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.toast-message.hiding {
    animation: slideUp 0.3s ease forwards;
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* 面板 */
.panel {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.panel:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.panel-heading {
    padding: 18px 24px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    background: #f8f9fa;
}

.panel-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #32325d;
}

.panel-body {
    padding: 24px;
}

.panel-primary .panel-heading {
    background: #a8dadc;
    color: #1d3557;
    border-bottom: none;
}

.panel-primary .panel-title {
    color: #1d3557;
}

.panel-success .panel-heading {
    background: #7bed9f;
    color: #1e5631;
    border-bottom: none;
}

.panel-success .panel-title {
    color: #1e5631;
}

.panel-warning .panel-heading {
    background: #ffd4a3;
    color: #8b5a00;
    border-bottom: none;
}

.panel-warning .panel-title {
    color: #8b5a00;
}

.panel-danger .panel-heading {
    background: #ffb3ba;
    color: #8b1e23;
    border-bottom: none;
}

.panel-danger .panel-title {
    color: #8b1e23;
}

.text-center { text-align: center; }
.text-muted { color: #8898aa; }

/* 按钮 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    text-decoration: none;
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
    border-radius: 8px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-primary { background: #a8dadc; color: #1d3557; }
.btn-success { background: #7bed9f; color: #1e5631; }
.btn-info { background: #add8e6; color: #1e4d6b; }
.btn-warning { background: #ffd4a3; color: #8b5a00; }
.btn-danger { background: #ffb3ba; color: #8b1e23; }
.btn-default {
    background: #fff;
    color: #525f7f;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.btn-primary:hover { background: #8fc9cc; color: #1d3557; }
.btn-success:hover { background: #6ad98b; color: #1e5631; }
.btn-info:hover { background: #94c7d6; color: #1e4d6b; }
.btn-warning:hover { background: #f5c78e; color: #8b5a00; }
.btn-danger:hover { background: #ff9ea6; color: #8b1e23; }
.btn-default:hover {
    background: #f7fafc;
    color: #525f7f;
    border-color: #dee2e6;
}

.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* 表单 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-control {
    display: block;
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.form-control:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.form-control[readonly] {
    background-color: #f8f9fa;
    cursor: not-allowed;
    border-color: #e9ecef;
}

/* Grid系统 */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -7.5px;
}

.col-xs-5, .col-xs-7 {
    padding: 0 7.5px;
}

.col-xs-5 { width: 41.666667%; }
.col-xs-7 { width: 58.333333%; }

/* 首页样式 */
.home-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.home-main {
    max-width: 500px;
    width: 100%;
}

.home-title {
    text-align: center;
    font-size: 32px;
    font-weight: bold;
    color: #333;
    margin-bottom: 40px;
}

.btn-wrapper {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.login-btn {
    height: 60px;
    font-size: 18px;
    margin-bottom: 15px;
    border-radius: 8px;
    border: none;
    transition: all 0.3s ease;
}

.login-btn:last-child {
    margin-bottom: 0;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-user {
    background: #7bed9f;
    color: #1e5631;
    border: none;
}

.btn-user:hover {
    background: #6ad98b;
    color: #1e5631;
}

.btn-admin {
    background: #add8e6;
    color: #1e4d6b;
    border: none;
}

.btn-admin:hover {
    background: #94c7d6;
    color: #1e4d6b;
}

/* 登录页面 */
.login-tip {
    text-align: center;
    color: #888;
    margin-bottom: 20px;
    font-size: 14px;
}

.login-btn-wrapper {
    padding: 40px 20px;
}

.btn-send-code {
    min-width: 120px;
}

#countdown {
    display: none;
}

/* 二维码容器 */
#qrcodeContainer {
    text-align: center;
    padding: 20px;
}

#qrcodeImg {
    max-width: 250px;
    border: 1px solid #ddd;
    padding: 10px;
    background: #fff;
    border-radius: 8px;
}

/* 用户头像 */
.user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 20px auto;
    display: block;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 消息样式 */
.success-message,
.error-message {
    text-align: center;
    font-size: 24px;
    padding: 20px;
}

.success-message { color: #52c41a; }
.error-message { color: #ff4d4f; }

.error-icon {
    font-size: 64px;
    color: #ff4d4f;
    margin-bottom: 20px;
}

/* Alert */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-warning {
    color: #8a6d3b;
    background-color: #fcf8e3;
    border-color: #faebcc;
}

.alert .close {
    float: right;
    font-size: 21px;
    font-weight: bold;
    line-height: 1;
    color: #000;
    opacity: 0.2;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.alert .close:hover {
    opacity: 0.5;
}

/* 响应式 */
@media (max-width: 768px) {
    body {
        margin: 20px auto;
        padding: 15px;
    }

    .home-title {
        font-size: 24px;
    }

    .btn-wrapper {
        padding: 30px 20px;
    }

    /* 手机端增加行间距 */
    .form-group {
        margin-bottom: 24px;
    }

    .panel-body {
        padding: 20px 15px;
        line-height: 1.8;
    }

    table {
        line-height: 1.6;
    }

    th, td {
        padding: 10px 6px;
        line-height: 1.5;
    }

    .btn {
        padding: 12px 20px;
        margin-bottom: 8px;
    }

    .toolbar {
        gap: 12px;
        margin-bottom: 15px;
    }
}

/* 模态框统一样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-header {
    font-size: 18px;
    font-weight: bold;
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-close {
    position: absolute;
    right: 15px;
    top: 15px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

/* 确认弹窗动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}
