:root {
    --primary: #f43f5e;
    --primary-dark: #27ae60;
    --primary-light: #f0f0f0;
    --text: #2d3748;
    --text-muted: #718096;
    --bg: #f5f7fa;
    --bg-white: #ffffff;
    --border: #e2e8f0;
    --radius: 8px;
    --shadow: 0 2px 10px rgba(0,0,0,.08);
    --header-h: 62px;
    --container-w: 1440px;
    --gap: 15px;
}

*, *::before, *::after { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2{color:#f43f5e; margin: 0 0 0.6em; line-height: 1.3; }
h3, h4, h5, h6 {color:#10b981; margin: 0 0 0.6em; line-height: 1.3; }
p { margin: 0 0 1em; }
em, i { font-style: normal; }

/* ================================
   Header
   ================================ */
.site-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    max-width: var(--container-w);
    margin: 0 auto;
    padding: 0 var(--gap);
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 8px;
}
.site-logo {
    flex-shrink: 0;
    width: 180px;
    height: 63px;

}
.site-logo a {
    display: block;
    width: 100%;
    height: 100%;
    font-size: 0;
    overflow: hidden;
}

.language-switcher {position: relative;cursor: pointer;height:44px;line-height:44px;color: #F43F5E;font-size:20px;min-width:40px;}
.language-switcher i{font-size:12px;}

.language-switcher ul{ width:260px;margin:0;padding:0;position:absolute;right:0;left:auto;top: calc(100% - 10px);box-shadow:0 2px 5px rgba(0,0,0,0.1);}
.language-switcher ul{display: none;}
.language-switcher:hover ul{display:block;position:absolute; z-index:1001;}
.language-switcher ul li{float:left;width:130px;height:38px;line-height:38px; list-style:none;overflow:hidden;margin:0px;letter-spacing:1px;margin-right:-1px;margin-bottom:-1px;border-bottom:1px solid #e0e0e0}
.language-switcher ul li a:link,.language-switcher ul li a:visited{ border-radius: 2px; font-size:13px;display:block; text-align:center; border:1px solid #e0e0e0;text-decoration:none;color:#000000;background:#f0f0f0; }
.language-switcher ul li a:hover,.language-switcher ul li a:active{background-color: var(--primary);color:#ffffff;}

.note{color:#555555;background-color:#ffffee;border:1px solid #e0e0e0;margin-bottom:9px;text-align:left;line-height:28px;word-wrap:break-word;word-break:break-all;padding:8px;font-size:15px;overflow:hidden;position:relative; border-radius: var(--radius);}
.note i{font-weight: bold;color:#22c55e;}
.note b{color:#7777ff;}
.note em{color:#ff5500;}
.note a:link,.note a:visited {text-decoration: underline;COLOR: #22c55e;text-decoration-style: dashed; text-underline-offset: 3px; }
.note a:hover{color:#ff5500;} 

.cta-hint{color:#10b981;background-color:#ffffee;border:1px solid #e0e0e0;margin-bottom:9px;text-align:left;line-height:28px;word-wrap:break-word;word-break:break-all;padding:8px;font-size:15px;overflow:hidden;position:relative; border-radius: var(--radius);}

/* Main Nav */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text);
    cursor: pointer;
    padding: 4px 8px;
    flex-shrink: 0;
}
.nav-main {
    display: flex;
    gap: 4px;
    flex: 1;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.nav-main::-webkit-scrollbar { display: none; }
.nav-main a {
    padding: 6px 14px;
    border-radius: 6px;
    background: var(--primary-light);
    color: #333;
    font-size: 0.95rem;
    white-space: nowrap;
    transition: background .15s, color .15s;
}
.nav-main a:hover,
.nav-main a.active {
    background: var(--primary);
    color: #fff;
    text-decoration: none;
}
.nav-main a.goto {
    background: #f43f5e;;
    color: #fff;
    border-radius: var(--radius);
}
.nav-main a.goto:hover {
    background: #2ecc71;
    text-decoration: none;
}

.tips {
  display: inline-block;
  font-size: 15px;
  padding: 6px 14px;
  border-radius: 6px;
  background: #f43f5e;
  color: #fff !important;
  text-decoration: none !important;
}
.tips:hover {
  background: #2ecc71;
  color: #fff !important;
}
.tips .nav-blank {border-color: #fff;color: #fff;}

/* Search Toggle */
.search-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    color: #fff;
    flex-shrink: 0;
}
.search-toggle:hover { color: rgba(255,255,255,.8); }

/* Search Overlay (fullscreen backdrop, compact box) */
.search-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 200;
    justify-content: center;
    align-items: flex-start;
    padding-top: 80px;
}
.search-overlay.active { display: flex; }
.search-overlay-inner {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 12px 16px;
    width: 90%;
    max-width: 500px;
    display: flex;
    gap: 6px;
    align-items: center;
    box-shadow: var(--shadow);
}
.search-overlay-inner form {
    flex: 1;
    display: flex;
    gap: 6px;
}
.search-overlay-inner input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    outline: none;
}
.search-overlay-inner input:focus {
    border-color: #9999ff;
    box-shadow: 0 0 0 3px var(--primary-light);
}
.search-overlay-inner button[type="submit"] {
    padding: 8px 16px;
    background: #f43f5e;
    color: #fff;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background .15s;
    white-space: nowrap;
}
.search-overlay-inner button[type="submit"]:hover { background: #ff9900; }
.search-overlay-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px 6px;
    flex-shrink: 0;
}
.search-overlay-close:hover { color: var(--text); }
/* ================================
   Container
   ================================ */
.site-container {
    max-width: var(--container-w);
    margin: 0 auto;
    padding: var(--gap);
}
main {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: var(--gap);
    min-height: 400px;
}
.path { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 12px; white-space: nowrap;overflow: hidden;text-overflow: ellipsis;}
.path a { color: var(--text-muted); }
.path a:hover { color: var(--primary); }
/* Article Images */
.article-img {
    max-width: 100%;
    border-radius: var(--radius);
    display: block;
    margin: 0 auto 10px;
}

/* ================================
   Footer
   ================================ */
.site-footer { text-align: center;background: var(--bg-white);border-top: 1px solid var(--border);margin-top: 40px;padding: 15px}
.site-footer a:link,.site-footer a:visited {color:#666666;text-decoration:none;}
.site-footer a:hover{color:#000000;text-decoration: underline} 
/* ================================
   Friend Links
   ================================ */
.friend-links { border: 1px solid var(--border); border-radius: var(--radius);
    list-style: none;
    padding: 10px;
    margin: 15px 0 1em;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.friend-links li { margin: 0; }
.friend-links a {
    color: #666;
    font-size: 0.875rem;
}
.friend-links a::after { content:"↗"; color:#999999;}
/* ================================
   menus Links
   ================================ */
.menus { border: 1px solid var(--border); border-radius: var(--radius);
    list-style: none;
    padding: 10px;
    margin: 15px 0 1em;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.menus li { margin: 0; }
.menus a {
    color: #666;
    font-size: 0.875rem;
}
.menus a::before { content:"↗"; color:#999999;}


/* ================================
   Lightbox
   ================================ */
.img-overlay {
    position: fixed; inset: 0; z-index: 999;
    background: rgba(0,0,0,.85);
    display: flex; align-items: center; justify-content: center;
}
.img-overlay-img {
    max-width: 90%; max-height: 90%;
    border-radius: 8px; cursor: default;
}
.img-overlay-close {
    position: fixed; top: 16px; right: 24px;
    font-size: 2.5rem; color: #fff;
    background: none; border: none; cursor: pointer;
    line-height: 1;
}
.img-overlay-close:hover { opacity: .7; }

/* ================================
   Popup Overlay
   ================================ */
#opendiv {
    display: none;
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(0,0,0,.5);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
}
#divcontent {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    max-width: 90%;
    max-height: 90%;
    width: auto;
    height: auto;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,.2);
}
.popup-close {
    background: none; border: none;
    font-size: 1.2rem; cursor: pointer;
    color: #fff;
    line-height: 1;
}
.popup-close:hover { opacity: .7; }
.copyright::after { font-size:11px;color:#999;content:" Powered by WebBase-PHP-MYSQL"; }
/* ================================
   Page Sections
   ================================ */
.page-section {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;margin-bottom: 8px;
}

.section-title { margin-bottom: 16px; }
.section-title h2 { margin: 0 0 4px; font-size: 1.25rem; }
.section-title h3 { margin: 0 0 4px; font-size: 1.1rem; }
.section-title p { margin: 0; color: var(--text-muted); font-size: 0.9rem; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border: none; border-radius: var(--radius);
  font-size: 0.9rem; cursor: pointer; transition: opacity .15s;
}
.btn:hover { opacity: .85; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--primary-light); }
.btn-dark { background: #333; color: #fff; }
.btn-dark:hover { background: #555; }
.btn-danger { color: #e74c3c; border-color: #e74c3c; }
.btn-danger:hover { background: #fde8e8; }

.download-toolbar { display: flex; gap: 8px; flex-wrap: wrap; }

.faq-section h3 { margin-bottom: 12px;margin-top: 12px; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; }
.faq-q {
  padding: 10px 14px; cursor: pointer; font-weight: 500; font-size: 0.9rem;
  position: relative; user-select: none;
}
.faq-q::after { content: '+'; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 1.1rem; color: var(--text-muted); }
.faq-a {
  padding: 0 14px; max-height: 0; overflow: hidden; transition: max-height .2s, padding .2s;
  font-size: 0.85rem; color: var(--text-muted); border-top: 0 solid var(--border);
}
.faq-a.open { padding: 10px 14px; max-height: 200px; border-top-width: 1px; }

/* ================================
   Doodle Search Results
   Used by: tpl/code_search.log (render helpers in data/nav_functions.log)
   ================================ */
.doodle-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 23px; margin: 23px 0; }
.doodle-item { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg-white); display: flex; flex-direction: column; }
.doodle-item-thumb { height: 247px; display: flex; align-items: center; justify-content: center; background: #fafafa; border-bottom: 1px solid var(--border); overflow: hidden; }
.doodle-item-thumb img { max-width: 100%; max-height: 247px; display: block; }
.doodle-item-thumb .article-img { margin: 0; cursor: zoom-in; }
.doodle-item-body { padding: 15px; }
.doodle-item-title { font-size: 1.3rem; font-weight: 600; color: var(--text); display: block; white-space: pre-line; }
.doodle-item-title a { color: var(--text); }
.doodle-item-udy { margin-top: 4px; font-size: 1rem; color: var(--text-muted); }
.doodle-tags { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.doodle-tags a { padding: 4px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.85rem; color: var(--text-muted); }
.doodle-tags a:hover { color: var(--primary); border-color: var(--primary); text-decoration: none; }

/* ================================

/* Pagination */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
    padding: 16px 0;
}
.page-num, .page-prev, .page-next {
    display: inline-block;
    padding: 4px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    font-size: 0.85rem;
}
.page-num:hover, .page-prev:hover, .page-next:hover {
    background: #f0f0f0;
    border-color: #ccc;
}
.page-num.active {
    background: #333;
    color: #fff;
    border-color: #333;
}
.page-dots {
    display: inline-block;
    padding: 4px 6px;
    color: #999;
    font-size: 0.85rem;
} 
/* ================================
   share
   ================================ */
.share{display: flex;gap:6px;color:#666666;justify-content: flex-end;line-height:22px;font-size: 14px;margin-top:3px;margin-bottom:10px; float: right;}
.share span {color:#000000;}

.cbuttonf {position: relative;padding: 5px;font-size: 14px;color: #fff;background-color: #1877F2;border: none;border-radius: 5px;cursor: pointer;transition: background-color 0.3s;display: flex;align-items: center;}
.cbuttonf:after {content: "Facebook";}
.cbuttonf:hover {background-color:var(--primary);}

.cbuttont {position: relative;padding: 5px;font-size: 14px;color: #fff;background-color: #000000;border: none;border-radius: 5px;cursor: pointer;transition: background-color 0.3s;display: flex;align-items: center;}
.cbuttont:after {content: "Twitter(X)";}
.cbuttont:hover {background-color: var(--primary);}

.cbuttonr {position: relative;padding: 5px;font-size: 14px;color: #fff;background-color:#FF4500;border: none;border-radius: 5px;cursor: pointer;transition: background-color 0.3s;display: flex;align-items: center;}
.cbuttonr:after {content: "Reddit";}
.cbuttonr:hover {background-color: var(--primary);}

.cbuttonl {position: relative;padding: 5px;font-size: 14px;color: #fff;background-color:#0077B5;border: none;border-radius: 5px;cursor: pointer;transition: background-color 0.3s;display: flex;align-items: center;}
.cbuttonl:after {content: "LinkedIn";}
.cbuttonl:hover {background-color: var(--primary);}


#top_div{ position:fixed; bottom:50px; right:10px; display:none;width:50px;height:53px;z-index:20;  } 

/* ================================
   Doodle Canvas
   Used by: tpl/code_doodle.log + pics/picup.js
   Ported from getdoodling.com/pic/pic.css
   ================================ */
.doodle-wrap { margin-bottom: 16px; }
.doodle-wrap #toolbar {
  padding: 5px; background: #f0f0f0; display: flex; justify-content: center;
  gap: 7px; flex-wrap: wrap; align-items: center;
  border: 1px solid #ddd; border-radius: var(--radius) var(--radius) 0 0;
}
.doodle-wrap #toolbar b{ font-size: 14px;color:#f43f5e;}
.doodle-wrap .buttonb { padding: 5px; background: #3366ff; color: #fff; border: none; border-radius: 5px; cursor: pointer; font-size: 18px; line-height: 18px; transition: background-color .3s ease; }
.doodle-wrap .buttonb:hover { background: #f43f5e; }
.doodle-wrap .buttons { padding: 5px; background: #333; color: #fff; border: none; border-radius: 5px; cursor: pointer; font-size: 14px; line-height: 18px; transition: background-color .3s ease; }
.doodle-wrap .buttons:hover { cursor: not-allowed; background: #000; }
.doodle-wrap .buttonr { padding: 5px; background: #f43f5e; color: #fff; border: none; border-radius: 5px; cursor: pointer; font-size: 14px; line-height: 18px; transition: background-color .3s ease; }
.doodle-wrap .buttonr:before { content: "💾"; margin-right: .2rem; }
.doodle-wrap .buttonr:hover { background: #00cc00; }
.doodle-wrap .buttong { padding: 5px; background: #00cc00; color: #fff; border: none; border-radius: 5px; cursor: pointer; font-size: 14px; line-height: 18px; transition: background-color .3s ease; }
.doodle-wrap .buttong:hover { cursor: help; background: #f43f5e; }
.doodle-wrap a.buttong:hover { text-decoration: none; }
.doodle-wrap .color-option { width: 22px; height: 22px; border-radius: 50%; cursor: pointer; border: 2px solid #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.doodle-wrap .color-option:hover { transform: scale(1.1); }
.doodle-wrap .size-option { background: #333; border-radius: 30%; cursor: pointer; margin: 5px; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.doodle-wrap #canvas { display: block; width: 100%; border: 1px solid #eee; border-top: 0; background: #fff; touch-action: none; cursor: none; }
.doodle-wrap #cursor { position: absolute; pointer-events: none; border-radius: 50%; border: 1px solid rgba(0,0,0,.3); display: none; }
.doodle-wrap #upload-status { color: #999; font-size: 13px; }

@media (max-width: 768px) {

    .menu-toggle { display: block; }
    .nav-main {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--bg-white);
        border-top: 1px solid var(--border);
        padding: 8px var(--gap);
        z-index: 100;
        flex: none;
    }
    .nav-main.active { display: flex; }
    .nav-main a {
        padding: 10px 0;
        border-bottom: 1px solid var(--border);
        border-radius: 0;
    }
    .nav-main a:last-child { border-bottom: none; }
    .nav-main a.active { color: var(--primary); font-weight: 600; }
    .nav-main a.goto {
        background: #FF783C;
        color: #fff;
        padding: 10px 14px;
        border-radius: var(--radius);
        margin-bottom: 4px;
        border-bottom: none;
    }
.language-switcher {margin-left: auto;font-size:14px;}
.language-switcher i{font-size:9px;}
    .site-container { padding: 5px; }
    main { padding: 5px; }
    .header-inner {
        position: relative;
        justify-content: normal;
    }
    .site-logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        width: 180px;
    }
    #divcontent { padding: 16px; max-width: 95%; }
    .search-toggle { display:none; }

}
