/* custom.css - Pink base with hierarchical text colors */
/* Based on test.css but fully redesigned */
/* Updated: heading font sizes re-adjusted (h6 = 1.3rem, h2-h5 scaled accordingly) */
/* Font style changed to soft/cute fonts for all headings */
/* Added blockquote (markdown >) styling with border, dark background, bold text */
/* Removed gradient background – now solid pink */
/* Added support for links, images, videos, and unified input/button sizing */
/* Added borders to all inputs and images as requested */
/* Removed border from color input only; styled range slider to match pink theme */
/* Added thicker borders for images, videos, audio; styled media controls */
/* Fixed audio background to avoid default black box (Firefox & Chrome) */

/* ---- Global reset & base ---- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    /* Solid pink background (no gradient) */
    background: #ffe4ec;
    min-height: 100vh;
    font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Helvetica Neue", sans-serif;
    font-weight: 500;
    padding: 2rem;
    color: #666666; /* base text color (lightest among headings) */
    line-height: 1.6;
}

/* ---- Headings with soft/cute fonts and re-adjusted sizes ----
     h1 = 2.5rem (unchanged)
     h2 = 2.26rem
     h3 = 2.02rem
     h4 = 1.78rem
     h5 = 1.54rem
     h6 = 1.3rem (previously h5 size)
     All headings use soft/cute font stack.
*/
h1, h2, h3, h4, h5, h6 {
    font-family: "Comic Sans MS", "Chalkboard SE", "Rounded Mplus 1c", "Hiragino Maru Gothic Pro", "Yu Gothic", sans-serif;
    font-weight: 700; /* keep bold for hierarchy */
}

h1 {
    color: #2c2c2c;
    font-size: 2.5rem;
    border-bottom: 3px solid rgba(255, 150, 180, 0.5);
    padding-bottom: 0.5rem;
    margin-top: 1.5rem;
}

h2 {
    color: #3a3a3a;
    font-size: 2.26rem;
    margin-top: 1.4rem;
}

h3 {
    color: #484848;
    font-size: 2.02rem;
    margin-top: 1.3rem;
}

h4 {
    color: #565656;
    font-size: 1.78rem;
    margin-top: 1.2rem;
}

h5 {
    color: #606060;
    font-size: 1.54rem;
    margin-top: 1.1rem;
}

h6 {
    color: #666666;
    font-size: 1.3rem;
    margin-top: 1rem;
}

/* ---- Body text (lightest among text) ---- */
p, li, .text-body {
    color: #666666;
    background: rgba(255, 255, 255, 0.4);
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    backdrop-filter: blur(2px);
    margin: 0.8rem 0;
}

/* ---- Lists ---- */
ul, ol {
    padding-left: 2rem;
    margin: 0.8rem 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 0.8rem 1.2rem 0.8rem 2.5rem;
}

li {
    background: transparent;
    padding: 0.2rem 0;
    backdrop-filter: none;
    margin: 0.2rem 0;
    border-radius: 0;
}

/* ---- Links (a) ---- */
a {
    color: #8a5a6a;              /* soft pinkish brown – fits pink theme */
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s, text-decoration 0.2s;
}

a:hover {
    color: #b06a7a;              /* slightly lighter on hover */
    text-decoration: underline;
}

a:visited {
    color: #7a4a5a;              /* subtle difference for visited */
}

/* ---- Buttons ---- */
button, .btn {
    display: inline-block;
    background: linear-gradient(145deg, #ffb6c9, #ff8aa7);
    border: none;
    border-radius: 30px;
    padding: 0.5rem 1.8rem;
    font-size: 1rem;
    font-weight: 600;
    color: #2c2c2c;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 100, 130, 0.3);
    transition: all 0.2s ease;
    margin: 0.3rem 0.2rem;
    line-height: 1.5;
    height: auto;
    min-height: 2.5rem;
}

button:hover, .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(255, 80, 120, 0.4);
    background: linear-gradient(145deg, #ffc0d0, #ff95b0);
}

button:active, .btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(255, 80, 120, 0.3);
}

button.secondary, .btn-secondary {
    background: transparent;
    border: 2px solid #ff8aa7;
    color: #3a3a3a;
    box-shadow: none;
}

button.secondary:hover, .btn-secondary:hover {
    background: rgba(255, 138, 167, 0.15);
}

/* ---- Input fields & selects (including date/time types) ---- */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="month"],
input[type="week"],
input[type="time"],
select,
textarea {
    background: rgba(255, 255, 255, 0.7);
    border: 2px solid #ffb6c9;    /* standard input border */
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    color: #444444;
    outline: none;
    transition: border 0.2s, box-shadow 0.2s;
    width: 100%;
    max-width: 300px;
    margin: 0.3rem 0;
    height: 2.5rem;
    line-height: 1.5;
    box-sizing: border-box;
}

/* Textarea needs different height */
textarea {
    height: auto;
    min-height: 5rem;
    resize: vertical;
}

/* File input – round it and style */
input[type="file"] {
    background: rgba(255, 255, 255, 0.7);
    border: 2px solid #ffb6c9;
    border-radius: 20px;
    padding: 0.4rem 0.8rem;
    font-size: 1rem;
    color: #444444;
    width: 100%;
    max-width: 300px;
    margin: 0.3rem 0;
    height: 2.5rem;
    box-sizing: border-box;
    cursor: pointer;
}

input[type="file"]::file-selector-button {
    background: #ffb6c9;
    border: none;
    border-radius: 12px;
    padding: 0.2rem 1rem;
    margin-right: 1rem;
    font-weight: 600;
    color: #2c2c2c;
    cursor: pointer;
    transition: background 0.2s;
}

input[type="file"]::file-selector-button:hover {
    background: #ff8aa7;
}

/* ---- Range input – styled to match pink theme ---- */
input[type="range"] {
    border: none;
    padding: 0;
    background: transparent;
    height: 2.5rem;
    width: 100%;
    max-width: 300px;
    margin: 0.3rem 0;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

/* Track */
input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 0.5rem;
    background: linear-gradient(90deg, #ffb6c9, #ff8aa7);
    border-radius: 1rem;
    border: none;
}

input[type="range"]::-moz-range-track {
    width: 100%;
    height: 0.5rem;
    background: linear-gradient(90deg, #ffb6c9, #ff8aa7);
    border-radius: 1rem;
    border: none;
}

/* Thumb */
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 1.4rem;
    height: 1.4rem;
    background: #ff8aa7;
    border-radius: 50%;
    cursor: pointer;
    margin-top: -0.45rem;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(255, 100, 130, 0.4);
    transition: transform 0.15s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
    width: 1.4rem;
    height: 1.4rem;
    background: #ff8aa7;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(255, 100, 130, 0.4);
    transition: transform 0.15s;
}

input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.1);
}

/* ---- Color input – no border, just the color swatch ---- */
input[type="color"] {
    border: none;
    padding: 0;
    width: 3rem;
    height: 2.5rem;
    background: #ffb6c9;
    border-radius: 20px;
    margin: 0.3rem 0;
    box-sizing: border-box;
    cursor: pointer;
}

/* ---- Submit, reset, button inputs – style like buttons ---- */
input[type="submit"],
input[type="reset"],
input[type="button"],
input[type="image"] {
    background: linear-gradient(145deg, #ffb6c9, #ff8aa7);
    border: none;
    border-radius: 30px;
    padding: 0.5rem 1.8rem;
    font-size: 1rem;
    font-weight: 600;
    color: #2c2c2c;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 100, 130, 0.3);
    transition: all 0.2s ease;
    margin: 0.3rem 0.2rem;
    height: 2.5rem;
    line-height: 1.5;
    box-sizing: border-box;
}

input[type="submit"]:hover,
input[type="reset"]:hover,
input[type="button"]:hover,
input[type="image"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(255, 80, 120, 0.4);
    background: linear-gradient(145deg, #ffc0d0, #ff95b0);
}

input[type="image"] {
    padding: 0;
    height: auto;
    background: transparent;
    box-shadow: none;
    border-radius: 12px;
    border: 2px solid transparent;
}

input[type="image"]:hover {
    transform: scale(1.02);
    border-color: #ff8aa7;
}

/* Focus for all inputs */
input:focus, select:focus, textarea:focus {
    border-color: #ff6f91;
    box-shadow: 0 0 0 4px rgba(255, 100, 140, 0.2);
}

/* ---- Checkboxes & radio buttons (custom) ---- */
input[type="checkbox"],
input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 1.2rem;
    height: 1.2rem;
    border: 2px solid #ff8aa7;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    vertical-align: middle;
    margin-right: 0.4rem;
}

input[type="radio"] {
    border-radius: 50%;
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
    background: #ff6f91;
    border-color: #ff6f91;
    position: relative;
}

input[type="checkbox"]:checked::after {
    content: "✓";
    color: white;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

input[type="radio"]:checked::after {
    content: "";
    width: 0.5rem;
    height: 0.5rem;
    background: white;
    border-radius: 50%;
    display: block;
    margin: 0.25rem auto;
}

/* ---- Labels for options ---- */
label {
    color: #555555;
    font-weight: 500;
    cursor: pointer;
    margin-right: 0.8rem;
}

/* ---- Select dropdown arrow (optional) ---- */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23ff6f91' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
    appearance: none;
    -webkit-appearance: none;
}

/* ---- Images, Videos – thicker border (4px) and white background ---- */
img,
video {
    border: 4px solid #ff8aa7;      /* thicker than inputs (2px) */
    border-radius: 12px;
    background: white;
    display: inline-block;
    max-width: 100%;
    height: auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin: 0.3rem 0;
    vertical-align: middle;
}

/* ---- Audio – force white background and style controls (Firefox + Chrome) ---- */
audio {
    border: 4px solid #ff8aa7;
    border-radius: 30px;
    background: white !important;          /* override default black */
    display: inline-block;
    max-width: 100%;
    padding: 0.2rem 0.4rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin: 0.3rem 0;
    vertical-align: middle;
    accent-color: #ff8aa7;                 /* fallback for Chrome/Edge */
}

/* ----- Firefox-specific pseudo-elements ----- */
audio::-moz-media-controls-panel {
    background: white !important;
}

audio::-moz-media-controls-timeline {
    background: linear-gradient(90deg, #ffb6c9, #ff8aa7) !important;
    border-radius: 1rem;
    height: 0.5rem;
}

audio::-moz-media-controls-volume-slider {
    background: linear-gradient(90deg, #ffb6c9, #ff8aa7) !important;
    border-radius: 1rem;
    height: 0.5rem;
}

audio::-moz-media-controls-timeline-thumb,
audio::-moz-media-controls-volume-slider-thumb {
    background: #ff8aa7 !important;
    border: 2px solid white !important;
    border-radius: 50% !important;
    width: 1.2rem;
    height: 1.2rem;
    box-shadow: 0 2px 6px rgba(255,100,130,0.4);
}

/* ----- WebKit (Chrome/Edge) specific – additional background override ----- */
audio::-webkit-media-controls-panel {
    background: white !important;
}

audio::-webkit-media-controls-timeline {
    background: linear-gradient(90deg, #ffb6c9, #ff8aa7) !important;
    border-radius: 1rem;
    height: 0.5rem;
}

audio::-webkit-media-controls-volume-slider {
    background: linear-gradient(90deg, #ffb6c9, #ff8aa7) !important;
    border-radius: 1rem;
    height: 0.5rem;
}

audio::-webkit-media-controls-thumb {
    background: #ff8aa7 !important;
    border: 2px solid white !important;
    border-radius: 50% !important;
    width: 1.2rem;
    height: 1.2rem;
    box-shadow: 0 2px 6px rgba(255,100,130,0.4);
}

/* ---- Utility spacing ---- */
.container {
    max-width: 800px;
    margin: 0 auto;
}

hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ffb6c9, transparent);
    margin: 1.5rem 0;
}

/* ---- Responsive tweaks ---- */
@media (max-width: 600px) {
    body { padding: 1rem; }
    button, .btn,
    input[type="submit"],
    input[type="reset"],
    input[type="button"] {
        width: 100%;
    }
    input[type="file"] { max-width: 100%; }
    input[type="range"] { max-width: 100%; }
}

/* ---- Blockquote (markdown >) ---- */
blockquote {
    background: rgba(255, 182, 201, 0.25);
    border-left: 5px solid #ff8aa7;
    padding: 0.8rem 1.2rem;
    margin: 1rem 0;
    border-radius: 8px;
    font-weight: 600;
    color: #4a4a4a;
}

/* Reset inner paragraph styling inside blockquote to avoid double backgrounds */
blockquote p {
    background: transparent;
    padding: 0;
    backdrop-filter: none;
    margin: 0.5rem 0;
}

/* ---- Details / Callouts (foldable block) ---- */
details {
    background: rgba(255, 255, 255, 0.7);
    border: 2px solid #ffb6c9;
    border-radius: 12px;
    padding: 0.5rem 1rem;
    margin: 1rem 0;
}

details > summary {
    cursor: pointer;
    font-weight: 600;
    color: #3a3a3a;
    padding: 0.2rem 0;
}

details > :not(summary) {
    font-size: 0.95rem;
}

details p,
details li,
details .text-body {
    background: transparent !important;
    backdrop-filter: none !important;
    padding: 0.3rem 0;
    margin: 0.2rem 0;
}

details ul,
details ol {
    background: transparent !important;
    padding: 0.3rem 0 0.3rem 1.5rem;
    backdrop-filter: none !important;
}