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

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background-color: #f5f5f5;
    height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

header {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    color: white;
    padding: 20px 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

header .subtitle {
    font-size: 14px;
    opacity: 0.8;
    font-weight: normal;
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-right span {
    font-size: 14px;
    opacity: 0.9;
}

.header-right button {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.header-right button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.district-selector {
    display: flex;
    align-items: center;
}

.district-selector select {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    outline: none;
    min-width: 150px;
}

.district-selector select option {
    background: #1e3a8a;
    color: white;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 12px 30px;
    border-bottom: 1px solid #e0e0e0;
    z-index: 1;
}

.navbar {
    display: flex;
    gap: 20px;
}

.navbar a {
    text-decoration: none;
    color: #333;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background 0.2s;
}

.navbar a:hover {
    background-color: #3b82f6;
    color: white;
}

.navbar a.active {
    background-color: #3b82f6;
    color: white;
}

.search-bar {
    display: flex;
    gap: 6px;
    align-items: center;
}

.search-bar select {
    padding: 7px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    background-color: #fff;
    min-width: 100px;
}

.search-bar input {
    padding: 7px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    width: 250px;
    outline: none;
    transition: border-color 0.2s;
}

.search-bar input:focus {
    border-color: #3b82f6;
}

.search-bar button {
    padding: 7px 16px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.search-bar button:first-of-type {
    background-color: #3b82f6;
    color: white;
}

.search-bar button:first-of-type:hover {
    background-color: #2563eb;
}

.search-bar button:last-of-type {
    background-color: #f0f0f0;
    color: #666;
}

.search-bar button:last-of-type:hover {
    background-color: #e0e0e0;
}

main {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.map {
    width: 100%;
    height: 100%;
}

.left-panel {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    padding: 16px;
    width: 280px;
    z-index: 1000;
    max-height: calc(100% - 80px);
    overflow-y: auto;
}

.panel {
    margin-bottom: 16px;
}

.panel:last-child {
    margin-bottom: 0;
}

.panel h3 {
    font-size: 15px;
    color: #333;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eee;
}

#layer-info {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
}

.legend {
    font-size: 13px;
    color: #555;
    line-height: 1.8;
}

.legend-color {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 3px;
    margin-right: 8px;
    vertical-align: middle;
}

.panel button {
    width: 100%;
    padding: 8px 14px;
    margin-bottom: 6px;
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s;
}

.panel button:hover {
    background-color: #2563eb;
}

.panel button:last-child {
    margin-bottom: 0;
}

.location-info {
    font-size: 12px;
    line-height: 1.6;
}

.location-info div {
    color: #666;
    margin-bottom: 3px;
}

.location-info strong {
    color: #333;
}

footer {
    background: white;
    padding: 8px 24px;
    border-top: 1px solid #eee;
    text-align: center;
    font-size: 12px;
    color: #999;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.loading-content {
    background: white;
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

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

.leaflet-popup {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}

.leaflet-popup-content {
    font-size: 13px;
    max-height: 300px;
    overflow-y: auto;
}

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

.form-group label {
    display: block;
    font-size: 13px;
    color: #555;
    margin-bottom: 5px;
}

.form-group select,
.form-group input[type="text"],
.form-group input[type="number"] {
    width: 100%;
    padding: 7px 9px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    background-color: #fff;
}

.form-group input[type="range"] {
    width: calc(100% - 40px);
    display: inline-block;
}

.form-group input[type="color"] {
    width: 45px;
    height: 30px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3b82f6;
}

.form-group .hint {
    font-size: 12px;
    color: #999;
    font-style: italic;
}

.form-group.inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.form-group.inline label {
    margin-bottom: 0;
    white-space: nowrap;
}

.form-group.inline select,
.form-group.inline input {
    width: auto;
    min-width: 80px;
}

.property-field {
    margin-bottom: 8px;
}

.property-field label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 3px;
}

.property-field input {
    width: 100%;
    padding: 5px 7px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 12px;
}

.property-field input.readonly {
    background-color: #f5f5f5;
    color: #666;
    cursor: not-allowed;
}

.btn-save-property {
    width: 100%;
    padding: 7px 10px;
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    margin-top: 10px;
}

.btn-save-property:hover {
    background-color: #2563eb;
}

#label-size-value {
    display: inline-block;
    width: 30px;
    text-align: center;
    font-size: 12px;
    color: #666;
}

.label-layer {
    z-index: 100;
}

.selected-polygon {
    stroke: #ff0000 !important;
    stroke-width: 3px !important;
    fill-opacity: 0.5 !important;
}

.edit-mode-active {
    background-color: #dc3545 !important;
}

.cutting-mode-active {
    cursor: crosshair;
}

.leaflet-draw-toolbar {
    top: 10px !important;
    left: 10px !important;
}

.leaflet-custom-label {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
}

.leaflet-custom-label::before,
.leaflet-custom-label::after {
    display: none !important;
}

.leaflet-custom-label img {
    display: none !important;
}

.toolbar {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    padding: 10px 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    z-index: 1000;
}

.toolbar-item {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #555;
    transition: all 0.2s;
    background: transparent;
}

.toolbar-item svg {
    width: 20px;
    height: 20px;
}

.toolbar-item:hover {
    background-color: #f0f0f0;
    color: #3b82f6;
}

.toolbar-item.active {
    background-color: #3b82f6;
    color: white;
}

.toolbar-divider {
    width: 22px;
    height: 1px;
    background-color: #e0e0e0;
    margin: 3px 0;
}

.toolbar-toggle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #555;
    transition: all 0.2s;
    background: transparent;
    margin-bottom: 4px;
}

.toolbar-toggle:hover {
    background-color: #f0f0f0;
    color: #3b82f6;
}

.toolbar-content.collapsed {
    display: none;
}

.summary-panel {
    position: absolute;
    top: 10px;
    right: 70px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    padding: 12px 16px;
    width: 280px;
    z-index: 1000;
}

.summary-panel h3 {
    font-size: 15px;
    color: #333;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eee;
}

.summary-content {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid #f5f5f5;
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-label {
    color: #666;
}

.summary-value {
    color: #333;
    font-weight: 500;
}

.summary-total {
    background-color: #f8f9fa;
    padding: 8px;
    border-radius: 4px;
    margin-top: 8px;
}

.summary-total .summary-row {
    border-bottom: none;
}

.summary-total .summary-value {
    color: #3b82f6;
    font-weight: 600;
}

.parcel-list {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 8px;
}

.parcel-item {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.parcel-item:hover {
    background: #e9ecef;
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

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

.parcel-title {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.parcel-zjrxm {
    color: #3b82f6;
    font-size: 13px;
    font-weight: 500;
}

.parcel-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
}

.bottom-bar {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    z-index: 1000;
}

.bottom-bar-left {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.toggle-btn {
    background: #3b82f6;
    color: white;
    padding: 6px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.toggle-btn:hover {
    background-color: #2563eb;
}

.toggle-btn.expanded {
    transform: rotate(180deg);
}

.bottom-content {
    padding: 10px 16px;
    display: flex;
    gap: 24px;
    align-items: center;
}

.bottom-content.collapsed {
    display: none;
}

.bottom-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bottom-section h4 {
    font-size: 13px;
    color: #333;
    margin-bottom: 4px;
}

.bottom-section button {
    padding: 6px 14px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    background-color: #f0f0f0;
    color: #666;
    transition: all 0.2s;
    margin-right: 6px;
}

.bottom-section button:hover {
    background-color: #3b82f6;
    color: white;
}

.legend.inline {
    display: flex;
    align-items: center;
}

.bottom-bar-right {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    padding: 10px 16px;
}

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

.section-header h4 {
    margin: 0;
    font-size: 12px;
    color: #333;
}

.section-header .toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    padding: 2px;
    border-radius: 4px;
    transition: background 0.2s;
}

.section-header .toggle-btn:hover {
    background-color: #f0f0f0;
}

.section-content.collapsed {
    display: none;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 500px;
    overflow: hidden;
}

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

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.modal-header .close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 0 8px;
    line-height: 1;
}

.modal-header .close-btn:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-body .form-group {
    margin-bottom: 16px;
}

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

.modal-body .form-group input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    background-color: #fafafa;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-body .form-group input[type="file"]:hover {
    border-color: #3b82f6;
    background-color: #f0f5ff;
}

.modal-body .hint {
    font-size: 12px;
    color: #999;
    margin-top: 6px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    background-color: #f5f5f5;
    border-top: 1px solid #eee;
}

.modal-footer .btn-cancel {
    padding: 8px 20px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: white;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-footer .btn-cancel:hover {
    background-color: #f5f5f5;
}

.modal-footer .btn-save {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    background-color: #3b82f6;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-footer .btn-save:hover:not(:disabled) {
    background-color: #2563eb;
}

.modal-footer .btn-save:disabled {
    background-color: #93c5fd;
    cursor: not-allowed;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #eee;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background-color: #3b82f6;
    border-radius: 4px;
    transition: width 0.3s;
}

#shp-upload-info p {
    font-size: 14px;
    margin: 6px 0;
    color: #666;
}