/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.hidden {
    display: none !important;
}

.page {
    min-height: 100vh;
    background: #f5f7fa;
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f5f5f5;
    color: #666;
}

.btn-secondary:hover {
    background: #e8e8e8;
}

/* 登录页 */
.login-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 60px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.header-section {
    text-align: center;
    margin-bottom: 40px;
}

.title {
    font-size: 28px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 14px;
    color: rgba(255,255,255,0.8);
}

.form-section {
    background: #fff;
    border-radius: 16px;
    padding: 30px 20px;
    max-width: 400px;
    margin: 0 auto;
    width: 100%;
}

.input-wrap {
    margin-bottom: 20px;
}

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

.input {
    width: 100%;
    height: 48px;
    background: #f5f5f5;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 0 16px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.input:focus {
    outline: none;
    border-color: #667eea;
}

.remember-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.remember-text {
    font-size: 14px;
    color: #666;
}

.tip-section {
    margin-top: 24px;
    text-align: center;
}

.tip-title {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.tip-item {
    font-size: 13px;
    color: #667eea;
    font-weight: 500;
    margin-bottom: 4px;
}

.tip-desc {
    font-size: 12px;
    color: #999;
}

/* 首页 */
.home-container {
    padding-bottom: 40px;
}

.home-container .header-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.avatar-placeholder {
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
}

.user-detail {
    display: flex;
    flex-direction: column;
}

.username {
    font-size: 20px;
    font-weight: bold;
    color: #fff;
}

.role {
    font-size: 13px;
    color: rgba(255,255,255,0.8);
    margin-top: 4px;
}

.logout-btn {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
}

.stats-section {
    padding: 20px;
}

.section-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 16px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px 10px;
    text-align: center;
}

.stat-number {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 4px;
}

.stat-card.total .stat-number {
    color: #667eea;
}

.stat-card.compliant .stat-number {
    color: #4caf50;
}

.stat-card.violation .stat-number {
    color: #ff5722;
}

.stat-label {
    font-size: 13px;
    color: #666;
}

.quick-actions {
    padding: 0 20px;
}

.action-list {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
}

.action-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.3s;
}

.action-item:hover {
    background: #f8f9fa;
}

.action-item:last-child {
    border-bottom: none;
}

.action-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    margin-right: 16px;
}

.action-icon.add {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.action-icon.map {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.action-icon.list {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.action-icon.staff {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.action-info {
    flex: 1;
}

.action-name {
    display: block;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.action-desc {
    font-size: 13px;
    color: #999;
}

.arrow {
    font-size: 18px;
    color: #ccc;
}

/* 页面头部 */
.page-header {
    background: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.back-btn {
    background: none;
    border: none;
    color: #667eea;
    font-size: 15px;
    cursor: pointer;
}

.page-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

/* 门店列表 */
.store-list-container {
    padding: 16px;
}

.search-section {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.search-box {
    flex: 1;
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 24px;
    padding: 10px 16px;
}

.search-icon {
    font-size: 16px;
    margin-right: 8px;
    color: #999;
}

.search-input {
    flex: 1;
    border: none;
    background: none;
    font-size: 14px;
    outline: none;
}

.filter-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background: #fff;
    border-radius: 12px;
}

.filter-icon {
    font-size: 16px;
    margin-bottom: 2px;
}

.filter-text {
    font-size: 11px;
    color: #666;
}

.address-search-section {
    margin-bottom: 16px;
}

.address-search-box {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 24px;
    padding: 10px 16px;
}

.address-search-box .search-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 16px;
    font-size: 13px;
    cursor: pointer;
    margin-left: 8px;
}

.filter-panel {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.filter-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.filter-label {
    width: 60px;
    font-size: 14px;
    color: #666;
}

.filter-select {
    flex: 1;
    height: 40px;
    background: #f5f7fa;
    border: none;
    border-radius: 8px;
    padding: 0 12px;
    font-size: 14px;
}

.search-stats {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.stats-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.stats-close {
    font-size: 13px;
    color: #667eea;
    cursor: pointer;
}

.stats-item {
    font-size: 14px;
    color: #666;
}

.stats-item.warning {
    color: #ff5722;
}

.duplicate-warning {
    background: #fff3e0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid #ffcc80;
}

.warning-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.warning-icon {
    width: 24px;
    height: 24px;
    background: #ff5722;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    margin-right: 8px;
}

.warning-title {
    font-size: 15px;
    font-weight: bold;
    color: #e65100;
}

.store-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.store-item {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
}

.store-item.violation {
    border-left: 4px solid #ff5722;
}

.store-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.store-name {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
}

.status-badge.compliant {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-badge.violation {
    background: #ffebee;
    color: #c62828;
}

.store-info {
    margin-bottom: 12px;
}

.info-row {
    display: flex;
    margin-bottom: 8px;
    font-size: 13px;
}

.info-row .label {
    width: 70px;
    color: #999;
    margin-bottom: 0;
}

.info-row .value {
    flex: 1;
    color: #333;
}

.info-row .value.hidden {
    color: #999;
    font-style: italic;
}

.store-actions {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.action-btn {
    flex: 1;
    padding: 8px 0;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}

.action-btn.view {
    background: #e3f2fd;
    color: #1976d2;
}

.action-btn.edit {
    background: #f5f5f5;
    color: #666;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 16px;
}

.empty-text {
    font-size: 14px;
    color: #999;
}

.float-btn {
    position: fixed;
    right: 20px;
    bottom: 40px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* 表单页 */
.form-container {
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
}

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

.form-label .required {
    color: #ff5722;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    height: 48px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0 16px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-textarea {
    height: 100px;
    padding: 12px 16px;
    resize: vertical;
}

.location-inputs {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.location-inputs .form-input {
    flex: 1;
}

.compliance-result {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.compliance-result.success {
    background: #e8f5e9;
    color: #2e7d32;
}

.compliance-result.error {
    background: #ffebee;
    color: #c62828;
}

.form-actions {
    display: flex;
    gap: 12px;
}

.form-actions .btn {
    flex: 1;
}

/* 详情页 */
.detail-container {
    padding: 20px;
}

.detail-section {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.detail-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

/* 地图页 */
.map-container {
    padding: 16px;
}

.map-canvas {
    height: 400px;
    background: #e8eaf6;
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
}

.map-placeholder {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #666;
    text-align: center;
    padding: 20px;
}

.map-store-list {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    max-height: 300px;
    overflow-y: auto;
}

.search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.search-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 24px;
    padding: 10px 16px;
}

.search-bar .search-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
}

/* 高德地图自定义样式 */
.amap-marker-label {
    background: rgba(255,255,255,0.9);
    border: 1px solid #667eea;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    color: #333;
}

.amap-info-window {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* 地址选择行 - 左右排布 */
.address-select-row {
    display: flex;
    gap: 10px;
}

.address-select-row .form-select {
    flex: 1;
    min-width: 0;
}

/* 位置显示 */
.location-display {
    font-size: 12px;
    color: #667eea;
    font-weight: normal;
    margin-left: 8px;
}

/* 地图选址器 */
.map-picker-container {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.picker-map {
    height: 350px;
    width: 100%;
    background: #f5f5f5;
}

.map-picker-controls {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

.map-picker-controls .btn {
    flex: 1;
    padding: 12px 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.map-picker-controls .icon {
    font-size: 16px;
}

.map-picker-tip {
    padding: 10px 16px;
    background: #e3f2fd;
    border-top: 1px solid #e0e0e0;
}

.map-picker-tip p {
    margin: 0;
    font-size: 13px;
    color: #1976d2;
}

/* 地图选址器中的标记样式 */
.picker-map .amap-marker {
    z-index: 100;
}

/* 中心点标记 */
.map-center-marker {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -100%);
    width: 30px;
    height: 40px;
    pointer-events: none;
    z-index: 100;
}

.map-center-marker::after {
    content: '📍';
    font-size: 30px;
    position: absolute;
    top: 0;
    left: 0;
}

/* 员工管理 */
.staff-container {
    padding: 16px;
}

.staff-item {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}

.staff-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.staff-name {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.staff-role {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
}

.staff-role.admin {
    background: #ffebee;
    color: #c62828;
}

.staff-role.manager {
    background: #e8f5e9;
    color: #2e7d32;
}

.staff-role.staff {
    background: #f5f5f5;
    color: #666;
}

.staff-permissions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.permission-tag {
    padding: 4px 10px;
    background: #f5f5f5;
    color: #999;
    font-size: 12px;
    border-radius: 6px;
}

.permission-tag.active {
    background: #e3f2fd;
    color: #1976d2;
}

/* 弹窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-end;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    position: relative;
    background: #fff;
    width: 100%;
    max-height: 80vh;
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.modal-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.close-btn {
    width: 32px;
    height: 32px;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    font-size: 16px;
    color: #999;
    cursor: pointer;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    max-height: 60vh;
}

.permission-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.permission-section .section-label {
    font-size: 15px;
    font-weight: bold;
    color: #333;
    margin-bottom: 16px;
}

.permission-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
}

.permission-item label {
    font-size: 14px;
    color: #333;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px 24px;
    border-top: 1px solid #f0f0f0;
}

.modal-footer .btn {
    flex: 1;
}

/* PC端适配 */
@media screen and (min-width: 768px) {
    body {
        background: #f0f2f5;
    }
    
    .page {
        max-width: 1200px;
        margin: 0 auto;
        background: #f5f7fa;
        min-height: 100vh;
        box-shadow: 0 0 20px rgba(0,0,0,0.1);
    }
    
    .login-container {
        max-width: 100%;
    }
    
    .form-section {
        max-width: 450px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .stat-card {
        padding: 30px;
    }
    
    .stat-number {
        font-size: 36px;
    }
    
    .action-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        background: transparent;
    }
    
    .action-item {
        background: #fff;
        border-radius: 12px;
        border-bottom: none;
    }
    
    .store-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .modal-content {
        max-width: 500px;
        margin: 0 auto;
        border-radius: 20px;
        max-height: 90vh;
    }
    
    .float-btn:hover {
        transform: scale(1.05);
    }
}

@media screen and (min-width: 1200px) {
    .store-list {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .action-list {
        grid-template-columns: repeat(4, 1fr);
    }
}
