/* ============================
   Base & Reset
   ============================ */
*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
                 "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: #faf9de;
    color: #333;
    line-height: 1.7;
}

a { color: #ff8e2d; text-decoration: none; }
a:hover { text-decoration: underline; }

hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 16px 0 0;
}

/* ============================
   Layout
   ============================ */
.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 16px 40px;
}

/* ============================
   Header
   ============================ */
.container-head {
    padding: 24px 0 0;
}

.head-box {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.page-title {
    font-size: 1.7rem;
    font-weight: 700;
    margin: 0;
    color: #222;
}

.page-subtitle {
    color: #888;
    font-size: 0.95rem;
    margin: 0;
}

/* ============================
   Cards (container-contact)
   ============================ */
.container-contact {
    margin-top: 20px;
}

.container-contact section {
    background: #fff;
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.container-contact h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 8px;
    color: #222;
}

.card-desc {
    color: #666;
    font-size: 0.9rem;
    margin: 0 0 16px;
}

/* ============================
   Intro box
   ============================ */
.intro-box {
    font-size: 0.92rem;
    color: #555;
}

.intro-box p { margin: 6px 0; }

.last-updated {
    color: #aaa;
    font-size: 0.85rem;
}

/* ============================
   Form elements
   ============================ */
.form-section { margin-top: 4px; }

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

.form-row label {
    font-size: 0.9rem;
    color: #555;
    white-space: nowrap;
}

.form-row input[type="text"],
.form-row select {
    flex: 1;
    min-width: 140px;
    padding: 9px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fafafa;
    color: #333;
    outline: none;
    transition: border-color 0.2s;
}

.form-row input[type="text"]:focus,
.form-row select:focus {
    border-color: #ff8e2d;
    background: #fff;
}

/* ============================
   Buttons
   ============================ */
.btn-generate {
    padding: 9px 18px;
    background: #ff8e2d;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.btn-generate:hover { background: #e07a20; }

.btn-copy {
    padding: 9px 14px;
    background: #f0f0f0;
    color: #555;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.btn-copy:hover { background: #e4e4e4; }

.btn-calendar {
    padding: 10px 20px;
    background: #fff;
    color: #ff8e2d;
    border: 2px solid #ff8e2d;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-calendar:hover {
    background: #ff8e2d;
    color: #fff;
}

/* ============================
   Link output area
   ============================ */
.link-output,
.static-link-box {
    margin-top: 8px;
}

.link-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.link-row input[type="text"] {
    flex: 1;
    padding: 9px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.82rem;
    background: #f7f7f7;
    color: #555;
    outline: none;
    font-family: "SF Mono", "Fira Code", monospace;
}

.btn-row {
    display: flex;
    gap: 10px;
}

/* ============================
   FAQ
   ============================ */
.faq-item {
    border-bottom: 1px solid #f0f0f0;
    padding: 4px 0;
}

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

.faq-q {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 4px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}

.faq-q:hover { color: #ff8e2d; }

.faq-icon {
    color: #ff8e2d;
    font-size: 0.75rem;
    transition: transform 0.2s;
}

.faq-a {
    display: none;
    padding: 0 4px 14px 22px;
    font-size: 0.9rem;
    color: #555;
    line-height: 1.8;
}

/* ============================
   Service update badge
   ============================ */
.service-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: #aaa;
    font-weight: 400;
    margin-left: 8px;
    vertical-align: middle;
}

/* ============================
   Preview section
   ============================ */
.btn-preview {
    padding: 7px 14px;
    background: transparent;
    color: #ff8e2d;
    border: 1px solid #ff8e2d;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-preview:hover {
    background: #fff5eb;
}

.preview-panel {
    display: none;
    margin-top: 14px;
    border-top: 1px dashed #f0d8b0;
    padding-top: 14px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.preview-loading {
    text-align: center;
    color: #aaa;
    font-size: 0.88rem;
    padding: 16px 0;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin-top: 4px;
}

.preview-item {
    background: #fffdf5;
    border: 1px solid #f0e8c0;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.85rem;
}

.preview-item .pi-label {
    color: #aaa;
    font-size: 0.75rem;
    margin-bottom: 2px;
}

.preview-item .pi-value {
    color: #333;
    font-weight: 600;
}

.preview-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.preview-list li {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #f5f0e0;
    font-size: 0.88rem;
    color: #444;
}

.preview-list li:last-child { border-bottom: none; }

.preview-list .pl-date {
    color: #aaa;
    font-size: 0.8rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.preview-list .pl-badge {
    font-size: 0.72rem;
    padding: 1px 6px;
    border-radius: 20px;
    flex-shrink: 0;
}

.pl-badge--off { background: #ffeaea; color: #e74c3c; }
.pl-badge--work { background: #e8f4fd; color: #2980b9; }
.pl-badge--soon { background: #fff3cd; color: #856404; }

.preview-stars { color: #ff8e2d; letter-spacing: 1px; }

.preview-horoscope-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 4px;
}

.preview-horoscope-box {
    background: #fffdf5;
    border: 1px solid #f0e8c0;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.85rem;
}

.preview-horoscope-box .phb-title {
    font-size: 0.75rem;
    color: #aaa;
    margin-bottom: 4px;
}

.preview-horoscope-box .phb-stars { color: #ff8e2d; font-size: 0.85rem; }

.preview-horoscope-box .phb-text { color: #555; margin-top: 4px; line-height: 1.6; }

/* ============================
   Quick Subscribe
   ============================ */
.quick-subscribe-section {
    border: 2px solid #ff8e2d;
    background: linear-gradient(135deg, #fffbf5 0%, #fff9ee 100%);
}

.qs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.qs-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid #f0dcc0;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.85rem;
}

.qs-icon { font-size: 1rem; flex-shrink: 0; }

.qs-name {
    flex: 1;
    color: #444;
    font-size: 0.82rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qs-btn {
    flex-shrink: 0;
    padding: 4px 10px;
    background: #ff8e2d;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: background 0.2s;
}

.qs-btn:hover { background: #e07a20; }

.qs-all-row {
    border-top: 1px dashed #f0dcc0;
    padding-top: 14px;
    margin-top: 4px;
}

.qs-all-desc {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 8px;
}

.btn-subscribe-all {
    background: #ff8e2d;
    color: #fff;
    border-color: #ff8e2d;
    font-weight: 600;
}

.btn-subscribe-all:hover {
    background: #e07a20;
    border-color: #e07a20;
    color: #fff;
}

@media (max-width: 520px) {
    .qs-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================
   Footer
   ============================ */
.app-footer {
    text-align: center;
    margin-top: 32px;
    color: #aaa;
    font-size: 0.85rem;
    display: flex;
    justify-content: center;
    gap: 8px;
}

/* ============================
   Toast notification
   ============================ */
.toast {
    position: fixed;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 24px;
    background: #333;
    color: #fff;
    border-radius: 24px;
    font-size: 0.9rem;
    transition: bottom 0.3s ease;
    z-index: 9999;
    white-space: nowrap;
}

.toast--show { bottom: 32px; }
.toast--error { background: #e74c3c; }
.toast--success { background: #27ae60; }

/* ============================
   Responsive
   ============================ */
@media (max-width: 520px) {
    .container-contact section { padding: 16px; }
    .page-title { font-size: 1.4rem; }
    .form-row { flex-direction: column; align-items: stretch; }
    .form-row label { margin-bottom: 4px; }
    .form-row input[type="text"],
    .form-row select { width: 100%; }
    .btn-generate { width: 100%; }
    .btn-preview { width: 100%; }
    .btn-row { flex-direction: column; }
    .btn-calendar { width: 100%; }
    .link-row { flex-direction: column; align-items: stretch; }
    .btn-copy { width: 100%; }
    .preview-horoscope-row { grid-template-columns: 1fr; }
    .preview-grid { grid-template-columns: 1fr 1fr; }
}
