:root {
    --ink: #16201a;
    --muted: #647066;
    --paper: #f6f1e6;
    --panel: rgba(255, 252, 243, 0.82);
    --line: rgba(22, 32, 26, 0.14);
    --shadow: 0 30px 80px rgba(45, 54, 44, 0.16);
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
    background:
        radial-gradient(circle at 18% 10%, rgba(255, 184, 77, 0.2), transparent 30%),
        radial-gradient(circle at 90% 18%, rgba(79, 140, 255, 0.18), transparent 32%),
        linear-gradient(135deg, #f7f0e3 0%, #edf3e8 100%);
}

body::before {
    position: fixed;
    inset: 0;
    pointer-events: none;
    content: "";
    background-image:
        linear-gradient(rgba(22, 32, 26, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(22, 32, 26, 0.05) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 82%);
}

.task-shell {
    position: relative;
    width: min(1400px, calc(100% - 32px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 20px 0 72px;
}

.task-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 28px;
    align-items: center;
    margin-bottom: 32px;
}

.header-left {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-self: start;
}

.space-switcher {
    display: flex;
    gap: 8px;
    align-items: center;
}

.space-switcher select {
    width: auto;
    min-width: 150px;
    min-height: 44px;
    border-radius: 999px;
    padding: 0 38px 0 16px;
    font-weight: 800;
}

.header-title {
    justify-self: center;
    text-align: center;
}

.header-actions {
    justify-self: end;
}

.table-link,
.text-button {
    color: #9a5c17;
    font-weight: 700;
    text-decoration: none;
}

.back-link {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    color: #9a5c17;
    border: 1px solid #9a5c17;
    border-radius: 999px;
    background: rgba(255, 252, 243, 0.72);
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
}

.eyebrow,
.section-label {
    margin: 0 0 8px;
    color: #9a5c17;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

h1,
h2,
h3 {
    margin: 0;
    letter-spacing: -0.04em;
}

h1 {
    font-size: 1.8em;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.04em;
}

h2 {
    font-size: 1.8em;
    font-weight: 800;
    line-height: 1.1;
}

.hero-copy {
    max-width: 620px;
    margin: 24px 0 0;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.8;
}

.header-actions,
.modal-actions,
.inline-form {
    display: flex;
    gap: 12px;
    align-items: center;
}

.primary-button,
.ghost-button,
.settings-button,
.danger-button,
.action-button {
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid rgba(22, 32, 26, 0.16);
    border-radius: 999px;
    font: inherit;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

.header-link-button {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.header-more-menu {
    position: relative;
}

.header-more-trigger {
    display: inline-grid;
    min-width: 44px;
    padding: 0 14px;
    place-items: center;
    font-size: 24px;
    list-style: none;
    user-select: none;
}

.header-more-trigger::-webkit-details-marker {
    display: none;
}

.header-more-popover {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 50;
    min-width: 128px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.header-more-item {
    display: block;
    width: 100%;
    min-height: 40px;
    padding: 0 14px;
    border: 0;
    border-radius: 12px;
    color: var(--ink);
    background: transparent;
    font: inherit;
    font-weight: 800;
    line-height: 40px;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.header-more-item:hover {
    background: rgba(22, 32, 26, 0.08);
}

.header-more-item[hidden] {
    display: none;
}

.primary-button {
    color: #fffaf0;
    background: #16201a;
}

.header-actions .primary-button {
    color: var(--ink);
    background: rgba(255, 252, 243, 0.72);
}

.danger-button {
    color: #fffaf0;
    background: #b42318;
}

.ghost-button,
.settings-button,
.action-button {
    color: var(--ink);
    background: rgba(255, 252, 243, 0.72);
}

.action-button.danger {
    color: #b42318;
    border-color: rgba(180, 35, 24, 0.24);
    background: rgba(180, 35, 24, 0.08);
}

.settings-button {
    min-width: 58px;
    padding: 0 14px;
    font-size: 32px;
}

.table-panel,
.modal-card,
.drawer-panel {
    border: 1px solid var(--line);
    border-radius: 32px;
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.table-panel {
    padding: 24px;
}

.table-title-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    margin-bottom: 18px;
}

.table-title-tools {
    display: flex;
    gap: 16px;
    align-items: center;
}

.project-status-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.project-status-legend span {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.status-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
}

.status-legend-dot.hold {
    background: #f2b84b;
}

.status-legend-dot.research-design {
    background: #fff0f4;
    border: 1px solid rgba(185, 71, 104, 0.3);
}

.status-legend-dot.development {
    background: #eef7ff;
    border: 1px solid rgba(22, 119, 255, 0.24);
}

.status-legend-dot.testing {
    background: #eefaf1;
    border: 1px solid rgba(47, 125, 87, 0.24);
}

.table-wrap {
    overflow-x: auto;
}

.project-table {
    width: 100%;
    min-width: 1100px;
    border-collapse: collapse;
}

.project-table th,
.project-table td {
    padding: 16px 14px;
    border-bottom: 1px solid rgba(22, 32, 26, 0.1);
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

.project-table .column-projectName,
.project-table .column-summary {
    white-space: normal;
}

.project-name-cell {
    display: block;
    width: 10em;
    white-space: normal;
    word-break: break-all;
}

.project-summary-cell {
    display: -webkit-box;
    width: 20em;
    overflow: hidden;
    white-space: normal;
    word-break: break-all;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
}

.project-table .column-platforms,
.project-table .column-owner {
    min-width: 100px;
    white-space: normal;
}

.project-table .column-owner {
    min-width: 150px;
    max-width: 220px;
}

.project-table .column-priority {
    width: 10ch;
    max-width: 10ch;
    padding-right: 10px;
    padding-left: 10px;
}

.project-table .column-priority .sort-button {
    gap: 2px;
}

.project-table .column-priority .sort-indicator {
    width: 14px;
}

.project-table .column-requirementDocs,
.project-table .column-ueDrafts,
.project-table .column-uiDrafts,
.project-table .column-platforms {
    width: 1%;
    min-width: auto;
    padding-right: 10px;
    padding-left: 10px;
    white-space: nowrap;
}

.platform-line,
.owner-line {
    display: block;
}

.owner-line {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-table th {
    color: #000;
    font-size: 15.6px;
    font-weight: 800;
}

.sort-button {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    min-height: 30px;
    border: 0;
    padding: 0;
    color: inherit;
    background: transparent;
    font: inherit;
    font-weight: inherit;
    cursor: pointer;
}

.sort-indicator {
    width: 22px;
    color: rgba(22, 32, 26, 0.72);
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
    text-align: center;
}

.project-table td {
    font-size: 14px;
}

.project-table tbody tr.project-row-hold td {
    background: #fff6df;
}

.project-table tbody tr.project-row-research-design td {
    background: #fff0f4;
}

.project-table tbody tr.project-row-development td {
    background: #eef7ff;
}

.project-table tbody tr.project-row-testing td {
    background: #eefaf1;
}

.project-table tbody tr.project-row-done td {
    background: #d6eadb;
}

.table-link {
    display: block;
    margin-bottom: 6px;
    color: #1677ff;
    text-align: left;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.action-column {
    position: sticky;
    right: 0;
    z-index: 1;
    width: 1%;
    white-space: nowrap;
    background: rgba(255, 252, 243, 0.96);
}

.row-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
    width: max-content;
}

.action-button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 13px;
}

.mini-tag,
.config-tag {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    margin: 0 6px 6px 0;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255, 184, 77, 0.18);
    color: #7b4b13;
    font-size: 12px;
    font-weight: 800;
}

.empty-cell {
    color: rgba(22, 32, 26, 0.36);
}

.empty-table-cell {
    padding: 48px 20px;
    color: rgba(22, 32, 26, 0.42);
    font-weight: 800;
    text-align: center;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(22, 32, 26, 0.32);
}

.task-toast {
    position: fixed;
    left: 50%;
    bottom: 40px;
    z-index: 60;
    max-width: min(420px, calc(100vw - 48px));
    padding: 12px 18px;
    border-radius: 999px;
    color: #fff;
    background: rgba(22, 32, 26, 0.9);
    box-shadow: 0 14px 34px rgba(22, 32, 26, 0.2);
    font-size: 14px;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 12px);
    transition: opacity 160ms ease, transform 160ms ease;
}

.task-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.modal.is-open {
    display: flex;
}

.modal-card {
    position: relative;
    width: min(680px, 100%);
    max-height: min(88vh, 900px);
    overflow-y: auto;
    padding: 30px;
}

.modal-card.wide {
    width: min(980px, 100%);
}

.modal-card.compact {
    width: min(520px, 100%);
}

.modal-card.confirm-card {
    width: min(460px, 100%);
}

#column-modal h2 {
    text-align: center;
    font-size: 1.8em;
    font-weight: 800;
    line-height: 1.1;
    margin: 0;
}

#column-form {
    margin-top: 30px;
}

#column-modal .modal-actions {
    justify-content: center;
    margin-top: 30px;
}

.modal-close,
.icon-button {
    border: 0;
    border-radius: 999px;
    cursor: pointer;
}

.modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 36px;
    height: 36px;
    background: rgba(22, 32, 26, 0.08);
    font-size: 24px;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid rgba(22, 32, 26, 0.14);
    border-radius: 16px;
    padding: 12px 14px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.62);
    font: inherit;
}

fieldset,
.form-section {
    margin: 0;
    border: 1px solid rgba(22, 32, 26, 0.12);
    border-radius: 18px;
    padding: 14px;
}

.check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.check-item {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(22, 32, 26, 0.05);
}

.check-item input {
    flex: 0 0 auto;
    width: auto;
    margin: 0;
}

.icon-button {
    width: 16px;
    height: 16px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    color: #9a5c17;
    border: 1px solid #9a5c17;
    background: rgba(255, 252, 243, 0.72);
    font-size: 12px;
    line-height: 1;
}

.text-button {
    width: 16px;
    height: 16px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 1px solid #9a5c17;
    border-radius: 999px;
    background: rgba(255, 252, 243, 0.72);
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.inline-form input {
    flex: 1;
}

.drawer {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: none;
}

.drawer.is-open {
    display: block;
}

.drawer-mask {
    position: absolute;
    inset: 0;
    background: rgba(22, 32, 26, 0.32);
}

.drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 80vw;
    max-width: 1180px;
    height: 100vh;
    overflow-y: auto;
    padding: 20px 36px 36px;
    border-radius: 32px 0 0 32px;
    animation: drawer-slide 180ms ease-out;
}

#drawer-title {
    padding: 0 48px;
    text-align: center;
}

.drawer-close {
    position: absolute;
    top: 20px;
    right: 24px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: rgba(22, 32, 26, 0.08);
    font-size: 24px;
    cursor: pointer;
}

.drawer-content {
    margin-top: 28px;
}

@keyframes drawer-slide {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

@media (max-width: 820px) {
    .task-shell {
        width: min(100% - 28px, 640px);
        padding: 36px 0;
    }

    .task-header {
        grid-template-columns: 1fr;
    }

    .header-left,
    .header-title,
    .header-actions {
        justify-self: stretch;
    }

    .header-title {
        text-align: left;
    }

    .table-title-row,
    .table-title-tools,
    .header-actions,
    .inline-form {
        align-items: stretch;
        flex-direction: column;
    }

    .project-status-legend {
        justify-content: flex-start;
    }

    .drawer-panel {
        width: 94vw;
        padding: 28px 20px;
    }
}
