:root {
    font-family: "Noto Serif TC", "Source Han Serif TC", "Songti TC", "PMingLiU", "MingLiU", "Microsoft JhengHei", serif;
    color: #13253a;
    background: #f5f7f4;
}

* { box-sizing: border-box; }
body { margin: 0; background: #f5f7f4; color: #13253a; }
a { color: inherit; text-decoration: none; }

.member-header {
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 0 32px;
    background: #fff;
    border-bottom: 1px solid #dbe2ea;
}

.brand {
    font-size: 20px;
    font-weight: 900;
    color: #0f3554;
}

.member-header nav {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    font-weight: 800;
}

.member-header button {
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #fff;
    color: #13253a;
    cursor: pointer;
    font: inherit;
}

.member-page {
    width: min(1080px, calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0 54px;
}

.status {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid #bde3cb;
    border-radius: 8px;
    background: #ecfbf1;
    color: #166534;
    font-weight: 800;
}

.panel {
    border: 1px solid #d8e2ec;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 16px 36px rgba(21, 38, 56, .07);
}

.eyebrow {
    margin: 0 0 8px;
    color: #2f5f7c;
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 26px; font-size: 30px; letter-spacing: 0; }
h2 { margin-bottom: 18px; font-size: 20px; letter-spacing: 0; }
p { color: #5f6f82; line-height: 1.7; }

.primary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    border: 0;
    background: #0f172a;
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 900;
    white-space: nowrap;
}

.profile-panel form { display: grid; gap: 12px; margin-top: 14px; }
.profile-panel .field label { display: block; margin-bottom: 7px; font-weight: 900; color: #26384d; }
.profile-panel .field input,
.profile-panel .field select {
    width: 100%;
    min-height: 42px;
    border: 1px solid #d5dee8;
    border-radius: 8px;
    padding: 9px 11px;
    background: #fff;
    outline: 0;
}
.profile-panel .field input:focus,
.profile-panel .field select:focus {
    border-color: #2f80c1;
    box-shadow: 0 0 0 4px rgba(47,128,193,.12);
}
.profile-panel .check { display: flex; align-items: center; gap: 9px; color: #46576b; font-weight: 800; }
.profile-panel .error { color: #b42318; font-size: 13px; font-weight: 800; }

.panel { padding: 24px; }

.account-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) 340px;
    gap: 28px;
    align-items: start;
}

.account-menu {
    position: sticky;
    top: 24px;
    padding-top: 6px;
    grid-row: 1 / span 2;
}

.account-menu h1 {
    color: #13253a;
}

.account-menu nav {
    display: grid;
    border-top: 1px solid #dbe2ea;
}

.account-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 50px;
    border-bottom: 1px solid #dbe2ea;
    color: #344054;
    font-weight: 800;
}

.account-menu a:hover,
.account-menu a.is-active {
    color: #0f3554;
}

.menu-icon {
    width: 26px;
    color: #0f3554;
    font-size: 18px;
    line-height: 1;
    text-align: center;
}

.account-main,
.account-side {
    display: grid;
    gap: 18px;
}

.welcome-panel {
    display: flex;
    justify-content: space-between;
    gap: 22px;
    align-items: center;
    min-height: 178px;
    padding: 30px;
    border: 1px solid #d8e2ec;
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(255,255,255,.94), rgba(246,249,250,.92)),
        radial-gradient(circle at 88% 16%, rgba(47,95,124,.16), transparent 28%);
    box-shadow: 0 18px 36px rgba(21, 38, 56, .07);
}

.welcome-panel h2 {
    margin: 0 0 10px;
    font-size: 30px;
}

.welcome-panel p {
    max-width: 530px;
    margin-bottom: 0;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 1px solid #d8e2ec;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.quick-actions a {
    display: grid;
    place-items: center;
    gap: 10px;
    min-height: 118px;
    padding: 18px 10px;
    border-right: 1px solid #e4e9ef;
    text-align: center;
}

.quick-actions a:last-child {
    border-right: 0;
}

.quick-actions span {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #f2f6f8;
    color: #0f3554;
    font-size: 20px;
}

.quick-actions strong {
    font-size: 14px;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.section-head h2 {
    margin: 0 0 6px;
}

.section-head p {
    margin-bottom: 0;
}

.section-head > span {
    min-height: 32px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #f0f5f8;
    color: #0f3554;
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}

.section-head.compact {
    margin-bottom: 12px;
}

.profile-list {
    margin: 0;
    display: grid;
    gap: 12px;
}

.profile-list div {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #edf1f5;
}

.profile-list div:last-child { border-bottom: 0; padding-bottom: 0; }
.profile-list dt { color: #667085; font-weight: 800; }
.profile-list dd { margin: 0; font-weight: 900; }
.profile-list dd {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.bind-status {
    color: #667085;
}
.bind-status.is-bound {
    color: #0f6b43;
}
.bind-link {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border: 1px solid #d5dee8;
    border-radius: 999px;
    background: #fff;
    color: #12324d;
    font-size: 13px;
    font-weight: 900;
}
.bind-link:hover {
    border-color: #2f80c1;
    background: #f4fbff;
}
.bind-note {
    margin: 12px 0 0;
    color: #667085;
    font-size: 14px;
    line-height: 1.7;
    font-weight: 800;
}

.order-card {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid #edf1f5;
}

.order-card:first-of-type { padding-top: 0; }
.order-card:last-of-type { border-bottom: 0; padding-bottom: 0; }
.order-card div { display: grid; gap: 6px; }
.order-card div:last-child { text-align: right; }
.order-card span { color: #667085; font-size: 14px; }
.order-card strong { color: #0f3554; }
.order-card:hover { background: #f8fbfd; }
.section-link {
    color: #0f3554;
    font-weight: 900;
    text-decoration: underline;
    white-space: nowrap;
}
.muted-text {
    margin-bottom: 0;
    color: #667085;
    line-height: 1.7;
}
.favorite-mini-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.favorite-mini-card {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid #edf1f5;
    border-radius: 8px;
    background: #fff;
}
.favorite-mini-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 6px;
}
.favorite-mini-card strong {
    color: #0f3554;
    line-height: 1.45;
}
.favorite-mini-card span,
.coupon-mini small {
    color: #667085;
    font-size: 13px;
    font-weight: 800;
}
.coupon-mini {
    display: grid;
    gap: 4px;
    padding: 12px 0;
    border-bottom: 1px solid #edf1f5;
}
.coupon-mini:last-child { border-bottom: 0; }
.coupon-mini strong { color: #0f3554; }
.coupon-mini span {
    width: fit-content;
    padding: 3px 8px;
    border-radius: 999px;
    background: #eef6fc;
    color: #0f3554;
    font-weight: 900;
    font-size: 13px;
}
.member-page-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 22px;
}
.member-page-head h1 { margin-bottom: 8px; }
.member-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 18px;
    align-items: start;
}
.member-order-items,
.request-list,
.request-forms {
    display: grid;
    gap: 12px;
}
.member-order-item {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding-bottom: 14px;
    border-bottom: 1px solid #edf1f5;
}
.member-order-item:last-child { border-bottom: 0; padding-bottom: 0; }
.member-order-thumb {
    width: 78px;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 8px;
    background: #f2f6f8;
}
.member-order-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.member-order-item div:nth-child(2) {
    display: grid;
    gap: 5px;
}
.member-order-item span { color: #667085; font-size: 14px; }
.order-detail-side hr { border: 0; border-top: 1px solid #edf1f5; margin: 18px 0; }
.summary-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    color: #667085;
}
.summary-row.total {
    padding-top: 12px;
    border-top: 1px solid #edf1f5;
    color: #0f3554;
    font-size: 18px;
    font-weight: 900;
}
.tracking-panel,
.request-panel { grid-column: 1 / -1; }
.tracking-card {
    display: grid;
    gap: 8px;
    padding: 16px;
    border: 1px solid #d8e2ec;
    border-radius: 8px;
    background: #f8fbfd;
}
.tracking-card a {
    color: #0f3554;
    font-weight: 900;
    text-decoration: underline;
}
.request-list article {
    padding: 12px;
    border: 1px solid #d8e2ec;
    border-radius: 8px;
    background: #f8fbfd;
}
.request-list article span {
    display: block;
    margin-top: 4px;
    color: #667085;
    font-size: 13px;
}
.request-list article p { margin: 8px 0 0; }
.request-forms {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.request-forms form {
    display: grid;
    gap: 8px;
}
.request-forms label { font-weight: 900; }
.request-forms textarea {
    min-height: 110px;
    border: 1px solid #cdd9e5;
    border-radius: 8px;
    padding: 10px 12px;
    resize: vertical;
    font: inherit;
}
.secondary-action {
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid #d8e2ec;
    border-radius: 999px;
    background: #fff;
    color: #0f3554;
    font-weight: 900;
    cursor: pointer;
}
.favorite-page-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}
.favorite-product-card {
    display: grid;
    gap: 14px;
    padding: 14px;
}
.favorite-product-image {
    display: block;
    overflow: hidden;
    border-radius: 8px;
    background: #f2f6f8;
}
.favorite-product-image img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}
.favorite-product-card h2 {
    margin: 4px 0 8px;
    font-size: 18px;
}
.favorite-product-card span {
    color: #667085;
    font-size: 13px;
}
.favorite-card-actions {
    display: grid;
    gap: 10px;
}
.favorite-card-actions form { margin: 0; }
.guide-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}
.guide-card {
    padding: 24px;
}
.guide-card h2 {
    margin-bottom: 10px;
}
.guide-card p {
    margin-bottom: 0;
}

.empty-orders {
    display: grid;
    justify-items: center;
    gap: 14px;
    min-height: 260px;
    align-content: center;
    padding: 32px 20px;
    border-radius: 8px;
    border: 1px solid #edf1f5;
    background: #fff;
    text-align: center;
}

.empty-box {
    position: relative;
    width: 84px;
    height: 68px;
    border-radius: 8px 8px 4px 4px;
    background: #d8dde2;
}

.empty-box::before {
    content: "";
    position: absolute;
    left: 18px;
    top: -22px;
    width: 48px;
    height: 48px;
    background: #e7eaee;
    transform: rotate(45deg);
    clip-path: polygon(0 0, 100% 0, 100% 58%, 0 58%);
}

.empty-box::after {
    content: "";
    position: absolute;
    left: -16px;
    right: -16px;
    bottom: -18px;
    height: 14px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .06);
}

.empty-orders p {
    margin-bottom: 0;
}

.empty-orders a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 22px;
    border-radius: 999px;
    background: #050505;
    color: #fff;
    font-weight: 900;
}

.member-card {
    position: relative;
    min-height: 230px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 16px;
    padding: 24px;
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(15,23,42,.2), transparent 44%),
        #2f2d2c;
    color: #fff;
    box-shadow: 0 18px 36px rgba(21, 38, 56, .16);
    overflow: hidden;
}

.member-card-top {
    grid-column: 2 / 4;
    min-height: 188px;
    padding: 28px;
}

.member-card-top h2 {
    font-size: 30px;
}

.member-card::before {
    content: "";
    position: absolute;
    inset: 16px auto auto 18px;
    width: 80px;
    height: 2px;
    background: #fff;
    opacity: .9;
}

.member-avatar {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #4d7a86;
    color: #fff;
    font-size: 26px;
    font-weight: 900;
}

.member-card p {
    margin: 0 0 8px;
    color: rgba(255,255,255,.78);
    font-weight: 800;
}

.member-card h2 {
    margin: 0 0 6px;
    color: #fff;
    font-size: 28px;
}

.member-card span {
    color: rgba(255,255,255,.82);
    font-size: 14px;
    font-weight: 800;
}

.card-code {
    position: absolute;
    right: 22px;
    bottom: 22px;
    width: 26px;
    height: 26px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
}

.card-code span {
    border: 2px solid rgba(255,255,255,.86);
    border-radius: 2px;
}

.reward-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 1px solid #d8e2ec;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.reward-grid div {
    padding: 20px;
    border-right: 1px solid #e7ebf0;
    border-bottom: 1px solid #e7ebf0;
}

.reward-grid div:nth-child(2n) {
    border-right: 0;
}

.reward-grid div:nth-last-child(-n + 2) {
    border-bottom: 0;
}

.reward-grid strong {
    display: block;
    margin-bottom: 6px;
    font-size: 22px;
    color: #0f3554;
}

.reward-grid span {
    color: #667085;
    font-size: 13px;
    font-weight: 800;
}

@media (max-width: 720px) {
    .member-header {
        height: auto;
        align-items: flex-start;
        flex-direction: column;
        padding: 18px;
    }

    .member-header nav {
        width: 100%;
        justify-content: space-between;
        gap: 10px;
        flex-wrap: wrap;
    }

    h1 { font-size: 25px; }
    .member-card-top { grid-column: auto; min-height: 188px; }
    .member-card-top h2 { font-size: 26px; }
    .account-layout { grid-template-columns: 1fr; gap: 18px; }
    .account-menu { position: static; grid-row: auto; }
    .account-menu nav { grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid #dbe2ea; border-radius: 8px; overflow: hidden; }
    .account-menu a { min-height: 48px; padding: 0 12px; border-right: 1px solid #dbe2ea; }
    .account-menu a:nth-child(2n) { border-right: 0; }
    .welcome-panel { align-items: flex-start; flex-direction: column; padding: 22px; }
    .welcome-panel h2 { font-size: 25px; }
    .quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .quick-actions a:nth-child(2n) { border-right: 0; }
    .quick-actions a:nth-child(-n + 2) { border-bottom: 1px solid #e4e9ef; }
    .profile-list div { grid-template-columns: 82px minmax(0, 1fr); }
    .favorite-mini-grid,
    .member-detail-grid,
    .request-forms,
    .favorite-page-grid,
    .guide-grid { grid-template-columns: 1fr; }
    .member-page-head { flex-direction: column; }
    .member-order-item { grid-template-columns: 64px minmax(0, 1fr); }
    .member-order-item > strong { grid-column: 2; }
}

@media (min-width: 721px) and (max-width: 1080px) {
    .account-layout {
        grid-template-columns: 200px minmax(0, 1fr);
    }

    .member-card-top,
    .account-main {
        grid-column: 2;
    }

    .account-side {
        grid-column: 2;
        grid-template-columns: minmax(280px, .95fr) minmax(0, 1.05fr);
    }
}
