:root {
        --bg: #f5f6f8;
        --surface: #ffffff;
        --text: #182026;
        --muted: #6e7781;
        --line: #e2e7ec;
        --primary: #176b5d;
        --primary-soft: #e1f0ec;
        --amber: #b95b16;
        --amber-soft: #fff0dc;
        --deep-red: #9f1d1d;
        --blue: #265d97;
        --blue-soft: #e6f0fb;
        --inactive: #b3bbc3;
        --shadow: 0 10px 24px rgba(24, 32, 38, 0.08);
        font-family:
          -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Microsoft YaHei", sans-serif;
      }

      * {
        box-sizing: border-box;
      }

      body {
        margin: 0;
        min-height: 100vh;
        background: var(--bg);
        color: var(--text);
      }

      button,
      input,
      select,
      textarea {
        font: inherit;
      }

      button {
        border: 0;
        cursor: pointer;
      }

      .app {
        min-height: 100vh;
        display: grid;
        grid-template-columns: 1fr;
      }

      body[data-auth="locked"] .sidebar,
      body[data-auth="locked"] .module-tabs,
      body[data-auth="locked"] .marketing-module,
      body[data-auth="locked"] .operation-module,
      body[data-auth="locked"] .learning-module,
      body[data-auth="locked"] #detailPanel,
      body[data-auth="locked"] #followEditor,
      body[data-auth="locked"] #taskEditor,
      body[data-auth="locked"] #customerEditor {
        display: none !important;
      }

      body[data-auth="unlocked"] .splash-screen {
        display: none;
      }

      #loginMask,
      #loginPanel {
        display: none !important;
      }

      .splash-screen {
        min-height: calc(100vh - 76px);
        padding: 16px 14px 96px;
        display: grid;
        align-content: center;
        gap: 14px;
        width: min(100%, 440px);
        margin: 0 auto;
      }

      .splash-slider {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 100%;
        gap: 12px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
      }

      .splash-slider::-webkit-scrollbar {
        display: none;
      }

      .splash-card {
        min-height: 66vh;
        display: grid;
        align-content: end;
        scroll-snap-align: center;
        border-radius: 14px;
        overflow: hidden;
        padding: 22px;
        color: #fff;
        background:
          linear-gradient(160deg, rgba(23, 107, 93, 0.92), rgba(24, 32, 38, 0.82)),
          var(--primary);
        box-shadow: var(--shadow);
      }

      .splash-card.has-image {
        background-size: cover;
        background-position: center;
      }

      .splash-card h2 {
        font-size: 26px;
        line-height: 1.15;
      }

      .splash-card p {
        margin-top: 12px;
        color: rgba(255, 255, 255, 0.84);
        font-size: 14px;
        line-height: 1.65;
      }

      .splash-dots {
        display: flex;
        justify-content: center;
        gap: 6px;
      }

      .splash-dot {
        width: 7px;
        height: 7px;
        border-radius: 999px;
        background: #c9d0d5;
      }

      .splash-dot.active {
        width: 18px;
        background: var(--primary);
      }

      .sidebar {
        display: none;
      }

      .main {
        width: 100%;
        max-width: 1180px;
        margin: 0 auto;
        padding: 16px 14px 94px;
      }

      .topbar {
        position: sticky;
        top: 0;
        z-index: 10;
        margin: -16px -14px 12px;
        padding: 14px;
        background: rgba(245, 246, 248, 0.95);
        border-bottom: 1px solid rgba(226, 231, 236, 0.9);
        backdrop-filter: blur(14px);
      }

      .topline {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        margin-top: 12px;
      }

      h1,
      h2,
      h3,
      p {
        margin: 0;
      }

      h1 {
        font-size: 21px;
        line-height: 1.2;
        letter-spacing: 0;
      }

      .sub {
        margin-top: 4px;
        color: var(--muted);
        font-size: 13px;
      }

      .sync {
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        border-radius: 999px;
        padding: 7px 10px;
        background: var(--primary-soft);
        color: var(--primary);
        font-size: 12px;
        font-weight: 700;
      }

      .sync::before {
        content: "";
        width: 7px;
        height: 7px;
        border-radius: 999px;
        background: var(--primary);
      }

      .module-tabs {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        margin-bottom: 12px;
      }

      .module-tab {
        min-height: 40px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: #fff;
        color: var(--muted);
        font-size: 13px;
        font-weight: 800;
      }

      body[data-module="marketing"] .module-tab[data-module="marketing"],
      body[data-module="operation"] .module-tab[data-module="operation"],
      body[data-module="learning"] .module-tab[data-module="learning"] {
        border-color: var(--primary);
        background: var(--primary-soft);
        color: var(--primary);
      }

      .search-row {
        display: grid;
        grid-template-columns: 1fr 44px;
        gap: 9px;
        margin-top: 13px;
      }

      body[data-view="todo"] .customer-only,
      body[data-view="customer"] .module-tabs,
      body[data-view="customer"] .todo-only,
      body[data-view="customer"] .operation-module,
      body[data-view="customer"] .learning-module,
      body[data-view="mine"] .module-tabs,
      body[data-view="mine"] .marketing-module,
      body[data-view="mine"] .operation-module,
      body[data-view="mine"] .learning-module,
      body:not([data-view="mine"]) .mine-module,
      body[data-view="dashboard"] .module-tabs,
      body[data-view="dashboard"] .marketing-module,
      body[data-view="dashboard"] .operation-module,
      body[data-view="dashboard"] .learning-module,
      body[data-view="todo"][data-module="operation"] .marketing-module,
      body[data-view="todo"][data-module="learning"] .marketing-module,
      body[data-view="todo"][data-module="marketing"] .operation-module,
      body[data-view="todo"][data-module="marketing"] .learning-module,
      body[data-view="todo"][data-module="operation"] .learning-module,
      body[data-view="todo"][data-module="learning"] .operation-module,
      body[data-view="customer"] .customer-extra-section {
        display: none;
      }

      body[data-view="todo"] .search-row,
      body[data-view="todo"] .filter-tags,
      body[data-view="todo"] .filter-mask,
      body[data-view="todo"] .filter-board {
        display: none;
      }

      .search {
        width: 100%;
        height: 44px;
        border: 1px solid var(--line);
        border-radius: 8px;
        padding: 0 13px;
        outline: none;
        background: var(--surface);
      }

      .filter-tags {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        padding: 8px 1px 1px;
        scrollbar-width: none;
      }

      .filter-tags::-webkit-scrollbar {
        display: none;
      }

      .active-filter {
        flex: 0 0 auto;
        min-height: 26px;
        display: inline-flex;
        align-items: center;
        gap: 5px;
        border: 1px solid var(--primary-soft);
        border-radius: 999px;
        padding: 0 9px;
        color: var(--primary);
        background: var(--primary-soft);
        font-size: 11px;
        font-weight: 800;
      }

      .active-filter button {
        color: inherit;
        background: transparent;
        font-size: 13px;
        line-height: 1;
      }

      .icon-btn {
        width: 44px;
        height: 44px;
        display: grid;
        place-items: center;
        border-radius: 8px;
        background: var(--primary);
        color: #fff;
      }

      svg {
        width: 20px;
        height: 20px;
        stroke-width: 2;
      }

      .filter-mask {
        position: fixed;
        inset: 0;
        z-index: 30;
        display: none;
        background: rgba(24, 32, 38, 0.2);
      }

      body.filter-open .filter-mask {
        display: block;
      }

      .filter-board {
        position: relative;
        z-index: 31;
        max-height: 0;
        overflow: hidden;
        padding: 0 14px;
        border: 1px solid var(--line);
        border-radius: 14px;
        background: var(--surface);
        margin: 0 0 12px;
        opacity: 0;
        pointer-events: none;
        transform: translateY(-8px);
        box-shadow: none;
        transition:
          max-height 180ms ease,
          opacity 160ms ease,
          transform 180ms ease,
          padding 180ms ease,
          box-shadow 180ms ease;
      }

      body.filter-open .filter-board {
        max-height: 72vh;
        padding: 12px 14px;
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
        box-shadow: 0 12px 24px rgba(24, 32, 38, 0.10);
      }

      .filter-board-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        margin-bottom: 8px;
      }

      .filter-board-head b {
        font-size: 15px;
      }

      .clear-filters {
        color: var(--muted);
        background: transparent;
        font-size: 12px;
        font-weight: 700;
      }

      .filter-grid {
        display: grid;
        gap: 10px;
      }

      .filter-item {
        position: relative;
        min-width: 0;
      }

      .filter-row {
        display: grid;
        gap: 7px;
        min-width: 0;
      }

      .filter-row-title {
        color: var(--muted);
        font-size: 11px;
        font-weight: 900;
      }

      .filter-options {
        display: flex;
        gap: 7px;
        overflow-x: auto;
        padding-bottom: 1px;
        scrollbar-width: none;
      }

      .filter-options::-webkit-scrollbar {
        display: none;
      }

      .dropdown-shell {
        position: relative;
      }

      .dropdown-trigger {
        width: 100%;
        min-height: 42px;
        display: grid;
        align-content: center;
        justify-items: start;
        gap: 4px;
        padding: 8px 10px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: #fff;
        color: var(--text);
        font-size: 12px;
        font-weight: 800;
      }

      .dropdown-trigger .label {
        color: var(--muted);
        font-size: 11px;
        line-height: 1;
      }

      .dropdown-trigger .value-row {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
      }

      .dropdown-trigger .value {
        color: var(--primary);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .user-switch {
        border: 0;
        cursor: pointer;
      }

      .dropdown-trigger .caret {
        color: var(--muted);
        transition: transform 160ms ease;
      }

      .dropdown-shell.open .caret {
        transform: rotate(180deg);
      }

      .dropdown-menu {
        position: absolute;
        left: 0;
        right: 0;
        top: calc(100% + 6px);
        z-index: 15;
        display: none;
        gap: 6px;
        padding: 8px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: #fff;
        box-shadow: 0 12px 22px rgba(24, 32, 38, 0.12);
      }

      .dropdown-shell.open .dropdown-menu {
        display: grid;
      }

      .option-chip {
        flex: 0 0 auto;
        min-height: 30px;
        padding: 0 10px;
        border: 1px solid var(--line);
        border-radius: 999px;
        background: #fff;
        color: var(--muted);
        font-size: 12px;
        font-weight: 700;
        text-align: left;
      }

      .option-chip.active {
        border-color: var(--primary);
        background: var(--primary-soft);
        color: var(--primary);
      }

      .section-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        margin: 17px 0 10px;
      }

      .section-head h2 {
        font-size: 16px;
        letter-spacing: 0;
      }

      .section-head span {
        color: var(--muted);
        font-size: 12px;
      }

      .todo-band {
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
      }

      .customer-list {
        display: grid;
        gap: 10px;
      }

      .customer-list.loading {
        min-height: 200px;
      }

      .empty-state {
        padding: 20px 12px;
        border: 1px dashed var(--line);
        border-radius: 8px;
        color: var(--muted);
        text-align: center;
        font-size: 13px;
        background: #fff;
      }

      .mine-module {
        display: grid;
        gap: 12px;
      }

      .mine-hero,
      .login-box,
      .password-box,
      .data-box,
      .admin-box {
        border: 1px solid rgba(226, 231, 236, 0.9);
        border-radius: 12px;
        background: var(--surface);
        padding: 14px;
        box-shadow: 0 8px 22px rgba(24, 32, 38, 0.06);
      }

      .mine-hero {
        display: flex;
        align-items: center;
        gap: 11px;
        min-height: 88px;
        background:
          linear-gradient(135deg, rgba(225, 240, 236, 0.95), rgba(255, 255, 255, 0.96) 62%),
          #fff;
      }

      .mine-avatar {
        flex: 0 0 auto;
        width: 44px;
        height: 44px;
        display: grid;
        place-items: center;
        border-radius: 50%;
        background: var(--primary);
        color: #fff;
        font-size: 16px;
        font-weight: 900;
      }

      .mine-identity {
        min-width: 0;
        flex: 1;
        display: grid;
        gap: 5px;
      }

      .mine-status-line {
        display: flex;
        align-items: center;
        gap: 7px;
        min-width: 0;
      }

      .mine-status-line h2 {
        min-width: 0;
        overflow: hidden;
        font-size: 19px;
        font-weight: 900;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .mine-identity p {
        color: var(--muted);
        font-size: 12px;
        line-height: 1.35;
      }

      .mine-role-chip {
        flex: 0 0 auto;
        height: 22px;
        display: inline-flex;
        align-items: center;
        border: 1px solid rgba(23, 107, 93, 0.18);
        border-radius: 999px;
        padding: 0 8px;
        color: var(--primary);
        background: rgba(225, 240, 236, 0.78);
        font-size: 11px;
        font-weight: 800;
      }

      .mine-action {
        flex: 0 0 auto;
        height: 32px;
        border-radius: 999px;
        padding: 0 12px;
        background: var(--primary);
        color: #fff;
        font-size: 12px;
        font-weight: 800;
      }

      .admin-box {
        display: none;
      }

      body[data-role="boss"] .admin-box {
        display: block;
      }

      body[data-auth="unlocked"] .login-box {
        display: none;
      }

      body[data-auth="locked"] .password-box {
        display: none;
      }

      body[data-auth="locked"] .data-box {
        display: none;
      }

      .data-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
      }

      .mine-card-title {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 10px;
        margin-bottom: 12px;
      }

      .mine-card-title h3 {
        font-size: 15px;
        font-weight: 900;
      }

      .mine-card-title p {
        margin-top: 4px;
        color: var(--muted);
        font-size: 12px;
        line-height: 1.45;
      }

      .mine-card-title span {
        flex: 0 0 auto;
        border-radius: 999px;
        padding: 4px 8px;
        color: var(--primary);
        background: var(--primary-soft);
        font-size: 11px;
        font-weight: 800;
      }

      .mine-login-tip {
        margin-top: 10px;
        color: var(--muted);
        font-size: 12px;
        text-align: center;
      }

      .account-list {
        display: grid;
        gap: 7px;
        margin-top: 12px;
      }

      .account-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        border: 1px solid #edf1f4;
        border-radius: 10px;
        padding: 9px 10px;
        background: #fafbfb;
      }

      .account-row b {
        font-size: 13px;
      }

      .account-row span {
        color: var(--muted);
        font-size: 11px;
        line-height: 1.35;
        text-align: right;
      }

      .customer-card {
        position: relative;
        display: grid;
        grid-template-rows: auto 1fr auto;
        aspect-ratio: 16 / 9;
        width: 100%;
        min-height: 176px;
        overflow: hidden;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: var(--surface);
        padding: 12px;
        box-shadow: 0 6px 18px rgba(24, 32, 38, 0.05);
        text-align: left;
      }

      .customer-card.todo {
        border-color: #edc58f;
      }

      .customer-card.expired {
        border-color: #c94343;
      }

      .region-group {
        display: grid;
        gap: 8px;
      }

      .region-title {
        position: sticky;
        top: 116px;
        z-index: 4;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 6px 2px 2px;
        color: var(--muted);
        background: var(--bg);
        font-size: 12px;
        font-weight: 900;
      }

      .region-title span {
        color: var(--primary);
        font-size: 11px;
      }

      .customer-card.compact {
        grid-template-rows: 1fr;
        aspect-ratio: 16 / 3;
        min-height: 66px;
        padding: 8px 10px;
        padding-right: 48px;
        cursor: pointer;
      }

      .customer-card.compact .card-first-row {
        align-content: center;
        gap: 4px;
        padding-right: 0;
      }

      .customer-card.compact .brand-name {
        font-size: 14px;
      }

      .customer-card.compact .stored-balance {
        margin-left: auto;
        min-width: 52px;
        font-size: 12px;
        font-weight: 900;
      }

      .customer-card.compact .people-row-text {
        font-size: 12px;
      }

      .compact-todo {
        display: flex;
        align-items: center;
        gap: 12px;
        min-width: 0;
        margin-top: 1px;
        color: var(--amber);
        font-size: 12px;
        font-weight: 900;
        line-height: 1;
      }

      .compact-todo.expired {
        color: var(--deep-red);
      }

      .compact-todo b {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .customer-card.compact .add-follow-btn {
        top: 50%;
        right: 9px;
        width: 34px;
        height: 34px;
        border-radius: 8px;
        transform: translateY(-50%);
      }

      .operation-card {
        position: relative;
        display: grid;
        grid-template-rows: auto 1fr auto;
        aspect-ratio: 16 / 9;
        width: 100%;
        min-height: 176px;
        overflow: hidden;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: var(--surface);
        padding: 12px;
        padding-right: 54px;
        box-shadow: 0 6px 18px rgba(24, 32, 38, 0.05);
        text-align: left;
      }

      .operation-card.overdue {
        border-color: #c94343;
      }

      .operation-card-head {
        display: grid;
        gap: 7px;
        min-width: 0;
      }

      .task-content {
        min-height: 45px;
        display: -webkit-box;
        overflow: hidden;
        padding: 8px 10px;
        border: 1px solid #edf1f2;
        border-radius: 8px;
        background: #fbfcfc;
        color: var(--text);
        font-size: 14px;
        font-weight: 800;
        line-height: 1.42;
        text-align: left;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
      }

      .task-status {
        width: fit-content;
        border-radius: 999px;
        padding: 4px 8px;
        color: var(--primary);
        background: var(--primary-soft);
        font-size: 11px;
        font-weight: 900;
        line-height: 1;
      }

      .operation-card.overdue .task-status {
        color: var(--deep-red);
        background: #faeeee;
      }

      .task-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px 10px;
        align-content: center;
        margin: 7px 0;
        padding-left: 10px;
      }

      .task-field {
        min-width: 0;
        display: grid;
        gap: 3px;
        text-align: left;
      }

      .task-field span {
        color: var(--muted);
        font-size: 10.5px;
        font-weight: 800;
      }

      .task-field b {
        overflow: hidden;
        color: var(--text);
        font-size: 12.5px;
        line-height: 1.3;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .task-deadline b {
        color: var(--primary);
      }

      .operation-card.overdue .task-deadline b {
        color: var(--deep-red);
      }

      .task-note {
        display: flex;
        gap: 8px;
        align-items: center;
        min-height: 30px;
        padding: 7px 8px;
        border-radius: 6px;
        background: #f4f7f7;
        color: var(--text);
        font-size: 11.5px;
        line-height: 1.2;
        text-align: left;
      }

      .operation-card.overdue .task-note {
        background: #fff4f4;
      }

      .task-note span {
        flex: 0 0 auto;
        color: var(--muted);
        font-weight: 900;
        white-space: nowrap;
      }

      .task-note b {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .task-edit-btn {
        position: absolute;
        top: 8px;
        right: 8px;
        width: 32px;
        height: 32px;
        display: grid;
        place-items: center;
        border-radius: 999px;
        color: var(--primary);
        background: var(--primary-soft);
      }

      .task-edit-btn svg {
        width: 18px;
        height: 18px;
      }

      .staff-filter {
        min-height: 30px;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        border: 1px solid var(--line);
        border-radius: 999px;
        padding: 0 10px;
        color: var(--primary);
        background: #fff;
        font-size: 12px;
        font-weight: 800;
      }

      .staff-filter svg {
        width: 14px;
        height: 14px;
      }

      .card-first-row {
        display: grid;
        gap: 3px;
        min-width: 0;
        padding-right: 42px;
      }

      .brand-name,
      .people-row-text {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .brand-row {
        display: flex;
        align-items: center;
        gap: 5px;
        min-width: 0;
      }

      .brand-name {
        min-width: 0;
        font-size: 14.5px;
        font-weight: 900;
        line-height: 1.25;
      }

      .cooperate-tag {
        flex: 0 0 auto;
        width: 17px;
        height: 17px;
        display: grid;
        place-items: center;
        border-radius: 999px;
        color: #fff;
        background: var(--primary);
        font-size: 10px;
        font-weight: 800;
      }

      .cooperate-tag.pending {
        color: var(--amber);
        background: var(--amber-soft);
      }

      .settlement-tag {
        flex: 0 0 auto;
        border-radius: 999px;
        padding: 3px 5px;
        color: var(--blue);
        background: var(--blue-soft);
        font-size: 10px;
        font-weight: 700;
        line-height: 1;
      }

      .settlement-tag.stored {
        color: var(--primary);
        background: var(--primary-soft);
      }

      .stored-balance {
        flex: 0 0 auto;
        min-width: 48px;
        color: var(--primary);
        font-size: 11.5px;
        font-weight: 700;
        text-align: right;
      }

      .people-row {
        display: flex;
        align-items: center;
        gap: 5px;
        min-width: 0;
      }

      .people-row-text {
        min-width: 0;
        color: var(--text);
        font-size: 12.5px;
        font-weight: 700;
        line-height: 1.25;
      }

      .muted {
        color: var(--muted);
        font-weight: 700;
      }

      .phone-icon {
        flex: 0 0 auto;
        width: 18px;
        height: 18px;
        display: grid;
        place-items: center;
        border-radius: 999px;
        color: var(--primary);
        background: var(--primary-soft);
      }

      .phone-icon.empty {
        color: var(--inactive);
        background: #eef2f5;
      }

      .phone-icon svg {
        width: 11px;
        height: 11px;
      }

      .level {
        flex: 0 0 auto;
        border-radius: 999px;
        padding: 5px 8px;
        color: var(--amber);
        background: var(--amber-soft);
        font-size: 12px;
        font-weight: 800;
      }

      .level.normal {
        color: var(--primary);
        background: var(--primary-soft);
      }

      .level.cold {
        color: var(--blue);
        background: var(--blue-soft);
      }

      .follow-list {
        display: grid;
        gap: 7px;
        align-content: start;
        min-height: 0;
        margin: 4px 0 2px;
      }

      .follow-line {
        display: grid;
        grid-template-columns: 22px 40px minmax(0, 1fr) 44px;
        gap: 7px;
        align-items: start;
        min-height: 28px;
        margin: 0 -5px;
        padding: 3px 5px;
        border-radius: 6px;
        color: var(--text);
        font-size: 12px;
        line-height: 1.32;
      }

      .follow-line.highlight {
        background: #f4f7f7;
      }

      .follow-line span {
        color: var(--muted);
        font-size: 12px;
        background: transparent;
      }

      .follow-icon {
        width: 20px;
        height: 20px;
        display: grid;
        place-items: center;
        border-radius: 999px;
        color: #2d6f95;
        background: #e6f2fb;
      }

      .follow-icon.info {
        color: #2d6f95;
        background: #e6f2fb;
      }

      .follow-icon.call {
        color: var(--amber);
        background: var(--amber-soft);
      }

      .follow-icon.visit {
        color: var(--primary);
        background: var(--primary-soft);
      }

      .follow-icon.plan {
        color: #4f46a5;
        background: #eeecff;
      }

      .follow-icon svg {
        width: 12px;
        height: 12px;
      }

      .follow-line b {
        overflow: hidden;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        font-weight: 600;
      }

      .follow-user {
        overflow: hidden;
        color: var(--muted);
        font-size: 11px;
        font-weight: 800;
        line-height: 1.35;
        text-align: right;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .todo-action {
        display: grid;
        grid-template-columns: 42px minmax(0, 1fr);
        gap: 8px;
        align-items: center;
        min-height: 22px;
        margin-top: 1px;
        margin-bottom: 2px;
        color: var(--amber);
        font-size: 12px;
        font-weight: 600;
        line-height: 1.25;
      }

      .todo-action.expired {
        color: var(--deep-red);
      }

      .todo-action.today {
        color: var(--amber);
      }

      .todo-action span,
      .todo-action b {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .card-footer {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 10px;
      }

      .next-time {
        display: none;
      }

      .add-follow-btn {
        position: absolute;
        top: 12px;
        right: 12px;
        width: 34px;
        height: 34px;
        display: grid;
        place-items: center;
        border-radius: 8px;
        background: #eef2f5;
        color: var(--text);
      }

      .add-follow-btn {
        color: var(--primary);
        background: var(--primary-soft);
      }

      .bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 20;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 4px;
        padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, 0.96);
        border-top: 1px solid var(--line);
        backdrop-filter: blur(14px);
      }

      .nav-item {
        height: 52px;
        display: grid;
        place-items: center;
        gap: 2px;
        border-radius: 8px;
        color: var(--muted);
        background: transparent;
        font-size: 11px;
      }

      body[data-view="todo"] .nav-item[data-view="todo"],
      body[data-view="customer"] .nav-item[data-view="customer"],
      body[data-view="mine"] .nav-item[data-view="mine"],
      body[data-view="dashboard"] .nav-item[data-view="dashboard"] {
        color: var(--primary);
        background: var(--primary-soft);
        font-weight: 700;
      }

      .detail-mask {
        position: fixed;
        inset: 0;
        z-index: 40;
        display: none;
        background: rgba(17, 24, 31, 0.34);
      }

      .detail-mask.open {
        display: block;
      }

      .follow-editor {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 60;
        display: none;
        border-radius: 14px 14px 0 0;
        background: var(--surface);
        padding: 16px 14px calc(18px + env(safe-area-inset-bottom));
        box-shadow: 0 -18px 40px rgba(24, 32, 38, 0.18);
      }

      .follow-editor.open {
        display: block;
      }

      .editor-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 12px;
      }

      .editor-title-line {
        min-width: 0;
        display: grid;
        gap: 5px;
      }

      .editor-head h2 {
        font-size: 17px;
      }

      .editor-title-row {
        display: flex;
        align-items: baseline;
        gap: 10px;
      }

      .editor-customer {
        max-width: 260px;
        overflow: hidden;
        color: var(--primary);
        font-size: 17px;
        font-weight: 900;
        line-height: 1.2;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .editor-owner {
        flex: 0 0 auto;
        color: var(--muted);
        font-size: 12px;
        font-weight: 800;
      }

      .duplicate-warning {
        display: none;
        margin: 0 0 10px;
        padding: 9px 10px;
        border: 1px solid #f0d7b5;
        border-radius: 8px;
        background: var(--amber-soft);
        color: var(--amber);
        font-size: 12px;
        font-weight: 800;
        line-height: 1.45;
      }

      .duplicate-warning.open {
        display: block;
      }

      .role-list {
        display: grid;
        gap: 10px;
      }

      .role-card {
        display: grid;
        gap: 5px;
        width: 100%;
        border: 1px solid var(--line);
        border-radius: 8px;
        padding: 11px 12px;
        background: #fff;
        color: var(--text);
        text-align: left;
      }

      .role-card b {
        font-size: 14px;
      }

      .role-card span {
        color: var(--muted);
        font-size: 12px;
        line-height: 1.4;
      }

      .role-card.active {
        border-color: var(--primary);
        background: var(--primary-soft);
      }

      .editor-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-bottom: 10px;
      }

      .next-follow-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: stretch;
        gap: 7px;
      }

      .follow-editor .next-follow-grid .editor-field {
        height: 46px;
        margin-top: 0;
      }

      .type-options {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
        margin-bottom: 12px;
      }

      .type-option {
        height: 38px;
        border: 1px solid var(--line);
        border-radius: 8px;
        color: var(--muted);
        background: #fff;
        font-size: 13px;
        font-weight: 800;
      }

      .type-option.active {
        border-color: var(--primary);
        color: var(--primary);
        background: var(--primary-soft);
      }

      .type-option[data-type="call"].active {
        border-color: var(--amber);
        color: var(--amber);
        background: var(--amber-soft);
      }

      .type-option[data-type="plan"].active {
        border-color: #6a5acd;
        color: #4f46a5;
        background: #eeecff;
      }

      .next-follow-box {
        margin-top: 12px;
        padding: 10px;
        border: 1px solid #edf1f2;
        border-radius: 10px;
        background: #f8faf9;
      }

      .next-follow-title {
        margin-bottom: 9px;
        color: var(--text);
        font-size: 14px;
        line-height: 1;
        font-weight: 900;
      }

      .editor-field {
        display: grid;
        gap: 6px;
      }

      .next-follow-box .editor-field {
        gap: 0;
      }

      .next-follow-box label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
      }

      .editor-field label {
        color: var(--muted);
        font-size: 12px;
        font-weight: 800;
      }

      .editor-field input,
      .editor-field select,
      .editor-field textarea {
        width: 100%;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: #fff;
        color: var(--text);
        font: inherit;
        outline: none;
        padding: 10px;
      }

      .next-follow-box select {
        height: 46px;
        min-height: 46px;
        border-color: #dce5e5;
        border-radius: 9px;
        background-color: #fff;
        color: var(--text);
        padding: 0 26px;
        appearance: none;
        background-image:
          linear-gradient(45deg, transparent 50%, #5d6872 50%),
          linear-gradient(135deg, #5d6872 50%, transparent 50%);
        background-position:
          calc(100% - 16px) 20px,
          calc(100% - 11px) 20px;
        background-size: 5px 5px, 5px 5px;
        background-repeat: no-repeat;
        box-shadow: 0 1px 0 rgba(24, 32, 38, 0.03);
        font-size: 15px;
        line-height: 46px;
        text-align: center;
        text-align-last: center;
        font-weight: 800;
      }

      .custom-date-field {
        display: none;
        margin-top: 8px;
      }

      .custom-date-field.open {
        display: block;
      }

      .custom-date-field input {
        height: 44px;
        border-color: #dce5e5;
        border-radius: 9px;
        background: #fff;
        font-size: 15px;
        font-weight: 800;
      }

      .editor-field textarea {
        min-height: 118px;
        resize: vertical;
      }

      .follow-editor .editor-field + .editor-field {
        margin-top: 10px;
      }

      .follow-editor .next-follow-grid .editor-field + .editor-field {
        margin-top: 0;
      }

      .editor-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-top: 12px;
      }

      .editor-actions button {
        min-height: 42px;
        border-radius: 8px;
        font-weight: 800;
      }

      .cancel-edit {
        color: var(--text);
        background: #eef2f5;
      }

      .save-edit {
        color: #fff;
        background: var(--primary);
      }

      .detail-panel {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 50;
        max-height: 82vh;
        overflow: auto;
        transform: translateY(105%);
        transition: transform 180ms ease;
        border-radius: 14px 14px 0 0;
        background: var(--surface);
        padding: 14px 14px calc(16px + env(safe-area-inset-bottom));
        box-shadow: 0 -18px 40px rgba(24, 32, 38, 0.18);
      }

      .detail-panel.open {
        transform: translateY(0);
      }

      .detail-head {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        padding-bottom: 9px;
        border-bottom: 1px solid var(--line);
      }

      .detail-head h2 {
        font-size: 20px;
        line-height: 1.2;
      }

      .detail-title-row {
        display: flex;
        align-items: center;
        gap: 7px;
        min-width: 0;
      }

      .detail-title-row h2 {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .detail-tags {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        flex: 0 0 auto;
      }

      .detail-tags .stored-balance {
        min-width: auto;
      }

      .detail-address {
        display: block;
        margin-top: 3px;
        color: var(--muted);
        font-size: 12px;
        line-height: 1.35;
        text-decoration: none;
      }

      .close-btn {
        flex: 0 0 auto;
        width: 34px;
        height: 34px;
        display: grid;
        place-items: center;
        border-radius: 8px;
        background: #eef2f5;
        color: var(--text);
      }

      .detail-section {
        margin-top: 8px;
      }

      .detail-section-title {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        margin-bottom: 8px;
      }

      .collapsible .detail-section-title {
        min-height: 34px;
        margin-bottom: 0;
        padding: 0 2px;
        cursor: pointer;
      }

      .detail-section-title h3 {
        font-size: 15px;
      }

      .section-title-left {
        display: inline-flex;
        align-items: center;
        gap: 6px;
      }

      .chevron {
        color: var(--muted);
        transition: transform 160ms ease;
      }

      .collapsible.open .chevron {
        transform: rotate(90deg);
      }

      .detail-section-title button {
        width: 32px;
        height: 32px;
        display: grid;
        place-items: center;
        border-radius: 8px;
        color: var(--primary);
        background: var(--primary-soft);
      }

      .product-list,
      .contact-list {
        display: grid;
        gap: 9px;
      }

      .collapsible .section-body {
        display: none;
        margin-top: 10px;
      }

      .collapsible.open .section-body {
        display: block;
      }

      .collapsible.open .section-body.product-list,
      .collapsible.open .section-body.contact-list {
        display: grid;
      }

      .section-body > button {
        width: 100%;
        min-height: 38px;
        display: grid;
        place-items: center;
        border-radius: 8px;
        color: var(--primary);
        background: var(--primary-soft);
        margin-top: 9px;
      }

      .cooperation-form {
        display: grid;
        gap: 10px;
      }

      .cooperation-form textarea {
        width: 100%;
        min-height: 108px;
        border: 1px solid var(--line);
        border-radius: 8px;
        padding: 10px;
        color: var(--text);
        background: #fff;
        font: inherit;
        line-height: 1.5;
        resize: vertical;
        outline: none;
      }

      .cooperation-form button {
        width: 100%;
        min-height: 38px;
        border-radius: 8px;
        color: #fff;
        background: var(--primary);
        font-weight: 800;
      }

      .product-row,
      .contact-row {
        display: grid;
        gap: 8px;
        padding: 11px 10px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: #fff;
      }

      .product-row {
        grid-template-columns: 30px minmax(0, 1fr) 34px 34px;
        align-items: center;
      }

      .sort-handle,
      .delete-row {
        width: 30px;
        height: 30px;
        display: grid;
        place-items: center;
        border-radius: 8px;
        background: #f0f3f5;
        color: var(--muted);
      }

      .delete-row {
        color: #9f1d1d;
        background: #faeeee;
      }

      .product-main,
      .contact-main {
        min-width: 0;
      }

      .product-main b,
      .contact-main b {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 13px;
      }

      .product-main span,
      .contact-main span {
        display: block;
        margin-top: 5px;
        overflow: hidden;
        color: var(--muted);
        font-size: 12px;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .contact-row {
        grid-template-columns: minmax(0, 1fr) 34px 34px;
        align-items: center;
      }

      .contact-line-detail {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 13px;
        font-weight: 800;
      }

      .contact-line-detail span {
        display: inline;
        margin-top: 0;
        font-size: inherit;
        white-space: inherit;
      }

      .contact-line-detail .phone-text {
        color: var(--muted);
        font-weight: 700;
      }

      .year-group {
        margin-top: 12px;
      }

      .record-tabs {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        margin-bottom: 12px;
      }

      .record-tab {
        min-height: 36px;
        border-radius: 8px;
        color: var(--muted);
        background: #f0f3f5;
        font-size: 13px;
        font-weight: 800;
      }

      .record-tab.active {
        color: var(--primary);
        background: var(--primary-soft);
      }

      .record-panel {
        display: none;
        min-height: 620px;
      }

      .record-panel.active {
        display: block;
      }

      .money-row {
        display: grid;
        grid-template-columns: 56px minmax(0, 1fr) auto;
        gap: 10px;
        align-items: center;
        padding: 12px 0;
        border-top: 1px solid var(--line);
      }

      .money-row span {
        color: var(--muted);
        font-size: 12px;
      }

      .money-row b {
        font-size: 13px;
      }

      .money-row strong {
        color: var(--primary);
        font-size: 13px;
      }

      .money-row.consume strong {
        color: var(--amber);
      }

      .year-label {
        margin: 14px 0 6px;
        color: var(--muted);
        font-size: 12px;
        font-weight: 800;
      }

      .detail-follow-row {
        display: grid;
        grid-template-columns: 52px 48px minmax(0, 1fr) 58px;
        gap: 10px;
        align-items: start;
        padding: 12px 0;
        border-top: 1px solid var(--line);
      }

      .detail-follow-row span {
        color: var(--muted);
        font-size: 12px;
      }

      .record-icon {
        width: 42px;
        height: 42px;
        display: grid;
        place-items: center;
        border-radius: 999px;
        color: #2d6f95;
        background: #e6f2fb;
      }

      .record-icon.info {
        color: #2d6f95;
        background: #e6f2fb;
      }

      .record-icon.call {
        color: var(--amber);
        background: var(--amber-soft);
      }

      .record-icon.visit {
        color: var(--primary);
        background: var(--primary-soft);
      }

      .record-icon.plan {
        color: #4f46a5;
        background: #eeecff;
      }

      .record-icon svg {
        width: 24px;
        height: 24px;
      }

      .record-icon svg path,
      .record-icon svg circle,
      .follow-icon svg path,
      .follow-icon svg circle {
        stroke: currentColor;
      }

      .detail-follow-row b {
        display: -webkit-box;
        overflow: hidden;
        font-size: 13px;
        line-height: 1.45;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
      }

      .record-user {
        overflow: hidden;
        color: var(--muted);
        font-size: 12px;
        font-weight: 800;
        text-align: right;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .pc-panel {
        display: none;
      }

      @media (min-width: 860px) {
        .app {
          grid-template-columns: 248px 1fr;
        }

        .sidebar {
          display: block;
          min-height: 100vh;
          padding: 22px 16px;
          border-right: 1px solid var(--line);
          background: #fff;
        }

        .sidebar h2 {
          margin: 0 0 22px;
          font-size: 20px;
        }

        .side-link {
          width: 100%;
          height: 44px;
          display: flex;
          align-items: center;
          gap: 10px;
          margin-bottom: 6px;
          padding: 0 12px;
          border-radius: 8px;
          background: transparent;
          color: var(--muted);
          text-align: left;
        }

        .side-link.active {
          color: var(--primary);
          background: var(--primary-soft);
          font-weight: 800;
        }

        .main {
          padding: 24px 28px;
        }

        .topbar {
          position: static;
          margin: 0 0 14px;
          padding: 0;
          border-bottom: 0;
          background: transparent;
          backdrop-filter: none;
        }

        .desktop-layout {
          display: grid;
          grid-template-columns: minmax(0, 1fr) 320px;
          gap: 18px;
          align-items: start;
        }

        .customer-list {
          grid-template-columns: repeat(2, minmax(0, 1fr));
        }

        .todo-band .customer-list {
          grid-template-columns: minmax(0, 1fr);
        }

        .customer-card {
          min-height: 0;
        }

        .pc-panel {
          display: block;
          position: sticky;
          top: 24px;
          padding: 16px;
          border: 1px solid var(--line);
          border-radius: 8px;
          background: var(--surface);
          box-shadow: var(--shadow);
        }

        .pc-panel h2 {
          font-size: 16px;
          margin-bottom: 12px;
        }

        .panel-line {
          padding: 11px 0;
          border-top: 1px solid var(--line);
        }

        .panel-line:first-of-type {
          border-top: 0;
        }

        .panel-line b {
          display: block;
          font-size: 13px;
        }

        .panel-line span {
          display: block;
          margin-top: 5px;
          color: var(--muted);
          font-size: 12px;
          line-height: 1.45;
        }

        .detail-panel {
          left: auto;
          right: 28px;
          bottom: 28px;
          width: 420px;
          max-height: calc(100vh - 56px);
          border-radius: 8px;
        }
      }
    
