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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.header h1 {
    color: #333;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.back-btn {
    background: #6c5ce7;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #5a4fcf;
    transform: translateY(-2px);
}

.room-info {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* 本地预览链接样式 */
.preview-section {
    margin-top: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.preview-section h3 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 1.1em;
    font-weight: 600;
}

.preview-links {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.preview-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: white;
    border: 1px solid #ced4da;
    border-radius: 6px;
    text-decoration: none;
    color: #495057;
    font-weight: 500;
    transition: all 0.3s ease;
}

.preview-link:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
    text-decoration: none;
    color: #343a40;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.preview-icon {
    font-size: 1.2em;
}

.room-info h2 {
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #6c5ce7;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.info-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #6c5ce7;
}

.info-item label {
    font-weight: 600;
    color: #555;
    display: block;
    margin-bottom: 5px;
}

.info-item .value {
    color: #333;
    font-size: 16px;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-inactive { background: #e74c3c; color: white; }
.status-active { background: #27ae60; color: white; }
.status-ended { background: #95a5a6; color: white; }

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.btn-primary { background: #6c5ce7; color: white; }
.btn-success { background: #00b894; color: white; }
.btn-danger { background: #e74c3c; color: white; }
.btn-warning { background: #f39c12; color: white; }
.btn-secondary { background: #95a5a6; color: white; }

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

.btn-sm {
    padding: 4px 8px;
    font-size: 11px;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #666;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #999;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.error {
    background: #fee;
    color: #c33;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #fcc;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

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

.modal h2 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #6c5ce7;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 25px;
}

.modal-actions button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-cancel {
    background: #95a5a6;
    color: white;
}

.btn-submit {
    background: #6c5ce7;
    color: white;
}

.btn-cancel:hover,
.btn-submit:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

/* 机位列表样式 */
.positions-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.positions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #6c5ce7;
}

.positions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(600px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

/* 大卡片样式 */
.position-card-large {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    overflow: hidden;
}

.position-card-large:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    transform: translateY(-4px);
}

.position-card-large.active {
    border-color: #4CAF50;
    background: linear-gradient(135deg, #f8fff8 0%, #ffffff 100%);
}

.position-card-large.default {
    border-color: #2196F3;
    background: linear-gradient(135deg, #f0f8ff 0%, #ffffff 100%);
}

/* 卡片头部 */
.position-card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.position-title h2 {
    margin: 0 0 10px 0;
    font-size: 1.5em;
    font-weight: 600;
}

.position-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.position-type-badge, .default-badge, .active-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 500;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
}

.position-type-badge.main {
    background: rgba(76, 175, 80, 0.8);
}

.position-type-badge.backup {
    background: rgba(255, 152, 0, 0.8);
}

.position-type-badge.special {
    background: rgba(156, 39, 176, 0.8);
}

.default-badge {
    background: rgba(33, 150, 243, 0.8);
}

.active-badge {
    background: rgba(76, 175, 80, 0.8);
}

.position-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ccc;
}

.status-indicator.1 {
    background: #4CAF50;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
}

.status-indicator.0 {
    background: #f44336;
}

.status-text {
    font-size: 0.9em;
    font-weight: 500;
}

/* 卡片内容 */
.position-content {
    padding: 25px;
}

.position-info-section, .stream-config-section, .play-urls-section {
    margin-bottom: 25px;
}

.position-info-section h3, .stream-config-section h3, .play-urls-section h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.1em;
    font-weight: 600;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 8px;
}

.stream-config-grid, .play-urls-grid {
    display: grid;
    gap: 15px;
}

.config-item, .play-url-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.config-item label, .play-url-item label {
    font-weight: 600;
    color: #666;
    font-size: 0.9em;
}

.config-value {
    display: flex;
    gap: 10px;
    align-items: center;
}

.config-value input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    background: #f9f9f9;
}

.position-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    border-left: 4px solid #6c5ce7;
    transition: all 0.3s ease;
}

.position-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.position-card.active {
    border-left-color: #27ae60;
    background: #e8f5e8;
}

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

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

.position-type {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.position-type.main { background: #e3f2fd; color: #1976d2; }
.position-type.backup { background: #fff3e0; color: #f57c00; }
.position-type.special { background: #f3e5f5; color: #7b1fa2; }

.position-info {
    margin-bottom: 15px;
}

.position-info p {
    margin: 5px 0;
    font-size: 14px;
    color: #666;
}

.position-info .status {
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
}

.status.active { background: #e8f5e8; color: #27ae60; }
.status.inactive { background: #fee; color: #e74c3c; }
.status.streaming { background: #e3f2fd; color: #1976d2; }
.status.offline { background: #f5f5f5; color: #666; }

.default-badge {
    background: #fff3cd;
    color: #856404;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
    margin-top: 5px;
}

.position-actions {
    padding: 20px 25px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.position-actions .btn {
    flex: 1;
    min-width: 120px;
    padding: 10px 16px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.position-actions .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* OBS推流信息样式 */
.obs-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.obs-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    border-left: 4px solid #e74c3c;
}

.obs-item label {
    font-weight: 600;
    color: #555;
    display: block;
    margin-bottom: 8px;
}

.obs-value {
    display: flex;
    align-items: center;
    gap: 10px;
}

.obs-value input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    font-family: monospace;
    font-size: 14px;
}

.copy-btn {
    padding: 8px 16px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 500;
    transition: background 0.3s ease;
    white-space: nowrap;
}

.copy-btn:hover {
    background: #1976D2;
}

.copy-btn.copied {
    background: #27ae60;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

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

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

    .positions-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .obs-value {
        flex-direction: column;
        align-items: stretch;
    }

    .modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 20px;
    }
}