@import url('https://fonts.googleapis.com/css2?family=Chiron+GoRound+TC:wght@200..900&display=swap');

:root {
    --color-primary: #c2652a;
    --color-primary-dark: #9e4c1e;
    --color-primary-soft: #f3dfcf;
    --color-background: #faf5ee;
    --color-surface: #fffdf9;
    --color-surface-muted: #f6eee5;
    --color-tertiary: #8c3c3c;
    --color-text: #3a302a;
    --color-text-muted: #756a63;
    --color-border: rgba(216, 208, 200, .60);
    --color-sage: #657969;
    --shadow-soft: 0 2px 16px rgba(58, 48, 42, .04);
    --shadow-float: 0 18px 48px rgba(83, 54, 36, .11);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --content-width: 680px;
    --mobile-bottom-nav-height: 62px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    color-scheme: light;
    scroll-behavior: smooth;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body,
button,
input,
textarea,
select {
    font-family: "Chiron GoRound TC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    background: var(--color-background);
    color: var(--color-text);
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

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

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    color: inherit;
    -webkit-user-select: none;
    user-select: none;
}

button:not(:disabled),
select:not(:disabled),
input[type="checkbox"]:not(:disabled) {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

img,
svg {
    display: block;
}

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

h1,
h2,
h3,
b,
strong {
    text-wrap: balance;
}

input,
textarea,
select {
    min-width: 0;
    color: var(--color-text);
}

select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: var(--color-surface);
}

select:not([multiple]) {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23756a63' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px 16px;
    padding-right: 38px;
}

select:not([multiple]):focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23c2652a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

select:disabled {
    cursor: not-allowed;
    opacity: .65;
    background-color: #f3eee8;
    color: var(--color-text-muted);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a89e96' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* iOS Safari 日期、時間輸入框標準化 */
input[type="date"],
input[type="datetime-local"],
input[type="time"],
input[type="month"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    line-height: normal;
    background-color: var(--color-surface);
    color: var(--color-text);
}

/* 修正 iOS Safari 內部日曆與時間文字顯示、行高及垂直對齊 */
input[type="date"]::-webkit-date-and-time-value,
input[type="datetime-local"]::-webkit-date-and-time-value,
input[type="time"]::-webkit-date-and-time-value,
input[type="month"]::-webkit-date-and-time-value {
    min-height: 1.5em;
    height: 1.5em;
    line-height: 1.5;
    text-align: start;
    margin: 0;
    padding: 0;
}

/* 日曆圖示指示器樣式微調 */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: .65;
    padding: 2px;
    margin-right: -2px;
    transition: opacity .18s ease;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover,
input[type="month"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

textarea {
    resize: vertical;
}

::selection {
    background: #e8c2a4;
    color: var(--color-text);
}

:focus-visible {
    outline: 3px solid rgba(194, 101, 42, .26);
    outline-offset: 2px;
}

.svg-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.rs-icon {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.is-hidden,
[hidden] {
    display: none !important;
}

.push-right {
    margin-left: auto;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: max-content;
}

.brand img {
    width: 38px;
    height: 38px;
}

.brand span {
    display: grid;
    line-height: 1.08;
}

.brand b {
    font-size: 17px;
    letter-spacing: -.03em;
}

.brand small {
    margin-top: 3px;
    color: var(--color-text-muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .22em;
}

.brand--large img {
    width: 48px;
    height: 48px;
}

.brand--large b {
    font-size: 22px;
}

.preview-pill {
    display: inline-flex;
    align-items: center;
    width: max-content;
    min-height: 24px;
    padding: 4px 9px;
    border: 1px solid rgba(194, 101, 42, .22);
    border-radius: 999px;
    background: rgba(255, 253, 249, .66);
    color: var(--color-primary-dark);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .11em;
}

.eyebrow {
    display: block;
    margin-bottom: 5px;
    color: var(--color-primary);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-weight: 650;
    line-height: 1;
    transition: transform .18s ease, background-color .18s ease, border-color .18s ease, color .18s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button:disabled {
    cursor: wait;
    opacity: .62;
    transform: none;
}

.button-runner {
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 6px;
    vertical-align: -3px;
    flex-shrink: 0;
}

.button--primary .button-runner {
    filter: brightness(0) invert(1);
}

.button.is-loading {
    cursor: wait;
    opacity: .85;
}

.button--primary {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 8px 20px rgba(194, 101, 42, .16);
}

.button--primary:hover {
    background: var(--color-primary-dark);
}

.button--danger {
    background: var(--color-tertiary);
    color: #fff;
}

.button--danger:hover {
    background: #702f2f;
}

.button--outline {
    border-color: var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
}

.button--outline:hover,
.button--outline.is-following:hover {
    border-color: rgba(194, 101, 42, .35);
    color: var(--color-primary-dark);
}

.button--ghost {
    background: transparent;
    color: var(--color-text-muted);
}

.button--small {
    min-height: 38px;
    padding: 8px 14px;
    font-size: 13px;
}

.button--full {
    width: 100%;
}

.icon-button {
    display: inline-grid;
    place-items: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    background: rgba(255, 253, 249, .86);
    transition: background-color .18s ease, color .18s ease, transform .18s ease;
}

.icon-button:hover {
    background: var(--color-surface-muted);
    color: var(--color-primary-dark);
    transform: translateY(-1px);
}

.icon-button--primary {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: #fff;
}

.icon-button--quiet {
    flex-basis: 36px;
    width: 36px;
    height: 36px;
    border-color: transparent;
    background: transparent;
    color: var(--color-text-muted);
}

.text-button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--color-primary-dark);
    font-weight: 650;
}

.text-button .rs-icon {
    width: 16px;
    height: 16px;
}

.field {
    display: grid;
    gap: 7px;
}

.field > span:first-child {
    font-size: 13px;
    font-weight: 650;
}

.field > small,
.field-count {
    color: var(--color-text-muted);
    font-size: 11px;
}

.field input,
.field textarea,
.field select,
.search-field,
.comment-composer input,
.composer-text {
    width: 100%;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background-color: var(--color-surface);
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.field input,
.field select {
    min-height: 48px;
    padding: 0 14px;
}

.field select:not([multiple]) {
    padding-right: 38px;
}

.field textarea {
    padding: 12px 14px;
    line-height: 1.65;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.search-field:focus-within,
.comment-composer:focus-within,
.composer-text:focus {
    outline: 0;
    border-color: rgba(194, 101, 42, .54);
    box-shadow: 0 0 0 4px rgba(194, 101, 42, .08);
}

.field input:disabled,
.field select:disabled {
    background-color: #f3eee8;
    color: var(--color-text-muted);
}

.form-stack {
    display: grid;
    gap: 18px;
}

.form-stack--compact {
    gap: 14px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.form-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-row--between {
    justify-content: space-between;
}

.input-prefix {
    display: flex;
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-surface);
}

.input-prefix:focus-within {
    border-color: rgba(194, 101, 42, .54);
    box-shadow: 0 0 0 4px rgba(194, 101, 42, .08);
}

.input-prefix i {
    padding-left: 14px;
    color: var(--color-text-muted);
    font-style: normal;
}

.input-prefix input {
    border: 0;
    background: transparent;
    box-shadow: none !important;
}

.check-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text-muted);
    font-size: 13px;
}

.check-label input {
    width: 17px;
    height: 17px;
    accent-color: var(--color-primary);
}

.check-label--terms {
    align-items: flex-start;
}

.field-count {
    justify-self: end;
    margin-top: -31px;
    padding: 0 10px 8px;
    pointer-events: none;
}
