/* 初识BDSM 任务清单样式 */

.task-hero {
    text-align: center;
    padding: 1.8rem 1rem 1.2rem;
    border-bottom: 2px solid var(--fg);
    margin-bottom: 1.5rem;
}
.task-hero h1 {
    font-size: 2rem;
    letter-spacing: 3px;
    margin-bottom: 6px;
}
.task-hero .subtitle {
    color: var(--muted);
    font-size: 0.85rem;
    letter-spacing: 1px;
}
.task-hero .task-source {
    color: var(--muted);
    font-size: 0.72rem;
    margin-top: 8px;
}

/* 进度统计条 */
.progress-bar-wrap {
    max-width: 720px;
    margin: 0 auto 1.5rem;
    padding: 0 1rem;
}
.progress-bar {
    background: var(--hover-bg);
    border: 1.5px solid var(--fg);
    border-radius: 6px;
    height: 28px;
    position: relative;
    overflow: hidden;
}
.progress-bar-inner {
    background: var(--fg);
    height: 100%;
    width: 0;
    transition: width 0.4s ease;
    border-radius: 4px 0 0 4px;
}
.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.8rem;
    font-weight: bold;
    mix-blend-mode: difference;
    color: #fff;
    white-space: nowrap;
}
.task-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.btn-task {
    background: var(--fg);
    color: var(--bg);
    border: 2px solid var(--fg);
    border-radius: 5px;
    padding: 8px 18px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.btn-task:hover {
    background: var(--bg);
    color: var(--fg);
}
.btn-task.btn-outline {
    background: var(--bg);
    color: var(--fg);
}
.btn-task.btn-outline:hover {
    background: var(--fg);
    color: var(--bg);
}

/* 任务分类 */
.task-section {
    max-width: 720px;
    margin: 0 auto 1.6rem;
    padding: 0 1rem;
}
.task-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 1rem;
    font-weight: bold;
    letter-spacing: 2px;
    cursor: pointer;
    user-select: none;
}
.task-section-title .cat-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 1.5px solid var(--fg);
    border-radius: 50%;
    font-size: 0.75rem;
    flex-shrink: 0;
}
.task-section-title .cat-line {
    flex: 1;
    height: 1px;
    background: var(--light-border);
}
.task-section-title .cat-count {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: normal;
}
.task-section-title .cat-toggle {
    font-size: 0.7rem;
    color: var(--muted);
    margin-left: 6px;
    transition: transform 0.2s;
    display: inline-block;
}
.task-section.collapsed .cat-toggle {
    transform: rotate(-90deg);
}
.task-section.collapsed .task-list,
.task-section.collapsed .custom-task-add {
    display: none;
}

.task-list {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow: hidden;
}
.task-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px 10px 14px;
    border: 1.5px solid var(--light-border);
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg);
    position: relative;
}
.task-item:hover {
    border-color: var(--fg);
    background: var(--hover-bg);
}
.task-item:active {
    background: var(--hover-bg);
}
.task-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--light-border);
    border-radius: 2px;
}
.task-item[data-difficulty="easy"]::before { background: #4CAF50; }
.task-item[data-difficulty="medium"]::before { background: #FF9800; }
.task-item[data-difficulty="hard"]::before { background: #f44336; }
.task-item[data-difficulty="extreme"]::before { background: #9C27B0; }

.task-content {
    flex: 1;
}
.task-text {
    font-size: 0.92rem;
    line-height: 1.5;
}
.task-desc {
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 3px;
}
.task-meta {
    display: flex;
    gap: 6px;
    margin-top: 5px;
    flex-wrap: wrap;
}
.task-tag {
    font-size: 0.68rem;
    padding: 1px 6px;
    border-radius: 3px;
    border: 1px solid var(--light-border);
    color: var(--muted);
    letter-spacing: 0.5px;
    line-height: 1.4;
}
.task-tag.diff-easy { color: #4CAF50; border-color: #4CAF50; }
.task-tag.diff-medium { color: #FF9800; border-color: #FF9800; }
.task-tag.diff-hard { color: #f44336; border-color: #f44336; }
.task-tag.diff-extreme { color: #9C27B0; border-color: #9C27B0; }
.task-tag.type-tag { color: var(--muted); }

/* 计数徽章 */
.task-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 22px;
    padding: 0 6px;
    border: 1.5px solid var(--fg);
    border-radius: 11px;
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--fg);
    background: var(--bg);
    flex-shrink: 0;
    transition: all 0.15s;
}
.task-item.counted .task-count-badge {
    background: var(--fg);
    color: var(--bg);
}

/* 自定义任务 */
.custom-task-add {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
.custom-task-input {
    flex: 1;
    border: 1.5px solid var(--light-border);
    border-radius: 5px;
    padding: 8px 12px;
    font-size: 0.88rem;
    font-family: inherit;
    transition: border-color 0.2s;
}
.custom-task-input:focus {
    outline: none;
    border-color: var(--fg);
}
.btn-add-task {
    background: var(--fg);
    color: var(--bg);
    border: 2px solid var(--fg);
    border-radius: 5px;
    padding: 8px 16px;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}
.btn-add-task:hover {
    background: var(--bg);
    color: var(--fg);
}
.task-item .task-delete {
    margin-left: 8px;
    color: var(--muted);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 2px 6px;
    border: none;
    background: none;
    font-family: inherit;
}
.task-item .task-delete:hover {
    color: #c33;
}

/* 难度图例 */
.difficulty-legend {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 10px;
}
.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

/* 说明区 */
.info-section {
    max-width: 720px;
    margin: 0 auto 1.6rem;
    padding: 1rem;
    border: 1.5px dashed var(--light-border);
    border-radius: 8px;
    background: var(--hover-bg);
}
.info-section h3 {
    font-size: 0.95rem;
    margin-bottom: 8px;
    letter-spacing: 1px;
}
.info-section ul {
    padding-left: 20px;
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.8;
}
.info-section + .info-section {
    margin-top: -0.5rem;
}

@media (max-width: 480px) {
    .task-hero { padding: 1.2rem 1rem 1rem; }
    .task-hero h1 { font-size: 1.6rem; letter-spacing: 2px; }
    .task-hero .subtitle { font-size: 0.78rem; }
    .task-section { padding: 0 0.6rem; margin-bottom: 1.2rem; }
    .progress-bar-wrap { padding: 0 0.6rem; }
    .task-item { padding: 9px 10px 9px 14px; gap: 8px; }
    .task-text { font-size: 0.85rem; }
    .task-desc { font-size: 0.72rem; }
    .btn-task { padding: 7px 14px; font-size: 0.8rem; }
    .info-section { margin: 0 0.6rem 1.2rem; padding: 0.8rem; }
    .info-section ul { font-size: 0.76rem; }
}
