/* 控制面板样式 - 红色氛围风格（与官网一致） */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #e0e0e0;
}

/* 登录界面 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: rgba(30, 30, 50, 0.95);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(229, 57, 53, 0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 24px;
    color: #fff;
    margin-bottom: 10px;
}

.login-header p {
    color: #888;
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    color: #aaa;
    font-size: 14px;
}

.login-form input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(50, 50, 70, 0.8);
    border: 1px solid rgba(229, 57, 53, 0.3);
    border-radius: 8px;
    color: #fff;
    font-size: 15px;
    transition: all 0.3s;
}

.login-form input:focus {
    outline: none;
    border-color: #e53935;
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.2);
}

.login-form input::placeholder {
    color: #666;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-login:hover {
    background: linear-gradient(135deg, #ef5350 0%, #d32f2f 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(229, 57, 53, 0.4);
}

.btn-login:disabled {
    background: #555;
    cursor: not-allowed;
    transform: none;
}

.error-message {
    color: #ff6b6b;
    font-size: 14px;
    text-align: center;
    margin-top: 10px;
    min-height: 20px;
}

.login-tips {
    margin-top: 20px;
    padding: 15px;
    background: rgba(229, 57, 53, 0.1);
    border-radius: 8px;
    border-left: 3px solid #e53935;
}

.login-tips p {
    color: #888;
    font-size: 13px;
    line-height: 1.6;
}

/* 控制面板界面 */
.panel-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: rgba(20, 20, 40, 0.95);
    border-bottom: 1px solid rgba(229, 57, 53, 0.2);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-left h1 {
    font-size: 20px;
    color: #fff;
}

.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.status-online {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.5);
}

.status-offline {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.5);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.card-info {
    color: #888;
    font-size: 14px;
}

.btn-logout {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid rgba(231, 76, 60, 0.5);
    border-radius: 6px;
    color: #e74c3c;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: rgba(231, 76, 60, 0.2);
}

/* 主内容区 */
.panel-content {
    display: flex;
    flex: 1;
    padding: 20px;
    gap: 20px;
}

.panel-left {
    width: 350px;
    flex-shrink: 0;
}

.panel-right {
    flex: 1;
}

.section-box {
    background: rgba(30, 30, 50, 0.9);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(229, 57, 53, 0.2);
}

.section-title {
    font-size: 16px;
    color: #fff;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e53935;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-header .section-title {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* 任务表单 */
.task-form .form-group {
    margin-bottom: 15px;
}

.task-form label {
    display: block;
    margin-bottom: 6px;
    color: #aaa;
    font-size: 13px;
}

.task-form input,
.task-form select {
    width: 100%;
    padding: 12px 14px;
    background: rgba(50, 50, 70, 0.8);
    border: 1px solid rgba(229, 57, 53, 0.3);
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    transition: all 0.3s;
}

.task-form input:focus,
.task-form select:focus {
    outline: none;
    border-color: #e53935;
}

.task-form select {
    cursor: pointer;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-group.half {
    flex: 1;
}

.btn-submit {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-submit:hover {
    background: linear-gradient(135deg, #ef5350 0%, #d32f2f 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(229, 57, 53, 0.4);
}

.btn-submit:disabled {
    background: #555;
    cursor: not-allowed;
    transform: none;
}

.btn-refresh {
    padding: 8px 16px;
    background: rgba(229, 57, 53, 0.2);
    border: 1px solid rgba(229, 57, 53, 0.5);
    border-radius: 6px;
    color: #e53935;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-refresh:hover {
    background: rgba(229, 57, 53, 0.3);
}

/* 提示框 */
.tips-box {
    background: rgba(229, 57, 53, 0.1);
    border-color: rgba(229, 57, 53, 0.3);
}

.tips-box h3 {
    font-size: 14px;
    color: #e53935;
    margin-bottom: 12px;
}

.tips-box ul {
    list-style: none;
}

.tips-box li {
    color: #888;
    font-size: 13px;
    line-height: 1.8;
    padding-left: 15px;
    position: relative;
}

.tips-box li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #e53935;
}

/* 任务列表 */
.task-list-container {
    max-height: calc(100vh - 250px);
    overflow-y: auto;
}

.task-table {
    width: 100%;
    border-collapse: collapse;
}

.task-table th,
.task-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid rgba(229, 57, 53, 0.15);
}

.task-table th {
    background: rgba(50, 50, 70, 0.5);
    color: #aaa;
    font-size: 13px;
    font-weight: normal;
    position: sticky;
    top: 0;
}

.task-table td {
    font-size: 14px;
}

.task-table tbody tr:hover {
    background: rgba(229, 57, 53, 0.1);
}

.empty-row td {
    text-align: center;
    color: #666;
    padding: 40px;
}

/* 状态标签 */
.task-status {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
}

.task-status.pending {
    background: rgba(241, 196, 15, 0.2);
    color: #f1c40f;
}

.task-status.running {
    background: rgba(229, 57, 53, 0.2);
    color: #e53935;
}

.task-status.completed {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.task-status.failed {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.task-status.cancelled {
    background: rgba(149, 165, 166, 0.2);
    color: #95a5a6;
}

/* 剩余时间列 */
.remaining-time {
    font-family: 'Consolas', 'Monaco', monospace;
    font-weight: bold;
    color: #e53935;
    font-size: 14px;
    text-align: center;
}

/* 进度条 */
.progress-bar {
    width: 80px;
    height: 6px;
    background: rgba(229, 57, 53, 0.2);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, #e53935, #c62828);
    border-radius: 3px;
    transition: width 0.3s;
}

/* 操作按钮 */
.btn-cancel {
    padding: 5px 10px;
    background: transparent;
    border: 1px solid rgba(231, 76, 60, 0.5);
    border-radius: 4px;
    color: #e74c3c;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-cancel:hover {
    background: rgba(231, 76, 60, 0.2);
}

.btn-cancel:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(50, 50, 70, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(229, 57, 53, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(229, 57, 53, 0.8);
}

/* 响应式 */
@media (max-width: 900px) {
    .panel-content {
        flex-direction: column;
    }
    
    .panel-left {
        width: 100%;
    }
    
    .task-list-container {
        max-height: 400px;
    }
}

@media (max-width: 600px) {
    .panel-header {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }
    
    .header-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    /* 在小屏幕上隐藏"时长"列，保留"剩余时间"列 */
    .task-table th:nth-child(3),
    .task-table td:nth-child(3) {
        display: none;
    }
}


/* 离线遮罩 */
.offline-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.offline-content {
    text-align: center;
    color: #fff;
}

.offline-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.offline-content h2 {
    font-size: 28px;
    margin-bottom: 15px;
    color: #e53935;
}

.offline-content p {
    font-size: 16px;
    color: #888;
    margin-bottom: 30px;
}

.btn-reload {
    padding: 12px 30px;
    background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-reload:hover {
    background: linear-gradient(135deg, #ef5350 0%, #d32f2f 100%);
    transform: translateY(-2px);
}

/* 分页样式 */
.pagination {
    margin-top: 20px;
    padding: 15px 0;
    border-top: 1px solid rgba(229, 57, 53, 0.2);
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.page-btn {
    background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.page-btn:hover {
    background: linear-gradient(135deg, #c62828 0%, #b71c1c 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(229, 57, 53, 0.4);
}

.page-btn:active {
    transform: translateY(0);
}

.page-info {
    color: #e0e0e0;
    font-size: 14px;
    padding: 0 10px;
}

/* 移动端优化 */
@media (max-width: 768px) {
    /* 登录界面 */
    .login-box {
        padding: 30px 20px;
        max-width: 100%;
    }

    .login-header h1 {
        font-size: 20px;
    }

    /* 控制面板头部 */
    .panel-header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .header-left,
    .header-right {
        width: 100%;
        justify-content: center;
    }

    .header-left h1 {
        font-size: 18px;
    }

    .card-info {
        font-size: 12px;
        text-align: center;
        display: block;
        margin-bottom: 10px;
    }

    /* 主内容区 */
    .panel-content {
        flex-direction: column;
        padding: 15px;
        gap: 20px;
    }

    .panel-left,
    .panel-right {
        width: 100%;
    }

    /* 表单优化 */
    .form-row {
        flex-direction: column;
    }

    .form-group.half {
        width: 100%;
    }

    /* 任务表格 */
    .task-table {
        font-size: 12px;
    }

    .task-table th,
    .task-table td {
        padding: 10px 5px;
    }

    /* 隐藏部分列以适应小屏幕 */
    .task-table th:nth-child(2),
    .task-table td:nth-child(2) {
        display: none;
    }

    /* 按钮优化 */
    .btn-cancel {
        padding: 6px 12px;
        font-size: 12px;
    }

    /* 分页 */
    .pagination-controls {
        gap: 10px;
    }

    .page-btn {
        padding: 6px 15px;
        font-size: 12px;
    }

    .page-info {
        font-size: 12px;
    }

    /* 离线遮罩 */
    .offline-content {
        padding: 30px 20px;
    }

    .offline-content h2 {
        font-size: 20px;
    }

    .offline-icon {
        font-size: 48px;
    }

    /* 使用说明 */
    .tips-box {
        font-size: 13px;
    }

    .tips-box ul li {
        padding: 8px 0;
    }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
    .login-box {
        padding: 25px 15px;
    }

    .panel-header {
        padding: 10px;
    }

    .panel-content {
        padding: 10px;
    }

    .section-box {
        padding: 15px;
    }

    .task-table {
        font-size: 11px;
    }

    .task-table th,
    .task-table td {
        padding: 8px 3px;
    }

    /* 进一步隐藏列 */
    .task-table th:nth-child(3),
    .task-table td:nth-child(3) {
        display: none;
    }

    .btn-submit {
        font-size: 14px;
        padding: 12px;
    }
}

/* 横屏优化 */
@media (max-width: 768px) and (orientation: landscape) {
    .login-container {
        padding: 10px;
    }

    .login-box {
        max-height: 90vh;
        overflow-y: auto;
    }

    .panel-content {
        flex-direction: row;
    }

    .panel-left,
    .panel-right {
        width: 50%;
    }
}

/* 触摸优化 */
@media (hover: none) and (pointer: coarse) {
    .btn-submit,
    .btn-cancel,
    .btn-logout,
    .btn-refresh,
    .page-btn {
        min-height: 44px;
        min-width: 44px;
    }

    .task-table td {
        padding: 12px 8px;
    }
}
