/* ===== 基础重置 ===== */
* { 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: #f0f2f5;
    color: #333;
    line-height: 1.6;
}

/* ===== 布局 ===== */
.layout {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: 220px;
    background: #001529;
    color: #fff;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}
.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #002140;
}
.sidebar-header h2 {
    font-size: 18px;
    font-weight: 500;
}
.sidebar-header h2::before {
    content: "📹 ";
}

.nav-menu {
    list-style: none;
    padding: 10px 0;
}
.nav-menu li a {
    display: block;
    padding: 15px 20px;
    color: #a6adb4;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}
.nav-menu li a:hover,
.nav-menu li a.active {
    color: #fff;
    background: #1890ff;
    border-left-color: #fff;
}
.nav-menu li a::before {
    margin-right: 10px;
    width: 20px;
    display: inline-block;
    text-align: center;
}

/* 主内容区 */
.main-content {
    margin-left: 220px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 顶部栏 */
.topbar {
    background: #fff;
    padding: 0 20px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    box-shadow: 0 1px 4px rgba(0,21,41,0.08);
    position: sticky;
    top: 0;
    z-index: 99;
}
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.user-role {
    background: #1890ff;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}
.user-role.member {
    background: #52c41a;
}

/* 内容区 */
.content {
    padding: 24px;
    flex: 1;
}
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.page-header h1 {
    font-size: 24px;
    font-weight: 500;
    color: #1f1f1f;
}

/* ===== 卡片 ===== */
.card {
    background: #fff;
    border-radius: 4px;
    padding: 24px;
    box-shadow: 0 1px 4px rgba(0,21,41,0.08);
    margin-bottom: 24px;
}

/* ===== 按钮 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    border-radius: 4px;
    border: 1px solid #d9d9d9;
    background: #fff;
    color: #595959;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}
.btn:hover {
    border-color: #1890ff;
    color: #1890ff;
}
.btn-primary {
    background: #1890ff;
    border-color: #1890ff;
    color: #fff;
}
.btn-primary:hover {
    background: #40a9ff;
    border-color: #40a9ff;
    color: #fff;
}
.btn-success {
    background: #52c41a;
    border-color: #52c41a;
    color: #fff;
}
.btn-success:hover {
    background: #73d13d;
    border-color: #73d13d;
}
.btn-danger {
    background: #ff4d4f;
    border-color: #ff4d4f;
    color: #fff;
}
.btn-danger:hover {
    background: #ff7875;
    border-color: #ff7875;
}
.btn-warning {
    background: #faad14;
    border-color: #faad14;
    color: #fff;
}
.btn-sm {
    padding: 4px 12px;
    font-size: 13px;
}
.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

/* ===== 表单 ===== */
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #262626;
}
.form-group label .required {
    color: #ff4d4f;
    margin-left: 4px;
}
.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
}
.form-control:focus {
    border-color: #1890ff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(24,144,255,0.2);
}
textarea.form-control {
    resize: vertical;
    min-height: 80px;
}
.form-hint {
    font-size: 12px;
    color: #8c8c8c;
    margin-top: 6px;
}
.form-inline {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

/* ===== 表格 ===== */
.data-table {
    width: 100%;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,21,41,0.08);
}
.data-table table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th,
.data-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}
.data-table th {
    background: #fafafa;
    font-weight: 600;
    color: #262626;
    font-size: 14px;
}
.data-table tr:hover {
    background: #fafafa;
}
.data-table td {
    color: #595959;
    font-size: 14px;
}

/* ===== 状态标签 ===== */
.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
}
.status::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.status-online {
    background: #f6ffed;
    color: #389e0d;
}
.status-online::before {
    background: #52c41a;
    box-shadow: 0 0 0 2px #b7eb8f;
}
.status-ready {
    background: #f6ffed;
    color: #389e0d;
}
.status-ready::before {
    background: #52c41a;
}
.status-disabled {
    background: #fff2f0;
    color: #cf1322;
}
.status-disabled::before {
    background: #ff4d4f;
}
.status-offline {
    background: #f5f5f5;
    color: #8c8c8c;
}
.status-offline::before {
    background: #bfbfbf;
}

/* ===== 提示框 ===== */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
}
.alert-success {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #389e0d;
}
.alert-error {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: #cf1322;
}
.alert-warning {
    background: #fffbe6;
    border: 1px solid #ffe58f;
    color: #d48806;
}
.alert-info {
    background: #e6f7ff;
    border: 1px solid #91d5ff;
    color: #096dd9;
}

/* ===== 登录页 ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}
.login-box {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 8px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.login-box h2 {
    text-align: center;
    margin-bottom: 8px;
    color: #1f1f1f;
    font-size: 28px;
}
.login-subtitle {
    text-align: center;
    color: #8c8c8c;
    margin-bottom: 32px;
    font-size: 14px;
}
.login-tips {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #f0f0f0;
    text-align: center;
    color: #8c8c8c;
    font-size: 13px;
}

/* ===== 信息展示 ===== */
.info-list {
    list-style: none;
}
.info-list li {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}
.info-list li:last-child {
    border-bottom: none;
}
.info-label {
    width: 120px;
    color: #8c8c8c;
    flex-shrink: 0;
}
.info-value {
    flex: 1;
    color: #262626;
    font-weight: 500;
}
.info-value code {
    background: #f5f5f5;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
    color: #cf1322;
    word-break: break-all;
}

/* ===== 播放器 ===== */
.player-container {
    background: #000;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
}
.player-info {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    border-radius: 4px;
    padding: 20px;
}
.player-info h3 {
    margin-bottom: 16px;
    color: #389e0d;
    font-size: 16px;
}
.url-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.url-item {
    display: flex;
    align-items: center;
    gap: 12px;
}
.url-label {
    width: 80px;
    flex-shrink: 0;
    color: #595959;
    font-size: 13px;
}
.url-input {
    flex: 1;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
    color: #262626;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== 下拉菜单 ===== */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: #fff;
    min-width: 120px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
    border-radius: 4px;
    z-index: 9999; /* 确保最上层 */
    overflow: visible;
    margin-top: 2px;
}

.dropdown-content a {
    display: block;
    padding: 10px 16px;
    color: #595959;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.3s;
    white-space: nowrap;
}

.dropdown-content a:hover {
    background: #f5f7fa;
    color: #1890ff;
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* 确保表格单元格overflow可见 */
.data-table td {
    position: relative;
    overflow: visible;
}

/* 修复表格容器 */
.data-table {
    overflow: visible;
}

.data-table table {
    overflow: visible;
}


/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .sidebar {
        width: 0;
        overflow: hidden;
    }
    .main-content {
        margin-left: 0;
    }
    .form-inline {
        flex-direction: column;
        align-items: stretch;
    }
    .form-inline .form-control {
        width: 100%;
    }
    .page-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}
