/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #00d4ff;
    --secondary-color: #0099ff;
    --bg-dark: #0a0e27;
    --bg-card: #141b3d;
    --bg-hover: #1a2347;
    --text-primary: #ffffff;
    --text-secondary: #8b92b8;
    --border-color: #1e2852;
    --success-color: #00ff88;
    --danger-color: #ff4757;
    --warning-color: #ffa502;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0a0e27 0%, #141b3d 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 0% 0%, rgba(0, 212, 255, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 100%, rgba(0, 153, 255, 0.15) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

#app {
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    background: rgba(20, 27, 61, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.1);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    font-size: 2rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 10px var(--primary-color));
    }
    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 20px var(--primary-color));
    }
}

.logo h1 {
    font-size: 1.5rem;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.username {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.9rem;
}

.lang-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.logout-btn {
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.logout-btn:hover {
    background: rgba(255, 71, 87, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.3);
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Tab Navigation */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 2rem;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(0, 212, 255, 0.05);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    animation: fadeIn 0.3s ease;
}

/* Action Bar */
.action-bar {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 300px;
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.search-box:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
}

.search-icon {
    margin-right: 0.75rem;
    color: var(--text-secondary);
}

.search-box input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-secondary);
}

.search-btn {
    background: var(--primary-color);
    color: var(--bg-dark);
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    margin-left: 0.5rem;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
}

.create-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    color: var(--bg-dark);
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.create-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.5);
}

/* Table */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--bg-hover);
    border-bottom: 2px solid var(--primary-color);
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.data-table tbody tr:hover {
    background: var(--bg-hover);
    transform: translateX(5px);
}

.row-clickable {
    cursor: pointer;
}

.data-table td {
    padding: 1rem;
    color: #c8cee8;
}

.project-name {
    color: #ffffff;
    font-weight: 500;
}

.web-link-cell {
    color: #c8cee8;
}

.web-link-cell .table-link {
    color: #5dd4ff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.web-link-cell .table-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

.badge {
    background: rgba(0, 212, 255, 0.2);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-block;
}

.date {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: #d4d9f0;
}

.actions {
    display: flex;
    gap: 0.5rem;
}

.view-btn, .edit-btn, .delete-btn {
    background: none;
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.view-btn:hover {
    background: rgba(0, 255, 136, 0.15);
    border-color: var(--success-color);
    transform: scale(1.1);
}

.edit-btn:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.delete-btn:hover {
    background: rgba(255, 71, 87, 0.2);
    border-color: var(--danger-color);
    transform: scale(1.1);
}

.no-data {
    text-align: center;
    padding: 3rem !important;
    color: var(--text-secondary);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.page-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

.page-btn:not(:disabled):hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-info {
    color: var(--text-secondary);
}


.storage-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 39, 0.9);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 212, 255, 0.2);
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    transition: all 0.3s ease;
}

.close-btn:hover {
    color: var(--danger-color);
    transform: rotate(90deg);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Detail Modal */
.detail-modal {
    max-width: 800px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-item label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-item span {
    color: var(--text-primary);
    font-size: 1rem;
}

.detail-item .link {
    color: var(--primary-color);
    text-decoration: none;
    word-break: break-all;
    transition: all 0.3s ease;
}

.detail-item .link:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Form */
.form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.form-row-2 {
    grid-template-columns: 1fr 1fr;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
}

.form-group select {
    width: 100%;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 2.25rem 0.75rem 0.75rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    appearance: none;
    background-image: 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='%239ca3c4' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Create project modal: constrain form width so select is not pushed too far right */
.modal-body-create .form-create {
    max-width: 100%;
}

.form-group-select .ori-data-select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.form-group-select .ori-data-select:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Ori create modal: name + folder + action row */
.ori-create-form {
    gap: 1.25rem;
}

.ori-folder-picker {
    display: grid;
    grid-template-columns: 7fr 3fr;
    gap: 0.75rem;
    width: 100%;
}

.ori-folder-input {
    width: 100%;
}

.ori-folder-btn {
    width: 100%;
    white-space: nowrap;
}

.ori-create-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    padding-top: 0.25rem;
}

.ori-create-progress {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 0.25rem;
}

.ori-create-progress-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.ori-create-progress-track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.ori-create-progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.25s ease;
}

.ori-create-progress-text {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Web link prefix + suffix input (create project) */
.web-link-input-wrap {
    display: flex;
    align-items: center;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
}

.web-link-input-wrap:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.2);
}

.web-link-prefix {
    flex: 1 1 68%;
    min-width: 0;
    max-width: 72%;
    padding: 0.875rem 1rem;
    color: var(--text-primary);
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-right: 1px solid var(--border-color);
}

.web-link-suffix-input {
    flex: 0 1 32%;
    min-width: 7rem;
    max-width: 32%;
    background: none;
    border: none;
    border-radius: 0;
    color: var(--text-secondary);
    padding: 0.875rem 1rem;
    font-size: 1rem;
    outline: none;
}

.web-link-input-wrap .web-link-suffix-input,
.web-link-input-wrap .web-link-suffix-input:focus {
    border: none;
    box-shadow: none;
}

.web-link-suffix-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.85;
}

.web-link-suffix-input:focus {
    color: var(--text-primary);
}

.form-group-readonly input {
    background: rgba(30, 40, 82, 0.6);
    border: 1px solid #2a3556;
    color: #9ca3c4;
    cursor: not-allowed;
}

.form-group-readonly input:focus {
    border-color: #2a3556;
    box-shadow: none;
}

.form-group-readonly label {
    color: #7a82a8;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--bg-dark);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.4);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-dark);
    border-color: var(--primary-color);
}

.btn-danger {
    background: var(--danger-color);
    color: var(--text-primary);
}

.btn-danger:hover {
    background: #ff6b81;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 71, 87, 0.4);
}

/* Delete Modal */
.delete-modal .modal-body {
    text-align: center;
}

.delete-modal .modal-body p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.project-to-delete {
    color: var(--danger-color) !important;
    font-weight: 600;
    font-size: 1.25rem;
}

.referenced-project-list {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
    text-align: left;
}

.referenced-project-list li {
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.35rem;
    background: rgba(255, 71, 87, 0.08);
    border: 1px solid rgba(255, 71, 87, 0.2);
    border-radius: 8px;
    color: var(--text-primary);
}

.referenced-project-link {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.badge-warning {
    background: rgba(255, 165, 0, 0.2);
    color: #ffb347;
}

.badge-muted {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
}

.delete-btn-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Loading */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 39, 0.8);
    backdrop-filter: blur(3px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Notification */
.notification {
    position: fixed;
    top: 100px;
    right: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--primary-color);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 212, 255, 0.3);
    z-index: 3000;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .tabs {
        overflow-x: auto;
    }

    .tab-btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
        white-space: nowrap;
    }

    .action-bar {
        flex-direction: column;
    }

    .search-box {
        min-width: 100%;
    }

    .table-container {
        overflow-x: auto;
    }

    .data-table {
        min-width: 800px;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .ori-folder-picker {
        grid-template-columns: 1fr;
    }

    .ori-create-actions {
        justify-content: stretch;
    }

    .ori-create-actions .btn {
        flex: 1 1 50%;
    }
}

/* Label Panel (edit page) – 与 index/login 统一使用 CSS 变量 */
.label-panel {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-primary);
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-dark) 100%);
}

/* 隐藏 number input 的原生上下箭头（spinner） */
.label-panel input[type="number"]::-webkit-inner-spin-button,
.label-panel input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.label-panel input[type="number"] {
    -moz-appearance: textfield;
}

.label-panel-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}

.label-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.label-panel-body::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.label-panel-section {
    margin-bottom: 12px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: rgba(20, 27, 61, 0.5);
}

.label-panel-section-header {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-hover);
    transition: background 0.2s;
}

.label-panel-section-title {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.label-panel-arrow {
    transition: transform 0.2s;
    color: var(--text-secondary);
}

.label-panel-section-content {
    background: rgba(10, 14, 39, 0.4);
    padding: 12px 16px;
}

.label-panel-section-content[data-label-panel-id="list-content"],
.label-panel-section-content[data-station-panel-id="list-content"] {
    max-height: 280px;
    overflow-y: auto;
}

/* 自定义滚动条（仅 section-content；body 不显示滚动条） */
.label-panel-section-content::-webkit-scrollbar {
    width: 6px;
}

.label-panel-section-content::-webkit-scrollbar-track {
    background: rgba(10, 14, 39, 0.3);
}

.label-panel-section-content::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.label-panel-section-content::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}


.label-panel-list-container {
    min-height: 48px;
}

.label-panel-save-wrap {
    padding: 12px;
}

.label-panel-btn {
    border-radius: 8px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.label-panel-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

.label-panel-btn-primary {
    width: 100%;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    font-weight: 600;
}

.label-panel-btn-primary:hover {
    box-shadow: 0 4px 16px rgba(0, 212, 255, 0.5);
}

.label-panel-btn-outline {
    width: 100%;
    height: 36px;
    margin-top: 8px;
    border: 1px solid var(--primary-color);
    background: rgba(0, 212, 255, 0.15);
    color: var(--primary-color);
    font-size: 0.8125rem;
    font-weight: 500;
}

.label-panel-btn-outline:hover {
    background: var(--primary-color);
    color: #fff;
}

.label-panel-btn-outline.label-panel-btn-lock {
    height: 34px;
    margin-top: 6px;
}

.label-panel-btn-lock-on {
    width: 100%;
    height: 34px;
    margin-top: 6px;
    border: 1px solid var(--danger-color);
    background: rgba(255, 71, 87, 0.2);
    color: #ff6b7a;
    font-size: 0.8125rem;
    font-weight: 500;
}

.label-panel-btn-lock-on:hover {
    background: var(--danger-color);
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.4);
}

.label-panel-btn-success {
    flex: 1;
    height: 40px;
    background: linear-gradient(135deg, var(--success-color), #00cc6a);
    color: #fff;
    font-weight: 600;
}

.label-panel-btn-success:hover {
    box-shadow: 0 4px 16px rgba(0, 255, 136, 0.4);
}

.label-panel-btn-secondary {
    flex: 1;
    height: 40px;
    border: 1px solid var(--border-color);
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.label-panel-btn-secondary:hover {
    background: var(--bg-card);
    border-color: var(--text-secondary);
    box-shadow: 0 2px 8px rgba(139, 146, 184, 0.2);
}

.label-panel-btn-sm {
    width: 100%;
    height: 32px;
    margin-top: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.label-panel-btn-sm:first-of-type {
    margin-top: 0;
}

.label-panel-field {
    margin-bottom: 14px;
}

.label-panel-label {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.label-panel-required {
    color: var(--danger-color);
}

.label-panel-input,
.label-panel-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-hover);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.label-panel-input {
    height: 36px;
}

.label-panel-input-readonly {
    color: var(--text-secondary);
}

.label-panel-input-num {
    height: 34px;
    padding-right: 28px;
    font-size: 0.8125rem;
}

.label-panel-grid3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

.label-panel-axis-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.label-panel-axis-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    width: 18px;
}

.label-panel-input-wrap {
    flex: 1;
    position: relative;
}

.label-panel-step-btns {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 0;
}

.label-panel-step-btn {
    width: 20px;
    height: 14px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 10px;
    line-height: 1;
}

/* 标签图标区域：新建分类/上传图标（占满整行各50%）+ 可展开列表（header 选择后显示图标） */
.label-panel-icon-section {
    margin-bottom: 12px;
}

.label-panel-icon-section .label-panel-label {
    margin-bottom: 6px;
}

/* 两个按钮占满整行，中间 10px 间隙 */
.label-panel-icon-row-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.label-panel-icon-row-actions .label-panel-btn {
    flex: 1;
    box-sizing: border-box;
    height: 36px;
    margin: 0;
}

/* 选择图标：可展开块（文档流，不覆盖下方内容） */
.label-panel-icon-list-wrap {
    margin-top: 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-hover);
    overflow: hidden;
}

.label-panel-icon-list-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.label-panel-icon-list-header-preview {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.label-panel-icon-list-header-preview:empty {
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
    overflow: hidden;
}

.label-panel-icon-list-header-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.label-panel-icon-list-title {
    flex: 1;
}

.label-panel-icon-list-arrow {
    flex: 0 0 auto;
}

.label-panel-icon-list-header:hover {
    background: rgba(0, 212, 255, 0.08);
}

.label-panel-icon-list-title {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
}

.label-panel-icon-list-arrow {
    font-size: 10px;
    color: var(--text-secondary);
}

.label-panel-icon-list-content {
    border-top: 1px solid var(--border-color);
    padding: 10px 0px 0px 0px;
    max-height: 280px;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.label-panel-icon-categories {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    min-height: 0;
}

.label-panel-icon-cards-area {
    flex: 1;
    min-height: 60px;
    max-height: calc(30px * 3 + 8px * 2);
    overflow-y: auto;
    padding-left: 10px;
    padding-right: 10px;
}

/* 分组卡片：贴底、占满宽度、减小高度、图标稍小 */
.label-panel-icon-group-cards {
    flex-shrink: 0;
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    overflow-x: auto;
    overflow-y: visible;
    padding: 4px 6px;
    margin-top: 8px;
    width: 100%;
    box-sizing: border-box;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(10, 14, 39, 0.3);
}

.label-panel-icon-group-cards::-webkit-scrollbar {
    height: 4px;
}

.label-panel-icon-group-cards::-webkit-scrollbar-track {
    background: rgba(10, 14, 39, 0.3);
}

.label-panel-icon-group-cards::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 2px;
}

.label-panel-icon-group-card {
    position: relative;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 6px;
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.label-panel-icon-group-card img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.label-panel-icon-group-card:hover {
    border-color: var(--primary-color);
    background: rgba(0, 212, 255, 0.1);
    transform: translateY(-2px);
}

.label-panel-icon-group-card-active {
    border-color: var(--primary-color);
    background: rgba(0, 212, 255, 0.2);
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.3);
}

/* Tooltip: hover显示分类名称 */
.label-panel-icon-group-card[data-tooltip]:hover::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(10, 14, 39, 0.95);
    color: var(--text-primary);
    font-size: 0.75rem;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
}

.label-panel-icon-group-card[data-tooltip]:hover::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 1px);
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid rgba(10, 14, 39, 0.95);
    pointer-events: none;
    z-index: 10;
}


/* 图标卡片：30*30，宽度占满自动换行，高度限制为 3 行，多出时垂直滚动 */
.label-panel-icon-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.label-panel-icon-card {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-card);
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.label-panel-icon-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.25);
}

.label-panel-icon-card-active {
    border-color: var(--primary-color);
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.35);
}

.label-panel-icon-card-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.label-panel-icon-card-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.label-panel-icon-loading,
.label-panel-icon-empty,
.label-panel-icon-error {
    padding: 16px;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.label-panel-icon-error {
    color: var(--danger-color);
}

/* 新建分类 / 上传图标 绘制弹窗 */
.label-panel-modal-small .label-panel-modal-content {
    width: 360px;
    max-height: 90vh;
}

.label-panel-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.label-panel-modal-actions .label-panel-btn {
    min-height: 40px;
    padding: 0 16px;
    flex: 1;
    max-width: 50%;
}
.label-panel-modal-actions .label-panel-btn-secondary {
    border: 1px solid var(--border-color);
    background: var(--bg-hover);
    color: var(--text-secondary);
    font-weight: 500;
}
.label-panel-modal-actions .label-panel-btn-secondary:hover {
    background: var(--bg-card);
    border-color: var(--text-secondary);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(139, 146, 184, 0.2);
}

.label-panel-inline-error {
    font-size: 0.8125rem;
    color: var(--danger-color);
    margin-top: 8px;
}

.label-panel-select {
    width: 100%;
    height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.875rem;
    margin-top: 4px;
}

.label-panel-upload-filename {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 6px;
}

/* HTML 编辑器区域 */
.label-panel-html-editor {
    margin-bottom: 16px;
}

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

.label-panel-html-actions {
    display: flex;
    gap: 6px;
}

.label-panel-icon-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.label-panel-icon-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

.label-panel-preview-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: transparent;
    color: #fff;
}

.label-panel-preview-btn:hover {
    box-shadow: 0 4px 16px rgba(0, 212, 255, 0.5);
}

.label-panel-toolbar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
    padding: 12px;
    background: linear-gradient(135deg, rgba(10, 14, 39, 0.6) 0%, rgba(20, 27, 61, 0.4) 100%);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.label-panel-toolbar-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.label-panel-toolbar-label {
    font-size: 0.6875rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: 4px;
}

.label-panel-toolbar-btn {
    height: 28px;
    padding: 0 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.label-panel-toolbar-btn code {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.6875rem;
    color: #7dd3fc;
}

.label-panel-toolbar-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    transform: scale(1.05);
}

.label-panel-toolbar-btn:hover code {
    color: #fff;
}

.label-panel-textarea-wrapper {
    position: relative;
    display: flex;
    height: 200px;
    min-height: 200px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    background: #0a0e1a;
}

.label-panel-line-numbers {
    padding: 12px 8px;
    background: linear-gradient(90deg, rgba(10, 14, 39, 0.8) 0%, rgba(20, 27, 61, 0.6) 100%);
    border-right: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.8125rem;
    line-height: 1.6;
    text-align: right;
    user-select: none;
    overflow: hidden;
    min-width: 40px;
    white-space: pre;
    word-break: normal;
}

.label-panel-textarea {
    flex: 1;
    min-height: 0;
    padding: 12px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.8125rem;
    line-height: 1.6;
    resize: none;
    overflow-y: auto;
    background: transparent;
    border: none;
    color: #e0f2fe;
    outline: none;
}

.label-panel-textarea-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
}

.label-panel-textarea::placeholder {
    color: #64748b;
    opacity: 0.7;
    font-style: italic;
}

.label-panel-textarea::selection {
    background: rgba(0, 212, 255, 0.3);
}

/* HTML 标签高亮（简单实现） */
.label-panel-textarea {
    tab-size: 2;
    -moz-tab-size: 2;
}

.label-panel-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.label-panel-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    display: none;
}

.label-panel-modal[style*="flex"] {
    display: flex;
}

.label-panel-modal-content {
    background: var(--bg-card);
    border-radius: 12px;
    width: 520px;
    height: auto;
    max-width: 90vw;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
}

.label-panel-modal-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.label-panel-modal-title {
    font-weight: 600;
    color: var(--text-primary);
}

.label-panel-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    line-height: 1;
}

.label-panel-modal-body {
    flex: 0 1 auto;
    padding: 18px;
    min-height: 0;
    overflow-y: auto;
    max-height: 60vh;
    color: var(--text-primary);
}

.label-panel-empty,
.label-panel-preview-empty {
    padding: 24px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.label-panel-preview-empty {
    padding: 18px;
}

.label-list-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid rgba(30, 40, 82, 0.35);
    border-radius: 8px;
    margin: 4px 8px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.label-list-item[data-label-panel-id="label-item"] {
    border-color: rgba(30, 40, 82, 0.5);
}

.label-list-item-editing {
    background: rgba(0, 212, 255, 0.12);
    border-color: rgba(0, 212, 255, 0.35);
    box-shadow: none;
}

.label-panel-list-id {
    color: var(--text-secondary);
    font-size: 0.75rem;
    width: 32px;
}

.label-panel-list-name {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.label-panel-list-delete,
.label-panel [data-label-panel-id="label-delete"] {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 6px;
    background: rgba(255, 71, 87, 0.2);
    color: var(--danger-color);
    font-size: 1rem;
    cursor: pointer;
    flex-shrink: 0;
}

/* 站点列表树状排布 */
.station-tree-list {
    padding: 0;
}
.station-tree-list .station-tree-node {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 8px 12px;
    padding-left: 12px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.15s;
    box-sizing: border-box;
}
.station-tree-list .station-tree-node:hover {
    background: var(--bg-hover);
}
.station-tree-list .station-tree-node .label-panel-list-name {
    flex: 1;
    min-width: 0;
}
.station-tree-list .station-tree-node .label-panel-list-id {
    flex-shrink: 0;
}
.station-tree-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 24px;
    margin-right: 2px;
    flex-shrink: 0;
    font-size: 0.7rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}
.station-tree-toggle.empty {
    cursor: default;
    color: transparent;
}
.station-tree-toggle:hover:not(.empty) {
    color: var(--primary-color);
}
.station-tree-children {
    border-left: 1px solid rgba(0, 212, 255, 0.2);
    margin-left: 10px;
}
.station-tree-list .station-tree-children .station-tree-node {
    border-bottom-color: rgba(30, 40, 82, 0.4);
}

/* Resource Management */
.resource-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.resource-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}

.resource-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 212, 255, 0.12);
}

.resource-card-compact {
    display: flex;
    flex-direction: column;
}

.resource-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.resource-card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.resource-card-meta {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.pie-chart-wrap {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 1.25rem;
}

.pie-chart {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.pie-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    box-shadow: 0 0 0 1px var(--border-color);
}

.pie-legend {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pie-legend li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.pie-legend li strong {
    margin-left: auto;
    color: var(--text-primary);
    font-weight: 500;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.member-quota-legend {
    margin-bottom: 0.75rem;
}

.member-quota-legend strong {
    font-variant-numeric: tabular-nums;
}

.legend-dot-expiry {
    background: var(--secondary-color);
}

.oss-access-hint {
    margin: 0 0 12px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 120, 120, 0.35);
    background: rgba(255, 80, 80, 0.08);
    color: #ffb4b4;
    font-size: 13px;
    line-height: 1.5;
}

.resource-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.resource-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.resource-panel-header h3 {
    font-size: 1.15rem;
    margin-bottom: 0.35rem;
}

.resource-panel-sub {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.owner-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: rgba(0, 212, 255, 0.12);
    color: var(--primary-color);
    font-size: 0.85rem;
    border: 1px solid rgba(0, 212, 255, 0.25);
}

.status-pill {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-active {
    background: rgba(0, 255, 136, 0.12);
    color: var(--success-color);
    border: 1px solid rgba(0, 255, 136, 0.25);
}

.status-disabled {
    background: rgba(255, 71, 87, 0.12);
    color: var(--danger-color);
    border: 1px solid rgba(255, 71, 87, 0.25);
}

.leader-tag {
    font-size: 0.8rem;
    color: var(--warning-color);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    background: rgba(255, 165, 2, 0.12);
    border: 1px solid rgba(255, 165, 2, 0.25);
}

.form-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    line-height: 1.5;
}
