/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #f5f5f5;
}

a {
    color: #1890ff;
    text-decoration: none;
}

a:hover {
    color: #40a9ff;
}

/* 布局 */
.wrap {
    min-height: calc(100vh - 60px);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 导航栏 */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 0;
    margin-bottom: 20px;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.navbar-brand a {
    color: #fff;
    font-size: 20px;
    font-weight: bold;
}

.navbar-menu {
    display: flex;
    align-items: center;
}

.nav {
    display: flex;
    list-style: none;
    gap: 20px;
}

.nav li a {
    color: rgba(255,255,255,0.9);
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.3s;
}

.nav li a:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.nav-right {
    margin-left: 30px;
    align-items: center;
}

.nav-right span {
    color: rgba(255,255,255,0.9);
    margin-right: 15px;
}

.nav-right a {
    color: #fff;
    background: rgba(255,255,255,0.2);
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 13px;
}

.nav-right a:hover {
    background: rgba(255,255,255,0.3);
}

/* 登录页面 */
.login-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-box {
    width: 100%;
    max-width: 400px;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
    color: #fff;
}

.login-logo h1 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.login-logo p {
    font-size: 16px;
    opacity: 0.9;
}

.login-form-box {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 15px;
    color: #999;
    z-index: 1;
}

.form-control {
    width: 100%;
    height: 48px;
    padding: 0 15px 0 45px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
    outline: none;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control::placeholder {
    color: #bfbfbf;
}

/* 错误提示 */
.help-block {
    color: #ff4d4f;
    font-size: 12px;
    margin-top: 5px;
}

.has-error .form-control {
    border-color: #ff4d4f;
}

/* 记住我 */
.remember-me {
    margin-bottom: 24px;
}

.remember-me input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    cursor: pointer;
}

.remember-me label {
    cursor: pointer;
    color: #666;
    font-size: 14px;
}

/* 登录按钮 */
.btn-login {
    width: 100%;
    height: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-login:active {
    transform: translateY(0);
}

/* 登录页脚 */
.login-footer {
    text-align: center;
    margin-top: 24px;
    color: rgba(255,255,255,0.7);
    font-size: 13px;
}

/* 页脚 */
.footer {
    background: #fff;
    border-top: 1px solid #e8e8e8;
    padding: 20px 0;
    text-align: center;
    color: #999;
    font-size: 13px;
}

/* 首页 */
.site-index {
    padding: 40px 0;
}

/* 模块网格 */
.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

/* 模块卡片 */
.module-card {
    background: #fff;
    border-radius: 12px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    border: 1px solid #e8e8e8;
}

.module-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.15);
    border-color: #667eea;
}

.module-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.module-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.module-desc {
    font-size: 14px;
    color: #999;
}

/* 管理员管理页面 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

/* 导航标签 */
.nav-tabs {
    display: flex;
    border-bottom: 1px solid #e8e8e8;
    margin-bottom: 24px;
}

.nav-tabs a {
    padding: 12px 24px;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.nav-tabs a:hover {
    color: #667eea;
}

.nav-tabs a.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 500;
}

/* 表格容器 */
.table-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
}

/* 数据表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.data-table th {
    background: #fafafa;
    font-weight: 500;
    color: #666;
}

.data-table tr:hover {
    background: #fafafa;
}

.data-table .text-center {
    text-align: center;
    color: #999;
    padding: 40px;
}

/* 徽章 */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-left: 8px;
}

.badge-super {
    background: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

.badge-success {
    background: #f6ffed;
    color: #52c41a;
}

.badge-danger {
    background: #fff2f0;
    color: #ff4d4f;
}

.badge-primary {
    background: #e6f7ff;
    color: #1890ff;
}

.badge-info {
    background: #e6fffb;
    color: #13c2c2;
}

.badge-default {
    background: #f5f5f5;
    color: #999;
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.btn-primary:hover {
    opacity: 0.9;
    color: #fff;
}

.btn-default {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #d9d9d9;
}

.btn-default:hover {
    color: #667eea;
    border-color: #667eea;
}

.btn-back {
    background: #fff;
    color: #666;
    border: 1px solid #d9d9d9;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 13px;
}

.btn-edit {
    background: #e6f7ff;
    color: #1890ff;
    margin-right: 8px;
}

.btn-edit:hover {
    background: #1890ff;
    color: #fff;
}

.btn-delete {
    background: #fff2f0;
    color: #ff4d4f;
}

.btn-delete:hover {
    background: #ff4d4f;
    color: #fff;
}

/* 表单容器 */
.form-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 32px;
    max-width: 600px;
}

.admin-form .form-group {
    margin-bottom: 24px;
}

.admin-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.admin-form .required {
    color: #ff4d4f;
}

.admin-form .form-control {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
}

.admin-form .form-control:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.admin-form .form-help {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #999;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #f0f0f0;
}

/* 提示框 */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-danger {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: #ff4d4f;
}

.alert-success {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #52c41a;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    gap: 12px;
}

.page-info {
    color: #666;
    font-size: 14px;
}

.text-muted {
    color: #999;
}

/* AJAX 加载样式 */
.ajax-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-text {
    color: #667eea;
    font-size: 16px;
    font-weight: 500;
}

.ajax-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    z-index: 10000;
    display: none;
    animation: slideIn 0.3s ease;
}

.ajax-message.success {
    background: #52c41a;
}

.ajax-message.error {
    background: #ff4d4f;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 页面切换动画 - 已禁用 */
.container {
    /* animation: fadeIn 0.3s ease; */
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.jumbotron {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 60px 40px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 40px;
}

.jumbotron h1 {
    font-size: 36px;
    margin-bottom: 16px;
}

.jumbotron .lead {
    font-size: 18px;
    opacity: 0.9;
}

.body-content {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* 错误页面 */
.site-error {
    padding: 60px 40px;
    text-align: center;
    background: #fff;
    border-radius: 12px;
    margin-top: 40px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.site-error h1 {
    color: #ff4d4f;
    margin-bottom: 20px;
}

.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-danger {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: #ff4d4f;
}

/* 响应式 */
@media (max-width: 768px) {
    .login-form-box {
        padding: 30px 20px;
    }
    
    .login-logo h1 {
        font-size: 24px;
    }
    
    .jumbotron {
        padding: 40px 20px;
    }
    
    .jumbotron h1 {
        font-size: 24px;
    }
    
    /* 手机版导航栏 */
    .navbar .container {
        height: 50px;
        padding: 0 10px;
    }
    
    .navbar-brand a {
        font-size: 16px;
    }
    
    .nav {
        gap: 10px;
    }
    
    .nav li a {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .nav-right {
        margin-left: 10px;
    }
    
    .nav-right span {
        display: none;
    }
    
    /* 手机版模块网格 */
    .module-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 0 10px;
    }
    
    .module-card {
        padding: 30px 20px;
    }
    
    /* 手机版管理页面 */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 0 10px;
    }
    
    .page-header h1 {
        font-size: 20px;
    }
    
    .nav-tabs {
        padding: 0 10px;
    }
    
    .nav-tabs a {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    /* 手机版表格 */
    .table-container {
        margin: 0 10px;
        overflow-x: auto;
    }
    
    .data-table {
        min-width: 600px;
        font-size: 13px;
    }
    
    .data-table th,
    .data-table td {
        padding: 12px 8px;
    }
    
    .btn-sm {
        padding: 4px 8px;
        font-size: 12px;
    }
    
    /* 手机版表单 */
    .form-container {
        margin: 0 10px;
        padding: 20px;
    }
    
    .admin-form .form-group {
        margin-bottom: 20px;
    }
    
    .admin-form label {
        font-size: 14px;
    }
    
    .admin-form .form-control {
        height: 44px;
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    .form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-actions .btn {
        width: 100%;
        text-align: center;
    }
    
    /* 手机版分页 */
    .pagination {
        flex-wrap: wrap;
        gap: 8px;
        padding: 15px 10px;
    }
    
    .page-info {
        font-size: 13px;
        width: 100%;
        text-align: center;
        order: -1;
    }
    
    /* 手机版消息提示 */
    .ajax-message {
        left: 10px;
        right: 10px;
        top: 10px;
        text-align: center;
    }
}

/* 超小屏幕 */
@media (max-width: 375px) {
    .navbar-brand a {
        font-size: 14px;
    }
    
    .module-icon {
        width: 60px;
        height: 60px;
    }
    
    .module-icon svg {
        width: 36px;
        height: 36px;
    }
    
    .module-title {
        font-size: 18px;
    }
}

/* ==================== 位置码管理 ==================== */

/* 地点列表样式 */
.location-table .location-name {
    font-weight: 500;
    color: #333;
    font-size: 15px;
}

.location-table .location-address {
    color: #999;
    font-size: 12px;
    margin-top: 4px;
}

.location-table .link-text {
    color: #666;
    font-size: 12px;
    font-family: monospace;
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
}

.btn-copy {
    background: #e6f7ff;
    color: #1890ff;
}

.btn-copy:hover {
    background: #1890ff;
    color: #fff;
}

.btn-qrcode {
    background: #f6ffed;
    color: #52c41a;
}

.btn-qrcode:hover {
    background: #52c41a;
    color: #fff;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 500;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
    border-radius: 0 0 8px 8px;
}

/* 手机版弹窗 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-header {
        padding: 16px 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-footer {
        padding: 12px 20px;
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    /* 手机版地点列表 */
    .location-table {
        min-width: 100%;
    }
    
    .location-table td {
        display: block;
        padding: 8px 12px;
        border: none;
    }
    
    .location-table td:first-child {
        display: none;
    }
    
    .location-table td:nth-child(2) {
        padding-top: 12px;
        font-weight: 500;
    }
    
    .location-table td:nth-child(3) {
        padding-bottom: 4px;
    }
    
    .location-table td:last-child {
        display: flex;
        gap: 8px;
        padding-top: 4px;
        padding-bottom: 12px;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .location-table tr {
        display: block;
        margin-bottom: 12px;
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    }
    
    .location-table thead {
        display: none;
    }
}
