* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

/* iOS 安全区适配 */
body {
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* 提升触控体验：更大的可点击区域 */
button, .tab-btn, .checkbox-label {
    -webkit-tap-highlight-color: transparent;
}

/* 弹窗在移动端更易滚动 */
.detail-modal-content {
    max-height: min(80vh, 640px);
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 20px;
    text-align: center;
}

.userbar {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

#userStatusText {
    font-size: 13px;
    opacity: 0.95;
}

header h1 {
    font-size: 28px;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 14px;
    opacity: 0.9;
}

/* 标签页样式 */
.tab-section {
    background: #f8f9fa;
    padding: 0;
    border-bottom: 1px solid #eee;
}

.tabs {
    display: flex;
    gap: 0;
}

.tab-btn {
    flex: 1;
    padding: 15px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: white;
}

.history-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-small.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 详情按钮与弹窗 */
.label-with-detail {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.btn-detail {
    padding: 2px 10px;
    font-size: 12px;
    color: #667eea;
    background: transparent;
    border: 1px solid #667eea;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 8px;
}

.btn-detail:hover {
    background: #667eea;
    color: white;
}

.detail-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.detail-modal.show {
    display: flex;
}

.detail-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.detail-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.detail-modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.detail-modal-close {
    font-size: 24px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.detail-modal-close:hover {
    color: #333;
}

.detail-modal-body {
    padding: 20px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.7;
}

.detail-modal-body h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
}

.detail-modal-body p, .detail-modal-body ul {
    margin-bottom: 12px;
}

/* 登录/个人中心表单 - 大气美观，适配手机与PC */
.auth-form-body {
    padding: 24px 20px;
}

.auth-info {
    margin-bottom: 20px;
    color: #555;
    font-size: 15px;
    line-height: 1.6;
}

.auth-form-group {
    margin-bottom: 20px;
}

.auth-label {
    display: block;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 10px;
    color: #333;
}

.auth-input {
    width: 100%;
    padding: 16px 18px;
    font-size: 18px;
    line-height: 1.5;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    transition: border-color 0.3s, box-shadow 0.3s;
    -webkit-appearance: none;
    appearance: none;
}

.auth-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.auth-input::placeholder {
    color: #aaa;
}

.auth-select {
    cursor: pointer;
    background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 16px center;
    padding-right: 40px;
}

.auth-carrier-readonly {
    padding: 16px 18px;
    font-size: 18px;
    color: #555;
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
}

.auth-code-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: stretch;
}

.auth-code-input {
    min-width: 0;
}

.auth-send-code-btn {
    min-width: 0;
    padding: 16px 12px;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
}

.auth-actions {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-login-btn {
    padding: 18px 24px;
    font-size: 18px;
    font-weight: 600;
}

.auth-logout-btn {
    padding: 14px 20px;
    font-size: 16px;
}

.auth-hint {
    margin-top: 16px;
    font-size: 13px;
    color: #888;
    line-height: 1.6;
}

@media (min-width: 600px) {
    .detail-modal-content {
        max-width: 520px;
    }
    .auth-form-body {
        padding: 28px 24px;
    }
    .auth-input {
        padding: 18px 20px;
        font-size: 17px;
    }
}

@media (max-width: 480px) {
    .auth-form-body {
        padding: 20px 16px;
    }
    .auth-input {
        padding: 14px 16px;
        font-size: 16px;
        min-height: 48px;
    }
    .auth-send-code-btn {
        padding: 14px 16px;
        font-size: 14px;
    }
}

.detail-modal-body ul {
    padding-left: 20px;
}

/* 周边环境分组 */
.env-group {
    margin-top: 8px;
}

.env-subgroup {
    margin-bottom: 12px;
}

.env-subgroup:last-child {
    margin-bottom: 0;
}

.env-subtitle {
    display: block;
    font-size: 13px;
    color: #667eea;
    font-weight: 600;
    margin-bottom: 6px;
}

.env-subgroup .checkbox-row {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
}

section {
    padding: 25px 20px;
    border-bottom: 1px solid #eee;
}

/* 手机罗盘使用指南 */
.usage-guide-section {
    background: #f0f7ff;
    border-bottom: 1px solid #d0e3ff;
}

.usage-guide-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.usage-guide-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.usage-guide-header h2 {
    font-size: 18px;
    margin: 0;
    color: #333;
}

.usage-guide-toggle {
    font-size: 14px;
    color: #667eea;
    flex-shrink: 0;
    margin-left: 10px;
}

.usage-guide-content {
    font-size: 14px;
    line-height: 1.7;
    color: #555;
    overflow: hidden;
    max-height: 1200px;
    transition: max-height 0.3s ease, margin 0.3s ease, padding 0.3s ease;
}

.usage-guide-content.collapsed {
    max-height: 0;
    margin: 0 !important;
    padding: 0 !important;
}

.usage-guide-content:not(.collapsed) {
    margin-top: 15px;
}

.usage-item {
    margin-bottom: 16px;
}

.usage-item:last-child {
    margin-bottom: 0;
}

.usage-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.usage-item .kw {
    font-weight: 600;
    color: #667eea;
}

.usage-item ul,
.usage-item ol {
    margin: 0;
    padding-left: 20px;
}

.usage-item li {
    margin-bottom: 6px;
}

.usage-item li:last-child {
    margin-bottom: 0;
}

section:last-child {
    border-bottom: none;
}

h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #333;
}

/* 罗盘样式 */
.compass-section {
    text-align: center;
    background: #f8f9fa;
    padding: 10px;
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
}

@media (min-width: 480px) {
    .compass-section {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .compass-section {
        padding: 8px;
    }
    
    .compass-wrapper {
        gap: 12px;
    }
    
    .compass-info-panel {
        padding: 12px;
        font-size: 14px;
    }
    
    .info-value {
        font-size: 14px;
    }
    
    .compass-controls {
        gap: 6px;
    }
    
    .compass-controls .btn {
        padding: 8px 12px;
        font-size: 14px;
    }
}

.compass-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.compass-container {
    position: relative;
    display: inline-block;
    margin: 0 auto 20px;
    transition: transform 0.3s ease;
    /* 容器随 canvas 尺寸收缩，确保中心与罗盘对齐 */
    width: fit-content;
    height: fit-content;
}

#compassCanvas {
    border-radius: 50%;
    box-shadow: 0 6px 30px rgba(184, 134, 11, 0.4), 
                0 2px 10px rgba(0, 0, 0, 0.3),
                inset 0 2px 5px rgba(212, 175, 55, 0.3);
    display: block;
    vertical-align: top;
    background: #8B6914;
    /* 尺寸由 JS 设置，不在此写死 */
}

.compass-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 38%;
    height: 38%;
    min-width: 60px;
    min-height: 60px;
    max-width: 100px;
    max-height: 100px;
    background: transparent;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 10;
}

@media (max-width: 480px) {
    .compass-center {
        min-width: 50px;
        min-height: 50px;
        max-width: 80px;
        max-height: 80px;
    }
}

.compass-24-marks {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.shanxiang-mark {
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(255,255,255,0.8);
}

.fullscreen-24-marks {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.compass-info-panel {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.info-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 8px;
}

.info-item.full-width {
    flex: 1 1 100%;
}

.info-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.info-value {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.info-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 4px;
}

.info-badge.excellent { background: #4caf50; color: white; }
.info-badge.good { background: #8bc34a; color: white; }
.info-badge.medium { background: #ffc107; color: #333; }
.info-badge.poor { background: #ff9800; color: white; }
.info-badge.bad { background: #f44336; color: white; }

/* 全屏罗盘模态框 */
.compass-fullscreen-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #1a1a1a;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.fullscreen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: #2c3e50;
    color: white;
    flex-shrink: 0;
    min-height: 48px;
}

.fullscreen-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.fullscreen-header h3 {
    margin: 0;
    font-size: 18px;
}

.fullscreen-quick-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    opacity: 0.9;
}

.fullscreen-quick-info span {
    padding: 4px 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

.fullscreen-controls {
    display: flex;
    gap: 8px;
}

.btn-icon {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: rgba(255,255,255,0.2);
}

.fullscreen-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    position: relative;
}

.fullscreen-info-panel {
    width: 100%;
    max-width: 1200px;
    margin-top: 10px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .fullscreen-content {
        padding: 8px;
    }
    
    .fullscreen-header {
        padding: 6px 12px;
        min-height: 40px;
    }
    
    .fullscreen-header h3 {
        font-size: 14px;
    }
    
    .fullscreen-quick-info {
        font-size: 12px;
        gap: 8px;
    }
    
    .btn-icon {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .fullscreen-info-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 12px;
    }
    
    .fullscreen-info-value {
        font-size: 16px;
    }
    
    .fullscreen-compass-wrapper {
        padding: 0;
    }
}

.fullscreen-compass-wrapper {
    position: relative;
    margin: 0;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    width: fit-content;
    height: fit-content;
}

#fullscreenCompassCanvas {
    border-radius: 50%;
    box-shadow: 0 8px 50px rgba(184, 134, 11, 0.5), 
                0 4px 20px rgba(0, 0, 0, 0.4),
                inset 0 3px 8px rgba(212, 175, 55, 0.3);
    display: block;
    background: #8B6914;
}

.fullscreen-compass-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 38%;
    height: 38%;
    min-width: 80px;
    min-height: 80px;
    max-width: 140px;
    max-height: 140px;
    background: transparent;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 10;
}

.fullscreen-reading {
    font-size: 32px;
    font-weight: bold;
    color: #FFFFFF;
    margin-top: 10px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.9), 0 0 6px rgba(0,0,0,0.8);
}

.fullscreen-direction {
    font-size: 20px;
    color: #F5E6D3;
    margin-top: 4px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.9), 0 0 4px rgba(0,0,0,0.8);
}

.fullscreen-24-marks {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.fullscreen-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    width: 100%;
    max-width: 1200px;
    padding: 16px;
    flex-shrink: 0;
}

.fullscreen-info-item {
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    color: white;
}

.fullscreen-info-label {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    margin-bottom: 8px;
}

.fullscreen-info-value {
    font-size: 24px;
    font-weight: bold;
    color: white;
}

.fullscreen-info-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
}

.compass-needle {
    position: absolute;
    top: 50%;
    left: 50%;
    margin: 0;
    width: 5px;
    height: 100px;
    transform-origin: 50% 100%;
    transform: translate(-50%, -100%) rotate(0deg);
    pointer-events: none;
    background: linear-gradient(to top, #e74c3c 0%, #c0392b 100%);
    border-radius: 3px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transition: transform 0.08s ease-out, height 0.3s ease;
    z-index: 15;
    /* width/height 由 JS updateNeedleSize 动态设置 */
}

.compass-needle::before {
    content: '';
    position: absolute;
    top: -11px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 18px solid #e74c3c;
}

.compass-needle::after {
    display: none;
}

.compass-reading {
    font-size: 22px;
    font-weight: bold;
    color: #FFFFFF;
    margin-top: 5px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.9), 0 0 4px rgba(0,0,0,0.8);
}

.compass-direction {
    font-size: 16px;
    color: #F5E6D3;
    margin-top: 2px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.9), 0 0 3px rgba(0,0,0,0.8);
}

.compass-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.manual-input-panel {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.manual-input-panel input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    width: 150px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.form-hint {
    margin-top: 8px;
    font-size: 12px;
    color: #888;
    line-height: 1.5;
}


.form-group input[type="number"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.direction-display {
    display: block;
    margin-top: 5px;
    color: #667eea;
    font-weight: bold;
}

.checkbox-group {
    margin-bottom: 20px;
}

.checkbox-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s;
}

.checkbox-label:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"]:checked + span {
    color: #667eea;
    font-weight: bold;
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-outline {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

.btn-large {
    width: 100%;
    padding: 15px;
    font-size: 18px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

/* 结果显示样式 */
.result-section {
    background: #f8f9fa;
}

.score-display {
    text-align: center;
    margin-bottom: 30px;
}

.score-circle {
    display: inline-block;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
}

.score-value {
    font-size: 48px;
    font-weight: bold;
    color: white;
}

.score-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 5px;
}

.result-details {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    color: #666;
}

.detail-value {
    font-weight: bold;
    color: #333;
}

.evaluation-box,
.suggestions-box {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.detail-evaluation-box {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.detail-evaluation-box pre {
    white-space: pre-wrap;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

.evaluation-box h3,
.suggestions-box h3,
.detail-evaluation-box h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #667eea;
}

.evaluation-box p {
    line-height: 1.8;
    color: #555;
}

.suggestions-box div {
    line-height: 1.8;
    color: #555;
    white-space: pre-line;
}

.result-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

@media (max-width: 480px) {
    .result-actions {
        grid-template-columns: 1fr;
    }
}

/* 历史记录样式 */
.history-list {
    margin-top: 15px;
}

.history-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #667eea;
    cursor: pointer;
    transition: all 0.3s;
}

.history-item:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 知识库 */
.knowledge-search-wrap {
    margin-bottom: 20px;
}

.knowledge-search-input {
    width: 100%;
    padding: 16px 18px;
    font-size: 18px;
    line-height: 1.5;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.knowledge-search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.knowledge-search-input::placeholder {
    color: #aaa;
}

.knowledge-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.knowledge-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.knowledge-pagination .page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    color: #333;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.knowledge-pagination .page-btn:hover:not(:disabled) {
    border-color: #667eea;
    color: #667eea;
    background: rgba(102, 126, 234, 0.08);
}

.knowledge-pagination .page-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

.knowledge-pagination .page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.knowledge-pagination .page-info {
    font-size: 14px;
    color: #666;
    padding: 0 8px;
}

.knowledge-card {
    background: white;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 14px;
}

.knowledge-card .k-title {
    font-weight: 700;
    color: #333;
    margin-bottom: 6px;
}

.knowledge-card .k-meta {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
}

.knowledge-card .k-content {
    font-size: 14px;
    color: #555;
    line-height: 1.7;
}

.knowledge-card .k-examples {
    margin-top: 8px;
    font-size: 13px;
    color: #666;
}

/* 地图 */
.map-section-desc {
    font-size: 14px;
    color: #666;
    margin: -8px 0 16px 0;
    line-height: 1.5;
}

.map-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
    padding: 12px;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.15);
}

.map-toolbar-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.map-toolbar .map-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.map-toolbar .map-actions .btn {
    padding: 6px 14px;
    font-size: 13px;
}

.map-rotate-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.map-rotate-info {
    font-size: 13px;
    color: #667eea;
    font-weight: 600;
    min-width: 32px;
}

.map-toolbar-label {
    font-size: 13px;
    color: #555;
    font-weight: 500;
}

.map-type-btns {
    display: flex;
    gap: 4px;
}

.map-type-btn {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: white;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.map-type-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.map-type-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.map-main-row {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    min-height: 360px;
}

.map-main-row .map-wrapper {
    flex: 1;
    min-width: 0;
}

.map-side-panel {
    width: 260px;
    min-width: 220px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e8e8e8;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
}

.map-side-panel.collapsed {
    width: 48px;
    min-width: 48px;
}

.map-side-panel.collapsed .map-side-header h3,
.map-side-panel.collapsed .map-side-body {
    display: none;
}

.map-side-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.map-side-header h3 {
    font-size: 15px;
    margin: 0;
    font-weight: 600;
}

.map-side-toggle {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255,255,255,0.2);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.map-side-toggle:hover {
    background: rgba(255,255,255,0.35);
}

.map-side-body {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    font-size: 13px;
}

.map-info {
    white-space: pre-line;
    color: #555;
    line-height: 1.6;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.map-points-list {
    max-height: 200px;
    overflow-y: auto;
}

.map-points-empty {
    color: #999;
    font-size: 13px;
    text-align: center;
    padding: 20px;
    display: none;
}

.map-point-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #eee;
}

.map-point-item:hover {
    background: #f0f4ff;
}

.map-point-item-main {
    flex: 1;
    min-width: 0;
}

.map-point-name {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.map-point-coord {
    font-size: 11px;
    color: #999;
}

.map-point-item-actions {
    display: flex;
    gap: 4px;
}

.map-point-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: white;
    color: #667eea;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.map-point-btn:hover {
    background: #667eea;
    color: white;
}

.map-point-btn.map-point-del:hover {
    background: #e74c3c;
    color: white;
}

.map-quick-eval-content {
    max-width: 380px;
}

.map-quick-eval-hint {
    margin-bottom: 16px;
    color: #666;
    font-size: 14px;
}

.map-quick-eval-btns {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.map-quick-eval-btns .btn {
    width: 100%;
}

@media (max-width: 768px) {
    .map-main-row {
        flex-direction: column;
    }
    .map-side-panel {
        width: 100%;
        min-width: 0;
    }
    .map-side-panel.collapsed {
        width: 100%;
        min-width: 0;
    }
    .map-side-panel.collapsed .map-side-body {
        display: none;
    }
}

.map-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e8e8e8;
    background: #f7f7f7;
}

.map-wrapper.map-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    border-radius: 0;
    border: none;
}

.map-wrapper.map-fullscreen .map-container {
    height: 100%;
}

.map-floating-buttons {
    position: absolute;
    bottom: 12px;
    left: 12px;
    right: 60px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    z-index: 8;
    pointer-events: auto;
}

.map-floating-btn {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 8px;
    border: 1px solid rgba(102, 126, 234, 0.5);
    background: rgba(255, 255, 255, 0.92);
    color: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: all 0.2s ease;
}

.map-floating-btn:hover {
    background: rgba(102, 126, 234, 0.15);
    border-color: #667eea;
}

.map-floating-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.map-wrapper.map-fullscreen .map-floating-buttons {
    bottom: 16px;
    left: 16px;
    right: 80px;
}

.map-toggle-fullscreen {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid rgba(102, 126, 234, 0.6);
    background: rgba(255, 255, 255, 0.95);
    color: #667eea;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.map-toggle-fullscreen:hover {
    background: #667eea;
    color: white;
    transform: scale(1.05);
}

.map-wrapper.map-fullscreen .map-toggle-fullscreen {
    top: 16px;
    right: 16px;
}

.map-inner {
    position: relative;
    width: 100%;
    height: 100%;
}

.map-wrapper.map-fullscreen .map-inner {
    display: flex;
    flex-direction: row;
}

.map-wrapper.map-fullscreen .map-inner.layout-top { flex-direction: column; }
.map-wrapper.map-fullscreen .map-inner.layout-bottom { flex-direction: column-reverse; }
.map-wrapper.map-fullscreen .map-inner.layout-left { flex-direction: row; }
.map-wrapper.map-fullscreen .map-inner.layout-right { flex-direction: row-reverse; }

.map-container {
    height: 320px;
    border-radius: 12px;
    overflow: hidden;
    background: #f7f7f7;
    position: relative;
    flex: 1;
    transition: transform 0.3s ease;
}

.map-baidu-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
}

.map-compass-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform-origin: center center;
    pointer-events: none;
    z-index: 100;
    background: transparent !important;
}

.map-compass-overlay.visible {
    display: block;
}

.map-wrapper.map-fullscreen .map-container {
    height: 100%;
    min-height: 200px;
}

.map-overlay-panel {
    display: none;
    position: absolute;
    top: 50px;
    left: 12px;
    right: auto;
    bottom: 12px;
    width: 140px;
    max-height: 220px;
    background: rgba(255,255,255,0.9);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 5;
    overflow: auto;
}

.map-overlay-panel.visible {
    display: block;
}

.map-wrapper.map-fullscreen .map-overlay-panel {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    width: 160px;
    max-width: 30vw;
    max-height: none;
    margin: 12px;
}

.map-overlay-panel[data-layout="right"] { left: auto; right: 12px; }
.map-overlay-panel[data-layout="top"] { top: 12px; left: 12px; right: 12px; bottom: auto; width: auto; max-height: 120px; }
.map-overlay-panel[data-layout="bottom"] { top: auto; bottom: 12px; left: 12px; right: 12px; width: auto; max-height: 120px; }

.map-wrapper.map-fullscreen .map-overlay-panel[data-layout="top"],
.map-wrapper.map-fullscreen .map-overlay-panel[data-layout="bottom"] {
    width: auto;
    max-width: none;
}

.map-overlay-content {
    font-size: 12px;
    line-height: 1.6;
    color: #333;
}

.map-overlay-content .overlay-item {
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eee;
}

.map-overlay-content .overlay-item:last-child {
    border-bottom: none;
}

.map-overlay-content .overlay-label {
    font-weight: 600;
    color: #667eea;
}

.map-overlay-content .compass-mini {
    width: 80px;
    height: 80px;
    margin: 8px auto;
    border-radius: 50%;
    border: 2px solid #B8860B;
    background: linear-gradient(135deg, #F5E6D3, #D4AF37);
    position: relative;
}

.map-overlay-content .compass-mini::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    margin-left: -6px;
    margin-top: -20px;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 20px solid #c0392b;
    transform-origin: 50% 20px;
}

.map-overlay-content .compass-cross {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    margin: 8px auto;
    position: relative;
}

.map-overlay-content .compass-cross::before,
.map-overlay-content .compass-cross::after {
    content: '';
    position: absolute;
    background: #B8860B;
}

.map-overlay-content .compass-cross::before {
    width: 2px;
    height: 100%;
}

.map-overlay-content .compass-cross::after {
    width: 100%;
    height: 2px;
}

.map-overlay-content .cross-label {
    position: absolute;
    font-size: 10px;
    font-weight: 600;
    color: #333;
}

.map-overlay-content .cross-n { top: 0; left: 50%; transform: translateX(-50%); }
.map-overlay-content .cross-s { bottom: 0; left: 50%; transform: translateX(-50%); }
.map-overlay-content .cross-e { right: 0; top: 50%; transform: translateY(-50%); }
.map-overlay-content .cross-w { left: 0; top: 50%; transform: translateY(-50%); }

.map-overlay-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
}

.map-overlay-controls .map-overlay-label,
.map-overlay-layout .map-overlay-label {
    font-size: 13px;
    color: #666;
}

.map-overlay-btn.active,
.map-layout-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.map-fullscreen-only {
    margin-top: 8px;
}

.map-overlay-layout,
.map-fullscreen-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.map-fullscreen-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
}

.map-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.map-info {
    margin-top: 10px;
    font-size: 13px;
    color: #555;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 10px 12px;
    white-space: pre-line;
}

@media (max-width: 480px) {
    .map-actions {
        grid-template-columns: 1fr;
    }
    .map-container {
        height: 300px;
    }
    .map-overlay-controls {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* 测量结果弹窗 */
.map-measure-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10001;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.map-measure-modal.show {
    display: flex;
}

.map-measure-modal-content {
    background: white;
    border-radius: 16px;
    max-width: 420px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.map-measure-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.map-measure-modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.map-measure-modal-close {
    font-size: 28px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.map-measure-modal-close:hover {
    color: #333;
}

.map-measure-modal-body {
    padding: 20px;
    font-size: 14px;
    line-height: 1.8;
    overflow-y: auto;
    max-height: 60vh;
}

.map-measure-modal-body .measure-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.map-measure-modal-body .measure-row:last-child {
    border-bottom: none;
}

.map-measure-modal-body .measure-label {
    color: #666;
}

.map-measure-modal-body .measure-value {
    font-weight: 600;
    color: #333;
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.history-direction {
    font-weight: bold;
    color: #667eea;
}

.history-score {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.history-date {
    font-size: 12px;
    color: #999;
}

.history-evaluation {
    font-size: 14px;
    color: #666;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 20px;
    color: #667eea;
}

/* 响应式设计 */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 24px;
    }

    .compass-controls {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .detail-modal {
        padding: 12px;
    }

    .detail-modal-header h3 {
        font-size: 16px;
    }

    .detail-modal-body {
        padding: 14px;
        font-size: 14px;
    }

    .checkbox-row {
        flex-direction: column;
    }

    .two-col {
        grid-template-columns: 1fr;
    }
}
