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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Microsoft YaHei", sans-serif;
    background: #f5f7fa;
    color: #2c3e50;
    line-height: 1.6;
}

header {
    background: #fff;
    border-bottom: 1px solid #e1e8ed;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

header h1 {
    font-size: 20px;
    color: #1a73e8;
}

nav {
    display: flex;
    gap: 8px;
}

.tab-btn {
    background: transparent;
    border: 1px solid transparent;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #5f6c7b;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: #f0f4f8;
}

.tab-btn.active {
    background: #1a73e8;
    color: #fff;
}

main {
    max-width: 1200px;
    margin: 24px auto;
    padding: 0 24px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.toolbar h2 {
    font-size: 18px;
    color: #2c3e50;
}

.table-wrap {
    background: #fff;
    border-radius: 8px;
    overflow: auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #eef2f6;
    white-space: nowrap;
}

th {
    background: #fafbfc;
    color: #5f6c7b;
    font-weight: 600;
    font-size: 13px;
    position: sticky;
    top: 0;
}

tbody tr:hover {
    background: #f8fafc;
}

td.message-cell {
    white-space: normal;
    max-width: 400px;
    overflow-wrap: break-word;
    word-break: normal;
}

.btn {
    background: #fff;
    border: 1px solid #d0d7de;
    color: #2c3e50;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.btn:hover {
    background: #f0f4f8;
}

.btn-primary {
    background: #1a73e8;
    border-color: #1a73e8;
    color: #fff;
}

.btn-primary:hover {
    background: #1557b0;
}

.btn-danger {
    color: #dc3545;
    border-color: #dc3545;
}

.btn-danger:hover {
    background: #dc3545;
    color: #fff;
}

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

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}

.status-success {
    background: #d4edda;
    color: #155724;
}

.status-failed {
    background: #f8d7da;
    color: #721c24;
}

.status-skip {
    background: #fff3cd;
    color: #856404;
}

.status-running {
    background: #d1ecf1;
    color: #0c5460;
}

/* 弹窗 */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 560px;
    max-height: 90vh;
    overflow: auto;
}

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

.modal-header h3 {
    font-size: 16px;
}

.btn-close {
    background: transparent;
    border: none;
    font-size: 24px;
    color: #5f6c7b;
    cursor: pointer;
    line-height: 1;
}

#task-form {
    padding: 20px;
}

.form-row {
    margin-bottom: 14px;
}

.form-row label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #2c3e50;
    font-weight: 500;
}

.form-row label small {
    color: #8b9aab;
    font-weight: normal;
}

.form-row input[type="text"],
.form-row input[type="url"],
.form-row input[type="password"],
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

.form-row input:focus,
.form-row textarea:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.form-row .hint {
    display: block;
    margin-top: 6px;
    color: #8b9aab;
    font-size: 12px;
    font-weight: normal;
    line-height: 1.5;
}

.form-row .help-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 4px;
    border-radius: 50%;
    background: #1a73e8;
    color: #fff !important;
    font-size: 11px;
    font-weight: bold;
    text-decoration: none;
    line-height: 1;
    vertical-align: middle;
}

.form-row .help-link:hover {
    background: #1557b0;
}

.form-row.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-row.checkbox label {
    margin: 0;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}

/* 卡片 */
.card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.card h3 {
    font-size: 15px;
    margin: 12px 0 8px;
    color: #2c3e50;
}

.card ul {
    padding-left: 20px;
    margin: 8px 0;
}

.card li {
    margin: 4px 0;
}

code {
    background: #f1f3f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
    color: #c7254e;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #2c3e50;
    color: #fff;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    z-index: 2000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast.hidden {
    display: none;
}

.toast.error {
    background: #dc3545;
}

.toast.success {
    background: #28a745;
}

#telegram-info {
    margin: 12px 0;
    padding: 12px;
    background: #f8fafc;
    border-radius: 6px;
    font-size: 14px;
}

#telegram-test-result {
    margin-top: 12px;
    font-size: 14px;
}

select {
    padding: 6px 10px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    font-size: 13px;
}
