:root {
    --bg: #eef4e8;
    --card: #ffffff;
    --card-2: #f4f9ee;
    --line: #d9e5cf;
    --text: #26332b;
    --muted: #61736a;
    --accent: #357f43;
    --accent-2: #2f7d42;
    --warn: #a9761a;
    --danger: #c0564a;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 50% -160px, rgba(63, 143, 78, .13), rgba(63, 143, 78, 0) 520px),
        var(--bg);
}

a { color: var(--accent-2); text-decoration: none; }

.wrap {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 18px 16px 34px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 2px 18px;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: linear-gradient(145deg, var(--accent-2), #2f9f27);
    color: #fff;
    font-weight: 800;
    font-size: 19px;
    display: grid;
    place-items: center;
    letter-spacing: 1px;
    box-shadow: 0 6px 18px rgba(47, 90, 63, .18);
}

.brand-name { font-size: 17px; font-weight: 700; letter-spacing: .5px; }
.brand-sub { font-size: 11px; color: var(--muted); margin-top: 2px; letter-spacing: 1px; }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 14px 40px rgba(47, 90, 63, .08);
}

.device {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: var(--card-2);
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 18px;
}

.device-name { font-size: 14px; font-weight: 600; }
.device-code { font-size: 11px; color: var(--muted); margin-top: 3px; letter-spacing: .6px; }

.state {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1.2;
    background: rgba(63, 143, 78, .10);
    color: var(--accent-2);
    border: 1px solid rgba(63, 143, 78, .25);
    white-space: nowrap;
}

.state.warn { background: rgba(169, 118, 26, .10); color: #8a6114; border-color: rgba(169, 118, 26, .28); }
.state.off { background: rgba(192, 86, 74, .08); color: #b04b3f; border-color: rgba(192, 86, 74, .25); }

h1 {
    margin: 0 0 8px;
    font-size: 25px;
    line-height: 1.3;
    letter-spacing: .5px;
}

.lead {
    margin: 0 0 18px;
    font-size: 13px;
    line-height: 1.8;
    color: var(--muted);
}

.plan {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding: 17px 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(63, 143, 78, .14), rgba(63, 143, 78, .03));
    border: 1px solid rgba(63, 143, 78, .22);
    margin-bottom: 16px;
}

.plan-name { font-size: 15px; font-weight: 700; }
.plan-days { font-size: 11px; color: var(--muted); margin-top: 4px; }
.plan-price { font-size: 27px; font-weight: 800; color: var(--accent-2); white-space: nowrap; }
.plan-price small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 2px; }

.plan-label { font-size: 12px; color: var(--muted); letter-spacing: 1px; margin: 2px 0 10px; }
.plan-list { display: grid; gap: 8px; margin-bottom: 16px; }
.plan-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    padding: 13px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--card-2);
    color: var(--text);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.plan-option-main { display: flex; flex-direction: column; gap: 3px; }
.plan-option-name { font-size: 14px; font-weight: 600; }
.plan-option-desc { font-size: 11px; color: var(--muted); }
.plan-option-price { font-size: 20px; font-weight: 800; color: var(--accent-2); white-space: nowrap; }
.plan-option.active {
    border-color: rgba(63, 143, 78, .5);
    background: linear-gradient(135deg, rgba(63, 143, 78, .13), rgba(63, 143, 78, .03));
    box-shadow: 0 6px 16px rgba(63, 143, 78, .10);
}
.plan-option.active .plan-option-name::after {
    content: " · 已选";
    font-size: 10px;
    font-weight: 500;
    color: var(--accent-2);
}

.actions { display: grid; gap: 10px; }

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--card-2);
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.btn.primary {
    background: linear-gradient(180deg, var(--accent-2), var(--accent));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 10px 24px rgba(63, 143, 78, .20);
}

.btn:disabled { opacity: .55; cursor: default; }
.btn .tag { font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 999px; background: rgba(0, 0, 0, .12); }

.notice {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #f7faf3;
    border: 1px solid var(--line);
    font-size: 11px;
    line-height: 1.8;
    color: var(--muted);
}

.error {
    display: none;
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(192, 86, 74, .08);
    border: 1px solid rgba(192, 86, 74, .25);
    color: #a8412f;
    font-size: 12px;
    line-height: 1.7;
}

.linkbox {
    display: none;
    margin-top: 14px;
    padding: 14px;
    border-radius: 12px;
    background: var(--card-2);
    border: 1px solid var(--line);
}

.linkbox p { margin: 0 0 10px; font-size: 12px; color: var(--muted); line-height: 1.7; }
.linkbox code {
    display: block;
    word-break: break-all;
    font-size: 11px;
    line-height: 1.7;
    color: var(--accent-2);
    margin-bottom: 10px;
}

.foot {
    text-align: center;
    font-size: 10px;
    color: #5f7266;
    line-height: 1.9;
    padding-top: 22px;
}

.success-mark {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    margin: 6px auto 16px;
    display: grid;
    place-items: center;
    font-size: 28px;
    color: #fff;
    background: linear-gradient(180deg, var(--accent-2), var(--accent));
    box-shadow: 0 10px 26px rgba(63, 143, 78, .20);
}

.order-no { font-size: 11px; color: var(--muted); letter-spacing: .6px; text-align: center; margin-top: 10px; }
.center { text-align: center; }

@media (min-width: 620px) {
    .wrap { padding-top: 44px; }
    .card { padding: 26px; }
}
