:root {
    --h5-primary: #1677ff;
    --h5-primary-pressed: #0958d9;
    --h5-bg: #f5f6f8;
    --h5-card: #fff;
    --h5-text: #1f1f1f;
    --h5-muted: #8c8c8c;
    --h5-border: #eee;
    --h5-danger: #ff4d4f;
    --h5-safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 17px;
    color: var(--h5-text);
    background: var(--h5-bg);
    line-height: 1.55;
}

.h5-app { min-height: 100dvh; display: flex; flex-direction: column; }

.h5-header {
    background: var(--h5-card);
    border-bottom: 1px solid var(--h5-border);
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.h5-step { font-size: 15px; color: var(--h5-muted); }

.h5-main {
    flex: 1;
    padding: 16px 16px calc(148px + var(--h5-safe-bottom));
}

.h5-card {
    background: var(--h5-card);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

.h5-title { font-size: 20px; font-weight: 600; margin: 0 0 8px; }

.h5-sub { font-size: 15px; color: var(--h5-muted); margin: 0 0 12px; }

.h5-sub--inline { margin: 10px 0 0; font-size: 15px; }

.h5-hint-bar {
    font-size: 14px;
    color: var(--h5-muted);
    background: #fff;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    line-height: 1.45;
}

.h5-field { margin-bottom: 14px; }

.h5-label {
    display: block;
    font-size: 16px;
    color: var(--h5-muted);
    margin-bottom: 6px;
}

.h5-input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid var(--h5-border);
    border-radius: 8px;
    font-size: 18px;
    background: #fff;
}

.h5-input:read-only { background: #fafafa; color: var(--h5-muted); }

.h5-btn {
    display: block;
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 26px;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    line-height: 52px;
    text-decoration: none;
    box-sizing: border-box;
}

.h5-btn-primary {
    background: var(--h5-primary);
    color: #fff;
}

.h5-btn-primary:active { background: var(--h5-primary-pressed); }

.h5-btn-ghost {
    background: #fff;
    color: var(--h5-text);
    border: 1px solid var(--h5-border);
    margin-top: 10px;
}

.h5-btn-danger {
    background: #fff;
    color: var(--h5-danger);
    border: 1px solid var(--h5-danger);
    margin-top: 10px;
}

.h5-footer {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    padding: 12px 16px calc(12px + var(--h5-safe-bottom));
    background: linear-gradient(180deg, rgba(245,246,248,0) 0%, var(--h5-bg) 24%);
}

.h5-alert {
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 12px;
}

.h5-alert-error { background: #fff2f0; color: var(--h5-danger); }

.h5-alert-info { background: #e6f4ff; color: #0958d9; }

.h5-package {
    display: block;
    width: 100%;
    border: 2px solid var(--h5-border);
    border-radius: 12px;
    padding: 14px 14px 12px;
    margin-bottom: 12px;
    background: var(--h5-card);
    text-align: left;
}

.h5-package.selected { border-color: var(--h5-primary); background: #f0f7ff; }

.h5-package-select {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    margin: 0;
    padding: 4px 0;
}

.h5-package-radio {
    width: 22px;
    height: 22px;
    margin-top: 3px;
    flex-shrink: 0;
    accent-color: var(--h5-primary);
}

.h5-package-title-wrap {
    flex: 1;
    min-width: 0;
}

.h5-package-name {
    display: inline;
    font-weight: 600;
    font-size: 18px;
    line-height: 1.4;
}

.h5-badge-selected {
    display: inline-block;
    margin-left: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--h5-primary);
    background: #e6f4ff;
    padding: 2px 8px;
    border-radius: 4px;
    vertical-align: middle;
}

.h5-tag {
    display: inline-block;
    font-size: 14px;
    color: var(--h5-muted);
    background: #f5f5f5;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
}

.h5-detail-toggle {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 12px 14px;
    font-size: 16px;
    color: #0958d9;
    background: #fff;
    border: 1px dashed #91caff;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
}

.h5-detail-toggle--sub {
    margin-top: 8px;
    font-size: 15px;
    padding: 10px 12px;
}

.h5-detail-panel {
    margin-top: 10px;
    padding: 12px 14px;
    background: #fafafa;
    border-radius: 10px;
    border: 1px solid var(--h5-border);
}

.h5-detail-panel--sub {
    margin-top: 8px;
    background: #f5f8fc;
}

.h5-detail-label {
    font-size: 14px;
    color: var(--h5-muted);
    margin-bottom: 8px;
}

.h5-items {
    margin: 0;
    padding-left: 20px;
    font-size: 16px;
    color: #434343;
    line-height: 1.55;
}

.h5-items--readonly li {
    margin-bottom: 6px;
}

.h5-addon {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--h5-border);
}

.h5-addon-heading {
    font-size: 16px;
    font-weight: 600;
    color: var(--h5-text);
    margin-bottom: 10px;
}

.h5-addon-item {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.h5-addon-item:last-child { border-bottom: none; }

.h5-addon-select {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    margin: 0;
}

.h5-checkbox-lg {
    width: 24px;
    height: 24px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--h5-primary);
}

.h5-addon-name {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.45;
    color: var(--h5-text);
}

.h5-footer--stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--h5-bg);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06);
}

.h5-footer--stack .h5-btn-ghost { margin-top: 0; }

.h5-date-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.h5-date-cell {
    border: 1px solid var(--h5-border);
    border-radius: 10px;
    padding: 12px 6px;
    text-align: center;
    font-size: 15px;
    background: #fff;
    cursor: pointer;
}

.h5-date-cell.selected { border-color: var(--h5-primary); background: #f0f7ff; }

.h5-date-cell .d { font-weight: 600; font-size: 18px; }

.h5-date-cell .s { color: var(--h5-muted); font-size: 13px; margin-top: 4px; }

.h5-kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; font-size: 16px; border-bottom: 1px solid var(--h5-border); }

.h5-kv:last-child { border-bottom: none; }

.h5-kv span:first-child { color: var(--h5-muted); }

.h5-empty { text-align: center; color: var(--h5-muted); padding: 40px 16px; font-size: 16px; }
